2021-03-17 09:15:52 +00:00
|
|
|
---
|
|
|
|
|
|
|
|
- name: Create hedwig system user
|
|
|
|
user:
|
|
|
|
name: "{{ hedwig_user }}"
|
|
|
|
state: present
|
|
|
|
system: yes
|
|
|
|
register: hedwig_user_res
|
|
|
|
|
|
|
|
- name: Ensure host directories are present
|
|
|
|
file:
|
|
|
|
path: "{{ hedwig_base_path }}"
|
|
|
|
state: directory
|
|
|
|
owner: "{{ hedwig_user_res.uid }}"
|
|
|
|
group: "{{ hedwig_user_res.group }}"
|
|
|
|
|
|
|
|
- name: Template configuration file for hedwig
|
2021-05-10 05:03:27 +00:00
|
|
|
copy:
|
|
|
|
content: "{{ hedwig_config | to_nice_yaml(indent=2, width=1000) }}"
|
2021-03-17 09:15:52 +00:00
|
|
|
dest: "{{ hedwig_config_file }}"
|
|
|
|
owner: "{{ hedwig_user_res.uid }}"
|
|
|
|
group: "{{ hedwig_user_res.group }}"
|
|
|
|
mode: 0770
|
2021-04-26 07:13:45 +00:00
|
|
|
notify: restart-hedwig
|
2021-03-17 09:15:52 +00:00
|
|
|
|
|
|
|
- name: Start hedwig container
|
|
|
|
docker_container:
|
|
|
|
name: "{{ hedwig_container_name }}"
|
|
|
|
image: "{{ hedwig_container_image }}"
|
|
|
|
env: "{{ hedwig_container_env }}"
|
|
|
|
user: "{{ hedwig_user_res.uid }}:{{ hedwig_user_res.group }}"
|
|
|
|
ports: "{{ hedwig_container_ports }}"
|
2021-04-22 12:09:53 +00:00
|
|
|
labels: "{{ hedwig_container_labels_complete }}"
|
2021-03-17 09:15:52 +00:00
|
|
|
volumes: "{{ hedwig_container_volumes }}"
|
|
|
|
restart_policy: "{{ hedwig_container_restart_policy }}"
|
|
|
|
pull: true
|
|
|
|
healthcheck:
|
2021-05-10 05:03:27 +00:00
|
|
|
test: "curl http://127.0.0.1:{{ hedwig_server_port }}/health || exit 1"
|
2021-04-26 07:13:45 +00:00
|
|
|
state: started
|