Files
kolla-ansible/ansible/roles/cloudkitty/tasks/register.yml
Christian Berendt e3f4d45d3a User os_keystone_role to create cloudkitty rating role
TrivialFix

Change-Id: I11ac0ffb814f3b2a0c60daf93ed22746e4d399bf
2016-09-15 13:45:16 +02:00

54 lines
2.4 KiB
YAML

---
- name: Creating the Cloudkitty service and endpoint
command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
-m kolla_keystone_service
-a "service_name=cloudkitty
service_type=rating
description='OpenStack Rating'
endpoint_region={{ openstack_region_name }}
url='{{ item.url }}'
interface='{{ item.interface }}'
region_name={{ openstack_region_name }}
auth={{ '{{ openstack_cloudkitty_auth }}' }}"
-e "{'openstack_cloudkitty_auth':{{ openstack_cloudkitty_auth }}}"
register: cloudkitty_endpoint
changed_when: "{{ cloudkitty_endpoint.stdout.find('localhost | SUCCESS => ') != -1 and (cloudkitty_endpoint.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
until: cloudkitty_endpoint.stdout.split()[2] == 'SUCCESS'
retries: 10
delay: 5
run_once: True
with_items:
- {'interface': 'admin', 'url': '{{ cloudkitty_admin_endpoint }}'}
- {'interface': 'internal', 'url': '{{ cloudkitty_internal_endpoint }}'}
- {'interface': 'public', 'url': '{{ cloudkitty_public_endpoint }}'}
- name: Creating the Cloudkitty project, user, and role
command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
-m kolla_keystone_user
-a "project=service
user=cloudkitty
password={{ cloudkitty_keystone_password }}
role=admin
region_name={{ openstack_region_name }}
auth={{ '{{ openstack_cloudkitty_auth }}' }}"
-e "{'openstack_cloudkitty_auth':{{ openstack_cloudkitty_auth }}}"
register: cloudkitty_user
changed_when: "{{ cloudkitty_user.stdout.find('localhost | SUCCESS => ') != -1 and (cloudkitty_user.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
until: cloudkitty_user.stdout.split()[2] == 'SUCCESS'
retries: 10
delay: 5
run_once: True
- name: Creating the rating role
command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
-m os_keystone_role
-a "name={{ cloudkitty_openstack_keystone_default_role }}
auth={{ '{{ openstack_cloudkitty_auth }}' }}"
-e "{'openstack_cloudkitty_auth':{{ openstack_cloudkitty_auth }}}"
register: cloudkitty_role
changed_when: "{{ cloudkitty_role.stdout.find('localhost | SUCCESS => ') != -1 and (cloudkitty_role.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
until: cloudkitty_role.stdout.split()[2] == 'SUCCESS'
retries: 10
delay: 5
run_once: True