Merge pull request #758 from ceph/ubuntu_use_systemd

Adds an use_systemd fact
pull/757/merge
Leseb 2016-05-07 01:02:49 +02:00
commit 3c4f62ba66
8 changed files with 47 additions and 37 deletions

View File

@ -17,7 +17,7 @@
state: restarted state: restarted
when: when:
socket.rc == 0 and socket.rc == 0 and
ansible_distribution != 'Ubuntu' and use_systemd and
mon_group_name in group_names and mon_group_name in group_names and
is_after_hammer is_after_hammer
@ -26,6 +26,7 @@
when: when:
socket.rc == 0 and socket.rc == 0 and
ansible_distribution == 'Ubuntu' and ansible_distribution == 'Ubuntu' and
not use_systemd and
mon_group_name in group_names mon_group_name in group_names
- name: restart ceph osds - name: restart ceph osds
@ -45,7 +46,7 @@
state: restarted state: restarted
when: when:
socket.rc == 0 and socket.rc == 0 and
ansible_distribution != 'Ubuntu' and use_systemd and
osd_group_name in group_names and osd_group_name in group_names and
is_after_hammer is_after_hammer
@ -57,6 +58,7 @@
when: when:
socket.rc == 0 and socket.rc == 0 and
ansible_distribution == 'Ubuntu' and ansible_distribution == 'Ubuntu' and
not use_systemd and
osd_group_name in group_names osd_group_name in group_names
- name: restart ceph mdss on ubuntu - name: restart ceph mdss on ubuntu
@ -64,6 +66,7 @@
when: when:
socket.rc == 0 and socket.rc == 0 and
ansible_distribution == 'Ubuntu' and ansible_distribution == 'Ubuntu' and
not use_systemd and
mds_group_name in group_names mds_group_name in group_names
- name: restart ceph mdss - name: restart ceph mdss
@ -71,9 +74,9 @@
when: when:
socket.rc == 0 and socket.rc == 0 and
ansible_distribution != 'Ubuntu' and ansible_distribution != 'Ubuntu' and
use_systemd and
mds_group_name in group_names and mds_group_name in group_names and
ceph_stable and is_before_infernalis
ceph_stable_release in ceph_stable_releases
- name: restart ceph mdss with systemd - name: restart ceph mdss with systemd
service: service:
@ -81,16 +84,16 @@
state: restarted state: restarted
when: when:
socket.rc == 0 and socket.rc == 0 and
ansible_distribution != 'Ubuntu' and use_systemd and
mds_group_name in group_names and mds_group_name in group_names and
ceph_stable and is_after_hammer
ceph_stable_release not in ceph_stable_releases
- name: restart ceph rgws on ubuntu - name: restart ceph rgws on ubuntu
command: initctl restart radosgw cluster={{ cluster }} id=rgw.{{ ansible_hostname }} command: initctl restart radosgw cluster={{ cluster }} id=rgw.{{ ansible_hostname }}
when: when:
socketrgw.rc == 0 and socketrgw.rc == 0 and
ansible_distribution == 'Ubuntu' and ansible_distribution == 'Ubuntu' and
not use_systemd and
rgw_group_name in group_names rgw_group_name in group_names
- name: restart ceph rgws - name: restart ceph rgws
@ -115,7 +118,7 @@
state: restarted state: restarted
when: when:
socketrgw.rc == 0 and socketrgw.rc == 0 and
ansible_distribution != 'Ubuntu' and use_systemd and
rgw_group_name in group_names and rgw_group_name in group_names and
is_after_hammer is_after_hammer

View File

@ -17,6 +17,9 @@
- set_fact: - set_fact:
init_system={{ init_system.content | b64decode }} init_system={{ init_system.content | b64decode }}
- set_fact:
use_systemd={{ init_system.strip() == 'systemd' }}
# NOTE (leseb/jsaintrocc): You are supposed to quote variables # NOTE (leseb/jsaintrocc): You are supposed to quote variables
# that follow colons to avoid confusion with dicts but this # that follow colons to avoid confusion with dicts but this
# causes issues with the boolean, so we keep this syntax styling... # causes issues with the boolean, so we keep this syntax styling...

View File

