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 <kevin.carter@rackspace.com>
This commit is contained in:
Kevin Carter 2017-09-27 09:54:22 -05:00 committed by Kevin Carter (cloudnull)
parent ce29ea23d1
commit 55640fa286
2 changed files with 44 additions and 41 deletions

View File

@ -71,8 +71,18 @@ infra1
[loadbalancer_hosts] [loadbalancer_hosts]
loadbalancer1 loadbalancer1
[log_hosts]
logging1
############################### OSA MNAIO HOSTS ############################### ############################### 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 # The group "swift_hosts" is used in the MNAIO setup to create the basic drive
# setup needed for a swift deployment. # setup needed for a swift deployment.
[swift_hosts] [swift_hosts]
@ -85,3 +95,9 @@ swift3
[cinder_hosts] [cinder_hosts]
cinder1 cinder1
cinder2 cinder2
# The group "compute_hosts" is used in the MNAIO setup to create the basic host
# layout for nova compute.
[compute_hosts]
compute1
compute2

View File

@ -87,8 +87,9 @@ global_overrides:
### Anchors ### Anchors
### ###
cinder_block: &cinder_block cinder_block: &cinder_block
cinder1: {% for host in groups['cinder_hosts'] %}
ip: 10.0.236.130 {{ hostvars[host]['server_hostname'] }}:
ip: {{ hostvars[host]['server_networks']['mgmt']['address'].split('/')[0] }}
container_vars: container_vars:
cinder_backends: cinder_backends:
limit_container_types: cinder_volume limit_container_types: cinder_volume
@ -96,60 +97,43 @@ cinder_block: &cinder_block
volume_group: cinder-volumes volume_group: cinder-volumes
volume_driver: cinder.volume.drivers.lvm.LVMVolumeDriver volume_driver: cinder.volume.drivers.lvm.LVMVolumeDriver
volume_backend_name: LVM_iSCSI volume_backend_name: LVM_iSCSI
iscsi_ip_address: "10.0.244.130" iscsi_ip_address: {{ hostvars[host]['server_networks']['storage']['address'].split('/')[0] }}
{% endfor %}
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"
compute_block: &compute_block compute_block: &compute_block
compute1: {% for host in groups['compute_hosts'] %}
ip: 10.0.236.120 {{ hostvars[host]['server_hostname'] }}:
ip: {{ hostvars[host]['server_networks']['mgmt']['address'].split('/')[0] }}
compute2: {% endfor %}
ip: 10.0.236.121
infra_block: &infra_block infra_block: &infra_block
infra1: {% for host in groups['infra_hosts'] %}
ip: 10.0.236.100 {{ hostvars[host]['server_hostname'] }}:
ip: {{ hostvars[host]['server_networks']['mgmt']['address'].split('/')[0] }}
infra2: {% endfor %}
ip: 10.0.236.101
infra3:
ip: 10.0.236.102
loadbalancer_block: &loadbalancer_block loadbalancer_block: &loadbalancer_block
loadbalancer1: {% for host in groups['loadbalancer_hosts'] %}
ip: 10.0.236.150 {{ hostvars[host]['server_hostname'] }}:
ip: {{ hostvars[host]['server_networks']['mgmt']['address'].split('/')[0] }}
{% endfor %}
log_block: &log_block log_block: &log_block
logging1: {% for host in groups['log_hosts'] %}
ip: 10.0.236.110 {{ hostvars[host]['server_hostname'] }}:
ip: {{ hostvars[host]['server_networks']['mgmt']['address'].split('/')[0] }}
{% endfor %}
swift_block: &swift_block swift_block: &swift_block
swift1: {% for host in groups['swift_hosts'] %}
ip: 10.0.236.140 {{ hostvars[host]['server_hostname'] }}:
ip: {{ hostvars[host]['server_networks']['mgmt']['address'].split('/')[0] }}
swift2: {% endfor %}
ip: 10.0.236.141
swift3:
ip: 10.0.236.142
### ###
@ -173,6 +157,9 @@ haproxy_hosts: *loadbalancer_block
### OpenStack ### OpenStack
### ###
# Legacy infra hosts
os-infra_hosts: *infra_block
# keystone # keystone
identity_hosts: *infra_block identity_hosts: *infra_block