ansible-role-strfry/tasks/install.yml

57 lines
1.6 KiB
YAML

---
- name: Install strfry binary
ansible.builtin.copy:
src: "{{ ansible_env.HOME }}/src/strfry/strfry"
dest: "{{ strfry_binary_path }}"
mode: 0755
remote_src: true
- name: Setup strfry service unit
ansible.builtin.template:
src: strfry.service
dest: /etc/systemd/system/strfry.service
notify: restart strfry
- name: Ensure strfry is enabled on boot
ansible.builtin.service:
name: strfry
enabled: true
state: started
- name: Configure strfry
ansible.builtin.template:
src: strfry.conf
dest: "{{ strfry_data_path }}/strfry.conf"
owner: "{{ strfry_system_user }}"
group: "{{ strfry_system_group }}"
when: not strfry_skip_config
tags: config
notify: restart strfry
- name: Install the strfry-policy template
ansible.builtin.copy:
src: strfry-policy.ts
dest: "{{ strfry_relay.writePolicy.plugin }}"
owner: "{{ strfry_system_user }}"
group: "{{ strfry_system_group }}"
# force: false # Never overwrite, this is just a starter policy
mode: '0755'
when: strfry_policies_enabled
notify: restart strfry
- name: Ensure the configured database directory exists.
ansible.builtin.file:
path: "{{ strfry_db }}"
state: directory
owner: "{{ strfry_system_user }}"
group: "{{ strfry_system_group }}"
when: strfry_db.startswith('/')
- name: Ensure the configured database directory exists.
ansible.builtin.file:
path: "{{ strfry_data_path }}/{{ strfry_db }}"
state: directory
owner: "{{ strfry_system_user }}"
group: "{{ strfry_system_group }}"
when: not strfry_db.startswith('/')