Skip to content

Commit

Permalink
Install edpm-container-shutdown to /var
Browse files Browse the repository at this point in the history
The script can't be installed to /usr/libexec when using bootc. Use
/var/local/libexec instead.

Signed-off-by: James Slagle <[email protected]>
  • Loading branch information
slagle committed Jan 21, 2025
1 parent 47595f6 commit 3816fa5
Show file tree
Hide file tree
Showing 14 changed files with 22 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ RefuseManualStop=yes
Type=oneshot
ExecStart=/bin/true
RemainAfterExit=yes
ExecStop=/usr/libexec/edpm-container-shutdown
ExecStop=/var/local/libexec/edpm-container-shutdown
# Wait at most 900 seconds for all containers to shutdown
TimeoutStopSec=900

Expand Down
11 changes: 9 additions & 2 deletions roles/edpm_container_manage/tasks/shutdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,24 @@
- name: Create EDPM Container systemd service
become: true
block:
- name: "Create /var/local/libexec dir"
file:
state: directory
path: /var/local/libexec
recurse: true
setype: container_file_t

- name: "Deploy edpm-container-shutdown and edpm-start-podman-container"
ansible.builtin.copy:
src: "{{ role_path }}/files/{{ item }}"
dest: "/usr/libexec/{{ item }}"
dest: "/var/local/libexec/{{ item }}"
mode: '0700'
owner: root
group: root
setype: container_file_t
loop:
- 'edpm-container-shutdown'
- 'edpm-start-podman-container'
when: not edpm_use_bootc

