- name: Check if managesoft is installed command: rpm -q managesoft ignore_errors: true failed_when: rpm_check.rc > 1 changed_when: false register: rpm_check when: ansible_os_family == 'RedHat' tags: flexera
- name: Install expect yum: name: "expect" state: installed when: rpm_check.stdout.find('is not installed') != -1 and ansible_os_family == 'RedHat' tags: flexera
ansible-playbook --tags="flexera" --limit="x.x.x.x" peganonprd.yml -vC
TASK [flexera : Install expect] ************************************************fatal: [x.x.x.x]: FAILED! => {"failed": true, "msg": "ERROR! The conditional check 'rpm_check.stdout.find('is not installed') != -1 and ansible_os_family == 'RedHat'' failed. The error was: ERROR! error while evaluating conditional (rpm_check.stdout.find('is not installed') != -1 and ansible_os_family == 'RedHat'): ERROR! 'dict object' has no attribute 'stdout'\n\nThe error appears to have been in '/etc/ansible/roles/flexera/tasks/package.yml': line 11, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Install expect\n ^ here\n"}