aboutsummaryrefslogtreecommitdiff
path: root/ansible
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-03-01 06:11:43 +0000
committerGerrit Code Review <review@openstack.org>2016-03-01 06:11:43 +0000
commit31a7e37f0916724f2d3c0382966ac02508ea7f69 (patch)
treeb414116b327b0ade23c85235b94a9e2e0ac63d83 /ansible
parent1e68e445db3e70046d616283f1ed8f884cab0b1d (diff)
parent4edd0baf8d0356538e7d3016b17297e7c34900d4 (diff)
downloadkolla-31a7e37f0916724f2d3c0382966ac02508ea7f69.tar.gz
kolla-31a7e37f0916724f2d3c0382966ac02508ea7f69.zip
Merge "Remove keystone admin token"
Diffstat (limited to 'ansible')
-rw-r--r--ansible/roles/ironic/templates/ironic.conf.j23
-rw-r--r--ansible/roles/keystone/defaults/main.yml5
-rw-r--r--ansible/roles/keystone/tasks/register.yml42
-rw-r--r--ansible/roles/keystone/templates/keystone.conf.j22
4 files changed, 11 insertions, 41 deletions
diff --git a/ansible/roles/ironic/templates/ironic.conf.j2 b/ansible/roles/ironic/templates/ironic.conf.j2
index 53c00e2c0..57bf36f29 100644
--- a/ansible/roles/ironic/templates/ironic.conf.j2
+++ b/ansible/roles/ironic/templates/ironic.conf.j2
@@ -1,7 +1,8 @@
[DEFAULT]
debug = {{ ironic_logging_debug }}
-admin_token = {{ keystone_admin_token }}
+admin_user = {{ openstack_auth.username }}
+admin_password = {{ keystone_admin_password }}
{% if service_name == 'ironic-api' %}
[api]
diff --git a/ansible/roles/keystone/defaults/main.yml b/ansible/roles/keystone/defaults/main.yml
index 78977e1c0..e9d150768 100644
--- a/ansible/roles/keystone/defaults/main.yml
+++ b/ansible/roles/keystone/defaults/main.yml
@@ -24,7 +24,10 @@ keystone_public_address: "{{ kolla_external_fqdn }}"
keystone_admin_address: "{{ kolla_internal_fqdn }}"
keystone_internal_address: "{{ kolla_internal_fqdn }}"
+keystone_admin_url: "{{ admin_protocol }}://{{ kolla_internal_fqdn }}:{{ keystone_admin_port }}"
+keystone_internal_url: "{{ internal_protocol }}://{{ kolla_internal_fqdn }}:{{ keystone_admin_port }}"
+keystone_public_url: "{{ public_protocol }}://{{ kolla_external_fqdn }}:{{ keystone_public_port }}"
+
keystone_logging_debug: "{{ openstack_logging_debug }}"
openstack_keystone_auth: "{'auth_url':'{{ openstack_auth_v2.auth_url }}','username':'{{ openstack_auth_v2.username }}','password':'{{ openstack_auth_v2.password }}','project_name':'{{ openstack_auth_v2.project_name }}'}"
-openstack_keystone_token_auth: "{'endpoint':'{{ openstack_auth_v2.auth_url }}','token':'{{ keystone_admin_token }}'}"
diff --git a/ansible/roles/keystone/tasks/register.yml b/ansible/roles/keystone/tasks/register.yml
index 53a9f55a8..27bee9596 100644
--- a/ansible/roles/keystone/tasks/register.yml
+++ b/ansible/roles/keystone/tasks/register.yml
@@ -1,39 +1,7 @@
---
-- name: Creating the admin project, user and role
- command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
- -m kolla_keystone_user
- -a "project=admin
- user=admin
- password={{ keystone_admin_password }}
- role=admin
- region_name={{ openstack_region_name }}
- auth_type=admin_token
- auth={{ '{{ openstack_keystone_token_auth }}' }}"
- -e "{'openstack_keystone_token_auth':{{ openstack_keystone_token_auth }}}"
- register: keystone_admin_user
- changed_when: "{{ keystone_admin_user.stdout.find('localhost | SUCCESS => ') != -1 and (keystone_admin_user.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
- until: keystone_admin_user.stdout.split()[2] == 'SUCCESS'
- retries: 10
- delay: 5
- run_once: True
-
-- name: Creating the Keystone service and endpoint
- command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
- -m kolla_keystone_service
- -a "service_name=keystone
- service_type=identity
- description='Openstack Identity'
- endpoint_region={{ openstack_region_name }}
- admin_url='{{ admin_protocol }}://{{ kolla_internal_fqdn }}:{{ keystone_admin_port }}'
- internal_url='{{ internal_protocol }}://{{ kolla_internal_fqdn }}:{{ keystone_admin_port }}'
- public_url='{{ public_protocol }}://{{ kolla_external_fqdn }}:{{ keystone_public_port }}'
- region_name={{ openstack_region_name }}
- auth_type=admin_token
- auth={{ '{{ openstack_keystone_token_auth }}' }}"
- -e "{'openstack_keystone_token_auth':{{ openstack_keystone_token_auth }}}"
- register: keystone_endpoint
- changed_when: "{{ keystone_endpoint.stdout.find('localhost | SUCCESS => ') != -1 and (keystone_endpoint.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
- until: keystone_endpoint.stdout.split()[2] == 'SUCCESS'
- retries: 10
- delay: 5
+- name: Creating admin project, user, role, service, and endpoint
+ command: docker exec -t keystone kolla_keystone_bootstrap {{ openstack_auth.username }} {{ openstack_auth.password }} {{ openstack_auth.project_name }} admin {{ keystone_admin_url }} {{ keystone_internal_url }} {{ keystone_public_url }} {{ openstack_region_name }}
+ register: keystone_bootstrap
+ changed_when: "{{ (keystone_bootstrap.stdout | from_json).changed }}"
+ failed_when: "{{ (keystone_bootstrap.stdout | from_json).failed }}"
run_once: True
diff --git a/ansible/roles/keystone/templates/keystone.conf.j2 b/ansible/roles/keystone/templates/keystone.conf.j2
index 7d2ef7eb8..c911d028c 100644
--- a/ansible/roles/keystone/templates/keystone.conf.j2
+++ b/ansible/roles/keystone/templates/keystone.conf.j2
@@ -4,7 +4,5 @@ debug = {{ keystone_logging_debug }}
# NOTE(elemoine) log_dir alone does not work for Keystone
log_file = /var/log/kolla/keystone/keystone.log
-admin_token = {{ keystone_admin_token }}
-
[database]
connection = mysql+pymysql://{{ keystone_database_user }}:{{ keystone_database_password }}@{{ keystone_database_address }}/{{ keystone_database_name }}