roles/yum-cron: Split from yum role.

This commit is contained in:
Jonathan Davies 2017-11-01 13:12:52 +00:00
parent a00e978505
commit 2757c67c23
5 changed files with 26 additions and 24 deletions

View File

@ -0,0 +1,3 @@
---
yum_cron_enabled: false

View File

@ -0,0 +1,23 @@
---
- name: Yum | Install yum-cron (CentOS)
yum:
name: yum-cron
state: present
when: yum_cron_enabled
- name: Replace | Enable update applying for yum-cron (CentOS)
replace:
dest: /etc/yum/yum-cron.conf
regexp: "^apply_updates = no"
replace: "apply_updates = yes"
when: yum_cron_enabled
notify:
- Restart yum-cron
- name: Service | Enable yum-cron (CentOS)
service:
name: yum-cron
state: started
enabled: yes
when: yum_cron_enabled

View File

@ -2,8 +2,6 @@
# Whether or not to use a local Yum mirror.
yum_use_local_mirror: false
# Whether or not yum-cron is enabled.
yum_cron_enabled: false
# Mirror FQDN for Yum repos.
yum_centos_mirror_host: 'mirror.centos.org'
# Mirror directory for Yum CentOS repos.

View File

@ -36,25 +36,3 @@
yum:
update_cache: yes
when: ansible_os_family == 'RedHat'
- name: Yum | Install yum-cron (CentOS)
yum:
name: yum-cron
state: present
when: yum_cron_enabled
- name: Replace | Enable update applying for yum-cron (CentOS)
replace:
dest: /etc/yum/yum-cron.conf
regexp: "^apply_updates = no"
replace: "apply_updates = yes"
when: yum_cron_enabled
notify:
- Restart yum-cron
- name: Service | Enable yum-cron (CentOS)
service:
name: yum-cron
state: started
enabled: yes
when: yum_cron_enabled