- name: "Create systemd preset dir"
ansible.builtin.file:
Expand Down
2 changes: 1 addition & 1 deletion roles/edpm_container_manage/templates/systemd-service.j2
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Wants={{ lookup('dict', container_data_unit).value.depends_on | default([]) | jo
[Service]
Restart=always
{% if lookup('dict', container_data_unit).value.depends_on is defined and (lookup('dict', container_data_unit).value.depends_on | length > 0) and podman_drop_in | default('false') %}
ExecStart=/usr/libexec/edpm-start-podman-container {{ lookup('dict', container_data_unit).key }}
ExecStart=/var/local/libexec/edpm-start-podman-container {{ lookup('dict', container_data_unit).key }}
{% else %}
ExecStart=/usr/bin/podman start {{ lookup('dict', container_data_unit).key }}
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion roles/edpm_frr/tasks/run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# License for the specific language governing permissions and limitations
# under the License.

- name: Ensure /usr/libexec/edpm-start-podman-container exists
- name: Ensure /var/local/libexec/edpm-start-podman-container exists
ansible.builtin.import_role:
name: edpm_container_manage
tasks_from: shutdown.yml
Expand Down
2 changes: 1 addition & 1 deletion roles/edpm_iscsid/tasks/run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# License for the specific language governing permissions and limitations
# under the License.

- name: Ensure /usr/libexec/edpm-start-podman-container exists
- name: Ensure /var/local/libexec/edpm-start-podman-container exists
ansible.builtin.import_role:
name: edpm_container_manage
tasks_from: shutdown.yml
Expand Down
2 changes: 1 addition & 1 deletion roles/edpm_multipathd/tasks/run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# License for the specific language governing permissions and limitations
# under the License.

- name: Ensure /usr/libexec/edpm-start-podman-container exists
- name: Ensure /var/local/libexec/edpm-start-podman-container exists
ansible.builtin.import_role:
name: edpm_container_manage
tasks_from: shutdown.yml
Expand Down
2 changes: 1 addition & 1 deletion roles/edpm_neutron_dhcp/tasks/run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
- "{{ edpm_neutron_dhcp_tls_cacert_bundle_src }}:{{ edpm_neutron_dhcp_tls_cacert_bundle_dest }}:ro,z"
when: cacert_bundle_exists.stat.exists

- name: Ensure /usr/libexec/edpm-start-podman-container exists
- name: Ensure /var/local/libexec/edpm-start-podman-container exists
ansible.builtin.import_role:
name: edpm_container_manage
tasks_from: shutdown.yml
Expand Down
2 changes: 1 addition & 1 deletion roles/edpm_neutron_metadata/tasks/run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
- "{{ edpm_neutron_metadata_tls_cacert_bundle_src }}:{{ edpm_neutron_metadata_tls_cacert_bundle_dest }}:ro,z"
when: cacert_bundle_exists.stat.exists

- name: Ensure /usr/libexec/edpm-start-podman-container exists
- name: Ensure /var/local/libexec/edpm-start-podman-container exists
ansible.builtin.import_role:
name: edpm_container_manage
tasks_from: shutdown.yml
Expand Down
2 changes: 1 addition & 1 deletion roles/edpm_neutron_ovn/tasks/run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
- "{{ edpm_neutron_ovn_tls_cacert_bundle_src }}:{{ edpm_neutron_ovn_tls_cacert_bundle_dest }}:ro,z"
when: cacert_bundle_exists.stat.exists

- name: Ensure /usr/libexec/edpm-start-podman-container exists
- name: Ensure /var/local/libexec/edpm-start-podman-container exists
ansible.builtin.import_role:
name: edpm_container_manage
tasks_from: shutdown.yml
Expand Down
2 changes: 1 addition & 1 deletion roles/edpm_neutron_sriov/tasks/run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
- "{{ edpm_neutron_sriov_tls_cacert_bundle_src }}:{{ edpm_neutron_sriov_tls_cacert_bundle_dest }}:ro,z"
when: cacert_bundle_exists.stat.exists

- name: Ensure /usr/libexec/edpm-start-podman-container exists
- name: Ensure /var/local/libexec/edpm-start-podman-container exists
ansible.builtin.import_role:
name: edpm_container_manage
tasks_from: shutdown.yml
Expand Down
2 changes: 1 addition & 1 deletion roles/edpm_ovn/tasks/run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
- "{{ edpm_ovn_controller_tls_cacert_bundle_src }}:{{ edpm_ovn_controller_tls_cacert_bundle_dest }}:ro,z"
when: cacert_bundle_exists.stat.exists

- name: Ensure /usr/libexec/edpm-start-podman-container exists
- name: Ensure /var/local/libexec/edpm-start-podman-container exists
ansible.builtin.import_role:
name: edpm_container_manage
tasks_from: shutdown.yml
Expand Down
2 changes: 1 addition & 1 deletion roles/edpm_ovn_bgp_agent/tasks/run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
- "{{ edpm_ovn_bgp_agent_tls_cacert_bundle_src }}:{{ edpm_ovn_bgp_agent_tls_cacert_bundle_dest }}:ro,z"
when: cacert_bundle_exists.stat.exists

- name: Ensure /usr/libexec/edpm-start-podman-container exists
- name: Ensure /var/local/libexec/edpm-start-podman-container exists
ansible.builtin.import_role:
name: osp.edpm.edpm_container_manage
tasks_from: shutdown.yml
Expand Down
2 changes: 1 addition & 1 deletion roles/edpm_ovn_bgp_agent/tasks/run_ovn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
- "{{ edpm_ovn_bgp_agent_tls_cacert_bundle_src }}:{{ edpm_ovn_bgp_agent_tls_cacert_bundle_dest }}:ro,z"
when: cacert_bundle_exists.stat.exists

- name: Ensure /usr/libexec/edpm-start-podman-container exists
- name: Ensure /var/local/libexec/edpm-start-podman-container exists
ansible.builtin.import_role:
name: edpm_container_manage
tasks_from: shutdown.yml
Expand Down
2 changes: 1 addition & 1 deletion roles/edpm_swift/tasks/run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# License for the specific language governing permissions and limitations
# under the License.

- name: Ensure /usr/libexec/edpm-start-podman-container exists
- name: Ensure /var/local/libexec/edpm-start-podman-container exists
ansible.builtin.import_role:
name: edpm_container_manage
tasks_from: shutdown.yml
Expand Down

0 comments on commit 3816fa5

Please sign in to comment.