Add removal of keystone service and endpoint

This commit is contained in:
Dmitry Shulyak 2015-06-02 15:01:16 +02:00
parent 6ea8544ed9
commit 1aae204447
2 changed files with 23 additions and 5 deletions

View File

@ -202,11 +202,15 @@ def ensure_endpoint_present(keystone, name, public_url, internal_url,
def ensure_service_absent(keystone, name, check_mode):
""" Ensure the service is absent"""
raise NotImplementedError()
service = get_service(keystone, name)
keystone.services.delete(service.id)
return True
def ensure_endpoint_absent(keystone, name, check_mode):
""" Ensure the service endpoint """
raise NotImplementedError()
endpoint = get_endpoint(keystone, name)
keystone.endpoints.delete(endpoint.id)
return True
def dispatch(keystone, name, service_type, description, public_url,

View File

@ -1,6 +1,20 @@
- hosts: [{{ ip }}]
sudo: yes
vars:
ip: {{ip}}
port: {{port}}
admin_port: {{admin_port}}
tasks:
- name: keystone service and endpoint
#TODO: not implemented in module
pause: seconds=1
- name: remove keystone service and endpoint
keystone_service:
token: {{admin_token}}
name: {{name}}
type: {{type}}
description: {{description}}
publicurl: {{publicurl}}
internalurl: {{internalurl}}
adminurl: {{adminurl}}
region: "RegionOne"
state: present
endpoint: http://{{keystone_host}}:{{keystone_port}}/v2.0/