]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
all: backward compatibility between stable-2.2 and 3.0 2083/head
authorSébastien Han <seb@redhat.com>
Wed, 18 Oct 2017 16:03:30 +0000 (18:03 +0200)
committerSébastien Han <seb@redhat.com>
Fri, 20 Oct 2017 12:00:20 +0000 (14:00 +0200)
stable-3.0 brought numerous changes in ceph-ansible variables, this PR
aims to maintain backward compatibility for someone running stable-2.2
upgrading to stable-3.0 but keeps its groups_vars untouched.
We will then determine the right options to make sure the upgrade works
but we are expecting that new variables should be used.

We will drop this in a near future, maybe 3.1 or 3.2.

Signed-off-by: Sébastien Han <seb@redhat.com>
(cherry picked from commit 4413511b6619e22007b7988ab9929d618e0dcd01)
Signed-off-by: Sébastien Han <seb@redhat.com>
15 files changed:
group_vars/all.yml.sample
group_vars/osds.yml.sample
group_vars/rhcs.yml.sample
infrastructure-playbooks/rolling_update.yml
roles/ceph-common/tasks/checks/check_mandatory_vars.yml
roles/ceph-config/templates/ceph.conf.j2
roles/ceph-defaults/defaults/main.yml
roles/ceph-defaults/templates/restart_rgw_daemon.sh.j2
roles/ceph-docker-common/tasks/check_mandatory_vars.yml [new file with mode: 0644]
roles/ceph-docker-common/tasks/main.yml
roles/ceph-mon/tasks/check_mandatory_vars.yml
roles/ceph-mon/tasks/docker/main.yml
roles/ceph-mon/templates/ceph-mon.service.j2
roles/ceph-osd/defaults/main.yml
roles/ceph-rgw/templates/ceph-radosgw.service.j2

index 78afcc327ed48d0f5dd730d0ad4007cb00ee260c..462ce1a92c532232f6a7b75ecd7ce61e89e22d07 100644 (file)
@@ -104,7 +104,15 @@ dummy:
 ###########
 # INSTALL #
 ###########
-
+#ceph_rhcs_cdn_install: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+#ceph_repository_type: "{{ 'cdn' if ceph_rhcs_cdn_install else 'dummy' }}" # backward compatibility with stable-2.2, will disappear in stable 3.1
+#ceph_rhcs_iso_install: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+#ceph_repository_type: "{{ 'iso' if ceph_rhcs_iso_install else 'dummy' }}" # backward compatibility with stable-2.2, will disappear in stable 3.1
+#ceph_rhcs: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+#ceph_stable: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+#ceph_dev: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+#ceph_stable_uca: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+#ceph_custom: False # backward compatibility with stable-2.2, will disappear in stable 3.1
 
 # ORIGIN SOURCE
 #
@@ -113,14 +121,14 @@ dummy:
 # - 'distro' means that no separate repo file will be added
 #  you will get whatever version of Ceph is included in your Linux distro.
 # 'local' means that the ceph binaries will be copied over from the local machine
-#ceph_origin: 'dummy'
+#ceph_origin: "{{ 'repository' if ceph_rhcs or ceph_stable or ceph_dev or ceph_stable_uca or ceph_custom else 'dummy' }}" # backward compatibility with stable-2.2, will disappear in stable 3.1
 #valid_ceph_origins:
 #  - repository
 #  - distro
 #  - local
 
 
-#ceph_repository: dummy
+#ceph_repository: "{{ 'community' if ceph_stable else 'rhcs' if ceph_rhcs else 'dev' if ceph_dev else 'uca' if ceph_stable_uca else 'custom' if ceph_custom else 'dummy' }}" # backward compatibility with stable-2.2, will disappear in stable 3.1
 #valid_ceph_repository:
 #  - community
 #  - rhcs
@@ -309,7 +317,7 @@ dummy:
 # To use an IPv6 address, use the monitor_address setting instead (and set ip_version to ipv6)
 #monitor_interface: interface
 #monitor_address: 0.0.0.0
-#monitor_address_block: []
+#monitor_address_block: subnet
 # set to either ipv4 or ipv6, whichever your network is using
 #ip_version: ipv4
 #mon_use_fqdn: false # if set to true, the MON name used will be the fqdn in the ceph.conf
@@ -353,8 +361,8 @@ dummy:
 # Preference will go to radosgw_address if both radosgw_address and radosgw_interface are defined.
 # To use an IPv6 address, use the radosgw_address setting instead (and set ip_version to ipv6)
 #radosgw_interface: interface
-#radosgw_address: 0.0.0.0
-#radosgw_address_block: []
+#radosgw_address: "{{ '0.0.0.0' if rgw_containerized_deployment else 'address' }}" # backward compatibility with stable-2.2, will disappear in stable 3.1
+#radosgw_address_block: subnet
 #radosgw_keystone: false # activate OpenStack Keystone options full detail here: http://ceph.com/docs/master/radosgw/keystone/
 # Rados Gateway options
 #email_address: foo@bar.com
@@ -460,20 +468,23 @@ dummy:
 #docker: false
 #ceph_docker_image: "ceph/daemon"
 #ceph_docker_image_tag: latest
