redhat-openstack / infrared

Plugin based framework that aims to provide an easy-to-use CLI for Ansible based projects
https://infrared.readthedocs.io/en/latest/index.html
Apache License 2.0
99 stars 96 forks source link

Infrared fails OSP-13 undercloud installation with error "/bin/sh: line 1: dnf: command not found" #420

Closed rh-apoorv closed 1 year ago

rh-apoorv commented 1 year ago

Infrared fails OSP-13 deployment (having RHEL-7 as base) is failing at task "TASK [Enable extra repo (crb) for vbmc dependencies (RHEL9)]" with error "/bin/sh: line 1: dnf: command not found" during undercloud installation.

Previously there was a check in this task where it would be executed on RHEL-9 machines only, however presently with no conditions in this task, it is being executed on RHEL-7 machine as well and hence failing.

It seems to the regression of commits 51498351a20bbf7a3cb64036dd3818d0f9d0f105 & 31be6a61018bf17a0da7dbe12baae69a1187dd3b.

Initially this task was added via commit 0820449eec65842e318bb33c34622568232b91e1, however with time the changes were made and now the condition no more exists.

I guess addition of condition "ansible_distribution_major_version | int >= 9" in this task will do the work

$ less plugins/tripleo-undercloud/setup_packages.yml
      - name: Enable extra repo (crb) for vbmc dependencies (RHEL9)
        become: yes
        shell: |
            set -ex
            dnf config-manager --save --setopt rhosp-rhel-{{ version_escaped }}-crb.includepkgs=libvirt-devel
            dnf config-manager --set-enabled rhosp-rhel-{{ version_escaped }}-crb
        vars:
            version_escaped: "{{ ansible_distribution_version | replace('.', '\\.') }}"
        when:
            - ansible_distribution == 'RedHat'
            - "install.version|openstack_distribution == 'OSP'"
            - not install.cdn|default(False)
            - cdn_status.rc != 0
            - not skip_release
        tags: rhos-release
tosky commented 1 year ago

Which infrared branch did you use? OSP13 is the branch for OSP 13.x, OSP16 is the branch for 16.x, and master for 17.x

rh-apoorv commented 1 year ago

My bad tosky++ I was on master branch. After switching to OSP13, the condition is present. Closing this bug.