From ab884c7cb27fede5af0ab1201650b679e4573476 Mon Sep 17 00:00:00 2001 From: Eric Cook Date: Fri, 4 Dec 2015 17:36:24 -0500 Subject: [PATCH] fixes ceph_stable_release logic mentioned in issue #446 I changed the argument used for starting the mds server. (pre infernalis) ``` service ceph start mds ``` errors, while ``` service ceph start mds.$hostname ``` correctly starts the service. I changed the mds directory ownership from ceph:cephh to root:root again, for pre-infernalis. And finally, add the ceph_stable_releases checks for the upstart activation task `for or after infernalis release'. --- roles/ceph-mds/tasks/pre_requisite.yml | 54 +++++++++++----------- roles/ceph-mon/tasks/deploy_monitors.yml | 24 +++++----- roles/ceph-mon/tasks/start_monitor.yml | 9 +++- roles/ceph-osd/tasks/pre_requisite.yml | 16 +++---- roles/ceph-restapi/tasks/pre_requisite.yml | 32 ++++++------- roles/ceph-rgw/tasks/pre_requisite.yml | 40 ++++++++-------- 6 files changed, 91 insertions(+), 84 deletions(-) diff --git a/roles/ceph-mds/tasks/pre_requisite.yml b/roles/ceph-mds/tasks/pre_requisite.yml index 7d3484222..1a4bc967c 100644 --- a/roles/ceph-mds/tasks/pre_requisite.yml +++ b/roles/ceph-mds/tasks/pre_requisite.yml @@ -7,10 +7,10 @@ group: ceph mode: 0755 when: - ceph_stable_release != 'dumpling' or - ceph_stable_release != 'emperor' or - ceph_stable_release != 'firefly' or - ceph_stable_release != 'giant' or + ceph_stable_release != 'dumpling' and + ceph_stable_release != 'emperor' and + ceph_stable_release != 'firefly' and + ceph_stable_release != 'giant' and ceph_stable_release != 'hammer' - name: create bootstrap-mds directory (before infernalis release) @@ -37,10 +37,10 @@ mode: 0600 when: cephx and - (ceph_stable_release != 'dumpling' or - ceph_stable_release != 'emperor' or - ceph_stable_release != 'firefly' or - ceph_stable_release != 'giant' or + (ceph_stable_release != 'dumpling' and + ceph_stable_release != 'emperor' and + ceph_stable_release != 'firefly' and + ceph_stable_release != 'giant' and ceph_stable_release != 'hammer') - name: copy mds bootstrap key (before infernalis release) @@ -67,18 +67,18 @@ mode: 0755 when: cephx and - (ceph_stable_release != 'dumpling' or - ceph_stable_release != 'emperor' or - ceph_stable_release != 'firefly' or - ceph_stable_release != 'giant' or + (ceph_stable_release != 'dumpling' and + ceph_stable_release != 'emperor' and + ceph_stable_release != 'firefly' and + ceph_stable_release != 'giant' and ceph_stable_release != 'hammer') - name: create mds directory (before infernalis release) file: path: /var/lib/ceph/mds/ceph-{{ ansible_hostname }} state: directory - owner: ceph - group: cephh + owner: root + group: root mode: 0755 when: cephx and @@ -103,10 +103,10 @@ group: ceph when: cephx and - (ceph_stable_release != 'dumpling' or - ceph_stable_release != 'emperor' or - ceph_stable_release != 'firefly' or - ceph_stable_release != 'giant' or + (ceph_stable_release != 'dumpling' and + ceph_stable_release != 'emperor' and + ceph_stable_release != 'firefly' and + ceph_stable_release != 'giant' and ceph_stable_release != 'hammer') - name: set mds key permissions (before infernalis) @@ -136,10 +136,10 @@ changed_when: false when: ansible_distribution == "Ubuntu" and - (ceph_stable_release != 'dumpling' or - ceph_stable_release != 'emperor' or - ceph_stable_release != 'firefly' or - ceph_stable_release != 'giant' or + (ceph_stable_release != 'dumpling' and + ceph_stable_release != 'emperor' and + ceph_stable_release != 'firefly' and + ceph_stable_release != 'giant' and ceph_stable_release != 'hammer') - name: activate metadata server with upstart (before infernalis release) @@ -174,10 +174,10 @@ changed_when: false when: ansible_distribution != "Ubuntu" and - (ceph_stable_release != 'dumpling' or - ceph_stable_release != 'emperor' or - ceph_stable_release != 'firefly' or - ceph_stable_release != 'giant' or + (ceph_stable_release != 'dumpling' and + ceph_stable_release != 'emperor' and + ceph_stable_release != 'firefly' and + ceph_stable_release != 'giant' and ceph_stable_release != 'hammer') - name: activate metadata server with sysvinit (before infernalis release) @@ -213,7 +213,7 @@ name: ceph state: started enabled: yes - args: mds + args: mds.{{ ansible_hostname }} changed_when: false when: ansible_distribution != "Ubuntu" and (ceph_stable_release == 'dumpling' or diff --git a/roles/ceph-mon/tasks/deploy_monitors.yml b/roles/ceph-mon/tasks/deploy_monitors.yml index 73e4c1356..3b18c42bc 100644 --- a/roles/ceph-mon/tasks/deploy_monitors.yml +++ b/roles/ceph-mon/tasks/deploy_monitors.yml @@ -26,10 +26,10 @@ owner: ceph group: ceph when: - ceph_stable_release != 'dumpling' or - ceph_stable_release != 'emperor' or - ceph_stable_release != 'firefly' or - ceph_stable_release != 'giant' or + ceph_stable_release != 'dumpling' and + ceph_stable_release != 'emperor' and + ceph_stable_release != 'firefly' and + ceph_stable_release != 'giant' and ceph_stable_release != 'hammer' - name: create monitor directory (for or after infernalis release) @@ -40,10 +40,10 @@ group: ceph mode: 0755 when: - ceph_stable_release != 'dumpling' or - ceph_stable_release != 'emperor' or - ceph_stable_release != 'firefly' or - ceph_stable_release != 'giant' or + ceph_stable_release != 'dumpling' and + ceph_stable_release != 'emperor' and + ceph_stable_release != 'firefly' and + ceph_stable_release != 'giant' and ceph_stable_release != 'hammer' - name: set initial monitor key permissions (before infernalis release) @@ -78,10 +78,10 @@ args: creates: /var/lib/ceph/mon/ceph-{{ ansible_hostname }}/keyring when: - ceph_stable_release != 'dumpling' or - ceph_stable_release != 'emperor' or - ceph_stable_release != 'firefly' or - ceph_stable_release != 'giant' or + ceph_stable_release != 'dumpling' and + ceph_stable_release != 'emperor' and + ceph_stable_release != 'firefly' and + ceph_stable_release != 'giant' and ceph_stable_release != 'hammer' - name: ceph monitor mkfs (before infernalis release) diff --git a/roles/ceph-mon/tasks/start_monitor.yml b/roles/ceph-mon/tasks/start_monitor.yml index ed4a3aedf..cc5e93b00 100644 --- a/roles/ceph-mon/tasks/start_monitor.yml +++ b/roles/ceph-mon/tasks/start_monitor.yml @@ -9,7 +9,14 @@ with_items: - done - upstart - when: ansible_distribution == "Ubuntu" + when: + ansible_distribution == "Ubuntu" and + (ceph_stable_release != 'dumpling' and + ceph_stable_release != 'emperor' and + ceph_stable_release != 'firefly' and + ceph_stable_release != 'giant' and + ceph_stable_release != 'hammer') + changed_when: false - name: activate monitor with upstart before infernalis release diff --git a/roles/ceph-osd/tasks/pre_requisite.yml b/roles/ceph-osd/tasks/pre_requisite.yml index 6c8d50d03..718c79fc1 100644 --- a/roles/ceph-osd/tasks/pre_requisite.yml +++ b/roles/ceph-osd/tasks/pre_requisite.yml @@ -20,10 +20,10 @@ mode: 0755 when: cephx and - (ceph_stable_release != 'dumpling' or - ceph_stable_release != 'emperor' or - ceph_stable_release != 'firefly' or - ceph_stable_release != 'giant' or + (ceph_stable_release != 'dumpling' and + ceph_stable_release != 'emperor' and + ceph_stable_release != 'firefly' and + ceph_stable_release != 'giant' and ceph_stable_release != 'hammer') - name: create bootstrap-osd directory (before infernalis release) @@ -50,10 +50,10 @@ mode: 0600 when: cephx and - (ceph_stable_release != 'dumpling' or - ceph_stable_release != 'emperor' or - ceph_stable_release != 'firefly' or - ceph_stable_release != 'giant' or + (ceph_stable_release != 'dumpling' and + ceph_stable_release != 'emperor' and + ceph_stable_release != 'firefly' and + ceph_stable_release != 'giant' and ceph_stable_release != 'hammer') - name: copy osd bootstrap key (before infernalis release) diff --git a/roles/ceph-restapi/tasks/pre_requisite.yml b/roles/ceph-restapi/tasks/pre_requisite.yml index 0d0b0bed5..13aa693f3 100644 --- a/roles/ceph-restapi/tasks/pre_requisite.yml +++ b/roles/ceph-restapi/tasks/pre_requisite.yml @@ -7,10 +7,10 @@ group: ceph mode: 0755 when: - ceph_stable_release != 'dumpling' or - ceph_stable_release != 'emperor' or - ceph_stable_release != 'firefly' or - ceph_stable_release != 'giant' or + ceph_stable_release != 'dumpling' and + ceph_stable_release != 'emperor' and + ceph_stable_release != 'firefly' and + ceph_stable_release != 'giant' and ceph_stable_release != 'hammer' - name: create ceph rest api directory (before infernalis release) @@ -36,10 +36,10 @@ mode: 600 when: cephx and - (ceph_stable_release != 'dumpling' or - ceph_stable_release != 'emperor' or - ceph_stable_release != 'firefly' or - ceph_stable_release != 'giant' or + (ceph_stable_release != 'dumpling' and + ceph_stable_release != 'emperor' and + ceph_stable_release != 'firefly' and + ceph_stable_release != 'giant' and ceph_stable_release != 'hammer') - name: copy ceph rest api keyring (before infernalis release) @@ -70,10 +70,10 @@ changed_when: false when: ansible_distribution == "Ubuntu" and - (ceph_stable_release != 'dumpling' or - ceph_stable_release != 'emperor' or - ceph_stable_release != 'firefly' or - ceph_stable_release != 'giant' or + (ceph_stable_release != 'dumpling' and + ceph_stable_release != 'emperor' and + ceph_stable_release != 'firefly' and + ceph_stable_release != 'giant' and ceph_stable_release != 'hammer') - name: activate ceph rest api with upstart (before infernalis release) @@ -107,10 +107,10 @@ - sysvinit when: ansible_distribution != "Ubuntu" and - (ceph_stable_release != 'dumpling' or - ceph_stable_release != 'emperor' or - ceph_stable_release != 'firefly' or - ceph_stable_release != 'giant' or + (ceph_stable_release != 'dumpling' and + ceph_stable_release != 'emperor' and + ceph_stable_release != 'firefly' and + ceph_stable_release != 'giant' and ceph_stable_release != 'hammer') - name: activate ceph rest api with sysvinit (before infernalis release)) diff --git a/roles/ceph-rgw/tasks/pre_requisite.yml b/roles/ceph-rgw/tasks/pre_requisite.yml index c28ddc1b7..89d47e365 100644 --- a/roles/ceph-rgw/tasks/pre_requisite.yml +++ b/roles/ceph-rgw/tasks/pre_requisite.yml @@ -10,10 +10,10 @@ - /var/lib/ceph/bootstrap-rgw - /var/lib/ceph/radosgw/ceph-rgw.{{ ansible_hostname }} when: - ceph_stable_release != 'dumpling' or - ceph_stable_release != 'emperor' or - ceph_stable_release != 'firefly' or - ceph_stable_release != 'giant' or + ceph_stable_release != 'dumpling' and + ceph_stable_release != 'emperor' and + ceph_stable_release != 'firefly' and + ceph_stable_release != 'giant' and ceph_stable_release != 'hammer' - name: create rados gateway directories (before infernalis release) @@ -42,10 +42,10 @@ mode: 0600 when: cephx and - (ceph_stable_release != 'dumpling' or - ceph_stable_release != 'emperor' or - ceph_stable_release != 'firefly' or - ceph_stable_release != 'giant' or + (ceph_stable_release != 'dumpling' and + ceph_stable_release != 'emperor' and + ceph_stable_release != 'firefly' and + ceph_stable_release != 'giant' and ceph_stable_release != 'hammer') - name: copy rados gateway bootstrap key (before infernalis release) @@ -78,10 +78,10 @@ group: ceph when: cephx and - (ceph_stable_release != 'dumpling' or - ceph_stable_release != 'emperor' or - ceph_stable_release != 'firefly' or - ceph_stable_release != 'giant' or + (ceph_stable_release != 'dumpling' and + ceph_stable_release != 'emperor' and + ceph_stable_release != 'firefly' and + ceph_stable_release != 'giant' and ceph_stable_release != 'hammer') - name: set rados gateway key permissions (before infernalis release) @@ -111,10 +111,10 @@ changed_when: false when: ansible_distribution == "Ubuntu" and - (ceph_stable_release != 'dumpling' or - ceph_stable_release != 'emperor' or - ceph_stable_release != 'firefly' or - ceph_stable_release != 'giant' or + (ceph_stable_release != 'dumpling' and + ceph_stable_release != 'emperor' and + ceph_stable_release != 'firefly' and + ceph_stable_release != 'giant' and ceph_stable_release != 'hammer') - name: activate rados gateway with upstart (before infernalis release) @@ -149,10 +149,10 @@ changed_when: false when: ansible_distribution != "Ubuntu" and - (ceph_stable_release != 'dumpling' or - ceph_stable_release != 'emperor' or - ceph_stable_release != 'firefly' or - ceph_stable_release != 'giant' or + (ceph_stable_release != 'dumpling' and + ceph_stable_release != 'emperor' and + ceph_stable_release != 'firefly' and + ceph_stable_release != 'giant' and ceph_stable_release != 'hammer') - name: activate rados gateway with sysvinit (before infernalis release)