ansible-role-firefly/tasks/main.yml
Julien Riou 793ee4598c
Initial commit
Signed-off-by: Julien Riou <julien@riou.xyz>
2024-12-28 07:54:57 +01:00

40 lines
843 B
YAML

---
- name: install dependencies
ansible.builtin.apt:
name:
- python3-docker
- python3-compose
- name: create directories
ansible.builtin.file:
path: /etc/firefly
state: directory
- name: create configuration files
ansible.builtin.template:
src: "{{ item }}.j2"
dest: "/etc/firefly/{{ item }}"
mode: "0600"
loop:
- docker-compose.yml
- db.env
- app.env
- name: start service
community.docker.docker_compose_v2:
project_src: /etc/firefly
files:
- docker-compose.yml
- name: allow with iptables
ansible.builtin.iptables:
chain: INPUT
protocol: tcp
source: "{{ item }}"
destination_ports:
- "{{ firefly_port }}"
jump: ACCEPT
comment: firefly
loop: "{{ firefly_allowed_sources }}"
notify: save iptables
when: firefly_manage_iptables