X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=playbooks%2Fdebian%2Froles%2Froot%2Ftasks%2Fmc.yml;fp=playbooks%2Fdebian%2Froles%2Froot%2Ftasks%2Fmc.yml;h=c27e80e99d076681ad6c51e1e000b178063a7a3b;hb=9d43bd9e52701c477ba57d6a0275a6b259a183f8;hp=332015ef7d3facd2480290e9d892eaca816480ac;hpb=a25c68ad3932c2ca7f1612be4c95286f6bce23b8;p=ansible.git diff --git a/playbooks/debian/roles/root/tasks/mc.yml b/playbooks/debian/roles/root/tasks/mc.yml index 332015e..c27e80e 100644 --- a/playbooks/debian/roles/root/tasks/mc.yml +++ b/playbooks/debian/roles/root/tasks/mc.yml @@ -10,41 +10,39 @@ msg: "mc links have already been created" when: links_exist.results|selectattr('stat.exists')|selectattr('stat.islnk')|list|length == 3 -- 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.results|selectattr('stat.exists')|selectattr('stat.islnk')|list|length != 3 +- block: + - name: "Setup root mc - create directories for mc links" + become: true + file: + path: "~root/{{ item }}" + state: directory + mode: "0700" + loop: ['.cache', '.config', '.local/share'] -- 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.results|selectattr('stat.exists')|selectattr('stat.islnk')|list|length != 3 + - name: "Setup root mc - remove mc directories" + become: true + file: + path: "~root/{{ item }}" + state: absent + loop: ['.cache/mc', '.config/mc', '.local/share/mc'] -- 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.results|selectattr('stat.exists')|selectattr('stat.islnk')|list|length != 3 + - 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'] -- name: "Setup root mc - link mc directories (2)" - become: true - file: - path: "~root/{{ item }}" - state: link - src: "../../.mc" - force: yes - loop: ['.local/share/mc'] + - 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.results|selectattr('stat.exists')|selectattr('stat.islnk')|list|length != 3 - name: "Setup root mc - overwrite files from ~phd/admin"