ansible-ansible-openshift-ansible: shuffle inventory and such so iad2 cluster only lists iad2 nodes, etc.

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
This commit is contained in:
Kevin Fenzi 2020-05-16 11:12:48 -07:00
parent 4b7c31a882
commit c1382106f5
3 changed files with 1190 additions and 6 deletions

View file

@ -32,14 +32,23 @@
- ansible-ansible-openshift-ansible-config
when: env == 'staging' and inventory_hostname.startswith('os-')
- name: generate the inventory file (production)
- name: generate the inventory file (production) (phx2)
template:
src: "cluster-inventory-prod.j2"
dest: "{{ openshift_ansible_path }}/{{ cluster_inventory_filename }}"
tags:
- ansible-ansible-openshift-ansible
- ansible-ansible-openshift-ansible-config
when: env == 'production' and inventory_hostname.startswith('os-')
when: env == 'production' and inventory_hostname.startswith('os-') and datacenter == 'phx2'
- name: generate the inventory file (production) (iad2)
template:
src: "cluster-inventory-iad2-prod.j2"
dest: "{{ openshift_ansible_path }}/{{ cluster_inventory_filename }}"
tags:
- ansible-ansible-openshift-ansible
- ansible-ansible-openshift-ansible-config
when: env == 'production' and inventory_hostname.startswith('os-') and datacenter == 'iad2'
- name: generate the inventory file (osbs)
template:

File diff suppressed because it is too large Load diff

View file

@ -6,20 +6,26 @@
[masters]
{% for host in groups[openshift_cluster_masters_group] %}
{% if hostvars[host].datacenter == 'phx2' %}
{{ host }}
{% endif %}
{% endfor %}
[etcd]
{% for host in groups[openshift_cluster_masters_group] %}
{% if hostvars[host].datacenter == 'phx2' %}
{{ host }}
{% endif %}
{% endfor %}
[nodes]
{% for host in groups[openshift_cluster_masters_group] %}
{% if hostvars[host].datacenter == 'phx2' %}
{{ host }} openshift_node_group_name='node-config-master'
{% endfor %}
{% for host in groups[openshift_cluster_nodes_group] %}
{{ host }} openshift_node_group_name='node-config-compute'
{% endif %}
{% endfor %}
#[nfs]
@ -515,7 +521,6 @@ openshift_master_identity_providers=[{"name": "fedoraidp", "login": "true", "cha
#openshift_hosted_registry_storage_nfs_directory=/exports
#openshift_hosted_registry_storage_volume_name=registry
#openshift_hosted_registry_storage_volume_size=10Gi
{% if datacenter != 'iad2' %}
{% if env == "staging" %}
openshift_hosted_registry_storage_kind=nfs
openshift_hosted_registry_storage_access_modes=['ReadWriteMany']
@ -531,7 +536,6 @@ openshift_hosted_registry_storage_nfs_directory=/
openshift_hosted_registry_storage_volume_name=openshift-prod-registry
openshift_hosted_registry_storage_volume_size=10Gi
{% endif %}
{% endif %}
#
# Openstack
# Volume must already exist.
@ -719,14 +723,12 @@ openshift_logging_es_nodeselector={"node-role.kubernetes.io/infra":"true"}
#openshift_logging_storage_volume_name=logging
#openshift_logging_storage_volume_size=10Gi
#openshift_logging_storage_labels={'storage': 'logging'}
{% if datacenter != 'iad2' %}
openshift_logging_storage_kind=nfs
openshift_logging_storage_access_modes=['ReadWriteOnce']
openshift_logging_storage_host=ntap-phx2-c01-fedora01-nfs.storage.phx2.redhat.com
openshift_logging_storage_nfs_directory=/
openshift_logging_storage_volume_name=openshift-prod-logging
openshift_logging_storage_volume_size=100Gi
{% endif %}
#
# Option C - Dynamic -- If openshift supports dynamic volume provisioning for
# your cloud platform use this.