]> git.phdru.name Git - ansible.git/commitdiff
Feat: Add `changed_when`
authorOleg Broytman <phd@phdru.name>
Mon, 29 Jul 2019 22:58:58 +0000 (01:58 +0300)
committerOleg Broytman <phd@phdru.name>
Mon, 29 Jul 2019 22:58:58 +0000 (01:58 +0300)
playbooks/debian/roles/add-apache-vhost/tasks/main.yml
playbooks/debian/roles/add-dns-domain/tasks/main.yml
playbooks/debian/roles/apache/tasks/main.yml
playbooks/debian/roles/dehydrated/tasks/main.yml

index 7a441497696804bca3a35bfa7c686869f9e7f190..2f0e03a9209a0e0f3f549d19ee8fe91c15be81fb 100644 (file)
@@ -2,6 +2,7 @@
   stat:
     path: "/etc/apache2/sites-enabled/{{ virtual_host }}.conf"
   register: vhost_conf
+  changed_when: not vhost_conf.stat.exists
 
 - name: Add vhost
   import_tasks: add-vhost.yml
index 422f28ecd3edd1350ec3bd15575ee3dcbe7cba52..80f3a6a7b8fdcbbe61ebca5b2faa3be0d7e3e7e4 100644 (file)
@@ -2,6 +2,7 @@
   stat:
     path: "/etc/bind/{{ domain }}"
   register: domain_exists
+  changed_when: not domain_exists.stat.exists
 
 - name: Copy domain template
   become: true
index a5b662a36e9ccd94311bed8d017ccdb98c8271dc..5cd209acc7f0a7ebd876d87ef18803ce83e58e96 100644 (file)
@@ -2,6 +2,7 @@
   stat:
     path: /etc/apache2/conf-enabled/001-phd.conf
   register: phd_conf
+  changed_when: not phd_conf.stat.exists
 
 - debug:
     msg: "apache has already been configured"
index d43ef8a946d8cd26dd619124dd3fc0eee10140b5..87ebe8f05bd0eb9cde2931e4028f9e37f54cf48f 100644 (file)
@@ -3,6 +3,7 @@
     module: stat
     path: /usr/local/src/LetsEncrypt/dehydrated/.git/config
   register: dehydrated
+  changed_when: not dehydrated.stat.exists
 
 - name: Install git
   local_action: