Commit 918e538d authored by Thomas Gambier's avatar Thomas Gambier 🚴🏼

[playbook] make sure playbook works with old version of ansible

parent c5e509c3
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
- name: get packages to upgrade - name: get packages to upgrade
shell: grep-status -X -S apt -ns Package shell: grep-status -X -S apt -ns Package
register: packages_to_upgrade register: packages_to_upgrade
check_mode: no
- name: Upgrade all apt related packages - name: Upgrade all apt related packages
apt: name={{ packages_to_upgrade.stdout.split('\n') }} state=latest apt: name={{ packages_to_upgrade.stdout.split('\n') }} state=latest
---
- name: Update cron service definition
# For ansible version < 2.4, state=restarted is mandatory to
# apply the changes (daemon_reload=yes only is not enough)
systemd: daemon_reload=yes name=cron state=restarted
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
- name: Get systemd version - name: Get systemd version
shell: systemd --version | head -n 1 | cut -d " " -f 2 shell: systemd --version | head -n 1 | cut -d " " -f 2
register: systemd_version register: systemd_version
check_mode: no
- file: state=directory path="/etc/systemd/system/cron.service.d/" - file: state=directory path="/etc/systemd/system/cron.service.d/"
when: systemd_version.stdout | int > 228 when: systemd_version.stdout | int > 228
...@@ -40,5 +39,3 @@ ...@@ -40,5 +39,3 @@
- name: Increase the maximum of subprocesses for cron - name: Increase the maximum of subprocesses for cron
copy: src="etc_systemd_system_cron_service_d_override.conf" dest="/etc/systemd/system/cron.service.d/override.conf" mode=0644 owner=root group=root copy: src="etc_systemd_system_cron_service_d_override.conf" dest="/etc/systemd/system/cron.service.d/override.conf" mode=0644 owner=root group=root
when: systemd_version.stdout | int > 228 when: systemd_version.stdout | int > 228
notify:
- "Update cron service definition"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment