]> git.phdru.name Git - ansible.git/commitdiff
Feat(adjtimex): Convert playbook `adjtimex.yml` to a role
authorOleg Broytman <phd@phdru.name>
Sun, 4 Aug 2019 18:38:47 +0000 (21:38 +0300)
committerOleg Broytman <phd@phdru.name>
Sun, 4 Aug 2019 18:50:28 +0000 (21:50 +0300)
playbooks/adjtimex.yml [deleted file]
playbooks/debian/roles/adjtimex/files/adjtimex [new file with mode: 0755]
playbooks/debian/roles/adjtimex/tasks/main.yml [new file with mode: 0644]

diff --git a/playbooks/adjtimex.yml b/playbooks/adjtimex.yml
deleted file mode 100644 (file)
index adf745c..0000000
+++ /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 (executable)
index 0000000..f11f2dc
--- /dev/null
@@ -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 (file)
index 0000000..0585334
--- /dev/null
@@ -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'