From d20288c3c2f0a8c3aeca7ca2b5187f5b97c4f62b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Han?= Date: Wed, 8 Apr 2015 18:46:54 +0200 Subject: [PATCH] Only change when the task returns false MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We only want to see things that really changed after a play completes. Signed-off-by: Sébastien Han --- roles/ceph-common/tasks/install_on_redhat.yml | 2 ++ roles/ceph-common/tasks/main.yml | 2 ++ roles/ceph-common/tasks/os_tuning.yml | 3 +++ roles/ceph-common/tasks/prerequisite_ice.yml | 2 ++ roles/ceph-mon/tasks/ceph_keys.yml | 1 + roles/ceph-mon/tasks/create_mds_filesystems.yml | 2 ++ roles/ceph-mon/tasks/openstack_config.yml | 2 ++ roles/ceph-mon/tasks/start_monitor.yml | 2 ++ roles/ceph-osd/tasks/osd_directory.yml | 1 + roles/ceph-osd/tasks/osd_fragment.yml | 3 +++ roles/ceph-osd/tasks/raw_multi_journal.yml | 1 + roles/ceph-osd/tasks/zap_devices.yml | 2 ++ roles/ceph-radosgw/tasks/install_debian.yml | 4 ++++ roles/ceph-radosgw/tasks/install_redhat.yml | 1 + roles/ceph-restapi/tasks/main.yml | 1 + roles/ceph-restapi/tasks/pre_requisite.yml | 1 + 16 files changed, 30 insertions(+) diff --git a/roles/ceph-common/tasks/install_on_redhat.yml b/roles/ceph-common/tasks/install_on_redhat.yml index a0c1c66de..8a66e537f 100644 --- a/roles/ceph-common/tasks/install_on_redhat.yml +++ b/roles/ceph-common/tasks/install_on_redhat.yml @@ -33,12 +33,14 @@ rpm -U http://ceph.com/rpm-{{ ceph_stable_release }}/{{ ceph_stable_redhat_distro }}/noarch/ceph-release-1-0.{{ ceph_stable_redhat_distro|replace('rhel', 'el') }}.noarch.rpm creates=/etc/yum.repos.d/ceph.repo when: ceph_stable + changed_when: False - name: Add Ceph development repository command: > rpm -U http://gitbuilder.ceph.com/ceph-rpm-{{ ceph_dev_redhat_distro }}-x86_64-basic/ref/{{ ceph_dev_branch }}/noarch/ceph-release-1-0.{{ ceph_stable_redhat_distro }}.noarch.rpm creates=/etc/yum.repos.d/ceph.repo when: ceph_dev + changed_when: False - name: Add Inktank Ceph Enterprise repository template: > diff --git a/roles/ceph-common/tasks/main.yml b/roles/ceph-common/tasks/main.yml index aff3da4ac..c65432262 100644 --- a/roles/ceph-common/tasks/main.yml +++ b/roles/ceph-common/tasks/main.yml @@ -16,6 +16,7 @@ shell: "stat /var/run/ceph/*.asok > /dev/null 2>&1" ignore_errors: true register: socket + changed_when: False - name: Generate cluster UUID shell: > @@ -32,6 +33,7 @@ connection: local sudo: false register: cluster_uuid + changed_when: False - name: Generate Ceph configuration file template: > diff --git a/roles/ceph-common/tasks/os_tuning.yml b/roles/ceph-common/tasks/os_tuning.yml index 7bf05f4f5..e0daff9f1 100644 --- a/roles/ceph-common/tasks/os_tuning.yml +++ b/roles/ceph-common/tasks/os_tuning.yml @@ -2,16 +2,19 @@ - name: Disable OSD directory parsing by updatedb command: updatedb -e /var/lib/ceph ignore_errors: true + changed_when: False - name: Disable transparent hugepage command: "echo never > /sys/kernel/mm/transparent_hugepage/enabled" when: disable_transparent_hugepage ignore_errors: true + changed_when: False - name: Disable swap command: swapoff -a when: disable_swap ignore_errors: true + changed_when: False - name: Apply OS tuning sysctl: > diff --git a/roles/ceph-common/tasks/prerequisite_ice.yml b/roles/ceph-common/tasks/prerequisite_ice.yml index da530f3e9..67d03ab0b 100644 --- a/roles/ceph-common/tasks/prerequisite_ice.yml +++ b/roles/ceph-common/tasks/prerequisite_ice.yml @@ -38,7 +38,9 @@ tar -xzf ICE-{{ ceph_stable_ice_version }}-{{ ceph_stable_ice_distro }}.tar.gz chdir={{ ceph_stable_ice_temp_path }} when: ceph_stable_ice and repo_exist.stat.exists == False + changed_when: False - name: Move ICE extracted packages shell: "mv {{ ceph_stable_ice_temp_path }}/ceph/*/* {{ ceph_stable_ice_temp_path }}" when: ceph_stable_ice and repo_exist.stat.exists == False + changed_when: False diff --git a/roles/ceph-mon/tasks/ceph_keys.yml b/roles/ceph-mon/tasks/ceph_keys.yml index e32220976..04dd77c96 100644 --- a/roles/ceph-mon/tasks/ceph_keys.yml +++ b/roles/ceph-mon/tasks/ceph_keys.yml @@ -27,6 +27,7 @@ shell: ls -1 /etc/ceph/*.keyring register: ceph_keys when: cephx + changed_when: False - name: Set keys permissions file: > diff --git a/roles/ceph-mon/tasks/create_mds_filesystems.yml b/roles/ceph-mon/tasks/create_mds_filesystems.yml index 4ebedbc33..f81e20be4 100644 --- a/roles/ceph-mon/tasks/create_mds_filesystems.yml +++ b/roles/ceph-mon/tasks/create_mds_filesystems.yml @@ -4,6 +4,8 @@ with_items: - cephfs_data - cephfs_metadata + changed_when: False - name: Create Ceph Filesystem command: ceph fs new {{ cephfs }} {{ cephfs_metadata }} {{ cephfs_data }} + changed_when: False diff --git a/roles/ceph-mon/tasks/openstack_config.yml b/roles/ceph-mon/tasks/openstack_config.yml index 870c17a8b..724e7c6a7 100644 --- a/roles/ceph-mon/tasks/openstack_config.yml +++ b/roles/ceph-mon/tasks/openstack_config.yml @@ -7,9 +7,11 @@ - "{{ openstack_nova_pool }}" - "{{ openstack_cinder_backup_pool }}" ignore_errors: True + changed_when: False - name: Create OpenStack keys command: > ceph auth get-or-create {{ item.name }} {{ item.value }} -o /etc/ceph/ceph.{{ item.name }}.keyring creates=/etc/ceph/ceph.{{ item.name }}.keyring with_items: openstack_keys + changed_when: False diff --git a/roles/ceph-mon/tasks/start_monitor.yml b/roles/ceph-mon/tasks/start_monitor.yml index 94d94f764..d507b8758 100644 --- a/roles/ceph-mon/tasks/start_monitor.yml +++ b/roles/ceph-mon/tasks/start_monitor.yml @@ -10,6 +10,7 @@ - done - upstart when: ansible_distribution == "Ubuntu" + changed_when: False - name: Activate monitor with sysvinit file: > @@ -42,3 +43,4 @@ - name: Get Ceph monitor version shell: ceph daemon mon."{{ ansible_hostname }}" version | cut -d '"' -f 4 | cut -f 1,2 -d '.' register: ceph_version + changed_when: False diff --git a/roles/ceph-osd/tasks/osd_directory.yml b/roles/ceph-osd/tasks/osd_directory.yml index d01a206f3..a646a1b08 100644 --- a/roles/ceph-osd/tasks/osd_directory.yml +++ b/roles/ceph-osd/tasks/osd_directory.yml @@ -30,6 +30,7 @@ command: "ceph-disk prepare {{ item }}" when: osd_directory with_items: osd_directories + changed_when: False # Activate means: # - mount the volume in a temp location diff --git a/roles/ceph-osd/tasks/osd_fragment.yml b/roles/ceph-osd/tasks/osd_fragment.yml index 13f96caf9..fd063d8e9 100644 --- a/roles/ceph-osd/tasks/osd_fragment.yml +++ b/roles/ceph-osd/tasks/osd_fragment.yml @@ -4,12 +4,14 @@ with_items: devices register: osd_path ignore_errors: true + changed_when: False - name: Get OSD id command: cat {{ item.stdout }}/whoami register: osd_id with_items: osd_path.results ignore_errors: true + changed_when: False - name: Create a Ceph fragment and assemble directory file: > @@ -30,6 +32,7 @@ - name: Copy ceph.conf for assembling command: cp /etc/ceph/ceph.conf /etc/ceph/ceph.d/ + changed_when: False - name: Assemble OSD sections assemble: > diff --git a/roles/ceph-osd/tasks/raw_multi_journal.yml b/roles/ceph-osd/tasks/raw_multi_journal.yml index 80e17c69b..d1ccf8a00 100644 --- a/roles/ceph-osd/tasks/raw_multi_journal.yml +++ b/roles/ceph-osd/tasks/raw_multi_journal.yml @@ -29,5 +29,6 @@ - ispartition.results - devices - raw_journal_devices + changed_when: False - include: activate_osds.yml diff --git a/roles/ceph-osd/tasks/zap_devices.yml b/roles/ceph-osd/tasks/zap_devices.yml index 6372e0cb7..f11b7f67a 100644 --- a/roles/ceph-osd/tasks/zap_devices.yml +++ b/roles/ceph-osd/tasks/zap_devices.yml @@ -6,8 +6,10 @@ command: ceph-disk zap {{ item }} when: zap_devices and (journal_collocation or raw_multi_journal) with_items: devices + changed_when: False - name: Erasing partitions and labels from the journal device(s) command: ceph-disk zap {{ item }} when: zap_devices and raw_multi_journal with_items: raw_journal_devices + changed_when: False diff --git a/roles/ceph-radosgw/tasks/install_debian.yml b/roles/ceph-radosgw/tasks/install_debian.yml index 16f95d803..5bfaf55a8 100644 --- a/roles/ceph-radosgw/tasks/install_debian.yml +++ b/roles/ceph-radosgw/tasks/install_debian.yml @@ -34,11 +34,13 @@ - name: Enable multiverse repo for Trusty command: "apt-add-repository multiverse" when: ansible_lsb.codename in ['trusty'] and not http_100_continue + changed_when: False # Disable the repo when we are using the Ceph repo for 100-continue packages - name: Disable multiverse repo for Trusty command: "apt-add-repository -r multiverse" when: ansible_lsb.codename in ['trusty'] and http_100_continue + changed_when: False # If using 100-continue, add Ceph dev key - name: Install the Ceph development repository key @@ -110,6 +112,7 @@ with_items: - a2enmod rewrite - a2enmod fastcgi + changed_when: False - name: Install Rados Gateway vhost template: > @@ -129,6 +132,7 @@ ignore_errors: True notify: - restart apache2 + changed_when: False - name: Install s3gw.fcgi script template: > diff --git a/roles/ceph-radosgw/tasks/install_redhat.yml b/roles/ceph-radosgw/tasks/install_redhat.yml index dab4f080e..511086390 100644 --- a/roles/ceph-radosgw/tasks/install_redhat.yml +++ b/roles/ceph-radosgw/tasks/install_redhat.yml @@ -14,6 +14,7 @@ - name: Add special fastcgi repository command: rpm -ivh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm + changed_when: False - name: "Install Apache and fastcgi" yum: > diff --git a/roles/ceph-restapi/tasks/main.yml b/roles/ceph-restapi/tasks/main.yml index cc3bf9edd..5bf69816f 100644 --- a/roles/ceph-restapi/tasks/main.yml +++ b/roles/ceph-restapi/tasks/main.yml @@ -9,3 +9,4 @@ - name: Start Ceph REST API shell: "nohup ceph-rest-api &" when: restapi_status.rc != 0 + changed_when: False diff --git a/roles/ceph-restapi/tasks/pre_requisite.yml b/roles/ceph-restapi/tasks/pre_requisite.yml index 25a586daf..bc7325ce3 100644 --- a/roles/ceph-restapi/tasks/pre_requisite.yml +++ b/roles/ceph-restapi/tasks/pre_requisite.yml @@ -27,6 +27,7 @@ - done - upstart when: ansible_distribution == "Ubuntu" + changed_when: False - name: Activate Ceph REST API with sysvinit file: >