diff options
author | Michael Gugino <gugino.michael@yahoo.com> | 2018-01-08 18:14:35 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-08 18:14:35 -0500 |
commit | 7536af8e199c025451bdb7f5083c685b8ed5180d (patch) | |
tree | 3ceb284f519984f564f4a8de6943c2d28bfc2da2 | |
parent | 96d40700a892353bd8207a1e7c4e7a662ae757cc (diff) | |
parent | 08f085dd28a32fffbd15d7f2d511fb12bd0fe947 (diff) | |
download | openshift-7536af8e199c025451bdb7f5083c685b8ed5180d.tar.gz openshift-7536af8e199c025451bdb7f5083c685b8ed5180d.tar.bz2 openshift-7536af8e199c025451bdb7f5083c685b8ed5180d.tar.xz openshift-7536af8e199c025451bdb7f5083c685b8ed5180d.zip |
Merge pull request #6651 from mgugino-upstream-stage/containerized-groups
Build containerized host group dynamically
-rw-r--r-- | playbooks/container-runtime/private/build_container_groups.yml | 6 | ||||
-rw-r--r-- | playbooks/container-runtime/private/config.yml | 9 | ||||
-rw-r--r-- | playbooks/container-runtime/private/setup_storage.yml | 4 | ||||
-rw-r--r-- | test/tox-inventory.txt | 4 |
4 files changed, 16 insertions, 7 deletions
diff --git a/playbooks/container-runtime/private/build_container_groups.yml b/playbooks/container-runtime/private/build_container_groups.yml new file mode 100644 index 000000000..7fd60743c --- /dev/null +++ b/playbooks/container-runtime/private/build_container_groups.yml @@ -0,0 +1,6 @@ +--- +- name: create oo_hosts_containerized_managed_true host group + hosts: oo_all_hosts:!oo_nodes_to_config + tasks: + - group_by: + key: oo_hosts_containerized_managed_{{ (containerized | default(False)) | ternary('true','false') }} diff --git a/playbooks/container-runtime/private/config.yml b/playbooks/container-runtime/private/config.yml index dd13fa4a2..7a49adcf0 100644 --- a/playbooks/container-runtime/private/config.yml +++ b/playbooks/container-runtime/private/config.yml @@ -1,10 +1,7 @@ --- -- hosts: "{{ l_containerized_host_groups }}" - vars: - l_chg_temp: "{{ hostvars[groups['oo_first_master'][0]]['openshift_containerized_host_groups'] | default([]) }}" - l_containerized_host_groups: "{{ (['oo_nodes_to_config'] | union(l_chg_temp)) | join(':') }}" - # role: container_runtime is necessary here to bring role default variables - # into the play scope. +- import_playbook: build_container_groups.yml + +- hosts: oo_nodes_to_config:oo_hosts_containerized_managed_true roles: - role: container_runtime tasks: diff --git a/playbooks/container-runtime/private/setup_storage.yml b/playbooks/container-runtime/private/setup_storage.yml index 357f67f0c..a6d396270 100644 --- a/playbooks/container-runtime/private/setup_storage.yml +++ b/playbooks/container-runtime/private/setup_storage.yml @@ -1,5 +1,7 @@ --- -- hosts: "{{ l_containerized_host_groups }}" +- import_playbook: build_container_groups.yml + +- hosts: oo_nodes_to_config:oo_hosts_containerized_managed_true vars: l_chg_temp: "{{ hostvars[groups['oo_first_master'][0]]['openshift_containerized_host_groups'] | default([]) }}" l_containerized_host_groups: "{{ (['oo_nodes_to_config'] | union(l_chg_temp)) | join(':') }}" diff --git a/test/tox-inventory.txt b/test/tox-inventory.txt index 6e57d224b..ed9e946ab 100644 --- a/test/tox-inventory.txt +++ b/test/tox-inventory.txt @@ -13,6 +13,7 @@ oo_first_etcd oo_etcd_hosts_to_backup oo_etcd_hosts_to_upgrade oo_etcd_to_migrate +oo_hosts_containerized_managed_true oo_masters oo_masters_to_config oo_first_master @@ -103,3 +104,6 @@ localhost [glusterfs_registry] localhost + +[oo_hosts_containerized_managed_true] +localhost |