@ -63,7 +63,7 @@
- done - done
- upstart - upstart
changed_when: false changed_when: false
when: ansible_distribution == "Ubuntu" when: not use_systemd
- name: activate metadata server with sysvinit - name: activate metadata server with sysvinit
file: file:
@ -76,7 +76,7 @@
- done - done
- sysvinit - sysvinit
changed_when: false changed_when: false
when: ansible_distribution != "Ubuntu" when: use_systemd
- name: enable systemd unit file for mds instance (for or after infernalis) - name: enable systemd unit file for mds instance (for or after infernalis)
file: file:
@ -86,16 +86,16 @@
changed_when: false changed_when: false
failed_when: false failed_when: false
when: when:
ansible_distribution != "Ubuntu" and use_systemd and
is_after_hammer is_after_hammer
- name: start and add that the metadata service to the init sequence (ubuntu) - name: start and add that the metadata service to the init sequence (upstart)
command: initctl emit ceph-mds cluster={{ cluster }} id={{ mds_name }} command: initctl emit ceph-mds cluster={{ cluster }} id={{ mds_name }}
changed_when: false changed_when: false
failed_when: false failed_when: false
when: ansible_distribution == "Ubuntu" when: not use_systemd
- name: start and add that the metadata service to the init sequence (before infernalis) - name: start and add that the metadata service to the init sequence (systemd before infernalis)
service: service:
name: ceph name: ceph
state: started state: started
@ -103,15 +103,15 @@
args: mds.{{ mds_name }} args: mds.{{ mds_name }}
changed_when: false changed_when: false
when: when:
ansible_distribution != "Ubuntu" and use_systemd and
is_before_infernalis is_before_infernalis
- name: start and add that the metadata service to the init sequence (for or after infernalis) - name: start and add that the metadata service to the init sequence (systemd after hammer)
service: service:
name: ceph-mds@{{ mds_name }} name: ceph-mds@{{ mds_name }}
state: started state: started
enabled: yes enabled: yes
changed_when: false changed_when: false
when: when:
ansible_distribution != "Ubuntu" and use_systemd and
is_after_hammer is_after_hammer

View File

@ -10,13 +10,13 @@
with_items: with_items:
- done - done
- upstart - upstart
when: ansible_distribution == "Ubuntu" when: not use_systemd
- name: start and add that the monitor service to the init sequence (ubuntu) - name: start and add that the monitor service to the init sequence (ubuntu)
command: initctl emit ceph-mon cluster={{ cluster }} id={{ monitor_name }} command: initctl emit ceph-mon cluster={{ cluster }} id={{ monitor_name }}
changed_when: false changed_when: false
failed_when: false failed_when: false
when: ansible_distribution == "Ubuntu" when: not use_systemd
# NOTE (leseb): somehow the service ansible module is messing things up # NOTE (leseb): somehow the service ansible module is messing things up
# as a safety measure we run the raw command # as a safety measure we run the raw command
@ -35,7 +35,7 @@
changed_when: false changed_when: false
failed_when: false failed_when: false
when: when:
ansible_distribution != "Ubuntu" and use_systemd and
is_after_hammer is_after_hammer
- name: start and add that the monitor service to the init sequence (for or after infernalis) - name: start and add that the monitor service to the init sequence (for or after infernalis)
@ -45,7 +45,7 @@
enabled: yes enabled: yes
changed_when: false changed_when: false
when: when:
ansible_distribution != "Ubuntu" and use_systemd and
is_after_hammer is_after_hammer
- name: collect admin and bootstrap keys - name: collect admin and bootstrap keys

View File

@ -74,7 +74,7 @@
failed_when: false failed_when: false
register: osd_id register: osd_id
when: when:
ansible_distribution != "Ubuntu" and use_systemd and
is_after_hammer is_after_hammer
- name: enable osd service instance(s) (for or after infernalis) - name: enable osd service instance(s) (for or after infernalis)
@ -85,7 +85,7 @@
with_items: osd_id.stdout_lines with_items: osd_id.stdout_lines
failed_when: false failed_when: false
when: when:
ansible_distribution != "Ubuntu" and use_systemd and
is_after_hammer is_after_hammer
- name: start and add that the osd service(s) to the init sequence (for or after infernalis) - name: start and add that the osd service(s) to the init sequence (for or after infernalis)
@ -96,5 +96,5 @@
with_items: osd_id.stdout_lines with_items: osd_id.stdout_lines
changed_when: false changed_when: false
when: when:
ansible_distribution != "Ubuntu" and use_systemd and
is_after_hammer is_after_hammer

