From ba4debd2aa9c808cd982030d3589443e87bb900e Mon Sep 17 00:00:00 2001 From: Andrew Butcher Date: Fri, 8 Apr 2016 12:36:42 -0400 Subject: Add openshift_hosted_facts role and remove hosted facts from openshift_common. --- roles/openshift_common/tasks/main.yml | 6 +----- roles/openshift_hosted_facts/meta/main.yml | 15 +++++++++++++++ roles/openshift_hosted_facts/tasks/main.yml | 9 +++++++++ roles/openshift_master/meta/main.yml | 1 + roles/openshift_persistent_volumes/meta/main.yml | 3 ++- roles/openshift_registry/meta/main.yml | 4 ++-- roles/openshift_storage_nfs/meta/main.yml | 6 +++--- 7 files changed, 33 insertions(+), 11 deletions(-) create mode 100644 roles/openshift_hosted_facts/meta/main.yml create mode 100644 roles/openshift_hosted_facts/tasks/main.yml (limited to 'roles') diff --git a/roles/openshift_common/tasks/main.yml b/roles/openshift_common/tasks/main.yml index b6074ff64..59ca659b5 100644 --- a/roles/openshift_common/tasks/main.yml +++ b/roles/openshift_common/tasks/main.yml @@ -36,12 +36,8 @@ action: "{{ ansible_pkg_mgr }} name={{ openshift.common.service_type }}{{ openshift_version | default('') | oo_image_tag_to_rpm_version }} state=present" when: not openshift.common.is_containerized | bool -# This invocation also updates the version facts which are necessary -# for setting the hostname below. -- name: openshift_facts +- name: Set version facts openshift_facts: - role: hosted - openshift_env: "{{ hostvars[inventory_hostname] | oo_openshift_env }}" # For enterprise versions < 3.1 and origin versions < 1.1 we want to set the # hostname by default. diff --git a/roles/openshift_hosted_facts/meta/main.yml b/roles/openshift_hosted_facts/meta/main.yml new file mode 100644 index 000000000..dd2de07bc --- /dev/null +++ b/roles/openshift_hosted_facts/meta/main.yml @@ -0,0 +1,15 @@ +--- +galaxy_info: + author: Andrew Butcher + description: OpenShift Hosted Facts + company: Red Hat, Inc. + license: Apache License, Version 2.0 + min_ansible_version: 1.9 + platforms: + - name: EL + versions: + - 7 + categories: + - cloud +dependencies: +- role: openshift_facts diff --git a/roles/openshift_hosted_facts/tasks/main.yml b/roles/openshift_hosted_facts/tasks/main.yml new file mode 100644 index 000000000..13e06e632 --- /dev/null +++ b/roles/openshift_hosted_facts/tasks/main.yml @@ -0,0 +1,9 @@ +--- +- name: Set hosted facts + openshift_facts: + role: hosted + openshift_env: "{{ item | oo_openshift_env }}" + no_log: true + with_items: + - "{{ hostvars[inventory_hostname] }}" + - "{{ hostvars }}" diff --git a/roles/openshift_master/meta/main.yml b/roles/openshift_master/meta/main.yml index 7ab913eea..0d4241e2c 100644 --- a/roles/openshift_master/meta/main.yml +++ b/roles/openshift_master/meta/main.yml @@ -16,3 +16,4 @@ dependencies: - role: openshift_cli - role: openshift_cloud_provider - role: openshift_master_facts +- role: openshift_hosted_facts diff --git a/roles/openshift_persistent_volumes/meta/main.yml b/roles/openshift_persistent_volumes/meta/main.yml index d9f6fc01a..25e5a38dd 100644 --- a/roles/openshift_persistent_volumes/meta/main.yml +++ b/roles/openshift_persistent_volumes/meta/main.yml @@ -10,4 +10,5 @@ galaxy_info: versions: - 7 dependencies: -- { role: openshift_common } +- role: openshift_common +- role: openshift_hosted_facts diff --git a/roles/openshift_registry/meta/main.yml b/roles/openshift_registry/meta/main.yml index b220a020e..e6db8c537 100644 --- a/roles/openshift_registry/meta/main.yml +++ b/roles/openshift_registry/meta/main.yml @@ -11,5 +11,5 @@ galaxy_info: - 7 categories: - cloud - dependencies: - - openshift_facts +dependencies: +- role: openshift_hosted_facts diff --git a/roles/openshift_storage_nfs/meta/main.yml b/roles/openshift_storage_nfs/meta/main.yml index c6815d697..d675e0750 100644 --- a/roles/openshift_storage_nfs/meta/main.yml +++ b/roles/openshift_storage_nfs/meta/main.yml @@ -10,6 +10,6 @@ galaxy_info: versions: - 7 dependencies: -- { role: os_firewall } -- { role: openshift_facts } -- { role: openshift_repos } +- role: os_firewall +- role: openshift_hosted_facts +- role: openshift_repos -- cgit v1.2.3 From 8591af8679e13374d9f13d8867679adee45a7d0d Mon Sep 17 00:00:00 2001 From: Andrew Butcher Date: Fri, 8 Apr 2016 16:14:49 -0400 Subject: Merge openshift_env hostvars. --- roles/openshift_cloud_provider/tasks/main.yml | 8 +++----- roles/openshift_hosted_facts/tasks/main.yml | 8 +++----- 2 files changed, 6 insertions(+), 10 deletions(-) (limited to 'roles') diff --git a/roles/openshift_cloud_provider/tasks/main.yml b/roles/openshift_cloud_provider/tasks/main.yml index 471fd686b..d7442924f 100644 --- a/roles/openshift_cloud_provider/tasks/main.yml +++ b/roles/openshift_cloud_provider/tasks/main.yml @@ -2,14 +2,12 @@ - name: Set cloud provider facts openshift_facts: role: cloudprovider - openshift_env: "{{ item | oo_openshift_env }}" + openshift_env: "{{ hostvars[inventory_hostname] + | oo_merge_dicts(hostvars) + | oo_openshift_env }}" openshift_env_structures: - 'openshift.cloudprovider.aws.*' - 'openshift.cloudprovider.openstack.*' - no_log: true - with_items: - - "{{ hostvars[inventory_hostname] }}" - - "{{ hostvars }}" - name: Create cloudprovider config dir file: diff --git a/roles/openshift_hosted_facts/tasks/main.yml b/roles/openshift_hosted_facts/tasks/main.yml index 13e06e632..f595e1e81 100644 --- a/roles/openshift_hosted_facts/tasks/main.yml +++ b/roles/openshift_hosted_facts/tasks/main.yml @@ -2,8 +2,6 @@ - name: Set hosted facts openshift_facts: role: hosted - openshift_env: "{{ item | oo_openshift_env }}" - no_log: true - with_items: - - "{{ hostvars[inventory_hostname] }}" - - "{{ hostvars }}" + openshift_env: "{{ hostvars[inventory_hostname] + | oo_merge_dicts(hostvars) + | oo_openshift_env }}" -- cgit v1.2.3