---
- name: Creating the Swift service and endpoint
  kolla_toolbox:
    module_name: kolla_keystone_service
    module_args:
      service_name: "swift"
      service_type: "object-store"
      description: "Openstack Object Storage"
      endpoint_region: "{{ openstack_region_name }}"
      url: "{{ item.url }}"
      interface: "{{ item.interface }}"
      region_name: "{{ openstack_region_name }}"
      auth: "{{ openstack_ceph_rgw_auth }}"
      endpoint_type: "{{ openstack_interface }}"
  run_once: True
  with_items:
    - {'interface': 'admin', 'url': '{{ swift_admin_endpoint }}'}
    - {'interface': 'internal', 'url': '{{ swift_internal_endpoint }}'}
    - {'interface': 'public', 'url': '{{ swift_public_endpoint }}'}

- name: Registering keystone ceph_rgw user
  kolla_toolbox:
    module_name: kolla_keystone_user
    module_args:
      project: "service"
      user: "{{ ceph_rgw_keystone_user }}"
      password: "{{ ceph_rgw_keystone_password }}"
      role: "admin"
      region_name: "{{ openstack_region_name }}"
      auth: "{{ openstack_ceph_rgw_auth }}"
      endpoint_type: "{{ openstack_interface }}"
  run_once: True
