From: Andrew Schoen Date: Thu, 30 Apr 2015 15:36:58 +0000 (-0500) Subject: More fixes to support --check mode. X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F8%2Fhead;p=ceph-cm-ansible.git More fixes to support --check mode. Signed-off-by: Andrew Schoen --- diff --git a/roles/testnode/tasks/apt_systems.yml b/roles/testnode/tasks/apt_systems.yml index 36e3b0e3..c1ee7419 100644 --- a/roles/testnode/tasks/apt_systems.yml +++ b/roles/testnode/tasks/apt_systems.yml @@ -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: diff --git a/roles/testnode/tasks/cpan.yml b/roles/testnode/tasks/cpan.yml index 5e7c067c..97174927 100644 --- a/roles/testnode/tasks/cpan.yml +++ b/roles/testnode/tasks/cpan.yml @@ -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 diff --git a/roles/testnode/tasks/redhat/rhel_7.0.yml b/roles/testnode/tasks/redhat/rhel_7.0.yml index fb1dcd72..df7e752c 100644 --- a/roles/testnode/tasks/redhat/rhel_7.0.yml +++ b/roles/testnode/tasks/redhat/rhel_7.0.yml @@ -17,12 +17,14 @@ - 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 diff --git a/roles/testnode/tasks/setup-debian.yml b/roles/testnode/tasks/setup-debian.yml index 83e04374..dd658085 100644 --- a/roles/testnode/tasks/setup-debian.yml +++ b/roles/testnode/tasks/setup-debian.yml @@ -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