Skip to content

Instantly share code, notes, and snippets.

@chanshik
Forked from hostmaster/playbook.yml
Created March 2, 2016 01:52
Show Gist options
  • Save chanshik/9bda5495dffc2fdc9d24 to your computer and use it in GitHub Desktop.
Save chanshik/9bda5495dffc2fdc9d24 to your computer and use it in GitHub Desktop.
ansible playbook choose APT or YUM for package installation
- 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'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment