Refactored file creation

This commit is contained in:
Kevin Veen-Birkenbach 2025-07-06 15:20:43 +02:00
parent cfeb8a5bf8
commit bd9e43506f
No known key found for this signature in database
GPG Key ID: 44D8F11FD62F878E
39 changed files with 11 additions and 83 deletions

View File

@ -97,8 +97,6 @@ Now that you have defined the application settings, domain, and application ID,
vars: vars:
domain: "{{ domains | get_domain(application_id) }}" domain: "{{ domains | get_domain(application_id) }}"
http_port: "{{ ports.localhost.http[application_id] }}" http_port: "{{ ports.localhost.http[application_id] }}"
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
``` ```
3. **`docker-compose.yml.j2`**: 3. **`docker-compose.yml.j2`**:

View File

@ -8,6 +8,4 @@
name: nginx-domain-setup name: nginx-domain-setup
vars: vars:
domain: "{{ domains | get_domain(application_id) }}" domain: "{{ domains | get_domain(application_id) }}"
http_port: "{{ ports.localhost.http[application_id] }}" http_port: "{{ ports.localhost.http[application_id] }}"
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"

View File

@ -10,4 +10,6 @@ database_password: "{{ applications.bigbluebutton.credentials.postgre
domain: "{{ domains | get_domain(application_id) }}" domain: "{{ domains | get_domain(application_id) }}"
http_port: "{{ ports.localhost.http[application_id] }}" http_port: "{{ ports.localhost.http[application_id] }}"
bbb_env_file_link: "{{ docker_compose.directories.instance }}.env" bbb_env_file_link: "{{ docker_compose.directories.instance }}.env"
bbb_env_file_origine: "{{ bbb_repository_directory }}.env" bbb_env_file_origine: "{{ bbb_repository_directory }}.env"
docker_compose_skipp_file_creation: true # Skipp creation of docker-compose.yml file

View File

@ -46,5 +46,3 @@
dest: "{{social_app_path}}" dest: "{{social_app_path}}"
version: "main" version: "main"
notify: docker compose up notify: docker compose up
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"

View File

@ -16,5 +16,3 @@
- subnet: "{{ networks.local.collabora.subnet }}" - subnet: "{{ networks.local.collabora.subnet }}"
when: run_once_docker_mariadb is not defined when: run_once_docker_mariadb is not defined
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"

View File

@ -0,0 +1 @@
docker_compose_skipp_file_creation: false # If set to true the file creation will be skipped

View File

@ -16,11 +16,5 @@
mode: '0755' mode: '0755'
with_dict: "{{ docker_compose.directories }}" with_dict: "{{ docker_compose.directories }}"
- name: flush docker service - include_tasks: "create-files.yml"
meta: flush_handlers when: not docker_compose_skipp_file_creation | bool
when: run_once_docker_compose is not defined
- name: run the docker tasks once
set_fact:
run_once_docker_compose: true
when: run_once_docker_compose is not defined

View File

@ -9,5 +9,3 @@
vars: vars:
domain: "{{ domains | get_domain(application_id) }}" domain: "{{ domains | get_domain(application_id) }}"
http_port: "{{ ports.localhost.http[application_id] }}" http_port: "{{ ports.localhost.http[application_id] }}"
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"

View File

@ -14,8 +14,6 @@
domain: "{{ domains | get_domain(application_id) }}" domain: "{{ domains | get_domain(application_id) }}"
http_port: "{{ ports.localhost.http[application_id] }}" http_port: "{{ ports.localhost.http[application_id] }}"
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
- name: Set OIDC scopes in EspoCRM config (inside web container) - name: Set OIDC scopes in EspoCRM config (inside web container)
ansible.builtin.shell: | ansible.builtin.shell: |
docker compose exec -T web php -r ' docker compose exec -T web php -r '

View File

@ -21,8 +21,6 @@
domain: "{{ domains | get_domain(application_id) }}" domain: "{{ domains | get_domain(application_id) }}"
http_port: "{{ ports.localhost.http[application_id] }}" http_port: "{{ ports.localhost.http[application_id] }}"
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
- name: Build friendica_addons based on features - name: Build friendica_addons based on features
set_fact: set_fact:
friendica_addons: >- friendica_addons: >-

View File

@ -10,6 +10,4 @@
domain: "{{ domains | get_domain(application_id) }}" domain: "{{ domains | get_domain(application_id) }}"
http_port: "{{ ports.localhost.http[application_id] }}" http_port: "{{ ports.localhost.http[application_id] }}"
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"

View File

@ -8,5 +8,3 @@
vars: vars:
domain: "{{ domains | get_domain(application_id) }}" domain: "{{ domains | get_domain(application_id) }}"
http_port: "{{ ports.localhost.http[application_id] }}" http_port: "{{ ports.localhost.http[application_id] }}"
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"

