mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-07-07 09:05:15 +02:00
Refactored file creation
This commit is contained in:
parent
cfeb8a5bf8
commit
bd9e43506f
@ -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`**:
|
||||||
|
@ -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"
|
|
@ -11,3 +11,5 @@ 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
|
@ -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"
|
|
||||||
|
@ -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"
|
|
||||||
|
|
||||||
|
1
roles/docker-compose/defaults/main.yml
Normal file
1
roles/docker-compose/defaults/main.yml
Normal file
@ -0,0 +1 @@
|
|||||||
|
docker_compose_skipp_file_creation: false # If set to true the file creation will be skipped
|
@ -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
|
|
@ -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"
|
|
||||||
|
@ -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 '
|
||||||
|
@ -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: >-
|
||||||
|
@ -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"
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -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"
|
|
||||||
|
@ -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"
|
||||||
|
@ -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"
|
|
||||||
|
@ -12,5 +12,3 @@
|
|||||||
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"
|
|
@ -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}}"
|
||||||
|
@ -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"
|
|
||||||
|
@ -23,8 +23,6 @@
|
|||||||
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
|
||||||
when: applications[application_id].network.local
|
when: applications[application_id].network.local
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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"
|
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
@ -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)
|
||||||
|
@ -13,5 +13,3 @@
|
|||||||
- 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"
|
|
@ -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"
|
|
||||||
|
@ -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"
|
|
||||||
|
@ -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"
|
|
@ -25,5 +25,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"
|
|
@ -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"
|
|
||||||
|
@ -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
|
||||||
|
@ -21,5 +21,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"
|
|
@ -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"
|
|
||||||
|
@ -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"
|
|
||||||
|
@ -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
|
||||||
|
@ -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"
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user