MNAIO: Make cinder/compute/swift hosts conditional

1. If osa_enable_block_storage=false, then there should
   be no cinder hosts deployed, nor any presence of the
   vars related to it in openstack_user_config.

2. If osa_enable_compute=false, then there should be no
   compute hosts deployed, nor any presence of the
   vars related to it in openstack_user_config..

3. If osa_enable_object_storage=false, then there should
   be no swift hosts deployed, nor any presence of the
   vars related to it in openstack_user_config..

Change-Id: Id6858d277c80095024af5d8e04dfc97cc3e3b253
This commit is contained in:
Jesse Pretorius 2018-10-18 14:21:08 +01:00
parent cce2bd3d41
commit d3d505b678
4 changed files with 17 additions and 10 deletions

View File

@ -16,7 +16,7 @@
ansible_os_family: "{{ images[default_vm_image]['image_type'] }}"
server_domain_name: 'openstack.local'
server_vm: true
server_vm: "{{ osa_enable_block_storage | bool }}"
server_vm_ram: '{{ cinder_vm_server_ram | default(2048) }}'
server_vm_vcpus: '{{ cinder_vm_server_vcpus | default(2) }}'
server_vm_primary_network: 'dhcp'

View File

@ -16,7 +16,7 @@
ansible_os_family: "{{ images[default_vm_image]['image_type'] }}"
server_domain_name: 'openstack.local'
server_vm: true
server_vm: "{{ osa_enable_compute | bool }}"
server_vm_ram: '{{ compute_vm_server_ram | default(8192) }}'
server_vm_vcpus: '{{ compute_vm_server_vcpus | default(4) }}'
server_vm_primary_network: 'dhcp'

View File

@ -16,7 +16,7 @@
ansible_os_family: "{{ images[default_vm_image]['image_type'] }}"
server_domain_name: 'openstack.local'
server_vm: true
server_vm: "{{ osa_enable_object_storage | bool }}"
server_vm_ram: '{{ swift_vm_server_ram | default(1024) }}'
server_vm_vcpus: '{{ swift_vm_server_vcpus | default(2) }}'
server_vm_primary_network: 'dhcp'

View File

@ -83,7 +83,7 @@ global_overrides:
- "octavia-worker"
- "octavia-housekeeping"
- "octavia-health-monitor"
{% if osa_enable_object_storage | bool %}
swift:
part_power: 8
storage_network: 'br-storage'
@ -98,12 +98,14 @@ global_overrides:
name: default
index: 0
default: True
{% endif %}
###
### Anchors
###
{% if osa_enable_block_storage | bool %}
cinder_block: &cinder_block
{% for host in groups['cinder_hosts'] %}
{% for host in groups['cinder_hosts'] %}
{{ hostvars[host]['server_hostname'] }}:
ip: {{ hostvars[host]['server_networks']['mgmt']['address'].split('/')[0] }}
container_vars:
@ -115,16 +117,19 @@ cinder_block: &cinder_block
volume_driver: cinder.volume.drivers.lvm.LVMVolumeDriver
volume_backend_name: LVM_iSCSI
iscsi_ip_address: {{ hostvars[host]['server_networks']['storage']['address'].split('/')[0] }}
{% endfor %}
{% endfor %}
{% endif %}
{% if osa_enable_compute | bool %}
compute_block: &compute_block
{% for host in groups['compute_hosts'] %}
{% for host in groups['compute_hosts'] %}
{{ hostvars[host]['server_hostname'] }}:
ip: {{ hostvars[host]['server_networks']['mgmt']['address'].split('/')[0] }}
container_vars:
container_tech: "{{ default_container_tech }}"
{% endfor %}
{% endfor %}
{% endif %}
infra_block: &infra_block
@ -154,13 +159,15 @@ log_block: &log_block
{% endfor %}
{% if osa_enable_object_storage | bool %}
swift_block: &swift_block
{% for host in groups['swift_hosts'] %}
{% for host in groups['swift_hosts'] %}
{{ hostvars[host]['server_hostname'] }}:
ip: {{ hostvars[host]['server_networks']['mgmt']['address'].split('/')[0] }}
container_vars:
container_tech: "{{ default_container_tech }}"
{% endfor %}
{% endfor %}
{% endif %}
###