mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-06-25 03:38:59 +02:00
Refactored docker logic
This commit is contained in:
parent
7a7825cc61
commit
cdfd464bce
2
Makefile
2
Makefile
@ -1,7 +1,7 @@
|
|||||||
ROLES_DIR := ./roles
|
ROLES_DIR := ./roles
|
||||||
APPLICATIONS_OUT := ./group_vars/all/03_applications.yml
|
APPLICATIONS_OUT := ./group_vars/all/03_applications.yml
|
||||||
APPLICATIONS_SCRIPT := ./cli/generate-applications-defaults.py
|
APPLICATIONS_SCRIPT := ./cli/generate-applications-defaults.py
|
||||||
INCLUDES_OUT := ./tasks/include-docker-roles.yml
|
INCLUDES_OUT := ./tasks/utils/docker-roles.yml
|
||||||
INCLUDES_SCRIPT := ./cli/generate_playbook.py
|
INCLUDES_SCRIPT := ./cli/generate_playbook.py
|
||||||
|
|
||||||
.PHONY: build install test
|
.PHONY: build install test
|
||||||
|
@ -98,8 +98,7 @@ Now that you have defined the application settings, domain, and application ID,
|
|||||||
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] }}"
|
||||||
|
|
||||||
- name: "copy docker-compose.yml and env file"
|
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
|
||||||
include_tasks: copy-docker-compose-and-env.yml
|
|
||||||
```
|
```
|
||||||
|
|
||||||
3. **`docker-compose.yml.j2`**:
|
3. **`docker-compose.yml.j2`**:
|
||||||
|
@ -23,6 +23,7 @@ def get_docker_compose(path_docker_compose_instances: str, application_id: str)
|
|||||||
'files': {
|
'files': {
|
||||||
'env': f"{base}.env/env",
|
'env': f"{base}.env/env",
|
||||||
'docker_compose': f"{base}docker-compose.yml",
|
'docker_compose': f"{base}docker-compose.yml",
|
||||||
|
'dockerfile': f"{base}Dockerfile",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,9 +2,9 @@
|
|||||||
hosts: all
|
hosts: all
|
||||||
tasks:
|
tasks:
|
||||||
- name: "Load 'constructor' tasks"
|
- name: "Load 'constructor' tasks"
|
||||||
include_tasks: "tasks/constructor.yml"
|
include_tasks: "tasks/plays/01_constructor.yml"
|
||||||
- name: "Load '{{host_type}}' tasks"
|
- name: "Load '{{host_type}}' tasks"
|
||||||
include_tasks: "tasks/{{host_type}}.yml"
|
include_tasks: "tasks/plays/02_{{host_type}}.yml"
|
||||||
- name: "Load 'destructor' tasks"
|
- name: "Load 'destructor' tasks"
|
||||||
include_tasks: "tasks/destructor.yml"
|
include_tasks: "tasks/plays/03_destructor.yml"
|
||||||
become: true
|
become: true
|
@ -10,5 +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] }}"
|
||||||
|
|
||||||
- name: "copy docker-compose.yml and env file"
|
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
|
||||||
include_tasks: copy-docker-compose-and-env.yml
|
|
@ -47,5 +47,4 @@
|
|||||||
version: "main"
|
version: "main"
|
||||||
notify: docker compose project build and setup
|
notify: docker compose project build and setup
|
||||||
|
|
||||||
- name: "copy docker-compose.yml and env file"
|
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
|
||||||
include_tasks: copy-docker-compose-and-env.yml
|
|
||||||
|
35
roles/docker-compose/tasks/create-files.yml
Normal file
35
roles/docker-compose/tasks/create-files.yml
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
- name: "Create (optional) '{{ docker_compose.files.dockerfile }}'"
|
||||||
|
template:
|
||||||
|
src: "{{ playbook_dir }}/roles/{{ role_name }}/templates/{{ template_name }}"
|
||||||
|
dest: "{{ docker_compose.files.dockerfile }}"
|
||||||
|
notify: docker compose project build and setup
|
||||||
|
ignore_errors: true
|
||||||
|
|
||||||
|
- name: "Create (optional) '{{ docker_compose.files.env }}'"
|
||||||
|
template:
|
||||||
|
src: "env.j2"
|
||||||
|
dest: "{{ docker_compose.files.env }}"
|
||||||
|
mode: '770'
|
||||||
|
force: yes
|
||||||
|
notify: docker compose project setup
|
||||||
|
register: env_template
|
||||||
|
ignore_errors: true
|
||||||
|
|
||||||
|
- name: "Create (obligatoric) '{{ docker_compose.files.docker_compose }}'"
|
||||||
|
template:
|
||||||
|
src: "docker-compose.yml.j2"
|
||||||
|
dest: "{{ docker_compose.files.docker_compose }}"
|
||||||
|
notify: docker compose project setup
|
||||||
|
register: docker_compose_template
|
||||||
|
|
||||||
|
- name: "Check if any container is running in {{ docker_compose.directories.instance }}"
|
||||||
|
command: docker compose ps -q --filter status=running
|
||||||
|
args:
|
||||||
|
chdir: "{{ docker_compose.directories.instance }}"
|
||||||
|
register: docker_ps
|
||||||
|
changed_when: (docker_ps.stdout | trim) == ""
|
||||||
|
notify: docker compose project setup
|
||||||
|
when: not (docker_compose_template.changed or env_template.changed)
|
||||||
|
|
||||||
|
- name: flush docker compose project setup
|
||||||
|
meta: flush_handlers
|
@ -10,5 +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] }}"
|
||||||
|
|
||||||
- name: "copy docker-compose.yml and env file"
|
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
|
||||||
include_tasks: copy-docker-compose-and-env.yml
|
|
||||||
|
@ -14,8 +14,7 @@
|
|||||||
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] }}"
|
||||||
|
|
||||||
- name: "copy docker-compose.yml and env file"
|
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
|
||||||
include_tasks: copy-docker-compose-and-env.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: |
|
||||||
|
@ -10,5 +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] }}"
|
||||||
|
|
||||||
- name: "copy docker-compose.yml and env file"
|
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
|
||||||
include_tasks: copy-docker-compose-and-env.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] }}"
|
||||||
|
|
||||||
- name: "copy docker-compose.yml and env file"
|
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
|
||||||
include_tasks: copy-docker-compose-and-env.yml
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -9,5 +9,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] }}"
|
||||||
|
|
||||||
- name: "copy docker-compose.yml and env file"
|
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
|
||||||
include_tasks: copy-docker-compose-and-env.yml
|
|
||||||
|
@ -10,5 +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] }}"
|
||||||
|
|
||||||
- name: "copy docker-compose.yml and env file"
|
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
|
||||||
include_tasks: copy-docker-compose-and-env.yml
|
|
||||||
|
@ -10,5 +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] }}"
|
||||||
|
|
||||||
- name: "copy docker-compose.yml and env file"
|
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
|
||||||
include_tasks: copy-docker-compose-and-env.yml
|
|
||||||
|
@ -13,5 +13,4 @@
|
|||||||
loop_control:
|
loop_control:
|
||||||
loop_var: domain
|
loop_var: domain
|
||||||
|
|
||||||
- name: "copy docker-compose.yml and env file"
|
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
|
||||||
include_tasks: copy-docker-compose-and-env.yml
|
|
@ -10,8 +10,7 @@
|
|||||||
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] }}"
|
||||||
|
|
||||||
- name: "copy docker-compose.yml and env file"
|
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
|
||||||
include_tasks: copy-docker-compose-and-env.yml
|
|
||||||
|
|
||||||
- name: "create directory {{import_directory_host}}"
|
- name: "create directory {{import_directory_host}}"
|
||||||
file:
|
file:
|
||||||
|
@ -9,5 +9,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] }}"
|
||||||
|
|
||||||
- name: "copy docker-compose.yml and env file"
|
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
|
||||||
include_tasks: copy-docker-compose-and-env.yml
|
|
||||||
|
@ -23,8 +23,7 @@
|
|||||||
ipam_config:
|
ipam_config:
|
||||||
- subnet: "{{ networks.local.central_ldap.subnet }}"
|
- subnet: "{{ networks.local.central_ldap.subnet }}"
|
||||||
|
|
||||||
- name: "copy docker-compose.yml and env file"
|
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
|
||||||
include_tasks: copy-docker-compose-and-env.yml
|
|
||||||
|
|
||||||
- name: "create directory {{ldif_host_path}}{{item}}"
|
- name: "create directory {{ldif_host_path}}{{item}}"
|
||||||
file:
|
file:
|
||||||
|
@ -25,8 +25,7 @@
|
|||||||
dest: "{{docker_compose.directories.config}}config.toml"
|
dest: "{{docker_compose.directories.config}}config.toml"
|
||||||
notify: docker compose project setup
|
notify: docker compose project setup
|
||||||
|
|
||||||
- name: "copy docker-compose.yml and env file"
|
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
|
||||||
include_tasks: copy-docker-compose-and-env.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"
|
||||||
|
@ -18,8 +18,7 @@
|
|||||||
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
|
||||||
|
|
||||||
- name: "Copy docker-compose.yml and env file"
|
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
|
||||||
include_tasks: copy-docker-compose-and-env.yml
|
|
||||||
when: run_once_docker_mailu is not defined
|
when: run_once_docker_mailu is not defined
|
||||||
|
|
||||||
- name: Flush docker service handlers
|
- name: Flush docker service handlers
|
||||||
|
@ -16,8 +16,7 @@
|
|||||||
client_max_body_size: "80m"
|
client_max_body_size: "80m"
|
||||||
vhost_flavour: "ws_generic"
|
vhost_flavour: "ws_generic"
|
||||||
|
|
||||||
- name: "copy docker-compose.yml and env file"
|
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
|
||||||
include_tasks: copy-docker-compose-and-env.yml
|
|
||||||
|
|
||||||
- name: flush docker service
|
- name: flush docker service
|
||||||
meta: flush_handlers
|
meta: flush_handlers
|
||||||
|
@ -12,8 +12,7 @@
|
|||||||
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
|
||||||
|
|
||||||
- name: "copy docker-compose.yml and env file"
|
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
|
||||||
include_tasks: copy-docker-compose-and-env.yml
|
|
||||||
when: run_once_docker_matomo is not defined
|
when: run_once_docker_matomo is not defined
|
||||||
|
|
||||||
- name: run the docker matomo tasks once
|
- name: run the docker matomo tasks once
|
||||||
|
@ -10,14 +10,7 @@
|
|||||||
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] }}"
|
||||||
|
|
||||||
- name: "Transfer Dockerfile to {{ docker_compose.directories.instance }}"
|
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
|
||||||
template:
|
|
||||||
src: Dockerfile.j2
|
|
||||||
dest: "{{ docker_compose.directories.instance }}Dockerfile"
|
|
||||||
notify: docker compose project build and setup
|
|
||||||
|
|
||||||
- name: "copy docker-compose.yml and env file"
|
|
||||||
include_tasks: copy-docker-compose-and-env.yml
|
|
||||||
|
|
||||||
- name: "Configure OIDC login for Moodle if enabled"
|
- name: "Configure OIDC login for Moodle if enabled"
|
||||||
include_tasks: oidc.yml
|
include_tasks: oidc.yml
|
||||||
|
@ -35,8 +35,7 @@
|
|||||||
dest: "{{docker_compose.directories.volumes}}nginx.conf"
|
dest: "{{docker_compose.directories.volumes}}nginx.conf"
|
||||||
notify: restart nextcloud nginx service
|
notify: restart nextcloud nginx service
|
||||||
|
|
||||||
- name: "copy docker-compose.yml and env file"
|
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
|
||||||
include_tasks: copy-docker-compose-and-env.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
|
||||||
|
@ -10,23 +10,16 @@
|
|||||||
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] }}"
|
||||||
|
|
||||||
- name: "Create {{openproject_plugins_service}}"
|
- name: "Create {{openproject_plugins_folder}}"
|
||||||
file:
|
file:
|
||||||
path: "{{openproject_plugins_service}}"
|
path: "{{openproject_plugins_folder}}"
|
||||||
state: directory
|
state: directory
|
||||||
mode: '0755'
|
mode: '0755'
|
||||||
|
|
||||||
- name: "Transfering Gemfile.plugins to {{openproject_plugins_service}}"
|
- name: "Transfering Gemfile.plugins to {{openproject_plugins_folder}}"
|
||||||
copy:
|
copy:
|
||||||
src: Gemfile.plugins
|
src: Gemfile.plugins
|
||||||
dest: "{{openproject_plugins_service}}Gemfile.plugins"
|
dest: "{{openproject_plugins_folder}}Gemfile.plugins"
|
||||||
notify:
|
|
||||||
- docker compose project build and setup
|
|
||||||
|
|
||||||
- name: "Transfering Dockerfile to {{openproject_plugins_service}}Dockerfile"
|
|
||||||
template:
|
|
||||||
src: Dockerfile
|
|
||||||
dest: "{{openproject_plugins_service}}Dockerfile"
|
|
||||||
notify:
|
notify:
|
||||||
- docker compose project build and setup
|
- docker compose project build and setup
|
||||||
|
|
||||||
@ -40,8 +33,7 @@
|
|||||||
state: directory
|
state: directory
|
||||||
mode: 0755
|
mode: 0755
|
||||||
|
|
||||||
- name: "copy docker-compose.yml and env file"
|
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
|
||||||
include_tasks: copy-docker-compose-and-env.yml
|
|
||||||
|
|
||||||
- name: flush docker service
|
- name: flush docker service
|
||||||
meta: flush_handlers
|
meta: flush_handlers
|
||||||
|
@ -5,7 +5,7 @@ FROM openproject/community:{{applications.openproject.version}}
|
|||||||
# path inside of the container. Say for `/app/vendor/plugins/openproject-slack`:
|
# path inside of the container. Say for `/app/vendor/plugins/openproject-slack`:
|
||||||
# COPY /path/to/my/local/openproject-slack /app/vendor/plugins/openproject-slack
|
# COPY /path/to/my/local/openproject-slack /app/vendor/plugins/openproject-slack
|
||||||
|
|
||||||
COPY Gemfile.plugins /app/
|
COPY volumes/plugins/Gemfile.plugins /app/
|
||||||
|
|
||||||
# If the plugin uses any external NPM dependencies you have to install them here.
|
# If the plugin uses any external NPM dependencies you have to install them here.
|
||||||
# RUN npm add npm <package-name>*
|
# RUN npm add npm <package-name>*
|
@ -4,7 +4,7 @@ x-op-app: &app
|
|||||||
driver: journald
|
driver: journald
|
||||||
image: {{custom_openproject_image}}
|
image: {{custom_openproject_image}}
|
||||||
build:
|
build:
|
||||||
context: {{openproject_plugins_service}}
|
context: .
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
@ -2,7 +2,8 @@ application_id: "openproject"
|
|||||||
docker_repository_address: "https://github.com/opf/openproject-deploy"
|
docker_repository_address: "https://github.com/opf/openproject-deploy"
|
||||||
database_type: "postgres"
|
database_type: "postgres"
|
||||||
|
|
||||||
openproject_plugins_service: "{{docker_compose.directories.services}}plugins/"
|
openproject_plugins_folder: "{{docker_compose.directories.volumes}}plugins/"
|
||||||
|
|
||||||
custom_openproject_image: "custom_openproject"
|
custom_openproject_image: "custom_openproject"
|
||||||
|
|
||||||
# The following volume doesn't have a practcical function. It just exist to prevent the creation of unnecessary anonymous volumes
|
# The following volume doesn't have a practcical function. It just exist to prevent the creation of unnecessary anonymous volumes
|
||||||
|
@ -11,8 +11,7 @@
|
|||||||
vars:
|
vars:
|
||||||
http: "{{ ports.localhost.http[application_id] }}"
|
http: "{{ ports.localhost.http[application_id] }}"
|
||||||
|
|
||||||
- name: "copy docker-compose.yml and env file"
|
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
|
||||||
include_tasks: copy-docker-compose-and-env.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
|
||||||
|
@ -14,5 +14,4 @@
|
|||||||
include_tasks: configuration.yml
|
include_tasks: configuration.yml
|
||||||
when: applications[application_id].server_mode | bool
|
when: applications[application_id].server_mode | bool
|
||||||
|
|
||||||
- name: "copy docker-compose.yml and env file"
|
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
|
||||||
include_tasks: copy-docker-compose-and-env.yml
|
|
@ -9,5 +9,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] }}"
|
||||||
|
|
||||||
- name: "copy docker-compose.yml and env file"
|
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
|
||||||
include_tasks: copy-docker-compose-and-env.yml
|
|
||||||
|
@ -10,5 +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] }}"
|
||||||
|
|
||||||
- name: "copy docker-compose.yml and env file"
|
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
|
||||||
include_tasks: copy-docker-compose-and-env.yml
|
|
||||||
|
@ -10,5 +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] }}"
|
||||||
|
|
||||||
- name: "copy docker-compose.yml and env file"
|
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
|
||||||
include_tasks: copy-docker-compose-and-env.yml
|
|
@ -26,5 +26,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] }}"
|
||||||
|
|
||||||
- name: "copy docker-compose.yml and env file"
|
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
|
||||||
include_tasks: copy-docker-compose-and-env.yml
|
|
@ -12,10 +12,4 @@
|
|||||||
become: true
|
become: true
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
||||||
- name: add docker-compose.yml
|
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
|
||||||
template: src=docker-compose.yml.j2 dest={{docker_compose.directories.instance}}docker-compose.yml
|
|
||||||
notify: docker compose project setup
|
|
||||||
|
|
||||||
- name: add Dockerfile
|
|
||||||
template: src=Dockerfile.j2 dest={{docker_compose.directories.instance}}Dockerfile
|
|
||||||
notify: docker compose project setup
|
|
||||||
|
@ -10,5 +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] }}"
|
||||||
|
|
||||||
- name: "copy docker-compose.yml and env file"
|
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
|
||||||
include_tasks: copy-docker-compose-and-env.yml
|
|
||||||
|
@ -22,5 +22,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] }}"
|
||||||
|
|
||||||
- name: "copy docker-compose.yml and env file"
|
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
|
||||||
include_tasks: copy-docker-compose-and-env.yml
|
|
@ -27,5 +27,4 @@
|
|||||||
force: yes
|
force: yes
|
||||||
notify: docker compose project setup
|
notify: docker compose project setup
|
||||||
|
|
||||||
- name: "copy docker-compose.yml and env file"
|
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
|
||||||
include_tasks: copy-docker-compose-and-env.yml
|
|
||||||
|
@ -28,5 +28,4 @@
|
|||||||
dest: "{{docker_compose_init}}"
|
dest: "{{docker_compose_init}}"
|
||||||
notify: docker compose project build and setup
|
notify: docker compose project build and setup
|
||||||
|
|
||||||
- name: "copy docker-compose.yml and env file"
|
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
|
||||||
include_tasks: copy-docker-compose-and-env.yml
|
|
||||||
|
@ -25,14 +25,7 @@
|
|||||||
dest: "{{ host_msmtp_conf }}"
|
dest: "{{ host_msmtp_conf }}"
|
||||||
notify: docker compose project build and setup
|
notify: docker compose project build and setup
|
||||||
|
|
||||||
- name: "Transfering Dockerfile to {{ docker_compose.directories.instance }}"
|
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
|
||||||
copy:
|
|
||||||
src: Dockerfile
|
|
||||||
dest: "{{ docker_compose.directories.instance }}Dockerfile"
|
|
||||||
notify: docker compose project build and setup
|
|
||||||
|
|
||||||
- name: "copy docker-compose.yml and env file"
|
|
||||||
include_tasks: copy-docker-compose-and-env.yml
|
|
||||||
|
|
||||||
- name: "Install wordpress"
|
- name: "Install wordpress"
|
||||||
include_tasks: install.yml
|
include_tasks: install.yml
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
FROM wordpress
|
FROM wordpress:{{applications[application_id].version}}
|
||||||
|
|
||||||
# Install msmtp and update system
|
# Install msmtp and update system
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
@ -10,5 +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] }}"
|
||||||
|
|
||||||
- name: "copy docker-compose.yml and env file"
|
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
|
||||||
include_tasks: copy-docker-compose-and-env.yml
|
|
||||||
|
1
tasks/.gitignore
vendored
1
tasks/.gitignore
vendored
@ -1 +0,0 @@
|
|||||||
include-docker-roles.yml
|
|
@ -1,3 +0,0 @@
|
|||||||
# todo
|
|
||||||
- Move update-repository-with-files.yml to own role
|
|
||||||
- Move copy-docker-compose-and-env.yml to own role
|
|
@ -1,27 +0,0 @@
|
|||||||
- name: "create {{ docker_compose.files.docker_compose }}"
|
|
||||||
template:
|
|
||||||
src: "docker-compose.yml.j2"
|
|
||||||
dest: "{{ docker_compose.files.docker_compose }}"
|
|
||||||
notify: docker compose project setup
|
|
||||||
register: docker_compose_template
|
|
||||||
|
|
||||||
- name: "create {{ docker_compose.files.env }}"
|
|
||||||
template:
|
|
||||||
src: "env.j2"
|
|
||||||
dest: "{{ docker_compose.files.env }}"
|
|
||||||
mode: '770'
|
|
||||||
force: yes
|
|
||||||
notify: docker compose project setup
|
|
||||||
register: env_template
|
|
||||||
|
|
||||||
- name: "Check if any container is running in {{ docker_compose.directories.instance }}"
|
|
||||||
command: docker compose ps -q --filter status=running
|
|
||||||
args:
|
|
||||||
chdir: "{{ docker_compose.directories.instance }}"
|
|
||||||
register: docker_ps
|
|
||||||
changed_when: (docker_ps.stdout | trim) == ""
|
|
||||||
notify: docker compose project setup
|
|
||||||
when: not (docker_compose_template.changed or env_template.changed)
|
|
||||||
|
|
||||||
- name: flush docker compose project setup
|
|
||||||
meta: flush_handlers
|
|
@ -12,7 +12,7 @@
|
|||||||
- system-btrfs-auto-balancer
|
- system-btrfs-auto-balancer
|
||||||
|
|
||||||
- name: "Integrate Docker Role includes"
|
- name: "Integrate Docker Role includes"
|
||||||
include_tasks: "include-docker-roles.yml"
|
include_tasks: "./tasks/utils/docker-roles.yml"
|
||||||
|
|
||||||
# Native Webserver Roles
|
# Native Webserver Roles
|
||||||
- name: setup nginx-serve-htmls
|
- name: setup nginx-serve-htmls
|
1
tasks/utils/.gitignore
vendored
Normal file
1
tasks/utils/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
docker-roles.yml
|
Loading…
x
Reference in New Issue
Block a user