View File

@ -10,8 +10,6 @@
domain: "{{ domains | get_domain(application_id) }}" domain: "{{ domains | get_domain(application_id) }}"
http_port: "{{ ports.localhost.http[application_id] }}" http_port: "{{ ports.localhost.http[application_id] }}"
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
- name: Wait for Gitea HTTP endpoint - name: Wait for Gitea HTTP endpoint
wait_for: wait_for:
host: "127.0.0.1" host: "127.0.0.1"

View File

@ -9,5 +9,3 @@
vars: vars:
domain: "{{ domains | get_domain(application_id) }}" domain: "{{ domains | get_domain(application_id) }}"
http_port: "{{ ports.localhost.http[application_id] }}" http_port: "{{ ports.localhost.http[application_id] }}"
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"

View File

@ -11,6 +11,4 @@
http_port: "{{ ports.localhost.http[application_id] }}" http_port: "{{ ports.localhost.http[application_id] }}"
loop: "{{ domains }}" loop: "{{ domains }}"
loop_control: loop_control:
loop_var: domain loop_var: domain
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"

View File

@ -10,8 +10,6 @@
domain: "{{ domains | get_domain(application_id) }}" domain: "{{ domains | get_domain(application_id) }}"
http_port: "{{ ports.localhost.http[application_id] }}" http_port: "{{ ports.localhost.http[application_id] }}"
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
- name: "create directory {{import_directory_host}}" - name: "create directory {{import_directory_host}}"
file: file:
path: "{{import_directory_host}}" path: "{{import_directory_host}}"

View File

@ -8,5 +8,3 @@
vars: vars:
domain: "{{ domains | get_domain(application_id) }}" domain: "{{ domains | get_domain(application_id) }}"
http_port: "{{ ports.localhost.http[application_id] }}" http_port: "{{ ports.localhost.http[application_id] }}"
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"

View File

@ -22,8 +22,6 @@
state: present state: present
ipam_config: ipam_config:
- subnet: "{{ networks.local.central_ldap.subnet }}" - subnet: "{{ networks.local.central_ldap.subnet }}"
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
- name: "Reset LDAP admin passwords" - name: "Reset LDAP admin passwords"
include_tasks: reset_admin_passwords.yml include_tasks: reset_admin_passwords.yml

View File

@ -25,8 +25,6 @@
dest: "{{docker_compose.directories.config}}config.toml" dest: "{{docker_compose.directories.config}}config.toml"
notify: docker compose up notify: docker compose up
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
- name: Check if listmonk database is already initialized - name: Check if listmonk database is already initialized
command: docker compose exec -T {{database_host}} psql -U {{database_username}} -d {{database_name}} -c "\dt" command: docker compose exec -T {{database_host}} psql -U {{database_username}} -d {{database_name}} -c "\dt"
register: db_tables register: db_tables

View File

@ -18,9 +18,6 @@
name: nginx-docker-cert-deploy name: nginx-docker-cert-deploy
when: run_once_docker_mailu is not defined when: run_once_docker_mailu is not defined
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
when: run_once_docker_mailu is not defined
- name: Flush docker service handlers - name: Flush docker service handlers
meta: flush_handlers meta: flush_handlers
when: run_once_docker_mailu is not defined when: run_once_docker_mailu is not defined

View File

@ -16,8 +16,6 @@
client_max_body_size: "80m" client_max_body_size: "80m"
vhost_flavour: "ws_generic" vhost_flavour: "ws_generic"
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
- name: flush docker service - name: flush docker service
meta: flush_handlers meta: flush_handlers
when: applications.mastodon.setup |bool when: applications.mastodon.setup |bool

View File

@ -12,9 +12,6 @@
http_port: "{{ ports.localhost.http[application_id] }}" http_port: "{{ ports.localhost.http[application_id] }}"
when: run_once_docker_matomo is not defined when: run_once_docker_matomo is not defined
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
when: run_once_docker_matomo is not defined
- name: run the docker matomo tasks once - name: run the docker matomo tasks once
set_fact: set_fact:
run_once_docker_matomo: true run_once_docker_matomo: true

View File

@ -15,5 +15,3 @@
src: "config.exs.j2" src: "config.exs.j2"
dest: "{{ mobilizon_host_conf_exs_file }}" dest: "{{ mobilizon_host_conf_exs_file }}"
notify: docker compose up notify: docker compose up
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"

View File

@ -10,8 +10,6 @@
domain: "{{ domains | get_domain(application_id) }}" domain: "{{ domains | get_domain(application_id) }}"
http_port: "{{ ports.localhost.http[application_id] }}" http_port: "{{ ports.localhost.http[application_id] }}"
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
- name: Wait until the Moodle container is healthy - name: Wait until the Moodle container is healthy
shell: docker inspect --format '{% raw %}{{.State.Health.Status}}{% endraw %}' {{ container_name }} shell: docker inspect --format '{% raw %}{{.State.Health.Status}}{% endraw %}' {{ container_name }}
register: health_check register: health_check

