Moves `iklimco-net` overlay network creation to be managed by the Docker Swarm stack, ensuring reliable embedded DNS resolution for inter-service communication. This resolves issues where services on external overlay networks failed to discover each other via Docker DNS. This refactoring includes: * Removing the manual `iklimco-net` creation from the Ansible `swarm` role. * Adjusting `act_runner` configuration to connect job containers to `iklimco-net` only after the stack has deployed and created the network. * Setting `storagebox_file_mode` to `0600` for DB nodes to prevent "too open" errors with MongoDB keyfiles. * Provisioning dedicated bind mount directories for MongoDB and PostgreSQL on DB nodes with correct ownership and permissions. * Updating documentation to reflect the consolidated stack and network changes.
38 lines
854 B
YAML
38 lines
854 B
YAML
---
|
|
- name: Create base directory
|
|
ansible.builtin.file:
|
|
path: /opt/iklimco
|
|
state: directory
|
|
mode: '0755'
|
|
|
|
- name: Create db specific directories
|
|
ansible.builtin.file:
|
|
path: "{{ item }}"
|
|
state: directory
|
|
mode: '0755'
|
|
loop:
|
|
- /opt/iklimco/db
|
|
- /opt/iklimco/backup
|
|
when: inventory_hostname in groups['db']
|
|
|
|
- name: Create db data directories (bind mounts for MongoDB and PostgreSQL)
|
|
ansible.builtin.file:
|
|
path: "{{ item }}"
|
|
state: directory
|
|
owner: "999"
|
|
group: "999"
|
|
mode: '0700'
|
|
loop:
|
|
- /opt/iklimco/db/mongodb
|
|
- /opt/iklimco/db/postgresql
|
|
when: inventory_hostname in groups['db']
|
|
|
|
- name: Create service node directories
|
|
ansible.builtin.file:
|
|
path: "{{ item }}"
|
|
state: directory
|
|
mode: '0755'
|
|
loop:
|
|
- /opt/iklimco/ssl
|
|
when: inventory_hostname in groups['app']
|