To be honest, I would also be interested in a solution to this.
Of course all the machines, that I install myself (preseed, kickstart,
...) meet the requirements for ansible.
For already existing machines which should be managed by us, the
requirements are somewhere in the middle of met or unmet.
To my knowledge python-simplejson (required on Python 2.4 boxes) can
only be installed using the raw module and not with the apt or yum module.
Therefore this is a task which I'd not like to be executed on every run.
Maybe the first task in the list could be an ansible ping and if it
fails do some brute-force raw commands.
....
And as writing this I answered my question :-)
My prototype looks like this:
- hosts: all
user: root
tasks:
- name: ping
ping:
register: result
- name: conditional task
raw: here_your_command
when: result|failed
Cheers
Christian
--
toscom - the open source company
Christian Rusa
Breiteneckergasse 32 1230 Wien
Mobil: 0699 10205595 Fax: 01 9249633
www.toscom.at christi...@toscom.at