2024-10-10 18:30:00 +00:00
|
|
|
---
|
|
|
|
- name: Ensure container image '{{ vmagent_container_image }}' is {{ vmagent_state }}
|
|
|
|
community.docker.docker_image:
|
|
|
|
name: "{{ vmagent_container_image }}"
|
|
|
|
state: "{{ vmagent_state }}"
|
|
|
|
source: "{{ vmagent_container_image_source }}"
|
|
|
|
force_source: "{{ vmagent_container_image_force_source }}"
|
|
|
|
register: vmagent_container_image_info
|
|
|
|
until: vmagent_container_image_info is success
|
|
|
|
retries: "{{ vmagent_container_image_network_retries }}"
|
|
|
|
delay: "{{ vmagent_container_image_network_delay }}"
|
|
|
|
|
|
|
|
- name: Ensure container '{{ vmagent_container_name }}' is {{ vmagent_container_state }}
|
|
|
|
community.docker.docker_container:
|
|
|
|
name: "{{ vmagent_container_name }}"
|
|
|
|
image: "{{ vmagent_container_image }}"
|
|
|
|
env: "{{ vmagent_container_merged_env }}"
|
|
|
|
user: "{{ vmagent_container_user }}"
|
|
|
|
ports: "{{ vmagent_container_ports | default(omit, true) }}"
|
|
|
|
labels: "{{ vmagent_container_labels | default(omit, true) }}"
|
|
|
|
command: "{{ vmagent_container_command }}"
|
|
|
|
volumes: "{{ vmagent_container_all_volumes }}"
|
|
|
|
networks: "{{ vmagent_container_networks | default(omit, true) }}"
|
|
|
|
etc_hosts: "{{ vmagent_container_etc_hosts | default(omit, true) }}"
|
|
|
|
dns_servers: "{{ vmagent_container_dns_servers | default(omit, true) }}"
|
2024-10-11 19:03:59 +00:00
|
|
|
network_mode: "{{ vmagent_container_network_mode | default(omit, true) }}"
|
2024-10-10 18:30:00 +00:00
|
|
|
restart_policy: "{{ vmagent_container_restart_policy | default(omit, true) }}"
|
|
|
|
state: "{{ vmagent_container_state }}"
|