lab-ansible/roles/apps/tasks/main.yml

39 lines
954 B
YAML

# vim: ft=yaml.ansible
# code: language=ansible
---
- name: Create Docker network for apps
community.docker.docker_network:
name: "{{ apps_shared_docker_network }}"
enable_ipv6: true
ipam_config:
- subnet: 172.17.2.0/24
- subnet: fd02::/64
state: present
- name: Create Docker network for Postfix
community.docker.docker_network:
name: "{{ apps_postfix_docker_network }}"
state: present
when: "'postfix' in apps_include"
- name: Create base directory for apps
ansible.builtin.file:
path: "{{ apps_data_root }}"
owner: root
mode: u=rwx,g=rx,o=rx
state: directory
- name: Configure apps
ansible.builtin.include_tasks: configure_app.yml
vars:
app_name: "{{ item }}"
app_vars: "{{ apps_vars[item] }}"
loop: "{{ apps_include }}"
- name: Copy deploy.sh
ansible.builtin.template:
src: scripts/deploy.sh.j2
dest: /usr/bin/deploy.sh
owner: root
mode: u=rwx,g=rx,o=rx