Skip to content

Instantly share code, notes, and snippets.

@DanyC97
Forked from halberom/old.yml
Created January 11, 2017 13:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save DanyC97/fbf20b09bad74d3dab23558434413b57 to your computer and use it in GitHub Desktop.
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
- 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
- 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 }
- 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