-
-
Save DanyC97/fbf20b09bad74d3dab23558434413b57 to your computer and use it in GitHub Desktop.
ansible - example of looping yum packages with different setting for one of them
This file contains 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 the required rpms | |
yum: name={{ item }} state=latest | |
with_items: | |
- wget | |
- git | |
- net-tools | |
- bind-utils | |
- iptables-services | |
- bridge-utils | |
- bash-completion | |
- docker | |
- python-httplib2 => ignore checking package signature |
This file contains 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 the required rpms | |
yum: | |
name: "{{ (item is mapping)|ternary(item.name, item) }}" | |
gpcheck: "{{ (item is mapping)|ternary(item.gpgcheck, default(omit)) }}" | |
state: latest | |
with_items: | |
- wget | |
- git | |
- net-tools | |
- bind-utils | |
- iptables-services | |
- bridge-utils | |
- bash-completion | |
- docker | |
- { name: python-httplib2, gpgcheck: no } |
This file contains 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 the required rpms | |
yum: | |
name: "{{ item.name }}" | |
gpcheck: "{{ item.gpgcheck|default(omit) }}" | |
state: latest | |
with_items: | |
- { name: wget } | |
- { name: git } | |
- { name: net-tools } | |
- { name: bind-utils } | |
- { name: iptables-services } | |
- { name: bridge-utils } | |
- { name: bash-completion } | |
- { name: docker } | |
- { name: python-httplib2, gpgcheck: no } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment