From: Oleg Broytman Date: Sun, 4 Aug 2019 18:38:47 +0000 (+0300) Subject: Feat(adjtimex): Convert playbook `adjtimex.yml` to a role X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=adadcb16e33617bc612dd65e82892241f8b5ace4;p=ansible.git Feat(adjtimex): Convert playbook `adjtimex.yml` to a role --- diff --git a/playbooks/adjtimex.yml b/playbooks/adjtimex.yml deleted file mode 100644 index adf745c..0000000 --- a/playbooks/adjtimex.yml +++ /dev/null @@ -1,14 +0,0 @@ -- name: "adjtimex: sync time and adjust kernel coefficients" - hosts: "{{ hosts | default('all') }}" - gather_facts: false - become: true - tasks: - - name: Copy the script adjtimex.sh - copy: - src: ~/admin/prog/adjtimex.sh - dest: /usr/local/sbin/adjtimex.sh - owner: root - group: root - mode: 0750 - - name: Run adjtimex.sh - command: /usr/local/sbin/adjtimex.sh diff --git a/playbooks/debian/roles/adjtimex/files/adjtimex b/playbooks/debian/roles/adjtimex/files/adjtimex new file mode 100755 index 0000000..f11f2dc --- /dev/null +++ b/playbooks/debian/roles/adjtimex/files/adjtimex @@ -0,0 +1,2 @@ +#!/bin/sh +exec /usr/local/sbin/adjtimex.sh diff --git a/playbooks/debian/roles/adjtimex/tasks/main.yml b/playbooks/debian/roles/adjtimex/tasks/main.yml new file mode 100644 index 0000000..0585334 --- /dev/null +++ b/playbooks/debian/roles/adjtimex/tasks/main.yml @@ -0,0 +1,16 @@ +- name: Copy the script adjtimex.sh + copy: + src: ~/admin/prog/adjtimex.sh + dest: /usr/local/sbin/adjtimex.sh + owner: root + group: root + mode: 0750 + +- name: Configure adjtimex weekly run + become: true + copy: + src: adjtimex + dest: /etc/cron.weekly + owner: root + group: root + mode: '0700'