diff --git a/group_vars/all b/group_vars/all index 3247bd3a4..acf2a8854 100644 --- a/group_vars/all +++ b/group_vars/all @@ -8,6 +8,11 @@ dummy: # INSTALL ######### +#mon_group_name: mons +#osd_group_name: osds +#rgw_group_name: rgws +#mds_group_name: mdss + # /!\ EITHER ACTIVE ceph_stable OR ceph_stable_ice OR ceph_dev /!\ # STABLE diff --git a/roles/ceph-common/defaults/main.yml b/roles/ceph-common/defaults/main.yml index 3cc97b9df..5160fe6ee 100644 --- a/roles/ceph-common/defaults/main.yml +++ b/roles/ceph-common/defaults/main.yml @@ -5,6 +5,11 @@ # INSTALL # ########### +mon_group_name: mons +osd_group_name: osds +rgw_group_name: rgws +mds_group_name: mdss + # /!\ EITHER ACTIVE ceph_stable OR ceph_stable_ice OR ceph_dev /!\ # STABLE diff --git a/roles/ceph-common/handlers/main.yml b/roles/ceph-common/handlers/main.yml index 6e98ad90a..220846663 100644 --- a/roles/ceph-common/handlers/main.yml +++ b/roles/ceph-common/handlers/main.yml @@ -6,29 +6,29 @@ command: service ceph restart mon when: socket.rc == 0 and - 'mons' in group_names + mon_group_name in group_names - name: restart ceph osds command: service ceph restart osd when: socket.rc == 0 and - 'osds' in group_names + osd_group_name in group_names - name: restart ceph osds on ubuntu command: restart ceph-osd-all when: socket.rc == 0 and ansible_distribution == 'Ubuntu' and - 'osds' in group_names + osd_group_name in group_names - name: restart ceph mdss command: service ceph restart mds when: socket.rc == 0 and - 'mdss' in group_names + mds_group_name in group_names - name: restart ceph rgws command: /etc/init.d/radosgw restart when: socket.rc == 0 and - 'rgws' in group_names + rgw_group_name in group_names diff --git a/roles/ceph-common/templates/ceph.conf.j2 b/roles/ceph-common/templates/ceph.conf.j2 index 7b6eeed06..98f4e178c 100644 --- a/roles/ceph-common/templates/ceph.conf.j2 +++ b/roles/ceph-common/templates/ceph.conf.j2 @@ -76,7 +76,7 @@ debug paxos = {{ debug_mon_level }} debug auth = {{ debug_mon_level }} {% endif %} -{% for host in groups['mons'] %} +{% for host in groups[mon_group_name] %} {% if hostvars[host]['ansible_hostname'] is defined %} [mon.{{ hostvars[host]['ansible_hostname'] }}] host = {{ hostvars[host]['ansible_hostname'] }} @@ -132,7 +132,7 @@ debug mds log = {{ debug_mds_level }} debug mds migrator = {{ debug_mds_level }} {% endif %} -{% for host in groups['mdss'] %} +{% for host in groups[mds_group_name] %} {% if hostvars[host]['ansible_hostname'] is defined %} [mds.{{ hostvars[host]['ansible_hostname'] }}] host = {{ hostvars[host]['ansible_hostname'] }} @@ -141,7 +141,7 @@ {% endif %} {% if radosgw %} -{% for host in groups['rgws'] %} +{% for host in groups[rgw_group_name] %} {% if hostvars[host]['ansible_hostname'] is defined %} [client.rgw.{{ hostvars[host]['ansible_hostname'] }}] {% if radosgw_dns_name is defined %} diff --git a/roles/ceph-mon/defaults/main.yml b/roles/ceph-mon/defaults/main.yml index 33f98506a..8e0b7395d 100644 --- a/roles/ceph-mon/defaults/main.yml +++ b/roles/ceph-mon/defaults/main.yml @@ -5,6 +5,8 @@ # GENERAL # ########### +rgw_group_name: rgws + # ACTIVATE BOTH FSID AND MONITOR_SECRET VARIABLES FOR NON-VAGRANT DEPLOYMENT fsid: "{{ cluster_uuid.stdout }}" # monitor_secret: diff --git a/roles/haproxy/defaults/main.yml b/roles/haproxy/defaults/main.yml index bee39111e..1e9098816 100644 --- a/roles/haproxy/defaults/main.yml +++ b/roles/haproxy/defaults/main.yml @@ -1,5 +1,7 @@ --- # You can override vars by using host or group vars +rgw_group_name: rgws + # Rados Gateway options radosgw_interface: eth1 # the public interface which the radosgw talks to the world with, this variable is used in the haproxy role, this does not need to be set if haproxy is not used. diff --git a/roles/haproxy/templates/precise/haproxy.cfg b/roles/haproxy/templates/precise/haproxy.cfg index b3e10bcba..1bbd32534 100644 --- a/roles/haproxy/templates/precise/haproxy.cfg +++ b/roles/haproxy/templates/precise/haproxy.cfg @@ -45,7 +45,7 @@ backend rgw mode http balance roundrobin cookie RADOSGWLB insert indirect nocache -{% for host in groups['rgws'] %} +{% for host in groups[rgw_group_name] %} server {{ hostvars[host].ansible_hostname }} {{ hostvars[host]['ansible_' + radosgw_interface ].ipv4.address }}:80 check cookie {{ hostvars[host].ansible_hostname }} {% endfor %}