I am starting with ansible and will use it, among others, to install packages on several Linux distros.
I see in the docs that the yum
and apt
commands are separated - what would be the easiest way to unify them and use something like this:
- name: install the latest version of Apache
unified_install: name=httpd state=latest
instead of
- name: install the latest version of Apache on CentOS
yum: name=httpd state=latest
when: ansible_os_family == "RedHat"
- name: install the latest version of Apache on Debian
apt: pkg=httpd state=latest
when: ansible_os_family == "Debian"
I understand that the two package managers are different, but they still have a set of common basic usages. Other orchestators (salt for instance) have a single install command.