Refactor ansible tasks in apt-gateway.yml to include module prefixes and improve variable naming consistency
This commit is contained in:
@@ -1,30 +1,30 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
- name: (apt-gateway.yml) Install gateway related packages
|
- name: (apt-gateway.yml) Install gateway related packages
|
||||||
apt:
|
ansible.builtin.apt:
|
||||||
name: "{{ apt_gateway_host_pkgs }}"
|
name: "{{ apt_gateway_host_pkgs }}"
|
||||||
state: "{{ apt_install_state }}"
|
state: "{{ apt_install_state }}"
|
||||||
|
|
||||||
|
|
||||||
- name: (apt-gateway.yml) Check if file '/etc/logrotate.d/speedtest' exists
|
- name: (apt-gateway.yml) Check if file '/etc/logrotate.d/speedtest' exists
|
||||||
stat:
|
ansible.builtin.stat:
|
||||||
path: /etc/logrotate.d/speedtest
|
path: /etc/logrotate.d/speedtest
|
||||||
register: logrotate_speedtest_exists
|
register: common_logrotate_speedtest_exists
|
||||||
|
|
||||||
|
|
||||||
- name: (apt-gateway.yml) Ensure file /etc/logrotate.d/speedtest exists
|
- name: (apt-gateway.yml) Ensure file /etc/logrotate.d/speedtest exists
|
||||||
copy:
|
ansible.builtin.copy:
|
||||||
src: "{{ role_path + '/files/etc/logrotate.d/speedtest' }}"
|
src: "{{ role_path + '/files/etc/logrotate.d/speedtest' }}"
|
||||||
dest: /etc/logrotate.d/speedtest
|
dest: /etc/logrotate.d/speedtest
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
mode: 0644
|
mode: '0644'
|
||||||
when:
|
when:
|
||||||
- logrotate_speedtest_exists.stat.exists == False
|
- not common_logrotate_speedtest_exists.stat.exists
|
||||||
|
|
||||||
|
|
||||||
- name: (apt-gateway.yml) Set crontab entry for nightly speedtests
|
- name: (apt-gateway.yml) Set crontab entry for nightly speedtests
|
||||||
cron:
|
ansible.builtin.cron:
|
||||||
name: 'Speedtest'
|
name: 'Speedtest'
|
||||||
minute: 13
|
minute: 13
|
||||||
hour: 0-8
|
hour: 0-8
|
||||||
|
|||||||
Reference in New Issue
Block a user