Created
January 12, 2014 14:55
-
-
Save hostmaster/8385567 to your computer and use it in GitHub Desktop.
ansible playbook choose APT or YUM for package installation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: Install wget package (Debian based) | |
action: apt pkg='wget' state=installed | |
only_if: "'$ansible_pkg_mgr' == 'apt'" | |
- name: Install wget package (RedHat based) | |
action: yum name='wget' state=installed | |
only_if: "'$ansible_pkg_mgr' == 'yum'" |
Much easier:
- name: Install wget
package: name=wget state=present
@EmiiKhaos: awesome!!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Or this (so long as the package has the same name on all distros):