From 6235ed82df82e43538f6ffe9ee7e6f627e1960b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Ole=C5=9B?= Date: Fri, 26 Jun 2015 21:05:13 +0000 Subject: [PATCH] Make resource universal --- .../actions/run.yaml | 6 +--- resources/keystone_service_endpoint/meta.yaml | 29 ++++++++++--------- templates/openstack_base.yml | 23 +++++++++------ 3 files changed, 31 insertions(+), 27 deletions(-) diff --git a/resources/keystone_service_endpoint/actions/run.yaml b/resources/keystone_service_endpoint/actions/run.yaml index 6fe788a8..2221f819 100644 --- a/resources/keystone_service_endpoint/actions/run.yaml +++ b/resources/keystone_service_endpoint/actions/run.yaml @@ -1,9 +1,5 @@ - hosts: [{{ ip }}] sudo: yes - vars: - ip: {{ip}} - port: {{port}} - admin_port: {{admin_port}} tasks: - name: keystone service and endpoint keystone_service: @@ -16,4 +12,4 @@ adminurl: {{adminurl}} region: "RegionOne" state: present - endpoint: http://{{keystone_host}}:{{keystone_port}}/v2.0/ + endpoint: http://{{keystone_host}}:{{keystone_admin_port}}/v2.0/ diff --git a/resources/keystone_service_endpoint/meta.yaml b/resources/keystone_service_endpoint/meta.yaml index ad651db0..a140418e 100644 --- a/resources/keystone_service_endpoint/meta.yaml +++ b/resources/keystone_service_endpoint/meta.yaml @@ -5,36 +5,39 @@ input: keystone_host: schema: str! value: - keystone_port: + keystone_admin_port: schema: int! value: admin_token: schema: str! value: - port: - schema: int! - value: - admin_port: - schema: int! - value: type: schema: str! - value: identity description: schema: str! - value: OpenStack Identity Service + name: + schema: str! + public_ip: + schema: str! + public_port: + schema: int! publicurl: schema: str! - value: http://{{ip}}:{{port}}/v2.0 + value: http://{{public_ip}}:{{public_port}}/v2.0 + internal_ip: + schema: str! + internal_port: + schema: int! internalurl: schema: str! value: http://{{ip}}:{{port}}/v2.0 + admin_ip: + schema: str! + admin_port: + schema: int! adminurl: schema: str! value: http://{{ip}}:{{admin_port}}/v2.0 - adminurl: - schema: str! - value: ip: schema: str! value: diff --git a/templates/openstack_base.yml b/templates/openstack_base.yml index dff1c142..73268028 100644 --- a/templates/openstack_base.yml +++ b/templates/openstack_base.yml @@ -5,7 +5,7 @@ resources: from: resources/keystone_tenant values: tenant_name: admin - keystone_port: '{{keystone_port}}' + keystone_port: '{{keystone_admin_port}}' keystone_host: '{{keystone_ip}}' admin_token: '{{admin_token}}' ip: '{{ip}}' @@ -18,7 +18,7 @@ resources: user_name: 'admin' user_password: 'admin' tenant_name: 'admin_tenant::tenant_name' - keystone_port: '{{keystone_port}}' + keystone_port: '{{keystone_admin_port}}' keystone_host: '{{keystone_ip}}' admin_token: '{{admin_token}}' ip: '{{ip}}' @@ -29,15 +29,20 @@ resources: from: resources/keystone_service_endpoint values: {% raw %} - adminurl: 'http://{{keystone_ip}}:{{admin_port}}/v2.0' - internalurl: 'http://{{keystone_ip}}:{{port}}/v2.0' - publicurl: 'http://{{keystone_ip}}:{{port}}/v2.0' + adminurl: 'http://{{admin_ip}}:{{admin_port}}/v2.0' + internalurl: 'http://{{internal_ip}}:{{internal_port}}/v2.0' + publicurl: 'http://{{public_ip}}:{{public_port}}/v2.0' {% endraw %} description: 'OpenStack Identity Service' type: 'identity' - admin_port: '{{keystone_port}}' - port: '{{keystone_admin_port}}' - keystone_port: '{{keystone_port}}' + name: 'keystone' + admin_port: '{{keystone_admin_port}}' + public_port: '{{keystone_port}}' + internal_port: '{{keystone_port}}' + admin_ip: '{{ip}}' + public_ip: '{{ip}}' + internal_ip: '{{ip}}' + keystone_admin_port: '{{keystone_admin_port}}' keystone_host: '{{keystone_ip}}' admin_token: '{{admin_token}}' ip: '{{ip}}' @@ -48,7 +53,7 @@ resources: from: resources/keystone_tenant values: tenant_name: services - keystone_port: '{{keystone_port}}' + keystone_port: '{{keystone_admin_port}}' keystone_host: '{{keystone_ip}}' admin_token: '{{admin_token}}' ip: '{{ip}}'