]> git.phdru.name Git - ansible.git/commitdiff
Feat(update-root): Update `~root` from `~phd`
authorOleg Broytman <phd@phdru.name>
Wed, 24 Jul 2019 00:47:38 +0000 (03:47 +0300)
committerOleg Broytman <phd@phdru.name>
Wed, 24 Jul 2019 00:50:23 +0000 (03:50 +0300)
playbooks/debian/roles/root/tasks/mc.yml
playbooks/debian/update-root.yml [new file with mode: 0644]

index e46d622f7731aeab7a24fb220f2e5f2762f8846e..36fe266db64c0acd55cc884953470a2b5399b073 100644 (file)
@@ -45,7 +45,7 @@
   loop: ['.local/share/mc']
   when: links_exist.rc != 0
 
-- name: "Setup root ms - overwrite files from ~phd/admin"
+- name: "Setup root mc - overwrite files from ~phd/admin"
   become: true
   copy:
     src: "~phd/admin/home/root/.mc/{{ item }}"
diff --git a/playbooks/debian/update-root.yml b/playbooks/debian/update-root.yml
new file mode 100644 (file)
index 0000000..74d0a8c
--- /dev/null
@@ -0,0 +1,37 @@
+- name: "Update ~root from ~phd"
+  hosts: "{{ hosts | default('all') }}"
+  become: yes
+  gather_facts: false
+  tasks:
+    - name: "Update ~root - sync directories from ~phd"
+      command: "rsync -rlt --info=name ~phd/{{ item }} ~root"
+      register: rsync
+      changed_when: "rsync.stdout != ''"
+      loop: ['.vim', 'bin', 'lib']
+
+    - name: "Update ~root - sync files from ~phd"
+      copy:
+        src: "~phd/{{ item }}"
+        remote_src: yes
+        dest: ~root
+        owner: root
+        group: root
+        mode: "0600"
+        force: no
+      loop: ['.bashrc', 'admin/home/root/.profile',
+             '.bash_logout', '.inputrc', '.less', '.lesskey',
+             '.screenrc', '.shellrc', '.tmux.conf', '.vimrc',
+            ]
+
+    - name: "Update root mc - overwrite files from ~phd/admin"
+      become: true
+      copy:
+        src: "~phd/admin/home/root/.mc/{{ item }}"
+        remote_src: yes
+        dest: ~root/.mc
+        owner: root
+        group: root
+        mode: "0600"
+        force: no
+      loop: ['hotlist', 'ini', 'panels.ini']
+