-
-# Do not comment the following variables containerized_deployment_* here. These variables are being used
-# by ceph.conf.j2 template. so it should always be defined
-#containerized_deployment_with_kv: false
-#containerized_deployment: false
-#mon_containerized_default_ceph_conf_with_kv: false
 #ceph_docker_registry: docker.io
 #ceph_docker_enable_centos_extra_repo: false
 #ceph_docker_on_openstack: false
+#ceph_mon_docker_interface: "{{ monitor_interface }}" # backward compatibility with stable-2.2, will disappear in stable 3.1
+#ceph_mon_docker_subnet: "{{ public_network }}" # backward compatibility with stable-2.2, will disappear in stable 3.1
+#mon_containerized_deployment: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+#osd_containerized_deployment: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+#mds_containerized_deployment: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+#rgw_containerized_deployment: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+#containerized_deployment: "{{ True if mon_containerized_deployment or osd_containerized_deployment or mds_containerized_deployment or rgw_containerized_deployment else False }}" # backward compatibility with stable-2.2, will disappear in stable 3.1
 
 
 ############
 # KV store #
 ############
+#containerized_deployment_with_kv: false
+#mon_containerized_default_ceph_conf_with_kv: false
 #kv_type: etcd
 #kv_endpoint: 127.0.0.1
 #kv_port: 2379
@@ -483,3 +494,4 @@ dummy:
 # do not ever change this here
 #rolling_update: false
 
+
index a6313bf7ffdb8bc7cf14d75434ec25fbb061dfd2..d61654b7811d92a0a455a2b7014a68def8b97ca6 100644 (file)
@@ -10,6 +10,12 @@ dummy:
 # You can override default vars defined in defaults/main.yml here,
 # but I would advice to use host or group vars instead
 
+#raw_journal_devices: "{{ dedicated_devices }}" # backward compatibility with stable-2.2, will disappear in stable 3.1
+#journal_collocation: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+#raw_multi_journal: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+#dmcrytpt_journal_collocation: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+#dmcrypt_dedicated_journal: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+
 
 ###########
 # GENERAL #
@@ -87,7 +93,7 @@ dummy:
 
 # Encrypt your OSD device using dmcrypt
 # If set to True, no matter which osd_objecstore and osd_scenario you use the data will be encrypted
-#dmcrypt: false
+#dmcrypt: "{{ True if dmcrytpt_journal_collocation or dmcrypt_dedicated_journal else False }}" # backward compatibility with stable-2.2, will disappear in stable 3.1
 
 
 # I. First scenario: collocated
@@ -110,7 +116,7 @@ dummy:
 # /dev/sda2: PARTLABEL="ceph block" PARTUUID="e6ca3e1d-4702-4569-abfa-e285de328e9d"
 #
 
-#osd_scenario: dummy
+#osd_scenario: "{{ 'collocated' if journal_collocation or dmcrytpt_journal_collocation else 'non-collocated' if raw_multi_journal or dmcrypt_dedicated_journal else 'dummy' }}" # backward compatibility with stable-2.2, will disappear in stable 3.1
 #valid_osd_scenarios:
 #  - collocated
 #  - non-collocated
index 034e28d1d4b552e0574b238f9d2739cb79b72266..6753a6501a25a8c30d13d8d9af5dbafddee215c8 100644 (file)
@@ -104,7 +104,15 @@ fetch_directory: ~/ceph-ansible-keys
 ###########
 # INSTALL #
 ###########
-
+#ceph_rhcs_cdn_install: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+#ceph_repository_type: "{{ 'cdn' if ceph_rhcs_cdn_install else 'dummy' }}" # backward compatibility with stable-2.2, will disappear in stable 3.1
+#ceph_rhcs_iso_install: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+#ceph_repository_type: "{{ 'iso' if ceph_rhcs_iso_install else 'dummy' }}" # backward compatibility with stable-2.2, will disappear in stable 3.1
+#ceph_rhcs: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+#ceph_stable: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+#ceph_dev: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+#ceph_stable_uca: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+#ceph_custom: False # backward compatibility with stable-2.2, will disappear in stable 3.1
 
 # ORIGIN SOURCE
 #
@@ -309,7 +317,7 @@ ceph_repository: rhcs
 # To use an IPv6 address, use the monitor_address setting instead (and set ip_version to ipv6)
 #monitor_interface: interface
 #monitor_address: 0.0.0.0
-#monitor_address_block: []
+#monitor_address_block: subnet
 # set to either ipv4 or ipv6, whichever your network is using
 #ip_version: ipv4
 #mon_use_fqdn: false # if set to true, the MON name used will be the fqdn in the ceph.conf
@@ -353,8 +361,8 @@ ceph_repository: rhcs
 # Preference will go to radosgw_address if both radosgw_address and radosgw_interface are defined.
 # To use an IPv6 address, use the radosgw_address setting instead (and set ip_version to ipv6)
 #radosgw_interface: interface
-#radosgw_address: 0.0.0.0
-#radosgw_address_block: []
+#radosgw_address: "{{ '0.0.0.0' if rgw_containerized_deployment else 'address' }}" # backward compatibility with stable-2.2, will disappear in stable 3.1
+#radosgw_address_block: subnet
 #radosgw_keystone: false # activate OpenStack Keystone options full detail here: http://ceph.com/docs/master/radosgw/keystone/
 # Rados Gateway options
 #email_address: foo@bar.com
@@ -460,20 +468,23 @@ ceph_repository: rhcs
 #docker: false
 #ceph_docker_image: "ceph/daemon"
 #ceph_docker_image_tag: latest
