Glance: more configs, keystone_user fix

This commit is contained in:
Przemyslaw Kaminski 2015-05-29 16:13:54 +02:00
parent 6176cf0e17
commit 5ced9d62b4
7 changed files with 27 additions and 3 deletions

View File

@ -23,6 +23,7 @@
- file: path={{ config_dir.value['src'] }}/glance-scrubber.conf state=touch - file: path={{ config_dir.value['src'] }}/glance-scrubber.conf state=touch
- file: path={{ config_dir.value['src'] }}/policy.json state=touch - file: path={{ config_dir.value['src'] }}/policy.json state=touch
- file: path={{ config_dir.value['src'] }}/schema-image.json state=touch - file: path={{ config_dir.value['src'] }}/schema-image.json state=touch
- file: path={{ config_dir.value['src'] }}/exports state=touch
- template: src={{ resource_dir }}/templates/glance-api.conf dest={{ config_dir.value['src'] }}/glance-api.conf - template: src={{ resource_dir }}/templates/glance-api.conf dest={{ config_dir.value['src'] }}/glance-api.conf
- template: src={{ resource_dir }}/templates/glance-api-paste.ini dest={{ config_dir.value['src'] }}/glance-api-paste.ini - template: src={{ resource_dir }}/templates/glance-api-paste.ini dest={{ config_dir.value['src'] }}/glance-api-paste.ini
- template: src={{ resource_dir }}/templates/glance-cache.conf dest={{ config_dir.value['src'] }}/glance-cache.conf - template: src={{ resource_dir }}/templates/glance-cache.conf dest={{ config_dir.value['src'] }}/glance-cache.conf
@ -31,3 +32,4 @@
- template: src={{ resource_dir }}/templates/glance-scrubber.conf dest={{ config_dir.value['src'] }}/glance-scrubber.conf - template: src={{ resource_dir }}/templates/glance-scrubber.conf dest={{ config_dir.value['src'] }}/glance-scrubber.conf
- template: src={{ resource_dir }}/templates/policy.json dest={{ config_dir.value['src'] }}/policy.json - template: src={{ resource_dir }}/templates/policy.json dest={{ config_dir.value['src'] }}/policy.json
- template: src={{ resource_dir }}/templates/schema-image.json dest={{ config_dir.value['src'] }}/schema-image.json - template: src={{ resource_dir }}/templates/schema-image.json dest={{ config_dir.value['src'] }}/schema-image.json
- template: src={{ resource_dir }}/templates/exports dest={{ config_dir.value['src'] }}/glance-export

View File

@ -0,0 +1,4 @@
export OS_TENANT_NAME={{ keystone_admin_tenant }}
export OS_USERNAME={{ keystone_admin_user }}
export OS_PASSWORD={{ keystone_admin_password }}
export OS_AUTH_URL=http://{{ keystone_ip }}:35357/v2.0

View File

@ -2,6 +2,8 @@
sudo: yes sudo: yes
vars: vars:
admin_token: {{admin_token}} admin_token: {{admin_token}}
keystone_host: {{ ip }}
keystone_port: {{ port }}
db_user: {{db_user}} db_user: {{db_user}}
db_password: {{db_password}} db_password: {{db_password}}
db_host: {{db_host}} db_host: {{db_host}}
@ -12,3 +14,4 @@
- template: src={{resource_dir}}/templates/default_catalog.templates dest={{config_dir}}/default_catalog.templates - template: src={{resource_dir}}/templates/default_catalog.templates dest={{config_dir}}/default_catalog.templates
- template: src={{resource_dir}}/templates/logging.conf dest={{config_dir}}/logging.conf - template: src={{resource_dir}}/templates/logging.conf dest={{config_dir}}/logging.conf
- template: src={{resource_dir}}/templates/policy.json dest={{config_dir}}/policy.json - template: src={{resource_dir}}/templates/policy.json dest={{config_dir}}/policy.json
- template: src={{resource_dir}}/templates/exports dest={{ config_dir }}/keystone-exports

View File

@ -0,0 +1,2 @@
export OS_SERVICE_ENDPOINT=http://localhost:35357/v2.0/
export OS_SERVICE_TOKEN={{ admin_token }}

View File

@ -1,6 +1,11 @@
- hosts: [{{ ip }}] - hosts: [{{ ip }}]
sudo: yes sudo: yes
tasks: tasks:
- name: install python-keystoneclient
shell: pip install python-keystoneclient
- name: keystone tenant
keystone_user: endpoint=http://localhost:35357/v2.0/ tenant={{ tenant_name }} token={{ login_token }} state=present
- name: keystone user - name: keystone user
- keystone_user: endpoint=http://{{ keystone_host }}:{{ keystone_port }}/v2.0/ tenant={{ tenant_name }} token={{ login_token }} state=present keystone_user: endpoint=http://localhost:35357/v2.0/ user={{ user_name }} password={{ user_password }} tenant={{ tenant_name }} token={{ login_token }} state=present
- keystone_user: endpoint=http://{{ keystone_host }}:{{ keystone_port }}/v2.0/ user={{ user_name }} password={{ user_password }} tenant={{ tenant_name }} token={{ login_token }} state=present - name: keystone role
keystone_user: endpoint=http://localhost:35357/v2.0/ role={{ role_name }} user={{ user_name }} tenant={{ tenant_name }} token={{ login_token }} state=present

View File

@ -5,7 +5,7 @@ input:
keystone_host: keystone_host:
schema: str! schema: str!
value: value:
keystone_port: keystone_admin_port:
schema: int! schema: int!
value: value:
login_user: login_user:
@ -14,6 +14,9 @@ input:
login_token: login_token:
schema: str! schema: str!
value: value:
role_name:
schema: str!
value:
user_name: user_name:
schema: str! schema: str!
value: value:

View File

@ -10,3 +10,8 @@
- {{ port }}:3306 - {{ port }}:3306
env: env:
MYSQL_ROOT_PASSWORD: {{ root_password }} MYSQL_ROOT_PASSWORD: {{ root_password }}
- shell: docker exec -t {{ name }} mysql -p{{ root_password }} -uroot -e "select 1"
register: result
until: result.rc == 0
retries: 10
delay: 0.5