]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
make group names definable 280/head
authorBjørnar Ness <bjornar.ness@gmail.com>
Thu, 11 Jun 2015 00:42:41 +0000 (02:42 +0200)
committerBjørnar Ness <bjornar.ness@gmail.com>
Thu, 11 Jun 2015 00:42:41 +0000 (02:42 +0200)
group_vars/all
roles/ceph-common/defaults/main.yml
roles/ceph-common/handlers/main.yml
roles/ceph-common/templates/ceph.conf.j2
roles/ceph-mon/defaults/main.yml
roles/ceph-mon/tasks/ceph_keys.yml
roles/haproxy/defaults/main.yml
roles/haproxy/templates/precise/haproxy.cfg

index 2c408dcf45bec92d95d042bcd4b1bab0ee815904..633a95d8428072bf7e2948a10f46fd5e7a20f984 100644 (file)
@@ -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
index 39def4bd4b02326c38cac632df7a7e2c58aa03a9..212abe2b7144751f0a5167e535502b187ded57c6 100644 (file)
@@ -5,6 +5,11 @@
 # INSTALL #\r
 ###########\r
 \r
+mon_group_name: mons\r
+osd_group_name: osds\r
+rgw_group_name: rgws\r
+mds_group_name: mdss\r
+\r
 # /!\ EITHER ACTIVE ceph_stable OR ceph_stable_ice OR ceph_dev /!\\r
 \r
 # STABLE\r
index d6bf1cfc500e45fd51def6a83537d8667a6878ea..859e865fc815d5180f3c69bbdb2e44d3f8b4782f 100644 (file)
@@ -4,20 +4,20 @@
 
 - name: restart ceph mons
   command: service ceph restart mon
-  when: socket.rc == 0 and 'mons' in group_names
+  when: socket.rc == 0 and mon_group_name in group_names
 
 - name: restart ceph osds
   command: service ceph restart osd
-  when: socket.rc == 0 and 'osds' in group_names
+  when: socket.rc == 0 and 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
+  when: socket.rc == 0 and ansible_distribution == 'Ubuntu' and osd_group_name in group_names
 
 - name: restart ceph mdss
   command: service ceph restart mds
-  when: socket.rc == 0 and 'mdss' in group_names
+  when: socket.rc == 0 and 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
+  when: socket.rc == 0 and rgw_group_name in group_names
index 1541cd1260d64f1e2008b18aea12d6fcab8b9b4b..de7a1c3e1261205416e43cf7882b72ece75cd8a8 100644 (file)
@@ -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'] }}
   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'] }}
 {% endif %}
 
 {% if radosgw %}
-{% for host in groups['rgws'] %}
+{% for host in groups[rgw_group_name] %}
 {% if hostvars[host]['ansible_hostname'] is defined %}
 [client.radosgw.{{ hostvars[host]['ansible_hostname'] }}]
   {% if radosgw_dns_name is defined %}
index ad48166fe444249cabc0d8e65d906211b179d182..981f14bc30fa81f5f14fe7de0a71897db7affb3a 100644 (file)
@@ -5,6 +5,8 @@
 # GENERAL #\r
 ###########\r
 \r
+rgw_group_name: rgws\r
+\r
 # ACTIVATE BOTH FSID AND MONITOR_SECRET VARIABLES FOR NON-VAGRANT DEPLOYMENT\r
 fsid: "{{ cluster_uuid.stdout }}"\r
 # monitor_secret:\r
index dd08462949901e6113ac95984c17f8090386902e..0669afb4b6426855188bc2c5071d70af5d94dea4 100644 (file)
@@ -9,7 +9,7 @@
     ceph auth get-or-create client.radosgw.{{ hostvars[item]['ansible_hostname'] }} osd 'allow rwx' mon 'allow rw' -o /etc/ceph/ceph.client.radosgw.{{ hostvars[item]['ansible_hostname'] }}.keyring
     creates=/etc/ceph/ceph.client.radosgw.{{ hostvars[item]['ansible_hostname'] }}.keyring
   when: cephx and radosgw
-  with_items: groups.rgws
+  with_items: groups[rgw_group_name]
   changed_when: False
 
 - name: create Ceph REST API keyring
index bee39111e41fa42d308f63543eec4de86dabf81a..1e909881617d2cca77745c4a13606dc9f0390d40 100644 (file)
@@ -1,5 +1,7 @@
 ---\r
 # You can override vars by using host or group vars\r
 \r
+rgw_group_name: rgws\r
+\r
 # Rados Gateway options\r
 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.\r
index b3e10bcba230c0b3112e8f676be7bd6f697e047f..1bbd325340f8f3c7cfb60262d6eb524a851e0ec5 100644 (file)
@@ -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 %}