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_random_sleep: 360
# yum_repositories: (defaults to not set)
# epel:
yum_repositories: []
## Example:
# yum_repositories:
# - name: epel
# filename: Extra-EPEL
# desc: Extra Packages for Enterprise Linux (EPEL)
# baseurl: "http://download.fedoraproject.org/pub/epel/$releasever/$basearch/"

View File

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

View File

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

View File

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