roles/yum-cron: Split from yum role.
This commit is contained in:
parent
a00e978505
commit
2757c67c23
3
ansible/roles/yum-cron/defaults/main.yml
Normal file
3
ansible/roles/yum-cron/defaults/main.yml
Normal file
@ -0,0 +1,3 @@
|
||||
---
|
||||
|
||||
yum_cron_enabled: false
|
23
ansible/roles/yum-cron/tasks/main.yml
Normal file
23
ansible/roles/yum-cron/tasks/main.yml
Normal 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
|
@ -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.
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user