From: Oleg Broytman Date: Sun, 28 Jul 2019 17:43:13 +0000 (+0300) Subject: Fix conditions X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=2e89ce86ff469b61661a0c7335b75ba6d5bcf05f;p=ansible.git Fix conditions --- diff --git a/playbooks/debian/roles/add-apache-vhost/tasks/main.yml b/playbooks/debian/roles/add-apache-vhost/tasks/main.yml index 666cd77..7a44149 100644 --- a/playbooks/debian/roles/add-apache-vhost/tasks/main.yml +++ b/playbooks/debian/roles/add-apache-vhost/tasks/main.yml @@ -5,8 +5,8 @@ - name: Add vhost import_tasks: add-vhost.yml - when: not vhost_conf.stats.exists + when: not vhost_conf.stat.exists - name: Run dehydrated for the vhost import_tasks: dehydrated.yml - when: not vhost_conf.stats.exists + when: not vhost_conf.stat.exists diff --git a/playbooks/debian/roles/apache/tasks/main.yml b/playbooks/debian/roles/apache/tasks/main.yml index b289d94..a5b662a 100644 --- a/playbooks/debian/roles/apache/tasks/main.yml +++ b/playbooks/debian/roles/apache/tasks/main.yml @@ -5,7 +5,7 @@ - debug: msg: "apache has already been configured" - when: not phd_conf.stats.exists + when: phd_conf.stat.exists - name: Install apache become: true @@ -17,13 +17,13 @@ purge: yes state: latest update_cache: yes - when: not phd_conf.stats.exists + when: not phd_conf.stat.exists - name: Enable SSL module become: true command: a2enmod ssl notify: Reload apache - when: not phd_conf.stats.exists + when: not phd_conf.stat.exists - name: Configure apache become: true @@ -34,13 +34,13 @@ group: root mode: '0640' force: no - when: not phd_conf.stats.exists + when: not phd_conf.stat.exists - name: Enable config become: true command: a2enconf 001-phd notify: Reload apache - when: not phd_conf.stats.exists + when: not phd_conf.stat.exists - name: Configure logrotate become: true diff --git a/playbooks/debian/roles/phd/tasks/main.yml b/playbooks/debian/roles/phd/tasks/main.yml index 4c00ec5..2c7373c 100644 --- a/playbooks/debian/roles/phd/tasks/main.yml +++ b/playbooks/debian/roles/phd/tasks/main.yml @@ -16,4 +16,4 @@ unarchive: src: ~/archive/STORE/phd/Home/phd.tar.bz2 dest: /home - when: phd_exists.results|selectattr('stat.exists')|list|length == 2 + when: phd_exists.results|selectattr('stat.exists')|list|length != 2 diff --git a/playbooks/debian/roles/root/tasks/mc.yml b/playbooks/debian/roles/root/tasks/mc.yml index dbb78ba..ec80523 100644 --- a/playbooks/debian/roles/root/tasks/mc.yml +++ b/playbooks/debian/roles/root/tasks/mc.yml @@ -7,7 +7,7 @@ - debug: msg: "mc links have already been created" - when: links_exist.results|selectattr('stat.islnk')|list|length == 3 + when: links_exist.results|selectattr('stat.exists')|selectattr('stat.islnk')|list|length == 3 - name: "Setup root mc - create directories for mc links" become: true @@ -16,7 +16,7 @@ state: directory mode: "0700" loop: ['.cache', '.config', '.local/share'] - when: links_exist.results|selectattr('stat.islnk')|list|length == 3 + when: links_exist.results|selectattr('stat.exists')|selectattr('stat.islnk')|list|length != 3 - name: "Setup root mc - remove mc directories" become: true @@ -24,7 +24,7 @@ path: "~root/{{ item }}" state: absent loop: ['.cache/mc', '.config/mc', '.local/share/mc'] - when: links_exist.results|selectattr('stat.islnk')|list|length == 3 + when: links_exist.results|selectattr('stat.exists')|selectattr('stat.islnk')|list|length != 3 - name: "Setup root mc - link mc directories (1)" become: true @@ -34,7 +34,7 @@ src: "../.mc" force: yes loop: ['.cache/mc', '.config/mc'] - when: links_exist.results|selectattr('stat.islnk')|list|length == 3 + when: links_exist.results|selectattr('stat.exists')|selectattr('stat.islnk')|list|length != 3 - name: "Setup root mc - link mc directories (2)" become: true @@ -44,7 +44,7 @@ src: "../../.mc" force: yes loop: ['.local/share/mc'] - when: links_exist.results|selectattr('stat.islnk')|list|length == 3 + when: links_exist.results|selectattr('stat.exists')|selectattr('stat.islnk')|list|length != 3 - name: "Setup root mc - overwrite files from ~phd/admin" become: true