First stab at an Ansible module (
bash, not Python) for installation/removal of packages on Suse's SLES and openSUSE.
There appears to be some Python zypper stuff floating around, but I have neither the time nor the inclination to use that, particularly not, as it's not installed by default on either platform (chicken/egg).
See also: Shell scripts as Ansible modules
$ANSIBLE_LIBRARY on the management host. (There's no need to make it executable.)
install -m 444 zypp $ANSIBLE_LIBRARY/zypp
zypp pkg= package-name state= installed|removed (default: installed)
Do not, repeat: NOT, pass shell-metacharacters in any of the arguments.
- name: Install editor action: zypp pkg=vim state=installed
- zypper on openSUSE 12.1 always exits with 0 -- that's a BUG
- Follow (tail -f) a node's
/var/log/zypp/historyto see operation.