View File

@ -35,8 +35,6 @@
dest: "{{docker_compose.directories.volumes}}nginx.conf" dest: "{{docker_compose.directories.volumes}}nginx.conf"
notify: restart nextcloud nginx service notify: restart nextcloud nginx service
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
- name: Flush all handlers immediately so that occ can be used - name: Flush all handlers immediately so that occ can be used
meta: flush_handlers meta: flush_handlers

View File

@ -33,8 +33,6 @@
state: directory state: directory
mode: 0755 mode: 0755
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
- name: flush docker service - name: flush docker service
meta: flush_handlers meta: flush_handlers

View File

@ -11,8 +11,6 @@
vars: vars:
http: "{{ ports.localhost.http[application_id] }}" http: "{{ ports.localhost.http[application_id] }}"
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
- name: "Install and activate auth-openid-connect plugin if OIDC is enabled" - name: "Install and activate auth-openid-connect plugin if OIDC is enabled"
include_tasks: enable-oidc.yml include_tasks: enable-oidc.yml
when: applications | is_feature_enabled('oidc',application_id) when: applications | is_feature_enabled('oidc',application_id)

View File

@ -12,6 +12,4 @@
- name: "configure pgadmin servers" - name: "configure pgadmin servers"
include_tasks: configuration.yml include_tasks: configuration.yml
when: applications[application_id].server_mode | bool when: applications[application_id].server_mode | bool
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"

View File

@ -8,5 +8,3 @@
vars: vars:
domain: "{{ domains | get_domain(application_id) }}" domain: "{{ domains | get_domain(application_id) }}"
http_port: "{{ ports.localhost.http[application_id] }}" http_port: "{{ ports.localhost.http[application_id] }}"
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"

View File

@ -9,5 +9,3 @@
vars: vars:
domain: "{{ domains | get_domain(application_id) }}" domain: "{{ domains | get_domain(application_id) }}"
http_port: "{{ ports.localhost.http[application_id] }}" http_port: "{{ ports.localhost.http[application_id] }}"
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"

View File

@ -9,5 +9,3 @@
vars: vars:
domain: "{{ domains | get_domain(application_id) }}" domain: "{{ domains | get_domain(application_id) }}"
http_port: "{{ ports.localhost.http[application_id] }}" http_port: "{{ ports.localhost.http[application_id] }}"
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"

View File

@ -24,6 +24,4 @@
name: nginx-domain-setup name: nginx-domain-setup
vars: vars:
domain: "{{ domains | get_domain(application_id) }}" domain: "{{ domains | get_domain(application_id) }}"
http_port: "{{ ports.localhost.http[application_id] }}" http_port: "{{ ports.localhost.http[application_id] }}"
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"

View File

@ -11,5 +11,3 @@
notify: docker compose up notify: docker compose up
become: true become: true
ignore_errors: true ignore_errors: true
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"

View File

@ -10,7 +10,6 @@
domain: "{{ domains | get_domain(application_id) }}" domain: "{{ domains | get_domain(application_id) }}"
http_port: "{{ ports.localhost.http[application_id] }}" http_port: "{{ ports.localhost.http[application_id] }}"
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
- name: "Configure Snipe-IT LDAP settings" - name: "Configure Snipe-IT LDAP settings"
import_tasks: ldap.yml import_tasks: ldap.yml

View File

@ -20,6 +20,4 @@
name: nginx-domain-setup name: nginx-domain-setup
vars: vars:
domain: "{{ domains | get_domain(application_id) }}" domain: "{{ domains | get_domain(application_id) }}"
http_port: "{{ ports.localhost.http[application_id] }}" http_port: "{{ ports.localhost.http[application_id] }}"
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"

View File

@ -27,4 +27,3 @@
force: yes force: yes
notify: docker compose up notify: docker compose up
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"

View File

@ -28,4 +28,3 @@
dest: "{{docker_compose_init}}" dest: "{{docker_compose_init}}"
notify: docker compose up notify: docker compose up
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"

View File

@ -25,7 +25,6 @@
dest: "{{ host_msmtp_conf }}" dest: "{{ host_msmtp_conf }}"
notify: docker compose up notify: docker compose up
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
- name: "Install wordpress" - name: "Install wordpress"
include_tasks: install.yml include_tasks: install.yml

View File

@ -10,4 +10,3 @@
domain: "{{ domains | get_domain(application_id) }}" domain: "{{ domains | get_domain(application_id) }}"
http_port: "{{ ports.localhost.http[application_id] }}" http_port: "{{ ports.localhost.http[application_id] }}"
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"