diff options
author | Scott Dodson <sdodson@redhat.com> | 2016-09-29 10:12:25 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-29 10:12:25 -0400 |
commit | be3a68ae520d518daef2e35553c28cd150d3c344 (patch) | |
tree | 5f532e018b38b6dbc6473aae38eaea8e48fcbce8 | |
parent | 7f1a3f99fc39265e39054e5de1a8d6e29f0d63b8 (diff) | |
parent | 4d90cd08d850b5916c93adecbea5b4dcbb22c140 (diff) | |
download | openshift-be3a68ae520d518daef2e35553c28cd150d3c344.tar.gz openshift-be3a68ae520d518daef2e35553c28cd150d3c344.tar.bz2 openshift-be3a68ae520d518daef2e35553c28cd150d3c344.tar.xz openshift-be3a68ae520d518daef2e35553c28cd150d3c344.zip |
Merge pull request #2527 from lhuard1A/fix_cloudprovider_openstack_keystonev3
Set the DomainName or DomainID in the OpenStack cloud provider
-rwxr-xr-x | bin/cluster | 13 | ||||
-rw-r--r-- | inventory/byo/hosts.origin.example | 2 | ||||
-rw-r--r-- | inventory/byo/hosts.ose.example | 2 | ||||
-rw-r--r-- | roles/openshift_cloud_provider/templates/openstack.conf.j2 | 5 |
4 files changed, 19 insertions, 3 deletions
diff --git a/bin/cluster b/bin/cluster index 92174954f..68d2a7cd4 100755 --- a/bin/cluster +++ b/bin/cluster @@ -73,9 +73,16 @@ class Cluster(object): cluster['openshift_cloudprovider_openstack_auth_url'] = os.getenv('OS_AUTH_URL') cluster['openshift_cloudprovider_openstack_username'] = os.getenv('OS_USERNAME') cluster['openshift_cloudprovider_openstack_password'] = os.getenv('OS_PASSWORD') - cluster['openshift_cloudprovider_openstack_tenant_id'] = os.getenv('OS_PROJECT_ID',os.getenv('OS_TENANT_ID')) - cluster['openshift_cloudprovider_openstack_tenant_name'] = os.getenv('OS_PROJECT_NAME',os.getenv('OS_TENANT_NAME')) - cluster['openshift_cloudprovider_openstack_region'] = os.getenv('OS_REGION_NAME') + if 'OS_USER_DOMAIN_ID' in os.environ: + cluster['openshift_cloudprovider_openstack_domain_id'] = os.getenv('OS_USER_DOMAIN_ID') + if 'OS_USER_DOMAIN_NAME' in os.environ: + cluster['openshift_cloudprovider_openstack_domain_name'] = os.getenv('OS_USER_DOMAIN_NAME') + if 'OS_PROJECT_ID' in os.environ or 'OS_TENANT_ID' in os.environ: + cluster['openshift_cloudprovider_openstack_tenant_id'] = os.getenv('OS_PROJECT_ID',os.getenv('OS_TENANT_ID')) + if 'OS_PROJECT_NAME' is os.environ or 'OS_TENANT_NAME' in os.environ: + cluster['openshift_cloudprovider_openstack_tenant_name'] = os.getenv('OS_PROJECT_NAME',os.getenv('OS_TENANT_NAME')) + if 'OS_REGION_NAME' in os.environ: + cluster['openshift_cloudprovider_openstack_region'] = os.getenv('OS_REGION_NAME') self.action(args, inventory, cluster, playbook) diff --git a/inventory/byo/hosts.origin.example b/inventory/byo/hosts.origin.example index 023f77149..55efc0925 100644 --- a/inventory/byo/hosts.origin.example +++ b/inventory/byo/hosts.origin.example @@ -145,6 +145,8 @@ openshift_master_identity_providers=[{'name': 'htpasswd_auth', 'login': 'true', #openshift_cloudprovider_openstack_auth_url=http://openstack.example.com:35357/v2.0/ #openshift_cloudprovider_openstack_username=username #openshift_cloudprovider_openstack_password=password +#openshift_cloudprovider_openstack_domain_id=domain_id +#openshift_cloudprovider_openstack_domain_name=domain_name #openshift_cloudprovider_openstack_tenant_id=tenant_id #openshift_cloudprovider_openstack_tenant_name=tenant_name #openshift_cloudprovider_openstack_region=region diff --git a/inventory/byo/hosts.ose.example b/inventory/byo/hosts.ose.example index 14dfbd91e..8a5655104 100644 --- a/inventory/byo/hosts.ose.example +++ b/inventory/byo/hosts.ose.example @@ -144,6 +144,8 @@ openshift_master_identity_providers=[{'name': 'htpasswd_auth', 'login': 'true', #openshift_cloudprovider_openstack_auth_url=http://openstack.example.com:35357/v2.0/ #openshift_cloudprovider_openstack_username=username #openshift_cloudprovider_openstack_password=password +#openshift_cloudprovider_openstack_domain_id=domain_id +#openshift_cloudprovider_openstack_domain_name=domain_name #openshift_cloudprovider_openstack_tenant_id=tenant_id #openshift_cloudprovider_openstack_tenant_name=tenant_name #openshift_cloudprovider_openstack_region=region diff --git a/roles/openshift_cloud_provider/templates/openstack.conf.j2 b/roles/openshift_cloud_provider/templates/openstack.conf.j2 index ce452db24..313ee02b4 100644 --- a/roles/openshift_cloud_provider/templates/openstack.conf.j2 +++ b/roles/openshift_cloud_provider/templates/openstack.conf.j2 @@ -2,6 +2,11 @@ auth-url = {{ openshift_cloudprovider_openstack_auth_url }} username = {{ openshift_cloudprovider_openstack_username }} password = {{ openshift_cloudprovider_openstack_password }} +{% if openshift_cloudprovider_openstack_domain_id is defined %} +domain-id = {{ openshift_cloudprovider_openstack_domain_id }} +{% elif openshift_cloudprovider_openstack_domain_name is defined %} +domain-name = {{ openshift_cloudprovider_openstack_domain_name }} +{% endif %} {% if openshift_cloudprovider_openstack_tenant_id is defined %} tenant-id = {{ openshift_cloudprovider_openstack_tenant_id }} {% else %} |