Update functionality
This commit is contained in:
@@ -46,3 +46,16 @@
|
||||
tags:
|
||||
- podman
|
||||
- podman-containers
|
||||
|
||||
- name: Generate systemd services
|
||||
ansible.builtin.include_tasks: systemd.yml
|
||||
when: podman_generate_systemd | bool
|
||||
tags:
|
||||
- podman
|
||||
- podman-systemd
|
||||
|
||||
- name: Prune unused resources
|
||||
ansible.builtin.include_tasks: prune.yml
|
||||
tags:
|
||||
- podman
|
||||
- podman-prune
|
||||
|
||||
12
tasks/prune.yml
Normal file
12
tasks/prune.yml
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
# Prune unused Podman resources
|
||||
|
||||
- name: Prune Podman resources
|
||||
containers.podman.podman_prune:
|
||||
container: "{{ podman_prune_options.container }}"
|
||||
image: "{{ podman_prune_options.image }}"
|
||||
network: "{{ podman_prune_options.network }}"
|
||||
system: "{{ podman_prune_options.system }}"
|
||||
system_all: "{{ podman_prune_options.system_all }}"
|
||||
volume: "{{ podman_prune_options.volume }}"
|
||||
when: podman_prune_enabled | bool
|
||||
50
tasks/systemd.yml
Normal file
50
tasks/systemd.yml
Normal file
@@ -0,0 +1,50 @@
|
||||
---
|
||||
# Generate systemd service files for Podman containers and pods
|
||||
|
||||
- name: Generate systemd service files for containers
|
||||
containers.podman.podman_generate_systemd:
|
||||
name: "{{ item.name }}"
|
||||
dest: "{{ podman_systemd_dir }}"
|
||||
new: "{{ podman_systemd_options.new }}"
|
||||
force: "{{ podman_systemd_options.force }}"
|
||||
restart_policy: "{{ item.systemd.restart_policy | default(podman_systemd_options.restart_policy) }}"
|
||||
time: "{{ item.systemd.time | default(podman_systemd_options.time) }}"
|
||||
no_header: "{{ item.systemd.no_header | default(podman_systemd_options.no_header) }}"
|
||||
separator: "{{ item.systemd.separator | default(podman_systemd_options.separator) }}"
|
||||
wants: "{{ item.systemd.wants | default(podman_systemd_options.wants) }}"
|
||||
after: "{{ item.systemd.after | default(podman_systemd_options.after) }}"
|
||||
requires: "{{ item.systemd.requires | default(podman_systemd_options.requires) }}"
|
||||
container_prefix: "{{ item.systemd.container_prefix | default(podman_systemd_options.container_prefix) }}"
|
||||
pod_prefix: "{{ item.systemd.pod_prefix | default(podman_systemd_options.pod_prefix) }}"
|
||||
loop: "{{ podman_containers | selectattr('systemd', 'defined') | list }}"
|
||||
loop_control:
|
||||
label: "{{ item.name }}"
|
||||
when:
|
||||
- podman_generate_systemd | bool
|
||||
- podman_containers is defined
|
||||
- podman_containers | length > 0
|
||||
notify: Reload systemd
|
||||
|
||||
- name: Generate systemd service files for pods
|
||||
containers.podman.podman_generate_systemd:
|
||||
name: "{{ item.name }}"
|
||||
dest: "{{ podman_systemd_dir }}"
|
||||
new: "{{ podman_systemd_options.new }}"
|
||||
force: "{{ podman_systemd_options.force }}"
|
||||
restart_policy: "{{ item.systemd.restart_policy | default(podman_systemd_options.restart_policy) }}"
|
||||
time: "{{ item.systemd.time | default(podman_systemd_options.time) }}"
|
||||
no_header: "{{ item.systemd.no_header | default(podman_systemd_options.no_header) }}"
|
||||
separator: "{{ item.systemd.separator | default(podman_systemd_options.separator) }}"
|
||||
wants: "{{ item.systemd.wants | default(podman_systemd_options.wants) }}"
|
||||
after: "{{ item.systemd.after | default(podman_systemd_options.after) }}"
|
||||
requires: "{{ item.systemd.requires | default(podman_systemd_options.requires) }}"
|
||||
container_prefix: "{{ item.systemd.container_prefix | default(podman_systemd_options.container_prefix) }}"
|
||||
pod_prefix: "{{ item.systemd.pod_prefix | default(podman_systemd_options.pod_prefix) }}"
|
||||
loop: "{{ podman_pods | selectattr('systemd', 'defined') | list }}"
|
||||
loop_control:
|
||||
label: "{{ item.name }}"
|
||||
when:
|
||||
- podman_generate_systemd | bool
|
||||
- podman_pods is defined
|
||||
- podman_pods | length > 0
|
||||
notify: Reload systemd
|
||||
Reference in New Issue
Block a user