From 84add1bd30fd5c72a1ce38889045874e08306644 Mon Sep 17 00:00:00 2001 From: Vikrant Balyan Date: Mon, 29 Feb 2016 13:21:17 -0800 Subject: [PATCH] fixes to enable mon and osd separation based of a flag Signed-off-by: Vikrant Balyan --- group_vars/all | 7 +++++++ roles/ceph-common/handlers/main.yml | 12 ++++++++++++ roles/ceph-common/tasks/main.yml | 14 ++------------ site.yml | 14 +++++++------- 4 files changed, 28 insertions(+), 19 deletions(-) diff --git a/group_vars/all b/group_vars/all index 813731b7..730701aa 100644 --- a/group_vars/all +++ b/group_vars/all @@ -25,3 +25,10 @@ validate_certs: "yes" # env: # service_vip: # control_interface: + +# should mons also run osds +mon_osd_colocation_allowed: "true" + +# OSDs could be run without netplugin on them +# osd_contiv_network_include controls this behaviour +osd_contiv_network_include: "true" diff --git a/roles/ceph-common/handlers/main.yml b/roles/ceph-common/handlers/main.yml index ef109b0b..8080c605 100644 --- a/roles/ceph-common/handlers/main.yml +++ b/roles/ceph-common/handlers/main.yml @@ -3,6 +3,18 @@ apt: update-cache: yes +- name: check for a ceph socket + shell: "stat /var/run/ceph/*.asok > /dev/null 2>&1" + changed_when: false + failed_when: false + register: socket + +- name: check for a rados gateway socket + shell: "stat {{ rbd_client_admin_socket_path }}*.asok > /dev/null 2>&1" + changed_when: false + failed_when: false + register: socketrgw + - name: restart ceph mons command: service ceph restart mon when: diff --git a/roles/ceph-common/tasks/main.yml b/roles/ceph-common/tasks/main.yml index adae3e64..9fc665ce 100644 --- a/roles/ceph-common/tasks/main.yml +++ b/roles/ceph-common/tasks/main.yml @@ -37,18 +37,6 @@ radosgw_frontend == 'apache' and rgw_group_name in group_names -- name: check for a ceph socket - shell: "stat /var/run/ceph/*.asok > /dev/null 2>&1" - changed_when: false - failed_when: false - register: socket - -- name: check for a rados gateway socket - shell: "stat {{ rbd_client_admin_socket_path }}*.asok > /dev/null 2>&1" - changed_when: false - failed_when: false - register: socketrgw - - name: create a local fetch directory if it doesn't exist local_action: file path={{ fetch_directory }} state=directory changed_when: false @@ -86,6 +74,8 @@ group: root mode: 0644 notify: + - check for a ceph socket + - check for a rados gateway socket - restart ceph mons - restart ceph mons on ubuntu - restart ceph mons with systemd diff --git a/site.yml b/site.yml index 9d5fad51..87a03339 100644 --- a/site.yml +++ b/site.yml @@ -59,11 +59,11 @@ - { role: ucarp } - { role: docker } - { role: etcd, run_as: master } - #- { role: ceph-mon, mon_group_name: service-master } - #- { role: ceph-osd, mon_group_name: service-master, osd_group_name: service-master } + - { role: ceph-mon, mon_group_name: service-master } + - { role: ceph-osd, mon_group_name: service-master, osd_group_name: service-master, when: host_capability|match('.*storage.*') } - { role: scheduler_stack, run_as: master } - - { role: contiv_network, run_as: master } - #- { role: contiv_storage, run_as: master } + - { role: contiv_network, run_as: master, when: host_capability|match('.*network.*') } + - { role: contiv_storage, run_as: master } # service-worker hosts correspond to cluster machines that run the worker/driver # logic of the infra services. @@ -74,10 +74,10 @@ - { role: base } - { role: docker } - { role: etcd, run_as: worker } - #- { role: ceph-osd, mon_group_name: service-master, osd_group_name: service-worker } + - { role: ceph-osd, mon_group_name: service-master, osd_group_name: service-worker, when: host_capability|match('.*storage.*') } - { role: scheduler_stack, run_as: worker } - - { role: contiv_network, run_as: worker } - #- { role: contiv_storage, run_as: worker } + - { role: contiv_network, run_as: worker, when: host_capability|match('.*network.*') } + - { role: contiv_storage, run_as: worker } # netplugin-node hosts set up netmast/netplugin in a cluster - hosts: netplugin-node