-
-# Do not comment the following variables containerized_deployment_* here. These variables are being used
-# by ceph.conf.j2 template. so it should always be defined
-#containerized_deployment_with_kv: false
-#containerized_deployment: false
-#mon_containerized_default_ceph_conf_with_kv: false
 #ceph_docker_registry: docker.io
 #ceph_docker_enable_centos_extra_repo: false
 #ceph_docker_on_openstack: false
+#ceph_mon_docker_interface: "{{ monitor_interface }}" # backward compatibility with stable-2.2, will disappear in stable 3.1
+#ceph_mon_docker_subnet: "{{ public_network }}" # backward compatibility with stable-2.2, will disappear in stable 3.1
+#mon_containerized_deployment: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+#osd_containerized_deployment: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+#mds_containerized_deployment: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+#rgw_containerized_deployment: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+#containerized_deployment: "{{ True if mon_containerized_deployment or osd_containerized_deployment or mds_containerized_deployment or rgw_containerized_deployment else False }}" # backward compatibility with stable-2.2, will disappear in stable 3.1
 
 
 ############
 # KV store #
 ############
+#containerized_deployment_with_kv: false
+#mon_containerized_default_ceph_conf_with_kv: false
 #kv_type: etcd
 #kv_endpoint: 127.0.0.1
 #kv_port: 2379
@@ -483,3 +494,4 @@ ceph_repository: rhcs
 # do not ever change this here
 #rolling_update: false
 
+
index 1d6ccabe747b1b09ae5652a2c647d9498fc8d288..7fa3fe345e48f6af7440fc41c1c8126f30f8d37a 100644 (file)
@@ -16,6 +16,8 @@
 
 - name: confirm whether user really meant to upgrade the cluster
   hosts: localhost
+  vars:
+    - mgr_group_name: mgrs
 
   vars_prompt:
     - name: ireallymeanit
       private: no
 
   tasks:
-  - name: exit playbook, if user did not mean to upgrade cluster
-    fail:
-      msg: >
-        "Exiting rolling_update.yml playbook, cluster was NOT upgraded.
-         To upgrade the cluster, either say 'yes' on the prompt or
-         use `-e ireallymeanit=yes` on the command line when
-         invoking the playbook"
-    when: ireallymeanit != 'yes'
+    - name: exit playbook, if user did not mean to upgrade cluster
+      fail:
+        msg: >
+          "Exiting rolling_update.yml playbook, cluster was NOT upgraded.
+           To upgrade the cluster, either say 'yes' on the prompt or
+           use `-e ireallymeanit=yes` on the command line when
+           invoking the playbook"
+      when: ireallymeanit != 'yes'
+
+    - name: fail if no mgr host is present in the inventory
+      fail:
+        msg: "Please add a mgr host to your inventory."
+      when:
+        - groups.get(mgr_group_name, []) | length == 0
 
 
 - name: gather facts and check the init system
     - "{{ client_group_name|default('clients') }}"
 
   become: True
+  gather_facts: False
+  vars:
+    delegate_facts_host: True
   tasks:
     - debug: msg="gather facts on all Ceph hosts for following reference"
 
+    - name: gather facts
+      setup:
+      when:
+        - not delegate_facts_host | bool
+
+    - name: gather and delegate facts
+      setup:
+      delegate_to: "{{ item }}"
+      delegate_facts: True
+      with_items: "{{ groups['all'] }}"
+      when:
+        - delegate_facts_host | bool
+
     - set_fact: rolling_update=true
 
 - name: upgrade ceph mon cluster
 
   roles:
     - ceph-defaults
-    - ceph-config
     - { role: ceph-common, when: not containerized_deployment }
     - { role: ceph-docker-common, when: containerized_deployment }
+    - ceph-config
     - ceph-mon
 
   post_tasks:
 
   roles:
     - ceph-defaults
-    - ceph-config
     - { role: ceph-common, when: not containerized_deployment }
     - { role: ceph-docker-common, when: containerized_deployment }
+    - ceph-config
     - ceph-osd
 
   post_tasks:
 
   roles:
     - ceph-defaults
-    - ceph-config
     - { role: ceph-common, when: not containerized_deployment }
     - { role: ceph-docker-common, when: containerized_deployment }
+    - ceph-config
     - ceph-mds
 
   post_tasks:
 
   roles:
     - ceph-defaults
-    - ceph-config
     - { role: ceph-common, when: not containerized_deployment }
     - { role: ceph-docker-common, when: containerized_deployment }
+    - ceph-config
     - ceph-rgw
 
   post_tasks:
 
   roles:
     - ceph-defaults
-    - ceph-config
     - { role: ceph-common, when: not containerized_deployment }
     - { role: ceph-docker-common, when: containerized_deployment }
+    - ceph-config
     - ceph-rbd-mirror
 
   post_tasks:
 
   roles:
     - ceph-defaults
-    - ceph-config
     - { role: ceph-common, when: not containerized_deployment }
     - { role: ceph-docker-common, when: containerized_deployment }
+    - ceph-config
     - ceph-client
 
 
index 8186d008d068dd733ab0b10cf3121ff23cf72659..239e6c1c9918ab814bdd2c3264c1290a0d12ffee 100644 (file)
   tags:
     - package-install
 
