--- /dev/null
+- name: "Setup root mc - check mc links"
+ become: true
+ command: test -L ~root/.cache/mc -a -L ~root/.config/mc -a -L ~root/.local/share/mc
+ failed_when: false
+ register: links_exist
+
+- debug:
+ msg: "mc links have already been created"
+ when: links_exist.rc == 0
+
+- name: "Setup root mc - create directories for mc links"
+ become: true
+ file:
+ path: "~root/{{ item }}"
+ state: directory
+ mode: "0700"
+ loop: ['.cache', '.config', '.local/share']
+ when: links_exist.rc != 0
+
+- name: "Setup root mc - remove mc directories"
+ become: true
+ file:
+ path: "~root/{{ item }}"
+ state: absent
+ loop: ['.cache/mc', '.config/mc', '.local/share/mc']
+ when: links_exist.rc != 0
+
+- name: "Setup root mc - link mc directories (1)"
+ become: true
+ file:
+ path: "~root/{{ item }}"
+ state: link
+ src: "../.mc"
+ force: yes
+ loop: ['.cache/mc', '.config/mc']
+ when: links_exist.rc != 0
+
+- name: "Setup root mc - link mc directories (2)"
+ become: true
+ file:
+ path: "~root/{{ item }}"
+ state: link
+ src: "../../.mc"
+ force: yes
+ loop: ['.local/share/mc']
+ when: links_exist.rc != 0
+
+- name: "Setup root ms - 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: yes
+ loop: ['hotlist', 'ini', 'panels.ini']
+
--- /dev/null
+- name: "Setup ~root - overwrite files from ~phd"
+ become: true
+ copy:
+ src: "~phd/{{ item }}"
+ remote_src: yes
+ dest: ~root
+ owner: root
+ group: root
+ directory_mode: "0700"
+ mode: "0600"
+ force: yes
+ loop: ['.bashrc', 'admin/home/root/.profile']
+
+- name: "Setup ~root - copy directories from ~phd"
+ become: true
+ copy:
+ src: "~phd/{{ item }}"
+ remote_src: yes
+ dest: ~root
+ owner: root
+ group: root
+ directory_mode: "0700"
+ mode: "0700"
+ force: no
+ loop: ['.mc', '.ssh', '.vim', 'bin', 'lib']
+
+- name: "Setup ~root - copy files from ~phd without overwriting"
+ become: true
+ copy:
+ src: "~phd/{{ item }}"
+ remote_src: yes
+ dest: ~root
+ owner: root
+ group: root
+ directory_mode: "0700"
+ mode: "0600"
+ force: no
+ loop: ['.bash_logout', '.inputrc', '.less', '.lesskey',
+ '.screenrc', '.shellrc', '.tmux.conf', '.vimrc',
+ ]
+
+- name: "Setup ~root - create .sh_history"
+ become: true
+ file:
+ path: ~root/.sh_history
+ state: touch
+ owner: root
+ group: root
+ mode: "0600"
+
+- name: "Setup ~root - link .bash_history"
+ become: true
+ file:
+ path: ~root/.bash_history
+ src: ./.sh_history
+ state: link
+ force: yes
+
+- name: "Setup ~root - create tmp/"
+ become: true
+ file:
+ path: tmp/vim/undo
+ state: directory
+ owner: root
+ group: root
+ mode: "0700"
+ recurse: yes