Skip to content

Commit 2c41730

Browse files
committed
feat: add support for Ubuntu 24.04
Signed-off-by: Rico Lin <rlin@vexxhost.com> Assisted-By: Codex <noreply@openai.com> Change-Id: I3c4741c992e48e650c7711b89f5806f045ecc5f9
1 parent 17c3e16 commit 2c41730

15 files changed

Lines changed: 109 additions & 19 deletions

File tree

galaxy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ description: Simple & easy private cloud platform featuring VMs, Kubernetes & ba
88
license:
99
- GPL-3.0-or-later
1010
dependencies:
11-
ansible.netcommon: 1.2.0
11+
ansible.netcommon: 8.5.0
1212
ansible.posix: 1.6.0
1313
ansible.utils: ">=2.9.0"
1414
community.crypto: 2.2.3

molecule/aio/prepare.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
state: present
2323

2424
- name: Purge "snapd" package
25-
when: ansible_distribution | lower == 'ubuntu'
25+
when: ansible_facts['distribution'] | lower == 'ubuntu'
2626
ansible.builtin.apt:
2727
name: snapd
2828
state: absent
@@ -32,7 +32,7 @@
3232
ansible.builtin.import_playbook: vexxhost.atmosphere.generate_workspace
3333
vars:
3434
workspace_path: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') }}"
35-
domain_name: "{{ ansible_default_ipv4['address'].replace('.', '-') }}.nip.io"
35+
domain_name: "{{ ansible_facts['default_ipv4']['address'].replace('.', '-') }}.nip.io"
3636

3737
- name: Setup networking
3838
hosts: all

molecule/default/group_vars/all/molecule.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ glance_images:
1010
container_format: bare
1111
is_public: true
1212

13+
magnum_images: "{{ _magnum_images[-1:] }}"
14+
1315
atmosphere_network_backend: "{{ lookup('env', 'ATMOSPHERE_NETWORK_BACKEND') | default('openvswitch', True) }}"
1416
ovn_helm_values:
1517
conf:

plugins/filter/storage.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,9 +557,28 @@ class StorageConfig(_StrictBase):
557557
)
558558

559559

560+
def _deep_unwrap(obj: Any) -> Any:
561+
"""Recursively unwrap Ansible lazy templating wrappers into plain types."""
562+
cls_name = obj.__class__.__name__
563+
if cls_name == "_LazyValue":
564+
for attr in ("_value", "value"):
565+
if hasattr(obj, attr):
566+
obj = getattr(obj, attr)
567+
break
568+
cls_name = obj.__class__.__name__
569+
570+
if isinstance(obj, dict) or cls_name == "_AnsibleLazyTemplateDict":
571+
return {_deep_unwrap(k): _deep_unwrap(v) for k, v in obj.items()}
572+
if isinstance(obj, list) or cls_name == "_AnsibleLazyTemplateList":
573+
return [_deep_unwrap(x) for x in obj]
574+
575+
return obj
576+
577+
560578
def _parse(raw: Any) -> StorageConfig:
561579
"""Validate and parse raw Ansible input into a StorageConfig."""
562-
return StorageConfig.model_validate(raw)
580+
return StorageConfig.model_validate(_deep_unwrap(raw))
581+
563582

564583

565584
def storage_to_cinder_helm_values(raw: Any) -> HelmValues:
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
features:
3+
- |
4+
Added support for Ubuntu 24.04-based Atmosphere deployments.
5+
fixes:
6+
- |
7+
Updated Molecule preparation, Magnum image selection, and Kubernetes
8+
resource rendering for compatibility with current Ansible versions.
9+
- |
10+
Fixed Open vSwitch deployments where the virtual IP init container could
11+
wait forever for an IPv4 address on ``br-ex`` before the role assigned the
12+
managed address.
13+
- |
14+
Wait for Neutron network availability zones before provisioning configured
15+
networks.

roles/ibm_block_csi_driver/tasks/main.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@
33
- name: Deploy CSI
44
kubernetes.core.k8s:
55
state: present
6-
template:
7-
- path: ibm-block-csi-operator.yaml.j2
8-
- path: csi.ibm.com_v1_ibmblockcsi_cr.yaml.j2
6+
definition: >-
7+
{{
8+
(lookup('ansible.builtin.template', 'ibm-block-csi-operator.yaml.j2') | from_yaml_all | list)
9+
+ (lookup('ansible.builtin.template', 'csi.ibm.com_v1_ibmblockcsi_cr.yaml.j2') | from_yaml_all | list)
10+
}}
911
1012
- name: Create Secret
1113
kubernetes.core.k8s:

roles/ingress/tasks/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@
1616
run_once: true
1717
kubernetes.core.k8s:
1818
state: present
19-
template: ingress.yml.j2
19+
definition: "{{ lookup('ansible.builtin.template', 'ingress.yml.j2') | from_yaml }}"

roles/keepalived/tasks/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@
5757
#!/bin/sh -x
5858
5959
while true; do
60-
ip -4 addr list dev {{ keepalived_interface }} | grep {{ keepalived_interface }}
60+
ip link show dev {{ keepalived_interface }} >/dev/null 2>&1
6161
62-
# We detected an IP address
62+
# We detected the interface that keepalived will manage.
6363
if [ $? -eq 0 ]; then
6464
break
6565
fi

roles/keystone/tasks/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
- name: Create ConfigMap with all OpenID connect configurations
6767
run_once: true
6868
kubernetes.core.k8s:
69-
template: configmap-openid-metadata.yml.j2
69+
definition: "{{ lookup('ansible.builtin.template', 'configmap-openid-metadata.yml.j2') | from_yaml }}"
7070

7171
- name: Create Keycloak clients
7272
no_log: true

roles/kube_prometheus_stack/tasks/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@
306306
run_once: true
307307
kubernetes.core.k8s:
308308
state: "{{ item.state }}"
309-
template: configmap-dashboard.yaml.j2
309+
definition: "{{ lookup('ansible.builtin.template', 'configmap-dashboard.yaml.j2') | from_yaml }}"
310310
loop:
311311
- name: haproxy
312312
state: present

0 commit comments

Comments
 (0)