aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docker/kolla-toolbox/Dockerfile.j24
-rw-r--r--docker/kolla-toolbox/kolla_keystone_service.py103
-rw-r--r--docker/kolla-toolbox/kolla_keystone_user.py91
-rw-r--r--releasenotes/notes/remove-kolla-keystone-modules-21f9034dd3a2aedb.yaml7
4 files changed, 8 insertions, 197 deletions
diff --git a/docker/kolla-toolbox/Dockerfile.j2 b/docker/kolla-toolbox/Dockerfile.j2
index 7de3930b0..3d699b58f 100644
--- a/docker/kolla-toolbox/Dockerfile.j2
+++ b/docker/kolla-toolbox/Dockerfile.j2
@@ -97,11 +97,9 @@ RUN mkdir -p /requirements \
ENV ANSIBLE_LIBRARY /usr/share/ansible:$ANSIBLE_LIBRARY
-COPY find_disks.py kolla_keystone_service.py kolla_keystone_user.py kolla_sanity.py /usr/share/ansible/
+COPY find_disks.py kolla_sanity.py /usr/share/ansible/
COPY ansible.cfg /var/lib/ansible/.ansible.cfg
RUN chmod 644 /usr/share/ansible/find_disks.py \
- /usr/share/ansible/kolla_keystone_service.py \
- /usr/share/ansible/kolla_keystone_user.py \
/usr/share/ansible/kolla_sanity.py \
/var/lib/ansible/.ansible.cfg
diff --git a/docker/kolla-toolbox/kolla_keystone_service.py b/docker/kolla-toolbox/kolla_keystone_service.py
deleted file mode 100644
index 74db35385..000000000
--- a/docker/kolla-toolbox/kolla_keystone_service.py
+++ /dev/null
@@ -1,103 +0,0 @@
-#!/usr/bin/python
-
-# Copyright 2015 Sam Yaple
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# This file is a barebones file needed to file a gap until Ansible 2.0. No
-# error checking, no deletions, no updates. Idempotent creation only.
-
-# If you look closely, you will see we arent _really_ using the shade module
-# we just use it to slightly abstract the authentication model. As patches land
-# in upstream shade we will be able to use more of the shade module. Until then
-# if we want to be 'stable' we really need to be using it as a passthrough
-
-import traceback
-
-import shade
-
-from ansible.module_utils.basic import AnsibleModule
-from ansible.module_utils.openstack import openstack_full_argument_spec
-
-
-def main():
- argument_spec = openstack_full_argument_spec(
- description=dict(required=True, type='str'),
- service_name=dict(required=True, type='str'),
- service_type=dict(required=True, type='str'),
- url=dict(required=True, type='str'),
- interface=dict(required=True, type='str'),
- endpoint_region=dict(required=True, type='str'),
- endpoint_type=dict(type='str')
- )
- module = AnsibleModule(argument_spec)
-
- try:
- description = module.params.pop('description')
- service_name = module.params.pop('service_name')
- service_type = module.params.pop('service_type')
- url = module.params.pop('url')
- interface = module.params.pop('interface')
- endpoint_region = module.params.pop('endpoint_region')
-
- changed = False
- service = None
- endpoint = None
-
- cloud = shade.operator_cloud(**module.params)
-
- for _service in cloud.keystone_client.services.list():
- if _service.type == service_type:
- service = _service
- service_description = getattr(service, 'description', None)
- if service.name != service_name or \
- service_description != description:
- changed = True
- cloud.keystone_client.services.update(
- service,
- name=service_name,
- description=description)
- break
- else:
- changed = True
- service = cloud.keystone_client.services.create(
- name=service_name,
- service_type=service_type,
- description=description)
-
- for _endpoint in cloud.keystone_client.endpoints.list():
- if _endpoint.service_id == service.id and \
- _endpoint.interface == interface and \
- _endpoint.region == endpoint_region:
- endpoint = _endpoint
- if endpoint.url != url:
- changed = True
- cloud.keystone_client.endpoints.update(
- endpoint, url=url)
- break
- else:
- changed = True
- cloud.keystone_client.endpoints.create(
- service=service.id,
- url=url,
- interface=interface,
- region=endpoint_region)
-
- module.exit_json(changed=changed)
- except Exception:
- module.exit_json(failed=True, changed=True,
- msg=repr(traceback.format_exc()))
-
-
-if __name__ == '__main__':
- main()
diff --git a/docker/kolla-toolbox/kolla_keystone_user.py b/docker/kolla-toolbox/kolla_keystone_user.py
deleted file mode 100644
index c9631cd7c..000000000
--- a/docker/kolla-toolbox/kolla_keystone_user.py
+++ /dev/null
@@ -1,91 +0,0 @@
-#!/usr/bin/python
-
-# Copyright 2015 Sam Yaple
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-import traceback
-
-import shade
-
-from ansible.module_utils.basic import AnsibleModule
-from ansible.module_utils.openstack import openstack_full_argument_spec
-
-
-def main():
- argument_spec = openstack_full_argument_spec(
- password=dict(required=True, type='str', no_log=True),
- project=dict(required=True, type='str'),
- role=dict(required=True, type='str'),
- user=dict(required=True, type='str')
- )
- module = AnsibleModule(argument_spec)
-
- try:
- password = module.params.pop('password')
- project_name = module.params.pop('project')
- role_name = module.params.pop('role')
- user_name = module.params.pop('user')
-
- changed = False
- project = None
- role = None
- user = None
-
- cloud = shade.OperatorCloud(**module.params)
-
- for _project in cloud.search_projects():
- if _project.name == project_name:
- project = _project
-
- for _role in cloud.search_roles():
- if _role.name == role_name:
- role = _role
-
- for _user in cloud.search_users():
- if _user.name == user_name:
- user = _user
-
- if not project:
- changed = True
- project = cloud.create_project(project_name,
- domain_id='default')
-
- if not role:
- changed = True
- role = cloud.create_role(role_name)
-
- if not user:
- changed = True
- user = cloud.create_user(user_name,
- password=password,
- default_project=project,
- domain_id='default')
- role_assignments = cloud.keystone_client.role_assignments
- assignment = role_assignments.list(user=user,
- project=project,
- role=role)
- if not assignment:
- changed = True
- cloud.grant_role(role,
- user=user,
- project=project)
-
- module.exit_json(changed=changed)
- except Exception:
- module.exit_json(failed=True, changed=True,
- msg=repr(traceback.format_exc()))
-
-
-if __name__ == '__main__':
- main()
diff --git a/releasenotes/notes/remove-kolla-keystone-modules-21f9034dd3a2aedb.yaml b/releasenotes/notes/remove-kolla-keystone-modules-21f9034dd3a2aedb.yaml
new file mode 100644
index 000000000..6e75280a9
--- /dev/null
+++ b/releasenotes/notes/remove-kolla-keystone-modules-21f9034dd3a2aedb.yaml
@@ -0,0 +1,7 @@
+---
+upgrade:
+ - |
+ The Ansible modules ``kolla_keystone_user`` and ``kolla_keystone_service``
+ have been removed from the ``kolla-toolbox`` image. These were previously
+ used by Kolla Ansible, which switched to the upstream Ansible modules in
+ the Train release.