Merge "Require Ceph network parameters to be passed to deployed_ceph playbook" into stable/wallaby
This commit is contained in:
commit
748d6228aa
|
@ -117,47 +117,35 @@
|
||||||
vars:
|
vars:
|
||||||
tripleo_cephadm_spec_on_bootstrap: false
|
tripleo_cephadm_spec_on_bootstrap: false
|
||||||
tripleo_cephadm_spec_ansible_host: "{{ ceph_spec_path }}"
|
tripleo_cephadm_spec_ansible_host: "{{ ceph_spec_path }}"
|
||||||
storage_network_name: Storage
|
tripleo_cephadm_bootstrap_host: "{{ inventory_hostname_short }}"
|
||||||
storage_mgmt_network_name: StorageMgmt
|
|
||||||
pre_tasks:
|
pre_tasks:
|
||||||
- name: ensure ceph_spec_path is defined
|
- name: Ensure ceph_spec_path is defined
|
||||||
set_fact:
|
set_fact:
|
||||||
ceph_spec_path: "{{ working_dir }}/generated_ceph_spec.yaml"
|
ceph_spec_path: "{{ working_dir }}/generated_ceph_spec.yaml"
|
||||||
when:
|
when:
|
||||||
- ceph_spec_path is undefined
|
- ceph_spec_path is undefined
|
||||||
|
|
||||||
- name: Ensure storage networks are in the inventory
|
- name: Ensure public_network and cluster_network are defined
|
||||||
fail:
|
fail:
|
||||||
msg: >
|
msg: >
|
||||||
Both {{ storage_network_name }} and {{ storage_mgmt_network_name }}
|
The following four variables must be passed to this playbook
|
||||||
should be in {{ networks }} but are not. If desired, override the
|
public_network ({{ public_network }}) |
|
||||||
network name variables, e.g. -e storage_network_name=ctlplane
|
public_network_name ({{ public_network_name }}) |
|
||||||
-e storage_mgmt_network_name=ctlplane
|
cluster_network ({{ cluster_network }}) |
|
||||||
|
cluster_network_name ({{ cluster_network_name }})
|
||||||
when:
|
when:
|
||||||
- storage_network_name not in networks or
|
- (public_network is undefined or public_network | length == 0) or
|
||||||
storage_mgmt_network_name not in networks
|
(public_network_name is undefined or public_network_name | length == 0) or
|
||||||
vars:
|
(cluster_network is undefined or cluster_network | length == 0) or
|
||||||
networks: "{{ hostvars[inventory_hostname_short]['networks_all']
|
(cluster_network_name is undefined or cluster_network_name | length == 0)
|
||||||
| union(['ctlplane']) | list | unique }}"
|
|
||||||
|
|
||||||
- name: Set Network Facts
|
- name: Set IP address of first monitor
|
||||||
set_fact:
|
set_fact:
|
||||||
tripleo_cephadm_bootstrap_host: "{{ inventory_hostname_short }}"
|
tripleo_cephadm_first_mon_ip: "{{ hv[public_network_name + '_ip'] }}"
|
||||||
tripleo_cephadm_first_mon_ip: "{{ hv[netmap[storage_network_name] + '_ip'] }}"
|
|
||||||
storage_mgmt_network_ip: "{{ hv[netmap[storage_mgmt_network_name] + '_ip'] }}"
|
|
||||||
storage_network_cidr: "{{ hv[netmap[storage_network_name] + '_cidr'] }}"
|
|
||||||
storage_mgmt_network_cidr: "{{ hv[netmap[storage_mgmt_network_name] + '_cidr' ]}}"
|
|
||||||
vars:
|
vars:
|
||||||
hv: "{{ hostvars[inventory_hostname_short] }}"
|
hv: "{{ hostvars[inventory_hostname_short] }}"
|
||||||
netmap: "{{ hostvars[inventory_hostname_short]['networks_lower'] }}"
|
when:
|
||||||
|
- tripleo_cephadm_first_mon_ip is undefined
|
||||||
- name: Set public and cluster networks
|
|
||||||
set_fact:
|
|
||||||
public_network: "{{ public | ansible.netcommon.ipaddr('network/prefix') }}"
|
|
||||||
cluster_network: "{{ private | ansible.netcommon.ipaddr('network/prefix') }}"
|
|
||||||
vars:
|
|
||||||
public: "{{ tripleo_cephadm_first_mon_ip }}/{{ storage_network_cidr }}"
|
|
||||||
private: "{{ storage_mgmt_network_ip }}/{{ storage_mgmt_network_cidr }}"
|
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
- name: Satisfy Ceph prerequisites
|
- name: Satisfy Ceph prerequisites
|
||||||
|
|
|
@ -103,7 +103,30 @@
|
||||||
become: true
|
become: true
|
||||||
when: tripleo_cephadm_spec_stat_host.stat.exists
|
when: tripleo_cephadm_spec_stat_host.stat.exists
|
||||||
|
|
||||||
- name: generate pre ceph.conf configuration file for initial bootstrap
|
- name: was a tripleo_cephadm_bootstrap_conf passed?
|
||||||
|
when:
|
||||||
|
- tripleo_cephadm_bootstrap_conf is defined
|
||||||
|
- tripleo_cephadm_bootstrap_conf | length > 0
|
||||||
|
block:
|
||||||
|
- name: stat tripleo_cephadm_bootstrap_conf file
|
||||||
|
stat:
|
||||||
|
path: "{{ tripleo_cephadm_bootstrap_conf }}"
|
||||||
|
register: stat_bootstrap_conf
|
||||||
|
become: true
|
||||||
|
delegate_to: localhost
|
||||||
|
ignore_errors: true
|
||||||
|
|
||||||
|
- name: push it to tripleo_cephadm_assimilate_conf on bootstrap node
|
||||||
|
copy:
|
||||||
|
src: "{{ tripleo_cephadm_bootstrap_conf }}"
|
||||||
|
dest: "{{ tripleo_cephadm_assimilate_conf }}"
|
||||||
|
owner: "{{ tripleo_cephadm_ssh_user }}"
|
||||||
|
group: "{{ tripleo_cephadm_ssh_user }}"
|
||||||
|
mode: '0644'
|
||||||
|
become: true
|
||||||
|
when: stat_bootstrap_conf.stat.exists
|
||||||
|
|
||||||
|
- name: generate tripleo_cephadm_assimilate_conf on bootstrap node
|
||||||
action: config_template
|
action: config_template
|
||||||
args:
|
args:
|
||||||
src: "ceph.conf.j2"
|
src: "ceph.conf.j2"
|
||||||
|
@ -114,3 +137,6 @@
|
||||||
config_overrides: "{{ tripleo_cephadm_conf_overrides }}"
|
config_overrides: "{{ tripleo_cephadm_conf_overrides }}"
|
||||||
config_type: ini
|
config_type: ini
|
||||||
become: true
|
become: true
|
||||||
|
when:
|
||||||
|
- tripleo_cephadm_bootstrap_conf is not defined or
|
||||||
|
tripleo_cephadm_bootstrap_conf | length == 0
|
||||||
|
|
|
@ -18,6 +18,12 @@ public network = {{ public_network | regex_replace(' ', '') }}
|
||||||
{% if cluster_network is defined %}
|
{% if cluster_network is defined %}
|
||||||
cluster network = {{ cluster_network | regex_replace(' ', '') }}
|
cluster network = {{ cluster_network | regex_replace(' ', '') }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if ms_bind_ipv4 is defined %}
|
||||||
|
ms_bind_ipv4 = {{ ms_bind_ipv4 }}
|
||||||
|
{% endif %}
|
||||||
|
{% if ms_bind_ipv6 is defined %}
|
||||||
|
ms_bind_ipv6 = {{ ms_bind_ipv6 }}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{# Build CephConfigOverrides #}
|
{# Build CephConfigOverrides #}
|
||||||
{% for key, value in (ceph_conf_overrides | default({})).items() %}
|
{% for key, value in (ceph_conf_overrides | default({})).items() %}
|
||||||
|
|
Loading…
Reference in New Issue