summaryrefslogtreecommitdiffstats
path: root/roles/openshift_cloud_provider
diff options
context:
space:
mode:
authorScott Dodson <sdodson@redhat.com>2016-08-26 13:35:27 -0400
committerGitHub <noreply@github.com>2016-08-26 13:35:27 -0400
commit54cac00a37f8070f5073021478a30c8fda90e346 (patch)
tree7e2de24cc685479639ec751cfd66bf61e1bab56a /roles/openshift_cloud_provider
parent739648d2131a2723a21eafa4217203025438e729 (diff)
parent791640e083c31e4380a3d7cd929fd67567a944f8 (diff)
downloadopenshift-54cac00a37f8070f5073021478a30c8fda90e346.tar.gz
openshift-54cac00a37f8070f5073021478a30c8fda90e346.tar.bz2
openshift-54cac00a37f8070f5073021478a30c8fda90e346.tar.xz
openshift-54cac00a37f8070f5073021478a30c8fda90e346.zip
Merge pull request #2364 from abutcher/cloudprovider-vars
Remove openshift_env cloudprovider facts.
Diffstat (limited to 'roles/openshift_cloud_provider')
-rw-r--r--roles/openshift_cloud_provider/tasks/main.yml10
-rw-r--r--roles/openshift_cloud_provider/tasks/openstack.yml2
-rw-r--r--roles/openshift_cloud_provider/templates/openstack.conf.j220
-rw-r--r--roles/openshift_cloud_provider/vars/main.yml6
4 files changed, 14 insertions, 24 deletions
diff --git a/roles/openshift_cloud_provider/tasks/main.yml b/roles/openshift_cloud_provider/tasks/main.yml
index 6111d1207..46549fc75 100644
--- a/roles/openshift_cloud_provider/tasks/main.yml
+++ b/roles/openshift_cloud_provider/tasks/main.yml
@@ -1,14 +1,4 @@
---
-- name: Set cloud provider facts
- openshift_facts:
- role: cloudprovider
- openshift_env: "{{ hostvars
- | oo_merge_hostvars(vars, inventory_hostname)
- | oo_openshift_env }}"
- openshift_env_structures:
- - 'openshift.cloudprovider.aws.*'
- - 'openshift.cloudprovider.openstack.*'
-
- name: Create cloudprovider config dir
file:
path: "{{ openshift.common.config_base }}/cloudprovider"
diff --git a/roles/openshift_cloud_provider/tasks/openstack.yml b/roles/openshift_cloud_provider/tasks/openstack.yml
index c501121e5..f22dd4520 100644
--- a/roles/openshift_cloud_provider/tasks/openstack.yml
+++ b/roles/openshift_cloud_provider/tasks/openstack.yml
@@ -7,4 +7,4 @@
template:
dest: "{{ openshift.common.config_base }}/cloudprovider/openstack.conf"
src: openstack.conf.j2
- when: "'auth_url' in openshift.cloudprovider.openstack and 'username' in openshift.cloudprovider.openstack and 'password' in openshift.cloudprovider.openstack and ('tenant_id' in openshift.cloudprovider.openstack or 'tenant_name' in openshift.cloudprovider.openstack)"
+ when: "openshift_cloudprovider_openstack_auth_url is defined and openshift_cloudprovider_openstack_username is defined and openshift_cloudprovider_openstack_password is defined and (openshift_cloudprovider_openstack_tenant_id is defined or openshift_cloudprovider_openstack_tenant_name is defined)"
diff --git a/roles/openshift_cloud_provider/templates/openstack.conf.j2 b/roles/openshift_cloud_provider/templates/openstack.conf.j2
index 8a06b3a08..4e1695b7b 100644
--- a/roles/openshift_cloud_provider/templates/openstack.conf.j2
+++ b/roles/openshift_cloud_provider/templates/openstack.conf.j2
@@ -1,16 +1,16 @@
[Global]
-auth-url = {{ openshift.cloudprovider.openstack.auth_url }}
-username = {{ openshift.cloudprovider.openstack.username }}
-password = {{ openshift.cloudprovider.openstack.password }}
-{% if 'tenant_id' in openshift.cloudprovider.openstack %}
-tenant-id = {{ openshift.cloudprovider.openstack.tenant_id }}
+auth-url = {{ openshift_cloudprovider_openstack_auth_url }}
+username = {{ openshift_cloudprovider_openstack_username }}
+password = {{ openshift_cloudprovider_openstack_password }}
+{% if openshift_cloudprovider_openstack_tenant_id is defined %}
+tenant-id = {{ openshift_cloudprovider_openstack_tenant_id }}
{% else %}
-tenant-name = {{ openshift.cloudprovider.openstack.tenant_name }}
+tenant-name = {{ openshift_cloudprovider_openstack_tenant_name }}
{% endif %}
-{% if 'region' in openshift.cloudprovider.openstack %}
-region = {{ openshift.cloudprovider.openstack.region }}
+{% if openshift_cloudprovider_openstack_region is defined %}
+region = {{ openshift_cloudprovider_openstack_region }}
{% endif %}
-{% if 'lb_subnet_id' in openshift.cloudprovider.openstack %}
+{% if 'lb_subnet_id' in openshift_cloudprovider_openstack %}
[LoadBalancer]
-subnet-id = {{ openshift.cloudprovider.openstack.lb_subnet_id }}
+subnet-id = {{ openshift_cloudprovider_openstack_lb_subnet_id }}
{% endif %}
diff --git a/roles/openshift_cloud_provider/vars/main.yml b/roles/openshift_cloud_provider/vars/main.yml
index c608e9b54..83bf6edc8 100644
--- a/roles/openshift_cloud_provider/vars/main.yml
+++ b/roles/openshift_cloud_provider/vars/main.yml
@@ -1,4 +1,4 @@
---
-has_cloudprovider: "{{ 'cloudprovider' in openshift and 'kind' in openshift.cloudprovider and openshift.cloudprovider.kind != None }}"
-cloudprovider_is_aws: "{{ has_cloudprovider | bool and openshift.cloudprovider.kind == 'aws' }}"
-cloudprovider_is_openstack: "{{ has_cloudprovider | bool and openshift.cloudprovider.kind == 'openstack' }}"
+has_cloudprovider: "{{ openshift_cloudprovider_kind | default(None) != None }}"
+cloudprovider_is_aws: "{{ has_cloudprovider | bool and openshift_cloudprovider_kind == 'aws' }}"
+cloudprovider_is_openstack: "{{ has_cloudprovider | bool and openshift_cloudprovider_kind == 'openstack' }}"