-- name: make sure monitor_interface or monitor_address is defined
+- name: make sure monitor_interface, monitor_address or monitor_address_block is defined
   fail:
-    msg: "you must set monitor_interface or monitor_address"
+    msg: "you must set monitor_interface, monitor_address or monitor_address_block"
   when:
+    - mon_group_name in group_names
     - monitor_interface == 'interface'
     - monitor_address == "0.0.0.0"
-    - mon_group_name in group_names
+    - monitor_address_block == 'subnet'
 
-- name: make sure radosgw_interface or radosgw_address is defined
+- name: make sure radosgw_interface, radosgw_address or radosgw_address_block is defined
   fail:
-    msg: "you must set radosgw_interface or radosgw_address"
+    msg: "you must set radosgw_interface, radosgw_address or radosgw_address_block"
   when:
-    - radosgw_interface == 'interface'
-    - radosgw_address == "0.0.0.0"
     - rgw_group_name in group_names
+    - radosgw_interface == 'interface'
+    - radosgw_address == 'address'
+    - radosgw_address_block == 'subnet'
index d8117f18c3e1edfd1ea59934c443cbb8b58aa64d..23e0b712b88c7cd32e57ebe6620c0f54c7b9b572 100644 (file)
@@ -38,7 +38,7 @@ mon initial members = {% for host in groups[mon_group_name] %}
 {% if not containerized_deployment and not containerized_deployment_with_kv -%}
 mon host = {% if nb_mon > 0 %}
   {% for host in groups[mon_group_name] -%}
-    {% if monitor_address_block | length > 0 %}
+    {% if monitor_address_block != 'subnet' %}
       {% if ip_version == 'ipv4' -%}
         {{ hostvars[host]['ansible_all_' + ip_version + '_addresses'] | ipaddr(monitor_address_block) | first }}
       {%- elif ip_version == 'ipv6' -%}
@@ -68,7 +68,7 @@ mon host = {% if nb_mon > 0 %}
 fsid = {{ fsid }}
 mon host = {% if nb_mon > 0 %}
 {% for host in groups[mon_group_name] -%}
-    {% if monitor_address_block | length > 0 %}
+    {% if monitor_address_block != 'subnet' %}
       {% if ip_version == 'ipv4' -%}
         {{ hostvars[host]['ansible_all_' + ip_version + '_addresses'] | ipaddr(monitor_address_block) | first }}
       {%- elif ip_version == 'ipv6' -%}
@@ -155,24 +155,42 @@ host = {{ hostvars[host]['ansible_hostname'] }}
 host = {{ hostvars[host]['ansible_hostname'] }}
 keyring = /var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ hostvars[host]['ansible_hostname'] }}/keyring
 log file = /var/log/ceph/{{ cluster }}-rgw-{{ hostvars[host]['ansible_hostname'] }}.log
-{% if hostvars[host]['radosgw_address_block'] is defined and hostvars[host]['radosgw_address_block'] | length > 0 %}
+{% if hostvars[host]['radosgw_address_block'] is defined and hostvars[host]['radosgw_address_block'] != 'subnet' %}
     {% if ip_version == 'ipv4' %}
 rgw frontends = civetweb port={{ hostvars[host]['ansible_all_' + ip_version + '_addresses'] | ipaddr(radosgw_address_block) | first }}:{{ radosgw_civetweb_port }} {{ radosgw_civetweb_options }}
     {% elif ip_version == 'ipv6' %}
 rgw frontends = civetweb port=[{{ hostvars[host]['ansible_all_' + ip_version + '_addresses'] | ipaddr(radosgw_address_block) | first }}]:{{ radosgw_civetweb_port }} {{ radosgw_civetweb_options }}
     {% endif %}
-{% elif hostvars[host]['radosgw_address'] is defined and hostvars[host]['radosgw_address'] != '0.0.0.0' -%}
+{% elif radosgw_address_block is defined and radosgw_address_block != 'subnet' -%}
+    {% if ip_version == 'ipv4' %}
+rgw frontends = civetweb port={{ radosgw_address_block | ipaddr(radosgw_address_block) | first }}:{{ radosgw_civetweb_port }} {{ radosgw_civetweb_options }}
+    {% elif ip_version == 'ipv6' %}
+rgw frontends = civetweb port=[{{ radosgw_address_block | ipaddr(radosgw_address_block) | first }}]:{{ radosgw_civetweb_port }} {{ radosgw_civetweb_options }}
+    {% endif %}
+{% elif hostvars[host]['radosgw_address'] is defined and hostvars[host]['radosgw_address'] != 'address' -%}
     {% if ip_version == 'ipv4' %}
 rgw frontends = civetweb port={{ hostvars[host]['radosgw_address'] }}:{{ radosgw_civetweb_port }} {{ radosgw_civetweb_options }}
     {% elif ip_version == 'ipv6' %}
 rgw frontends = civetweb port=[{{ hostvars[host]['radosgw_address'] }}]:{{ radosgw_civetweb_port }} {{ radosgw_civetweb_options }}
     {% endif %}
