| # Copyright (c) 2022 VEXXHOST, Inc. |
| # |
| # 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. |
| |
| - name: Deploy Helm chart |
| run_once: true |
| kubernetes.core.helm: |
| name: "{{ barbican_helm_release_name }}" |
| chart_ref: "{{ barbican_helm_chart_ref }}" |
| release_namespace: "{{ barbican_helm_release_namespace }}" |
| create_namespace: true |
| kubeconfig: "{{ barbican_helm_kubeconfig }}" |
| values: "{{ _barbican_helm_values | combine(barbican_helm_values, recursive=True) }}" |
| |
| - name: Create Ingress |
| ansible.builtin.include_role: |
| name: openstack_helm_ingress |
| vars: |
| openstack_helm_ingress_endpoint: key_manager |
| openstack_helm_ingress_service_name: barbican-api |
| openstack_helm_ingress_service_port: 9311 |
| openstack_helm_ingress_annotations: "{{ barbican_ingress_annotations }}" |
| openstack_helm_ingress_class_name: "{{ barbican_ingress_class_name }}" |
| |
| - name: Create creator role |
| openstack.cloud.identity_role: |
| cloud: atmosphere |
| state: present |
| name: creator |
| |
| - name: Add implied roles |
| run_once: true |
| ansible.builtin.shell: | |
| set -o posix |
| source /etc/profile.d/atmosphere.sh |
| openstack implied role create \ |
| --implied-role {{ item.implies }} \ |
| {{ item.role }} |
| args: |
| executable: /bin/bash |
| loop: |
| - role: member |
| implies: creator |
| environment: |
| OS_CLOUD: atmosphere |
| register: _octavia_implied_role_create |
| changed_when: _octavia_implied_role_create.rc == 0 |
| failed_when: _octavia_implied_role_create.rc != 0 and 'Duplicate entry.' not in _octavia_implied_role_create.stderr |
| retries: 10 |
| delay: 1 |
| until: _octavia_implied_role_create.rc == 0 or 'Duplicate entry.' in _octavia_implied_role_create.stderr |