diff options
author | Matthieu Saulnier <fantom@fedoraproject.org> | 2017-03-15 01:06:07 +0100 |
---|---|---|
committer | Matthieu Saulnier <fantom@fedoraproject.org> | 2017-03-15 01:06:07 +0100 |
commit | 17ddee13e4a8f8e4fbc0296b789ab396dcddfa82 (patch) | |
tree | 7b4dcc6b1c75aced541db8cc56c40720003b9783 /roles/common/tasks | |
parent | dd18a22f9745e97f0e6c5bcc5bdc2d1e1487a6bb (diff) | |
download | playbooks-ansible-17ddee13e4a8f8e4fbc0296b789ab396dcddfa82.tar.gz playbooks-ansible-17ddee13e4a8f8e4fbc0296b789ab396dcddfa82.tar.xz playbooks-ansible-17ddee13e4a8f8e4fbc0296b789ab396dcddfa82.zip |
improve automatic reboot in playbook and in common role and use pkg_mgr variable
Diffstat (limited to 'roles/common/tasks')
-rw-r--r-- | roles/common/tasks/aide.yml | 4 | ||||
-rw-r--r-- | roles/common/tasks/cron.yml | 7 | ||||
-rw-r--r-- | roles/common/tasks/logo.yml | 4 |
3 files changed, 9 insertions, 6 deletions
diff --git a/roles/common/tasks/aide.yml b/roles/common/tasks/aide.yml index 919a3a7..f14da74 100644 --- a/roles/common/tasks/aide.yml +++ b/roles/common/tasks/aide.yml @@ -1,10 +1,10 @@ - name: Installation du HIDS AIDE yum: name=aide state=present - when: ansible_distribution == "CentOS" + when: ansible_pkg_mgr == "yum" - name: Installation du HIDS AIDE dnf: name=aide state=present - when: ansible_distribution == "Fedora" and ansible_distribution_version|int >= 22 + when: ansible_pkg_mgr == "dnf" - name: Activation Cron du HIDS AIDE copy: src=aidereport.sh dest=/etc/cron.daily/z-aidereport.sh mode=755 diff --git a/roles/common/tasks/cron.yml b/roles/common/tasks/cron.yml index 5abc63f..05013bf 100644 --- a/roles/common/tasks/cron.yml +++ b/roles/common/tasks/cron.yml @@ -1,10 +1,10 @@ - name: Installation démon Cron yum: name=crontabs state=present - when: ansible_distribution == "CentOS" + when: ansible_pkg_mgr == "yum" - name: Installation démon Cron dnf: name=crontabs state=present - when: ansible_distribution == "Fedora" and ansible_distribution_version|int >= 22 + when: ansible_pkg_mgr == "dnf" - name: Rapport disques durs template: src=diskreport.sh.j2 dest=/etc/cron.daily/diskreport.sh mode=755 @@ -21,3 +21,6 @@ - name: Rapport d'uptime des machines physiques copy: src=uptimereport.sh dest=/etc/cron.weekly/a-uptimereport.sh mode=755 when: ansible_virtualization_role == "NA" or ansible_virtualization_role == "host" + +- name: Reboot automatique + copy: src=reboot-auto.crontab dest=/etc/cron.d/reboot-auto mode=644 diff --git a/roles/common/tasks/logo.yml b/roles/common/tasks/logo.yml index 5d08b63..2802bc4 100644 --- a/roles/common/tasks/logo.yml +++ b/roles/common/tasks/logo.yml @@ -11,11 +11,11 @@ section=main option=exclude value=linux_logo - when: ansible_distribution == "Fedora" and ansible_distribution_version|int <= 21 + when: ansible_pkg_mgr == "yum" - name: Ajout linux_logo en Exclude (dnf) ini_file: dest=/etc/dnf/dnf.conf section=main option=exclude value=linux_logo - when: ansible_distribution == "Fedora" and ansible_distribution_version|int >= 22 + when: ansible_pkg_mgr == "dnf" |