-{% else %}
+{% elif radosgw_address is defined and radosgw_address != 'address' -%}
+    {% if ip_version == 'ipv4' %}
+rgw frontends = civetweb port={{ radosgw_address }}:{{ radosgw_civetweb_port }} {{ radosgw_civetweb_options }}
+    {% elif ip_version == 'ipv6' %}
+rgw frontends = civetweb port=[{{ radosgw_address }}]:{{ radosgw_civetweb_port }} {{ radosgw_civetweb_options }}
+    {% endif %}
+{% elif hostvars[host]['radosgw_interface'] is defined -%}
     {% if ip_version == 'ipv4' %}
 rgw frontends = civetweb port={{ hostvars[host]['ansible_' + hostvars[host]['radosgw_interface']][ip_version]['address'] }}:{{ radosgw_civetweb_port }} {{ radosgw_civetweb_options }}
     {% elif ip_version == 'ipv6' %}
 rgw frontends = civetweb port=[{{ hostvars[host]['ansible_' + hostvars[host]['radosgw_interface']][ip_version][0]['address'] }}]:{{ radosgw_civetweb_port }} {{ radosgw_civetweb_options }}
     {% endif %}
+{% else %}
+    {% if ip_version == 'ipv4' %}
+rgw frontends = civetweb port={{ ['ansible_' + radosgw_interface][ip_version]['address'] }}:{{ radosgw_civetweb_port }} {{ radosgw_civetweb_options }}
+    {% elif ip_version == 'ipv6' %}
+rgw frontends = civetweb port=[{{ ['ansible_' + radosgw_interface][ip_version][0]['address'] }}]:{{ radosgw_civetweb_port }} {{ radosgw_civetweb_options }}
+    {% endif %}
 {% endif %}
 {% endif %}
 {% endfor %}
index a8ef2a1ecc74bcc94d2e2e08934432b3497d0f9f..2c9a126471ca42c67c982db7810ceabbb22a0339 100644 (file)
@@ -96,7 +96,15 @@ ceph_use_distro_backports: false # DEBIAN ONLY
 ###########
 # INSTALL #
 ###########
-
+ceph_rhcs_cdn_install: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+ceph_repository_type: "{{ 'cdn' if ceph_rhcs_cdn_install else 'dummy' }}" # backward compatibility with stable-2.2, will disappear in stable 3.1
+ceph_rhcs_iso_install: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+ceph_repository_type: "{{ 'iso' if ceph_rhcs_iso_install else 'dummy' }}" # backward compatibility with stable-2.2, will disappear in stable 3.1
+ceph_rhcs: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+ceph_stable: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+ceph_dev: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+ceph_stable_uca: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+ceph_custom: False # backward compatibility with stable-2.2, will disappear in stable 3.1
 
 # ORIGIN SOURCE
 #
@@ -105,14 +113,14 @@ ceph_use_distro_backports: false # DEBIAN ONLY
 # - 'distro' means that no separate repo file will be added
 #  you will get whatever version of Ceph is included in your Linux distro.
 # 'local' means that the ceph binaries will be copied over from the local machine
-ceph_origin: 'dummy'
+ceph_origin: "{{ 'repository' if ceph_rhcs or ceph_stable or ceph_dev or ceph_stable_uca or ceph_custom else 'dummy' }}" # backward compatibility with stable-2.2, will disappear in stable 3.1
 valid_ceph_origins:
   - repository
   - distro
   - local
 
 
-ceph_repository: dummy
+ceph_repository: "{{ 'community' if ceph_stable else 'rhcs' if ceph_rhcs else 'dev' if ceph_dev else 'uca' if ceph_stable_uca else 'custom' if ceph_custom else 'dummy' }}" # backward compatibility with stable-2.2, will disappear in stable 3.1
 valid_ceph_repository:
   - community
   - rhcs
@@ -301,7 +309,7 @@ rbd_client_admin_socket_path: /var/run/ceph # must be writable by QEMU and allow
 # To use an IPv6 address, use the monitor_address setting instead (and set ip_version to ipv6)
 monitor_interface: interface
 monitor_address: 0.0.0.0
-monitor_address_block: []
+monitor_address_block: subnet
 # set to either ipv4 or ipv6, whichever your network is using
 ip_version: ipv4
 mon_use_fqdn: false # if set to true, the MON name used will be the fqdn in the ceph.conf
@@ -345,8 +353,8 @@ radosgw_civetweb_options: "num_threads={{ radosgw_civetweb_num_threads }}"
 # Preference will go to radosgw_address if both radosgw_address and radosgw_interface are defined.
 # To use an IPv6 address, use the radosgw_address setting instead (and set ip_version to ipv6)
 radosgw_interface: interface
-radosgw_address: 0.0.0.0
-radosgw_address_block: []
+radosgw_address: "{{ '0.0.0.0' if rgw_containerized_deployment else 'address' }}" # backward compatibility with stable-2.2, will disappear in stable 3.1
+radosgw_address_block: subnet
 radosgw_keystone: false # activate OpenStack Keystone options full detail here: http://ceph.com/docs/master/radosgw/keystone/
 # Rados Gateway options
 email_address: foo@bar.com
@@ -452,20 +460,23 @@ docker_exec_cmd:
 docker: false
 ceph_docker_image: "ceph/daemon"
 ceph_docker_image_tag: latest
-
-# Do not comment the following variables containerized_deployment_* here. These variables are being used
-# by ceph.conf.j2 template. so it should always be defined
-containerized_deployment_with_kv: false
-containerized_deployment: false
-mon_containerized_default_ceph_conf_with_kv: false
 ceph_docker_registry: docker.io
 ceph_docker_enable_centos_extra_repo: false
 ceph_docker_on_openstack: false
