-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Brendan Shephard <[email protected]>
- Loading branch information
Showing
1 changed file
with
44 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,9 +43,49 @@ | |
ovn_controller: "{{ lookup('template', 'kolla_ovn_controller.yaml.j2') | from_yaml }}" | ||
when: not edpm_use_bootc | ||
|
||
- name: Run ovn_controller container | ||
ansible.builtin.systemd_service: | ||
name: edpm-compute@ovn_controller | ||
state: started | ||
- name: Configure ovn_controller for bootc deployments | ||
block: | ||
- name: Collect default pod spec | ||
ansible.builtin.slurp: | ||
src: /usr/share/containers/systemd/ovn_controller.yaml | ||
register: ovn_controller_pod_spec | ||
|
||
- name: Decode and parse the YAML content | ||
ansible.builtin.set_fact: | ||
ovn_controller_pod_spec: "{{ ovn_controller_pod_spec.content | b64decode | from_yaml }}" | ||
|
||
- name: Update fields in the YAML data | ||
ansible.builtin.set_fact: | ||
updated_pod_spec: >- | ||
{{ | ||
ovn_controller_pod_spec | combine(ovn_controller_pod_spec.spec.containers.image, edpm_ovn_controller_agent_image, recursive=true) | ||
}) | ||
}} | ||
- name: Write the updated pod spec to /etc | ||
ansible.builtin.copy: | ||
content: "{{ updated_pod_spec | to_yaml }}" | ||
dest: /etc/containers/systemd/ovn_controller.yaml | ||
mode: '0644' | ||
|
||
- name: Copy systemd service template | ||
ansible.builtin.copy: | ||
remote_src: true | ||
src: /usr/share/containers/systemd/[email protected] | ||
dest: /etc/containers/systemd/[email protected] | ||
|
||
- name: Update service template Yaml path | ||
ansible.builtin.ini_file: | ||
path: /etc/containers/systemd/[email protected] | ||
section: Kube | ||
option: "Yaml" | ||
value: "/etc/containers/systemd/%i.yaml" | ||
mode: "0644" | ||
|
||
- name: Run ovn_controller container | ||
ansible.builtin.systemd_service: | ||
daemon_reload: true | ||
name: edpm-compute@ovn_controller | ||
state: started | ||
become: true | ||
when: edpm_use_bootc |