chore(barad-dur): general maintenance

- added tags
- fixed file modes
- seperate container pulling and starting
This commit is contained in:
Lars Kaiser 2023-04-19 16:41:30 +02:00
parent fdcb1c23ff
commit abcc898254
No known key found for this signature in database
GPG key ID: BB97304A16BC5DCF

View file

@ -4,16 +4,19 @@
user:
name: "{{ barad_dur_user }}"
state: present
system: yes
system: true
register: barad_dur_user_res
tags: [ 'prepare', 'prepare-barad_dur',
'deploy', 'deploy-barad_dur' ]
- name: Ensure host directories are present [{{ barad_dur_base_path }}]
- name: Create base-directory for barad-dur [{{ barad_dur_base_path }}]
file:
path: "{{ barad_dur_base_path }}"
state: directory
owner: "{{ barad_dur_user_res.uid }}"
group: "{{ barad_dur_user_res.group }}"
mode: 0750
mode: "0755"
tags: [ 'prepare', 'prepare-barad_dur' ]
- name: Template configuration file for barad-dur [{{ barad_dur_config_file }}]
template:
@ -21,8 +24,21 @@
dest: "{{ barad_dur_config_file }}"
owner: "{{ barad_dur_user_res.uid }}"
group: "{{ barad_dur_user_res.group }}"
mode: 0750
mode: "0640"
notify: restart-barad-dur
tags: [ 'deploy', 'deploy-barad_dur' ]
- name: Pull barad-dur container
docker_image:
name: "{{ barad_dur_container_image_reference }}"
source: pull
state: present
force_source: "{{ barad_dur_container_force_pull }}"
register: barad_dur_container_image_pulled
until: barad_dur_container_image_pulled is success
retries: 10
delay: 5
tags: [ 'prepare', 'prepare-barad_dur' ]
- name: Start barad-dur container
docker_container:
@ -35,4 +51,4 @@
volumes: "{{ barad_dur_container_volumes }}"
restart_policy: "{{ barad_dur_container_restart_policy }}"
state: "{{ barad_dur_container_state }}"
pull: true
tags: [ 'deploy', 'deploy-barad_dur' ]