2023-07-30 00:19:36 +00:00
|
|
|
---
|
|
|
|
- name: Install strfry binary
|
|
|
|
ansible.builtin.copy:
|
|
|
|
src: "{{ ansible_env.HOME }}/src/strfry/strfry"
|
|
|
|
dest: "{{ strfry_binary_path }}"
|
|
|
|
mode: 0755
|
|
|
|
remote_src: true
|
2023-09-25 15:03:34 +00:00
|
|
|
notify: restart strfry
|
2023-07-30 00:19:36 +00:00
|
|
|
|
|
|
|
- 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
|
2023-08-11 19:28:48 +00:00
|
|
|
tags: config
|
|
|
|
notify: restart strfry
|
|
|
|
|
2023-08-12 21:59:36 +00:00
|
|
|
- name: Install the strfry-policy template
|
|
|
|
ansible.builtin.copy:
|
2023-08-11 19:28:48 +00:00
|
|
|
src: strfry-policy.ts
|
2023-08-12 21:59:36 +00:00
|
|
|
dest: "{{ strfry_relay.writePolicy.plugin }}"
|
2023-08-11 19:28:48 +00:00
|
|
|
owner: "{{ strfry_system_user }}"
|
|
|
|
group: "{{ strfry_system_group }}"
|
2023-09-25 15:03:34 +00:00
|
|
|
force: false # Never overwrite, this is just a starter policy
|
2023-08-12 21:59:36 +00:00
|
|
|
mode: '0755'
|
|
|
|
when: strfry_policies_enabled
|
2023-07-30 00:19:36 +00:00
|
|
|
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 }}"
|
2023-08-12 21:59:36 +00:00
|
|
|
when: not strfry_db.startswith('/')
|