]> git.phdru.name Git - ansible.git/blob - playbooks/debian/roles/root/tasks/mc.yml
Fix(add-apache-vhost): Fix directories
[ansible.git] / playbooks / debian / roles / root / tasks / mc.yml
1 - name: "Setup root mc - check mc links"
2   become: true
3   stat:
4     path: "{{ item }}"
5   register: links_exist
6   changed_when: not links_exist.stat.exists
7   loop: ['~root/.cache/mc', '~root/.config/mc', '~root/.local/share/mc']
8
9 - debug:
10     msg: "mc links have already been created"
11   when: links_exist.results|selectattr('stat.exists')|selectattr('stat.islnk')|list|length == 3
12
13 - name: "Setup root mc - create directories for mc links"
14   become: true
15   file:
16     path: "~root/{{ item }}"
17     state: directory
18     mode: "0700"
19   loop: ['.cache', '.config', '.local/share']
20   when: links_exist.results|selectattr('stat.exists')|selectattr('stat.islnk')|list|length != 3
21
22 - name: "Setup root mc - remove mc directories"
23   become: true
24   file:
25     path: "~root/{{ item }}"
26     state: absent
27   loop: ['.cache/mc', '.config/mc', '.local/share/mc']
28   when: links_exist.results|selectattr('stat.exists')|selectattr('stat.islnk')|list|length != 3
29
30 - name: "Setup root mc - link mc directories (1)"
31   become: true
32   file:
33     path: "~root/{{ item }}"
34     state: link
35     src: "../.mc"
36     force: yes
37   loop: ['.cache/mc', '.config/mc']
38   when: links_exist.results|selectattr('stat.exists')|selectattr('stat.islnk')|list|length != 3
39
40 - name: "Setup root mc - link mc directories (2)"
41   become: true
42   file:
43     path: "~root/{{ item }}"
44     state: link
45     src: "../../.mc"
46     force: yes
47   loop: ['.local/share/mc']
48   when: links_exist.results|selectattr('stat.exists')|selectattr('stat.islnk')|list|length != 3
49
50 - name: "Setup root mc - overwrite files from ~phd/admin"
51   become: true
52   copy:
53     src: "~phd/admin/home/root/.mc/{{ item }}"
54     remote_src: yes
55     dest: ~root/.mc
56     owner: root
57     group: root
58     mode: "0600"
59     force: yes
60   loop: ['hotlist', 'ini', 'panels.ini']