]> git.apps.os.sepia.ceph.com Git - ceph-cm-ansible.git/commitdiff
More fixes to support --check mode. 8/head
authorAndrew Schoen <aschoen@redhat.com>
Thu, 30 Apr 2015 15:36:58 +0000 (10:36 -0500)
committerAndrew Schoen <aschoen@redhat.com>
Thu, 30 Apr 2015 15:37:22 +0000 (10:37 -0500)
Signed-off-by: Andrew Schoen <aschoen@redhat.com>
roles/testnode/tasks/apt_systems.yml
roles/testnode/tasks/cpan.yml
roles/testnode/tasks/redhat/rhel_7.0.yml
roles/testnode/tasks/setup-debian.yml

index 36e3b0e37d7e7ae63044d8cf05d2db3e8287a5e4..c1ee7419ef1fa2f129588780fb594ae4904c4148 100644 (file)
@@ -25,7 +25,8 @@
 - name: Enable xattr for this boot.
   command:
     mount -o remount,user_xattr /
-  when: add_user_xattr|changed
+  when: add_user_xattr is defined and
+        add_user_xattr|changed
 
 - name: Upload /etc/fuse.conf.
   template:
index 5e7c067c7cb6d946b99b61aba5c426c0a21b5d70..971749276ce608e8d1245a0202a1a7056a6749b3 100644 (file)
@@ -47,4 +47,5 @@
 
 - name: "Install Amazon::S3."
   command: "cpan  Amazon::S3"
-  when: cpan_check.rc != 0
+  when: cpan_check is defined and
+        cpan_check.rc != 0
index fb1dcd72b67de2265850d663735514a3fb20fbe5..df7e752cecb28bfd1c119c231207afae5eff83b4 100644 (file)
 - name: Remove lab domain from hostname.
   shell: hostname | cut -d'.' -f1
   register: new_hostname
-  when: existing_hostname.stdout.find("{{ lab_domain | mandatory }}") != -1
+  when: existing_hostname is defined and
+        existing_hostname.stdout.find("{{ lab_domain | mandatory }}") != -1
 
 - name: Set hostname.
   hostname:
      name: "{{ new_hostname.stdout }}"
-  when: existing_hostname.stdout.find("{{ lab_domain | mandatory }}") != -1
+  when: existing_hostname is defined and
+        existing_hostname.stdout.find("{{ lab_domain | mandatory }}") != -1
 
 # Install and configure cpan and Amazon::S3
 - include: ../cpan.yml
index 83e04374c579a7ce19c3e3e56cd5146d17a30503..dd6580851a6ca2b7ec54d1862906d385826e5edd 100644 (file)
@@ -29,4 +29,5 @@
 - name: Update /etc/profile if needed.
   command:
     sed -i 's/\/usr\/games"/\/usr\/games:\/usr\/sbin"/g' /etc/profile
-  when: update_profile.rc != 0
+  when: update_profile is defined and
+        update_profile.rc != 0