[stable/zed] feat: containerize openstack cli (#1173)
This is an automated cherry-pick of #972
/assign mnaser
diff --git a/roles/openstacksdk/defaults/main.yml b/roles/openstacksdk/defaults/main.yml
new file mode 100644
index 0000000..27dc31a
--- /dev/null
+++ b/roles/openstacksdk/defaults/main.yml
@@ -0,0 +1,15 @@
+# Copyright (c) 2024 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.
+
+openstacksdk_version: "0.61.0"
diff --git a/roles/openstacksdk/tasks/main.yml b/roles/openstacksdk/tasks/main.yml
index 724f291..1a4c3b4 100644
--- a/roles/openstacksdk/tasks/main.yml
+++ b/roles/openstacksdk/tasks/main.yml
@@ -1,4 +1,4 @@
-# Copyright (c) 2022 VEXXHOST, Inc.
+# Copyright (c) 2024 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
@@ -14,7 +14,8 @@
- name: Install openstacksdk
ansible.builtin.pip:
- name: openstacksdk==0.61.0
+ name: openstacksdk
+ version: "{{ openstacksdk_version }}"
- name: Create openstack config directory
become: true
@@ -32,4 +33,4 @@
dest: /etc/openstack/clouds.yaml
owner: root
group: root
- mode: '0600'
+ mode: "0600"
diff --git a/roles/openstacksdk/templates/clouds.yaml.j2 b/roles/openstacksdk/templates/clouds.yaml.j2
index b855a63..efb2245 100644
--- a/roles/openstacksdk/templates/clouds.yaml.j2
+++ b/roles/openstacksdk/templates/clouds.yaml.j2
@@ -9,5 +9,5 @@
project_domain_name: Default
region_name: "{{ openstack_helm_endpoints_keystone_region_name }}"
{% if cluster_issuer_type is defined and cluster_issuer_type in ('self-signed', 'ca') %}
- cacert: /usr/local/share/ca-certificates/atmosphere.crt
+ cacert: "{{ '/usr/local/share/ca-certificates' if ansible_facts['os_family'] in ['Debian'] else '/etc/pki/ca-trust/source/anchors' }}/atmosphere.crt"
{% endif %}