tasks:
- name: check if package is installed
package:
name: mypackage
state: present
check_mode: true
register: mypackage_check
- name: run script if package installed
shell: myscript.sh
when: not mypackage_check.changed
Выдает: FAILED! => {"changed": false, "msg": "No package matching 'mypackage' found available, installed or updated", "rc": 126, "results": ["No package matching 'mypackage' found available, installed or updated"]}
а mypackage_check это что? И что он возвращает?
Обсуждают сегодня