remove old loop syntax

This commit is contained in:
Robert Kaussow 2019-08-27 08:32:50 +02:00
parent 4f9463be1a
commit d120f0a5aa
4 changed files with 15 additions and 13 deletions

View File

@ -17,8 +17,10 @@ yum_cron_email_to: root
yum_cron_emit_via: stdio yum_cron_emit_via: stdio
yum_cron_random_sleep: 360 yum_cron_random_sleep: 360
# yum_repositories: (defaults to not set) yum_repositories: []
# epel: ## Example:
# yum_repositories:
# - name: epel
# filename: Extra-EPEL # filename: Extra-EPEL
# desc: Extra Packages for Enterprise Linux (EPEL) # desc: Extra Packages for Enterprise Linux (EPEL)
# baseurl: "http://download.fedoraproject.org/pub/epel/$releasever/$basearch/" # baseurl: "http://download.fedoraproject.org/pub/epel/$releasever/$basearch/"

View File

@ -4,14 +4,14 @@
package: package:
name: "{{ item }}" name: "{{ item }}"
state: absent state: absent
with_items: loop:
- "{{ yum_packages_uninstall | default([]) }}" - "{{ yum_packages_uninstall | default([]) }}"
- name: Install common packages - name: Install common packages
package: package:
name: "{{ item }}" name: "{{ item }}"
state: present state: present
with_items: loop:
- "{{ yum_packages_install | default([]) }} + {{ yum_packages_extra_install | default([]) }}" - "{{ yum_packages_install | default([]) }} + {{ yum_packages_extra_install | default([]) }}"
become: True become: True
become_user: root become_user: root

View File

@ -1,15 +1,15 @@
--- ---
- name: Add common yum repositories - name: Add common yum repositories
yum_repository: yum_repository:
name: "{{ item.key }}" name: "{{ item.name }}"
file: "{{ item.value.filename }}" file: "{{ item.filename }}"
description: "{{ item.value.desc }}" description: "{{ item.desc }}"
baseurl: "{{ item.value.baseurl }}" baseurl: "{{ item.baseurl }}"
gpgkey: "{{ item.value.gpgkey }}" gpgkey: "{{ item.gpgkey }}"
enabled: "{{ item.value.enabled }}" enabled: "{{ item.enabled }}"
with_dict: "{{ yum_repositories | default({}) }}" loop: "{{ yum_repositories }}"
loop_control: loop_control:
label: "{{ item.key }}" label: "{{ item.name }}"
notify: __yum_upgrade notify: __yum_upgrade
become: True become: True
become_user: root become_user: root

View File

@ -26,7 +26,7 @@
file: file:
path: "{{ item }}" path: "{{ item }}"
state: absent state: absent
with_items: loop:
- /etc/cron.daily/0yum-daily.cron - /etc/cron.daily/0yum-daily.cron
- /etc/cron.hourly/0yum-hourly.cron - /etc/cron.hourly/0yum-hourly.cron