tripleo-container-manage: set some defaults
Set defaults that are needed to use the role outside of THT more easily. Change-Id: Id67cf06c85a2a6b50e6494b1a66f534ccb06c4a7
This commit is contained in:
parent
115e95bcae
commit
609d7895a1
@ -18,4 +18,6 @@
|
|||||||
# All variables intended for modification should place placed in this file.
|
# All variables intended for modification should place placed in this file.
|
||||||
|
|
||||||
# All variables within this role should have a prefix of "tripleo_container_manage"
|
# All variables within this role should have a prefix of "tripleo_container_manage"
|
||||||
tripleo_container_cli: podman
|
tripleo_container_manage_cli: podman
|
||||||
|
tripleo_container_manage_log_path: '/var/log/containers/stdouts'
|
||||||
|
tripleo_container_manage_healthcheck_disabled: false
|
||||||
|
@ -39,8 +39,6 @@
|
|||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
become: true
|
become: true
|
||||||
when:
|
|
||||||
- tripleo_container_manage_log_path is defined
|
|
||||||
|
|
||||||
- name: Generate containers configs data
|
- name: Generate containers configs data
|
||||||
no_log: true
|
no_log: true
|
||||||
@ -68,7 +66,7 @@
|
|||||||
|
|
||||||
- name: Manage containers with Podman
|
- name: Manage containers with Podman
|
||||||
when:
|
when:
|
||||||
- tripleo_container_cli == 'podman'
|
- tripleo_container_manage_cli == 'podman'
|
||||||
become: true
|
become: true
|
||||||
block:
|
block:
|
||||||
- name: "Manage Podman containers at step {{ step }}"
|
- name: "Manage Podman containers at step {{ step }}"
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
- item.1.action == 'exec'
|
- item.1.action == 'exec'
|
||||||
block:
|
block:
|
||||||
- name: "Check if {{ item.1.command.0 }} container exists"
|
- name: "Check if {{ item.1.command.0 }} container exists"
|
||||||
command: "{{ tripleo_container_cli }} container exists {{ item.1.command.0 }}"
|
command: "{{ tripleo_container_manage_cli }} container exists {{ item.1.command.0 }}"
|
||||||
- name: "Check if {{ item.1.command.0 }} container is running"
|
- name: "Check if {{ item.1.command.0 }} container is running"
|
||||||
block:
|
block:
|
||||||
- name: "Gather podman infos for {{ item.1.command.0 }}"
|
- name: "Gather podman infos for {{ item.1.command.0 }}"
|
||||||
@ -35,7 +35,7 @@
|
|||||||
- name: "Prepare the exec command for {{ item.0 }}"
|
- name: "Prepare the exec command for {{ item.0 }}"
|
||||||
set_fact:
|
set_fact:
|
||||||
cmd_template:
|
cmd_template:
|
||||||
- "{{ tripleo_container_cli }}"
|
- "{{ tripleo_container_manage_cli }}"
|
||||||
- "exec"
|
- "exec"
|
||||||
- "-u"
|
- "-u"
|
||||||
- "{{ item.1.user if item.1.user is defined else 'root' }}"
|
- "{{ item.1.user if item.1.user is defined else 'root' }}"
|
||||||
@ -65,7 +65,7 @@
|
|||||||
container_name: "{{ item.0 }}"
|
container_name: "{{ item.0 }}"
|
||||||
managed_by: tripleo_ansible
|
managed_by: tripleo_ansible
|
||||||
config_data: "{{ item.1 | to_json }}"
|
config_data: "{{ item.1 | to_json }}"
|
||||||
log_driver: "{{ 'k8s-file' if tripleo_container_manage_log_path is defined else '' }}"
|
log_driver: 'k8s-file'
|
||||||
# log_opt: |
|
# log_opt: |
|
||||||
# "{{ 'path=' if tripleo_container_manage_log_path is defined else '' }}
|
# "{{ 'path=' if tripleo_container_manage_log_path is defined else '' }}
|
||||||
# {{ tripleo_container_manage_log_path | default('') }}
|
# {{ tripleo_container_manage_log_path | default('') }}
|
||||||
@ -134,7 +134,7 @@
|
|||||||
- systemd_file.changed
|
- systemd_file.changed
|
||||||
- name: "Manage systemd healthcheck for {{ item.0 }}"
|
- name: "Manage systemd healthcheck for {{ item.0 }}"
|
||||||
when:
|
when:
|
||||||
- not (container_healthcheck_disabled | default(false))
|
- not tripleo_container_manage_healthcheck_disabled
|
||||||
- item.1.healthcheck is defined
|
- item.1.healthcheck is defined
|
||||||
block:
|
block:
|
||||||
- name: "Create systemd unit file for {{ item.0 }} healthcheck"
|
- name: "Create systemd unit file for {{ item.0 }} healthcheck"
|
||||||
|
Loading…
Reference in New Issue
Block a user