Ansible module (shell) to install/remove packages on Suse Linux
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Warning: deprectated

Ansible 1.2 now ships with a zypper module. Use that.

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


Copy zypp to $ANSIBLE_LIBRARY on the management host. (There's no need to make it executable.)

install -m 444 zypp $ANSIBLE_LIBRARY/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/history to see operation.
  • Works on SLES11
  • 2012-08-31: fix zypper options for SLES10SP3