--- - 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