+ceph_mon_docker_interface: "{{ monitor_interface }}" # backward compatibility with stable-2.2, will disappear in stable 3.1
+ceph_mon_docker_subnet: "{{ public_network }}" # backward compatibility with stable-2.2, will disappear in stable 3.1
+mon_containerized_deployment: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+osd_containerized_deployment: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+mds_containerized_deployment: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+rgw_containerized_deployment: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+containerized_deployment: "{{ True if mon_containerized_deployment or osd_containerized_deployment or mds_containerized_deployment or rgw_containerized_deployment else False }}" # backward compatibility with stable-2.2, will disappear in stable 3.1
 
 
 ############
 # KV store #
 ############
+containerized_deployment_with_kv: false
+mon_containerized_default_ceph_conf_with_kv: false
 kv_type: etcd
 kv_endpoint: 127.0.0.1
 kv_port: 2379
@@ -474,3 +485,4 @@ kv_port: 2379
 # this is only here for usage with the rolling_update.yml playbook
 # do not ever change this here
 rolling_update: false
+
index c760846c73e6851ac560bb6be22b40844e9706a8..82d2c667a8a59b9bac69b5a71bb2e5b8b7795484 100644 (file)
@@ -8,27 +8,45 @@ SOCKET=/var/run/ceph/{{ cluster }}-client.rgw.${RGW_NAME}.asok
 {% if containerized_deployment %}
 DOCKER_EXEC="docker exec ceph-rgw-{{ ansible_hostname }}"
 {% endif %}
