51 lines
1.3 KiB
YAML
51 lines
1.3 KiB
YAML
- name: Create saiblog directories.
|
|
ansible.builtin.file:
|
|
path: "{{ saiblog_install_dir }}"
|
|
owner: "root"
|
|
group: "root"
|
|
mode: "0700"
|
|
state: directory
|
|
become: true
|
|
|
|
- name: Add caddy config file.
|
|
block:
|
|
- name: Check caddy config dir.
|
|
ansible.builtin.stat:
|
|
path: "{{ caddy_install_dir }}/config"
|
|
become: true
|
|
register: caddy_stat_config_dir
|
|
|
|
- name: Template caddy config for saiblog.
|
|
ansible.builtin.template:
|
|
src: saiblog.caddy.j2
|
|
dest: "{{ caddy_install_dir }}/config/saiblog.caddy"
|
|
mode: "0600"
|
|
setype: "container_file_t"
|
|
selevel: "{{ caddy_selinux_level }}"
|
|
owner: "{{ caddy_stat_config_dir.stat.uid }}"
|
|
group: "{{ caddy_stat_config_dir.stat.gid }}"
|
|
notify: "caddy config changed"
|
|
become: true
|
|
|
|
- name: Create saiblog container file.
|
|
ansible.builtin.template:
|
|
src: saiblog.container.j2
|
|
dest: /etc/containers/systemd/saiblog.container
|
|
owner: "root"
|
|
group: "root"
|
|
mode: "0644"
|
|
become: true
|
|
notify: "saiblog service changed"
|
|
|
|
- name: Flush handlers
|
|
ansible.builtin.meta: flush_handlers
|
|
|
|
- name: Ensure saiblog services are started and enabled.
|
|
ansible.builtin.systemd:
|
|
state: started
|
|
enabled: true
|
|
name: "{{ item }}"
|
|
daemon_reload: true
|
|
loop:
|
|
- saiblog.service
|
|
become: true
|