From d36a99e41b25b505fd4625c0661902d63bf7df30 Mon Sep 17 00:00:00 2001 From: James Saint-Rossy Date: Mon, 26 Sep 2016 09:19:15 -0400 Subject: [PATCH] Used list style ands for better readibility and fixed legacy debian checks --- roles/ceph-common/tasks/release.yml | 3 ++- roles/ceph-mon/tasks/start_monitor.yml | 6 ++++-- roles/ceph-rgw/tasks/main.yml | 5 ++++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/roles/ceph-common/tasks/release.yml b/roles/ceph-common/tasks/release.yml index ec190d363..3bb54e038 100644 --- a/roles/ceph-common/tasks/release.yml +++ b/roles/ceph-common/tasks/release.yml @@ -7,5 +7,6 @@ - set_fact: ceph_release: "{{ item.key }}" when: - ceph_dev and ({{ item.value }} > ceph_release_num.{{ ceph_release }}) + - ceph_dev + - ({{ item.value }} > ceph_release_num.{{ ceph_release }}) with_dict: "{{ ceph_release_num }}" diff --git a/roles/ceph-mon/tasks/start_monitor.yml b/roles/ceph-mon/tasks/start_monitor.yml index c308481c0..0999673fa 100644 --- a/roles/ceph-mon/tasks/start_monitor.yml +++ b/roles/ceph-mon/tasks/start_monitor.yml @@ -21,6 +21,7 @@ - not use_systemd # legacy ceph system v init scripts require a mon section in order to work +# Not Ubuntu so we can catch old debian systems that don't use systemd or upstart - name: add mon section into ceph.conf for systemv init scripts ini_file: dest: /etc/ceph/{{ cluster }}.conf @@ -29,16 +30,17 @@ value: "{{ ansible_host }}" state: present when: - - ansible_os_family == "RedHat" + - ansible_os_family != "Ubuntu" - ceph_release_num.{{ ceph_stable_release }} < ceph_release_num.infernalis # NOTE (jsaintrocc): can't use service module because we need to use the # legacy systemv init for older ceph releases. Even when the os supports systemd +# Not Ubuntu so we can catch old debian systems that don't use systemd or upstart - name: start and add that the monitor service to the init sequence command: service ceph start mon changed_when: false when: - - ansible_os_family == "RedHat" + - ansible_os_family != "Ubuntu" - ceph_release_num.{{ ceph_stable_release }} < ceph_release_num.infernalis - name: start and add that the monitor service to the init sequence (for or after infernalis) diff --git a/roles/ceph-rgw/tasks/main.yml b/roles/ceph-rgw/tasks/main.yml index ab1d53ae5..5fb5699cd 100644 --- a/roles/ceph-rgw/tasks/main.yml +++ b/roles/ceph-rgw/tasks/main.yml @@ -16,7 +16,10 @@ - name: include rgw multisite playbooks include: multisite/main.yml - when: rgw_zone is defined and rgw_multisite and ( ceph_release_num.{{ ceph_release }} >= ceph_release_num.jewel ) + when: + - rgw_zone is defined + - rgw_multisite + - ( ceph_release_num.{{ ceph_release }} >= ceph_release_num.jewel ) # Hard code this so we will skip the entire file instead of individual tasks (Default isn't Consistent) static: False -- 2.39.5