-
-{% if radosgw_address_block | length > 0 %}
-  {% if ip_version == 'ipv4' -%}
-RGW_IP={{ hostvars[inventory_hostname]['ansible_all_' + ip_version + '_addresses'] | ipaddr(radosgw_address_block) | first }}
-  {%- elif ip_version == 'ipv6' -%}
-RGW_IP=[{{ hostvars[inventory_hostname]['ansible_all_' + ip_version + '_addresses'] | ipaddr(radosgw_address_block) | first }}]
-  {%- endif %}
-{% elif hostvars[inventory_hostname]['radosgw_address'] is defined and hostvars[inventory_hostname]['radosgw_address'] != '0.0.0.0' -%}
-  {% if ip_version == 'ipv4' -%}
-RGW_IP={{ hostvars[inventory_hostname]['radosgw_address'] }}
-  {%- elif ip_version == 'ipv6' -%}
-RGW_IP=[{{ hostvars[inventory_hostname]['radosgw_address'] }}]
-  {% endif %}
-{%- else -%}
-  {% set interface = ["ansible_",radosgw_interface]|join %}
-  {% if ip_version == 'ipv6' -%}
-RGW_IP=[{{ hostvars[inventory_hostname][interface][ip_version][0]['address'] }}]
-  {%- elif ip_version == 'ipv4' -%}
-RGW_IP={{ hostvars[inventory_hostname][interface][ip_version]['address'] }}
-  {% endif %}
-{%- endif %}
+{% if hostvars[inventory_hostname]['radosgw_address_block'] is defined and hostvars[inventory_hostname]['radosgw_address_block'] != 'subnet' %}
+    {% if ip_version == 'ipv4' %}
+RGW_IP={{ hostvars[inventory_hostname]['ansible_all_' + ip_version + '_addresses'] | ipaddr(radosgw_address_block) | first }} \
+    {% elif ip_version == 'ipv6' %}
+RGW_IP=[{{ hostvars[inventory_hostname]['ansible_all_' + ip_version + '_addresses'] | ipaddr(radosgw_address_block) | first }}] \
+    {% endif %}
+{% elif radosgw_address_block is defined and radosgw_address_block != 'subnet' -%}
+    {% if ip_version == 'ipv4' %}
+RGW_IP={{ ['ansible_all_' + ip_version + '_addresses'] | ipaddr(radosgw_address_block) | first }} \
+    {% elif ip_version == 'ipv6' %}
+RGW_IP=[{{ ['ansible_all_' + ip_version + '_addresses'] | ipaddr(radosgw_address_block) | first }}] \
+    {% endif %}
+{% elif hostvars[inventory_hostname]['radosgw_address'] is defined and hostvars[inventory_hostname]['radosgw_address'] != 'address' -%}
+    {% if ip_version == 'ipv4' %}
+RGW_IP={{ hostvars[inventory_hostname]['radosgw_address'] }} \
+    {% elif ip_version == 'ipv6' %}
+RGW_IP=[{{ hostvars[inventory_hostname]['radosgw_address'] }}] \
+    {% endif %}
+{% elif radosgw_address is defined and radosgw_address != 'address' -%}
+    {% if ip_version == 'ipv4' %}
+RGW_IP={{ radosgw_address }} \
+    {% elif ip_version == 'ipv6' %}
+RGW_IP=[{{ radosgw_address }}] \
+    {% endif %}
+{% elif hostvars[inventory_hostname]['radosgw_interface'] is defined -%}
+    {% set interface = 'ansible_' + hostvars[inventory_hostname]['radosgw_interface'] %}
+    {% if ip_version == 'ipv4' %}
+RGW_IP={{ hostvars[inventory_hostname][interface][ip_version]['address'] }} \
+    {% elif ip_version == 'ipv6' %}
+RGW_IP=[{{ hostvars[inventory_hostname][interface][ip_version][0]['address'] }}] \
+    {% endif %}
+{% else %}
+    {% set interface = 'ansible_' + radosgw_interface %}
+    {% if ip_version == 'ipv4' %}
+RGW_IP={{ [interface][ip_version]['address'] }} \
+    {% elif ip_version == 'ipv6' %}
+RGW_IP=[{{ [interface][ip_version][0]['address'] }}] \
+    {% endif %}
+{% endif %}
 
 check_for_curl_or_wget() {
   if $DOCKER_EXEC command -v wget &>/dev/null; then
diff --git a/roles/ceph-docker-common/tasks/check_mandatory_vars.yml b/roles/ceph-docker-common/tasks/check_mandatory_vars.yml
new file mode 100644 (file)
index 0000000..011433b
--- /dev/null
@@ -0,0 +1,18 @@
+---
+- name: make sure monitor_interface, monitor_address or monitor_address_block is defined
+  fail:
+    msg: "you must set monitor_interface, monitor_address or monitor_address_block"
+  when:
+    - mon_group_name in group_names
+    - monitor_interface == 'interface'
+    - monitor_address == "0.0.0.0"
+    - monitor_address_block == 'subnet'
+
+- name: make sure radosgw_interface, radosgw_address or radosgw_address_block is defined
+  fail:
+    msg: "you must set radosgw_interface, radosgw_address or radosgw_address_block"
+  when:
+    - rgw_group_name in group_names
+    - radosgw_interface == 'interface'
+    - radosgw_address == 'address'
+    - radosgw_address_block == 'subnet'
index 81e95704b0ab3d17bdfa58483b357dee609f5d3b..c82ae0032c183dda7af156b82f74f2643f4372e4 100644 (file)
@@ -2,6 +2,9 @@
 - name: include system_checks.yml
   include: system_checks.yml
 
+- name: include check_mandatory_vars.yml
+  include: check_mandatory_vars.yml
+
 - name: check if it is atomic host
   stat:
     path: /run/ostree-booted
index cb0b950705851b13ab7037cc75f9723c3cafc082..aef5e6a7e8ac10fd250d2d354676624428252c32 100644 (file)
@@ -5,4 +5,4 @@
   when:
     - monitor_interface == 'interface'
     - monitor_address == '0.0.0.0'
-    - monitor_address_block | length == 0
+    - monitor_address_block == 'subnet'
index 08162560377e2a00aae599b39a72e51c562c9686..5aff76b0d25fb0a4449f7006ecd3628dcd9c9358 100644 (file)
@@ -41,7 +41,7 @@
     - not containerized_deployment_with_kv
     - ip_version == 'ipv4'
     - hostvars[groups[mon_group_name][0]]['monitor_address_block'] is defined
-    - hostvars[groups[mon_group_name][0]]['monitor_address_block'] | length > 0
+    - hostvars[groups[mon_group_name][0]]['monitor_address_block'] != 'subnet'
 
 - name: ipv6 - force peer addition as potential bootstrap peer for cluster bringup - monitor_interface
   command: docker exec ceph-mon-{{ ansible_hostname }} ceph --admin-daemon /var/run/ceph/{{ cluster }}-mon.{{ monitor_name }}.asok add_bootstrap_peer_hint [{{ hostvars[groups[mon_group_name][0]]['ansible_' + monitor_interface].ipv6[0].address }}]
@@ -71,7 +71,7 @@
     - not containerized_deployment_with_kv
     - ip_version == 'ipv6'
     - hostvars[groups[mon_group_name][0]]['monitor_address_block'] is defined
-    - hostvars[groups[mon_group_name][0]]['monitor_address_block'] | length > 0
+    - hostvars[groups[mon_group_name][0]]['monitor_address_block'] != 'subnet'
 
 - name: include fetch_configs.yml
   include: fetch_configs.yml
index 4b31d3eb952d6d06f37a0f729b98bfeae8b811d7..cc2ec3dc59186fc67011158f3525a3092a04c908 100644 (file)
@@ -29,7 +29,7 @@ ExecStart=/usr/bin/docker run --rm --name ceph-mon-%i --net=host \
   --net=host \
   {% endif -%}
   -e IP_VERSION={{ ip_version[-1:] }} \
-  {% if monitor_address_block | length > 0 %}
+  {% if monitor_address_block != 'subnet' %}
     {% if ip_version == 'ipv4' -%}
   -e MON_IP={{ hostvars[inventory_hostname]['ansible_all_' + ip_version + '_addresses'] | ipaddr(monitor_address_block) | first }} \
     {% elif ip_version == 'ipv6' -%}
index 16639d3dc7125f3634038291746a1dea48ebd240..62eddb506e178c7d117651f8d40f4a1cd611c55c 100644 (file)
@@ -2,6 +2,12 @@
 # You can override default vars defined in defaults/main.yml here,
 # but I would advice to use host or group vars instead
 
+raw_journal_devices: "{{ dedicated_devices }}" # backward compatibility with stable-2.2, will disappear in stable 3.1
+journal_collocation: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+raw_multi_journal: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+dmcrytpt_journal_collocation: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+dmcrypt_dedicated_journal: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+
 
 ###########
 # GENERAL #
@@ -79,7 +85,7 @@ osd_auto_discovery: false
 
 # Encrypt your OSD device using dmcrypt
 # If set to True, no matter which osd_objecstore and osd_scenario you use the data will be encrypted
-dmcrypt: false
+dmcrypt: "{{ True if dmcrytpt_journal_collocation or dmcrypt_dedicated_journal else False }}" # backward compatibility with stable-2.2, will disappear in stable 3.1
 
 
 # I. First scenario: collocated
@@ -102,7 +108,7 @@ dmcrypt: false
 # /dev/sda2: PARTLABEL="ceph block" PARTUUID="e6ca3e1d-4702-4569-abfa-e285de328e9d"
 #
 
-osd_scenario: dummy
+osd_scenario: "{{ 'collocated' if journal_collocation or dmcrytpt_journal_collocation else 'non-collocated' if raw_multi_journal or dmcrypt_dedicated_journal else 'dummy' }}" # backward compatibility with stable-2.2, will disappear in stable 3.1
 valid_osd_scenarios:
   - collocated
   - non-collocated
index c784d382290cccb1e2b3c8cf1c95165edd858066..6488fba7189444ca89fc6c279ec1eabd90940ab1 100644 (file)
@@ -21,27 +21,45 @@ ExecStart=/usr/bin/docker run --rm --net=host \
   -e KV_IP={{ kv_endpoint }} \
   -e KV_PORT={{ kv_port }} \
   {% endif -%}
-  {% if radosgw_address_block | length > 0 %}
-    {% if ip_version == 'ipv4' -%}
+{% if hostvars[inventory_hostname]['radosgw_address_block'] is defined and hostvars[inventory_hostname]['radosgw_address_block'] != 'subnet' %}
+    {% if ip_version == 'ipv4' %}
   -e RGW_CIVETWEB_IP={{ hostvars[inventory_hostname]['ansible_all_' + ip_version + '_addresses'] | ipaddr(radosgw_address_block) | first }} \
-    {% elif ip_version == 'ipv6' -%}
+    {% elif ip_version == 'ipv6' %}
   -e RGW_CIVETWEB_IP=[{{ hostvars[inventory_hostname]['ansible_all_' + ip_version + '_addresses'] | ipaddr(radosgw_address_block) | first }}] \
-    {% endif -%}
-  {% elif hostvars[inventory_hostname]['radosgw_address'] is defined and hostvars[inventory_hostname]['radosgw_address'] != '0.0.0.0' -%}
-    {% if ip_version == 'ipv4' -%}
+    {% endif %}
+{% elif radosgw_address_block is defined and radosgw_address_block != 'subnet' -%}
+    {% if ip_version == 'ipv4' %}
+  -e RGW_CIVETWEB_IP={{ ['ansible_all_' + ip_version + '_addresses'] | ipaddr(radosgw_address_block) | first }} \
+    {% elif ip_version == 'ipv6' %}
+  -e RGW_CIVETWEB_IP=[{{ ['ansible_all_' + ip_version + '_addresses'] | ipaddr(radosgw_address_block) | first }}] \
+    {% endif %}
+{% elif hostvars[inventory_hostname]['radosgw_address'] is defined and hostvars[inventory_hostname]['radosgw_address'] != 'address' -%}
+    {% if ip_version == 'ipv4' %}
   -e RGW_CIVETWEB_IP={{ hostvars[inventory_hostname]['radosgw_address'] }} \
-    {% elif ip_version == 'ipv6' -%}
+    {% elif ip_version == 'ipv6' %}
   -e RGW_CIVETWEB_IP=[{{ hostvars[inventory_hostname]['radosgw_address'] }}] \
-    {% endif -%}
-  {% else -%}
+    {% endif %}
+{% elif radosgw_address is defined and radosgw_address != 'address' -%}
+    {% if ip_version == 'ipv4' %}
+  -e RGW_CIVETWEB_IP={{ radosgw_address }} \
+    {% elif ip_version == 'ipv6' %}
+  -e RGW_CIVETWEB_IP=[{{ radosgw_address }}] \
+    {% endif %}
+{% elif hostvars[inventory_hostname]['radosgw_interface'] is defined -%}
     {% set interface = 'ansible_' + hostvars[inventory_hostname]['radosgw_interface'] %}
-      {% if ip_version == 'ipv6' -%}
-  -e RGW_CIVETWEB_IP=[{{ hostvars[inventory_hostname][interface][ip_version][0]['address'] }}] \
-      {% elif ip_version == 'ipv4' -%}
+    {% if ip_version == 'ipv4' %}
   -e RGW_CIVETWEB_IP={{ hostvars[inventory_hostname][interface][ip_version]['address'] }} \
-      {% endif -%}
-  {% endif -%}
-
+    {% elif ip_version == 'ipv6' %}
+  -e RGW_CIVETWEB_IP=[{{ hostvars[inventory_hostname][interface][ip_version][0]['address'] }}] \
+    {% endif %}
+{% else %}
+    {% set interface = 'ansible_' + radosgw_interface %}
+    {% if ip_version == 'ipv4' %}
+  -e RGW_CIVETWEB_IP={{ [interface][ip_version]['address'] }} \
+    {% elif ip_version == 'ipv6' %}
+  -e RGW_CIVETWEB_IP=[{{ [interface][ip_version][0]['address'] }}] \
+    {% endif %}
+{% endif %}
   -v /etc/localtime:/etc/localtime:ro \
   -e CEPH_DAEMON=RGW \
   -e CLUSTER={{ cluster }} \