Optimize the yaml format for Barbican check.yml

1. Optimize the yaml format
2. Change the "shell" to "command" for task "fetch secret"
and "cleaning up"

refor to
https://github.com/openstack/kolla-ansible/blob/master/ansible/roles/nova/tasks/simple_cell_setup.yml#L3

Change-Id: Ia6c670ff1349888f6c8a350052e3b170693e12b1
This commit is contained in:
caoyuan 2017-09-25 13:34:59 +08:00
parent d6200ab131
commit 6134de26e3

View File

@ -1,33 +1,36 @@
--- ---
- name: Barbican sanity - storing a secret - name: Barbican sanity - storing a secret
shell: docker exec -t barbican_api openstack \ shell: >
--os-auth-url={{ openstack_auth.auth_url }} \ docker exec -t barbican_api openstack \
--os-password={{ openstack_auth.password }} \ --os-auth-url={{ openstack_auth.auth_url }} \
--os-username={{ openstack_auth.username }} \ --os-password={{ openstack_auth.password }} \
--os-project-name={{ openstack_auth.project_name }} \ --os-username={{ openstack_auth.username }} \
secret store -f value -p kolla | head -1 --os-project-name={{ openstack_auth.project_name }} \
secret store -f value -p kolla | head -1
register: barbican_store_secret register: barbican_store_secret
run_once: True run_once: True
when: kolla_enable_sanity_barbican | bool when: kolla_enable_sanity_barbican | bool
- name: Barbican sanity - fetch secret - name: Barbican sanity - fetch secret
shell: docker exec -t barbican_api openstack \ command: >
--os-auth-url={{ openstack_auth.auth_url }} \ docker exec -t barbican_api openstack
--os-password={{ openstack_auth.password }} \ --os-auth-url={{ openstack_auth.auth_url }}
--os-username={{ openstack_auth.username }} \ --os-password={{ openstack_auth.password }}
--os-project-name={{ openstack_auth.project_name }} \ --os-username={{ openstack_auth.username }}
secret get -f value -p {{ barbican_store_secret.stdout }} --os-project-name={{ openstack_auth.project_name }}
secret get -f value -p {{ barbican_store_secret.stdout }}
register: barbican_get_secret register: barbican_get_secret
failed_when: barbican_get_secret.stdout != 'kolla' failed_when: barbican_get_secret.stdout != 'kolla'
run_once: True run_once: True
when: kolla_enable_sanity_barbican | bool when: kolla_enable_sanity_barbican | bool
- name: Barbican sanity - cleaning up - name: Barbican sanity - cleaning up
shell: docker exec -t barbican_api openstack \ command: >
--os-auth-url={{ openstack_auth.auth_url }} \ docker exec -t barbican_api openstack
--os-password={{ openstack_auth.password }} \ --os-auth-url={{ openstack_auth.auth_url }}
--os-username={{ openstack_auth.username }} \ --os-password={{ openstack_auth.password }}
--os-project-name={{ openstack_auth.project_name }} \ --os-username={{ openstack_auth.username }}
secret delete {{ barbican_store_secret.stdout }} --os-project-name={{ openstack_auth.project_name }}
secret delete {{ barbican_store_secret.stdout }}
run_once: True run_once: True
when: kolla_enable_sanity_barbican | bool when: kolla_enable_sanity_barbican | bool