From 55640fa28641f6531242e5c275ebf40bb568db66 Mon Sep 17 00:00:00 2001 From: Kevin Carter Date: Wed, 27 Sep 2017 09:54:22 -0500 Subject: [PATCH] Convert the user config group build outs to be dynamic the previous group build outs for the osa user config were statically defined. This change makes all of them dynamic which gives a user the ability to add or remove hosts from the basic inventory as they need. Change-Id: I1eae7de6d62435e8222ec80b05b6c0a060c5bb69 Signed-off-by: Kevin Carter --- multi-node-aio/playbooks/inventory/hosts | 16 +++++ .../playbooks/osa/openstack_user_config.yml | 69 ++++++++----------- 2 files changed, 44 insertions(+), 41 deletions(-) diff --git a/multi-node-aio/playbooks/inventory/hosts b/multi-node-aio/playbooks/inventory/hosts index 52bbb704..fa3538d5 100644 --- a/multi-node-aio/playbooks/inventory/hosts +++ b/multi-node-aio/playbooks/inventory/hosts @@ -71,8 +71,18 @@ infra1 [loadbalancer_hosts] loadbalancer1 +[log_hosts] +logging1 + ############################### OSA MNAIO HOSTS ############################### +# The group "infra_hosts" is used in the MNAIO setup to create the basic host +# layout for nova compute. +[infra_hosts] +infra1 +infra2 +infra3 + # The group "swift_hosts" is used in the MNAIO setup to create the basic drive # setup needed for a swift deployment. [swift_hosts] @@ -85,3 +95,9 @@ swift3 [cinder_hosts] cinder1 cinder2 + +# The group "compute_hosts" is used in the MNAIO setup to create the basic host +# layout for nova compute. +[compute_hosts] +compute1 +compute2 diff --git a/multi-node-aio/playbooks/osa/openstack_user_config.yml b/multi-node-aio/playbooks/osa/openstack_user_config.yml index 2e9cff88..ddd2bb57 100644 --- a/multi-node-aio/playbooks/osa/openstack_user_config.yml +++ b/multi-node-aio/playbooks/osa/openstack_user_config.yml @@ -87,8 +87,9 @@ global_overrides: ### Anchors ### cinder_block: &cinder_block - cinder1: - ip: 10.0.236.130 +{% for host in groups['cinder_hosts'] %} + {{ hostvars[host]['server_hostname'] }}: + ip: {{ hostvars[host]['server_networks']['mgmt']['address'].split('/')[0] }} container_vars: cinder_backends: limit_container_types: cinder_volume @@ -96,60 +97,43 @@ cinder_block: &cinder_block volume_group: cinder-volumes volume_driver: cinder.volume.drivers.lvm.LVMVolumeDriver volume_backend_name: LVM_iSCSI - iscsi_ip_address: "10.0.244.130" - - cinder2: - ip: 10.0.236.131 - container_vars: - cinder_backends: - limit_container_types: cinder_volume - lvm: - volume_group: cinder-volumes - volume_driver: cinder.volume.drivers.lvm.LVMVolumeDriver - volume_backend_name: LVM_iSCSI - iscsi_ip_address: "10.0.244.131" + iscsi_ip_address: {{ hostvars[host]['server_networks']['storage']['address'].split('/')[0] }} +{% endfor %} compute_block: &compute_block - compute1: - ip: 10.0.236.120 - - compute2: - ip: 10.0.236.121 +{% for host in groups['compute_hosts'] %} + {{ hostvars[host]['server_hostname'] }}: + ip: {{ hostvars[host]['server_networks']['mgmt']['address'].split('/')[0] }} +{% endfor %} infra_block: &infra_block - infra1: - ip: 10.0.236.100 - - infra2: - ip: 10.0.236.101 - - infra3: - ip: 10.0.236.102 +{% for host in groups['infra_hosts'] %} + {{ hostvars[host]['server_hostname'] }}: + ip: {{ hostvars[host]['server_networks']['mgmt']['address'].split('/')[0] }} +{% endfor %} loadbalancer_block: &loadbalancer_block - loadbalancer1: - ip: 10.0.236.150 +{% for host in groups['loadbalancer_hosts'] %} + {{ hostvars[host]['server_hostname'] }}: + ip: {{ hostvars[host]['server_networks']['mgmt']['address'].split('/')[0] }} +{% endfor %} log_block: &log_block - logging1: - ip: 10.0.236.110 +{% for host in groups['log_hosts'] %} + {{ hostvars[host]['server_hostname'] }}: + ip: {{ hostvars[host]['server_networks']['mgmt']['address'].split('/')[0] }} +{% endfor %} swift_block: &swift_block - swift1: - ip: 10.0.236.140 - - swift2: - ip: 10.0.236.141 - - swift3: - ip: 10.0.236.142 - - +{% for host in groups['swift_hosts'] %} + {{ hostvars[host]['server_hostname'] }}: + ip: {{ hostvars[host]['server_networks']['mgmt']['address'].split('/')[0] }} +{% endfor %} ### @@ -173,6 +157,9 @@ haproxy_hosts: *loadbalancer_block ### OpenStack ### +# Legacy infra hosts +os-infra_hosts: *infra_block + # keystone identity_hosts: *infra_block