View File

@ -1,20 +1,20 @@
--- ---
- name: start and add that the rbd mirror service to the init sequence (ubuntu) - name: start and add that the rbd mirror service to the init sequence (upstart)
command: initctl emit ceph-rbd-mirror cluster={{ cluster }} id={{ ansible_hostname }} command: initctl emit ceph-rbd-mirror cluster={{ cluster }} id={{ ansible_hostname }}
changed_when: false changed_when: false
failed_when: false failed_when: false
when: ansible_distribution == "Ubuntu" when: not use_systemd
# NOTE (leseb): somehow the service ansible module is messing things up # NOTE (leseb): somehow the service ansible module is messing things up
# as a safety measure we run the raw command # as a safety measure we run the raw command
- name: start and add that the rbd mirror service to the init sequence - name: start and add that the rbd mirror service to the init sequence (systemd before infernalis)
command: service ceph start ceph-rbd-mirror command: service ceph start ceph-rbd-mirror
changed_when: false changed_when: false
when: when:
ansible_distribution != "Ubuntu" and use_systemd and
is_before_infernalis is_before_infernalis
- name: enable systemd unit file for the rbd mirror service (for or after infernalis) - name: enable systemd unit file for the rbd mirror service (systemd after hammer)
file: file:
src: /usr/lib/systemd/system/ceph-rbd-mirror@.service src: /usr/lib/systemd/system/ceph-rbd-mirror@.service
dest: "/etc/systemd/system/multi-user.target.wants/ceph-rbd-mirror@{{ ceph_rbd_mirror_local_user }}.service" dest: "/etc/systemd/system/multi-user.target.wants/ceph-rbd-mirror@{{ ceph_rbd_mirror_local_user }}.service"
@ -22,15 +22,15 @@
changed_when: false changed_when: false
failed_when: false failed_when: false
when: when:
ansible_distribution != "Ubuntu" and use_systemd and
is_after_hammer is_after_hammer
- name: start and add that the rbd mirror service to the init sequence (for or after infernalis) - name: start and add that the rbd mirror service to the init sequence (systemd after hammer)
service: service:
name: "ceph-rbd-mirror@{{ ceph_rbd_mirror_local_user }}" name: "ceph-rbd-mirror@{{ ceph_rbd_mirror_local_user }}"
state: started state: started
enabled: yes enabled: yes
changed_when: false changed_when: false
when: when:
ansible_distribution != "Ubuntu" and use_systemd and
is_after_hammer is_after_hammer

View File

@ -10,13 +10,14 @@
when: when:
rgwstatus.rc != 0 and rgwstatus.rc != 0 and
ansible_distribution != "Ubuntu" and ansible_distribution != "Ubuntu" and
ansible_os_family != 'RedHat' ansible_os_family != 'RedHat' and
not use_systemd
- name: start and add that the rados gateway service to the init sequence (ubuntu) - name: start and add that the rados gateway service to the init sequence (ubuntu)
command: initctl emit radosgw cluster={{ cluster }} id=rgw.{{ ansible_hostname }} command: initctl emit radosgw cluster={{ cluster }} id=rgw.{{ ansible_hostname }}
changed_when: false changed_when: false
failed_when: false failed_when: false
when: ansible_distribution == 'Ubuntu' when: not use_systemd
- name: start rgw on red hat (before or on infernalis) - name: start rgw on red hat (before or on infernalis)
service: service:
@ -35,14 +36,14 @@
changed_when: false changed_when: false
failed_when: false failed_when: false
when: when:
ansible_distribution != "Ubuntu" and use_systemd and
is_after_hammer is_after_hammer
- name: start rgw on red hat (after infernalis) - name: start rgw with systemd (for or after infernalis)
service: service:
name: ceph-radosgw@rgw.{{ ansible_hostname }} name: ceph-radosgw@rgw.{{ ansible_hostname }}
state: started state: started
enabled: yes enabled: yes
when: when:
ansible_os_family == 'RedHat' and use_systemd and
is_after_hammer is_after_hammer

View File

@ -6,3 +6,6 @@ localhost
[rgws] [rgws]
localhost localhost
[mdss]
localhost