mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-06-24 19:25:32 +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
|
||||
APPLICATIONS_OUT := ./group_vars/all/03_applications.yml
|
||||
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
|
||||
|
||||
.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) }}"
|
||||
http_port: "{{ ports.localhost.http[application_id] }}"
|
||||
|
||||
- name: "copy docker-compose.yml and env file"
|
||||
include_tasks: copy-docker-compose-and-env.yml
|
||||
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
|
||||
```
|
||||
|
||||
3. **`docker-compose.yml.j2`**:
|
||||
|
@ -23,6 +23,7 @@ def get_docker_compose(path_docker_compose_instances: str, application_id: str)
|
||||
'files': {
|
||||
'env': f"{base}.env/env",
|
||||
'docker_compose': f"{base}docker-compose.yml",
|
||||
'dockerfile': f"{base}Dockerfile",
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -19,15 +19,15 @@ defaults_service_provider:
|
||||
bluesky: >-
|
||||
{{ ('@' ~ users.administrator.username ~ '.' ~ domains.bluesky.api)
|
||||
if 'bluesky' in group_names else '' }}
|
||||
email: "contact@{{ primary_domain }}"
|
||||
mastodon: "{{ '@' ~ users.administrator.username ~ '@' ~ domains | get_domain('mastodon') if 'mastodon' in group_names else '' }}"
|
||||
matrix: "{{ '@' ~ users.administrator.username ~ ':' ~ domains.matrix.synapse if 'matrix' in group_names else '' }}"
|
||||
peertube: "{{ '@' ~ users.administrator.username ~ '@' ~ domains | get_domain('peertube') if 'peertube' in group_names else '' }}"
|
||||
pixelfed: "{{ '@' ~ users.administrator.username ~ '@' ~ domains | get_domain('pixelfed') if 'pixelfed' in group_names else '' }}"
|
||||
phone: "+0 000 000 404"
|
||||
wordpress: "{{ '@' ~ users.administrator.username ~ '@' ~ domains | get_domain('wordpress') if 'wordpress' in group_names else '' }}"
|
||||
email: "contact@{{ primary_domain }}"
|
||||
mastodon: "{{ '@' ~ users.administrator.username ~ '@' ~ domains | get_domain('mastodon') if 'mastodon' in group_names else '' }}"
|
||||
matrix: "{{ '@' ~ users.administrator.username ~ ':' ~ domains.matrix.synapse if 'matrix' in group_names else '' }}"
|
||||
peertube: "{{ '@' ~ users.administrator.username ~ '@' ~ domains | get_domain('peertube') if 'peertube' in group_names else '' }}"
|
||||
pixelfed: "{{ '@' ~ users.administrator.username ~ '@' ~ domains | get_domain('pixelfed') if 'pixelfed' in group_names else '' }}"
|
||||
phone: "+0 000 000 404"
|
||||
wordpress: "{{ '@' ~ users.administrator.username ~ '@' ~ domains | get_domain('wordpress') if 'wordpress' in group_names else '' }}"
|
||||
|
||||
legal:
|
||||
editorial_responsible: "Johannes Gutenberg"
|
||||
source_code: "https://github.com/kevinveenbirkenbach/cymais"
|
||||
imprint: "{{web_protocol}}://{{ domains | get_domain('html-server') }}/imprint.html"
|
||||
imprint: "{{web_protocol}}://{{ domains | get_domain('html-server') }}/imprint.html"
|
@ -2,9 +2,9 @@
|
||||
hosts: all
|
||||
tasks:
|
||||
- name: "Load 'constructor' tasks"
|
||||
include_tasks: "tasks/constructor.yml"
|
||||
include_tasks: "tasks/plays/01_constructor.yml"
|
||||
- name: "Load '{{host_type}}' tasks"
|
||||
include_tasks: "tasks/{{host_type}}.yml"
|
||||
include_tasks: "tasks/plays/02_{{host_type}}.yml"
|
||||
- name: "Load 'destructor' tasks"
|
||||
include_tasks: "tasks/destructor.yml"
|
||||
include_tasks: "tasks/plays/03_destructor.yml"
|
||||
become: true
|
@ -10,5 +10,4 @@
|
||||
domain: "{{ domains | get_domain(application_id) }}"
|
||||
http_port: "{{ ports.localhost.http[application_id] }}"
|
||||
|
||||
- name: "copy docker-compose.yml and env file"
|
||||
include_tasks: copy-docker-compose-and-env.yml
|
||||
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
|
@ -47,5 +47,4 @@
|
||||
version: "main"
|
||||
notify: docker compose project build and setup
|
||||
|
||||
- name: "copy docker-compose.yml and env file"
|
||||
include_tasks: copy-docker-compose-and-env.yml
|
||||
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.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) }}"
|
||||
http_port: "{{ ports.localhost.http[application_id] }}"
|
||||
|
||||
- name: "copy docker-compose.yml and env file"
|
||||
include_tasks: copy-docker-compose-and-env.yml
|
||||
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
|
||||
|
@ -14,8 +14,7 @@
|
||||
domain: "{{ domains | get_domain(application_id) }}"
|
||||
http_port: "{{ ports.localhost.http[application_id] }}"
|
||||
|
||||
- name: "copy docker-compose.yml and env file"
|
||||
include_tasks: copy-docker-compose-and-env.yml
|
||||
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
|
||||
|
||||
- name: Set OIDC scopes in EspoCRM config (inside web container)
|
||||
ansible.builtin.shell: |
|
||||
|
@ -10,5 +10,4 @@
|
||||
domain: "{{ domains | get_domain(application_id) }}"
|
||||
http_port: "{{ ports.localhost.http[application_id] }}"
|
||||
|
||||
- name: "copy docker-compose.yml and env file"
|
||||
include_tasks: copy-docker-compose-and-env.yml
|
||||
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
|
||||
|
@ -10,7 +10,6 @@
|
||||
domain: "{{ domains | get_domain(application_id) }}"
|
||||
http_port: "{{ ports.localhost.http[application_id] }}"
|
||||
|
||||
- name: "copy docker-compose.yml and env file"
|
||||
include_tasks: copy-docker-compose-and-env.yml
|
||||
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
|
||||
|
||||
|
||||
|
@ -9,5 +9,4 @@
|
||||
domain: "{{ domains | get_domain(application_id) }}"
|
||||
http_port: "{{ ports.localhost.http[application_id] }}"
|
||||
|
||||
- name: "copy docker-compose.yml and env file"
|
||||
include_tasks: copy-docker-compose-and-env.yml
|
||||
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
|
||||
|
@ -10,5 +10,4 @@
|
||||
domain: "{{ domains | get_domain(application_id) }}"
|
||||
http_port: "{{ ports.localhost.http[application_id] }}"
|
||||
|
||||
- name: "copy docker-compose.yml and env file"
|
||||
include_tasks: copy-docker-compose-and-env.yml
|
||||
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
|
||||
|
@ -10,5 +10,4 @@
|
||||
domain: "{{ domains | get_domain(application_id) }}"
|
||||
http_port: "{{ ports.localhost.http[application_id] }}"
|
||||
|
||||
- name: "copy docker-compose.yml and env file"
|
||||
include_tasks: copy-docker-compose-and-env.yml
|
||||
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
|
||||
|
@ -13,5 +13,4 @@
|
||||
loop_control:
|
||||
loop_var: domain
|
||||
|
||||
- name: "copy docker-compose.yml and env file"
|
||||
include_tasks: copy-docker-compose-and-env.yml
|
||||
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
|
@ -10,8 +10,7 @@
|
||||
domain: "{{ domains | get_domain(application_id) }}"
|
||||
http_port: "{{ ports.localhost.http[application_id] }}"
|
||||
|
||||
- name: "copy docker-compose.yml and env file"
|
||||
include_tasks: copy-docker-compose-and-env.yml
|
||||
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
|
||||
|
||||
- name: "create directory {{import_directory_host}}"
|
||||
file:
|
||||
|
@ -9,5 +9,4 @@
|
||||
domain: "{{ domains | get_domain(application_id) }}"
|
||||
http_port: "{{ ports.localhost.http[application_id] }}"
|
||||
|
||||
- name: "copy docker-compose.yml and env file"
|
||||
include_tasks: copy-docker-compose-and-env.yml
|
||||
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
|
||||
|
@ -23,8 +23,7 @@
|
||||
ipam_config:
|
||||
- subnet: "{{ networks.local.central_ldap.subnet }}"
|
||||
|
||||
- name: "copy docker-compose.yml and env file"
|
||||
include_tasks: copy-docker-compose-and-env.yml
|
||||
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
|
||||
|
||||
- name: "create directory {{ldif_host_path}}{{item}}"
|
||||
file:
|
||||
|
@ -25,8 +25,7 @@
|
||||
dest: "{{docker_compose.directories.config}}config.toml"
|
||||
notify: docker compose project setup
|
||||
|
||||
- name: "copy docker-compose.yml and env file"
|
||||
include_tasks: copy-docker-compose-and-env.yml
|
||||
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
|
||||
|
||||
- name: Check if listmonk database is already initialized
|
||||
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
|
||||
when: run_once_docker_mailu is not defined
|
||||
|
||||
- name: "Copy docker-compose.yml and env file"
|
||||
include_tasks: copy-docker-compose-and-env.yml
|
||||
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
|
||||
when: run_once_docker_mailu is not defined
|
||||
|
||||
- name: Flush docker service handlers
|
||||
|
@ -16,8 +16,7 @@
|
||||
client_max_body_size: "80m"
|
||||
vhost_flavour: "ws_generic"
|
||||
|
||||
- name: "copy docker-compose.yml and env file"
|
||||
include_tasks: copy-docker-compose-and-env.yml
|
||||
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
|
||||
|
||||
- name: flush docker service
|
||||
meta: flush_handlers
|
||||
|
@ -12,8 +12,7 @@
|
||||
http_port: "{{ ports.localhost.http[application_id] }}"
|
||||
when: run_once_docker_matomo is not defined
|
||||
|
||||
- name: "copy docker-compose.yml and env file"
|
||||
include_tasks: copy-docker-compose-and-env.yml
|
||||
- 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
|
||||
|
@ -10,14 +10,7 @@
|
||||
domain: "{{ domains | get_domain(application_id) }}"
|
||||
http_port: "{{ ports.localhost.http[application_id] }}"
|
||||
|
||||
- name: "Transfer Dockerfile to {{ docker_compose.directories.instance }}"
|
||||
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
|
||||
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
|
||||
|
||||
- name: "Configure OIDC login for Moodle if enabled"
|
||||
include_tasks: oidc.yml
|
||||
|
@ -35,8 +35,7 @@
|
||||
dest: "{{docker_compose.directories.volumes}}nginx.conf"
|
||||
notify: restart nextcloud nginx service
|
||||
|
||||
- name: "copy docker-compose.yml and env file"
|
||||
include_tasks: copy-docker-compose-and-env.yml
|
||||
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
|
||||
|
||||
- name: Flush all handlers immediately so that occ can be used
|
||||
meta: flush_handlers
|
||||
|
@ -10,23 +10,16 @@
|
||||
domain: "{{ domains | get_domain(application_id) }}"
|
||||
http_port: "{{ ports.localhost.http[application_id] }}"
|
||||
|
||||
- name: "Create {{openproject_plugins_service}}"
|
||||
- name: "Create {{openproject_plugins_folder}}"
|
||||
file:
|
||||
path: "{{openproject_plugins_service}}"
|
||||
path: "{{openproject_plugins_folder}}"
|
||||
state: directory
|
||||
mode: '0755'
|
||||
|
||||
- name: "Transfering Gemfile.plugins to {{openproject_plugins_service}}"
|
||||
- name: "Transfering Gemfile.plugins to {{openproject_plugins_folder}}"
|
||||
copy:
|
||||
src: Gemfile.plugins
|
||||
dest: "{{openproject_plugins_service}}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"
|
||||
dest: "{{openproject_plugins_folder}}Gemfile.plugins"
|
||||
notify:
|
||||
- docker compose project build and setup
|
||||
|
||||
@ -40,8 +33,7 @@
|
||||
state: directory
|
||||
mode: 0755
|
||||
|
||||
- name: "copy docker-compose.yml and env file"
|
||||
include_tasks: copy-docker-compose-and-env.yml
|
||||
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
|
||||
|
||||
- name: flush docker service
|
||||
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`:
|
||||
# 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.
|
||||
# RUN npm add npm <package-name>*
|
@ -4,7 +4,7 @@ x-op-app: &app
|
||||
driver: journald
|
||||
image: {{custom_openproject_image}}
|
||||
build:
|
||||
context: {{openproject_plugins_service}}
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
|
||||
services:
|
||||
|
@ -9,7 +9,7 @@ ldap:
|
||||
features:
|
||||
matomo: true
|
||||
css: true
|
||||
portfolio_iframe: false
|
||||
portfolio_iframe: false
|
||||
ldap: true
|
||||
central_database: true
|
||||
oauth2: true
|
||||
|
@ -2,7 +2,8 @@ application_id: "openproject"
|
||||
docker_repository_address: "https://github.com/opf/openproject-deploy"
|
||||
database_type: "postgres"
|
||||
|
||||
openproject_plugins_service: "{{docker_compose.directories.services}}plugins/"
|
||||
openproject_plugins_folder: "{{docker_compose.directories.volumes}}plugins/"
|
||||
|
||||
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
|
||||
@ -23,4 +24,4 @@ openproject_filters:
|
||||
|
||||
users: >-
|
||||
{{ '(memberOf=cn=openproject-users,' ~ ldap.dn.application_roles ~ ')'
|
||||
if applications[application_id].ldap.filters.users else '' }}
|
||||
if applications[application_id].ldap.filters.users else '' }}
|
||||
|
@ -11,8 +11,7 @@
|
||||
vars:
|
||||
http: "{{ ports.localhost.http[application_id] }}"
|
||||
|
||||
- name: "copy docker-compose.yml and env file"
|
||||
include_tasks: copy-docker-compose-and-env.yml
|
||||
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
|
||||
|
||||
- name: "Install and activate auth-openid-connect plugin if OIDC is enabled"
|
||||
include_tasks: enable-oidc.yml
|
||||
|
@ -14,5 +14,4 @@
|
||||
include_tasks: configuration.yml
|
||||
when: applications[application_id].server_mode | bool
|
||||
|
||||
- name: "copy docker-compose.yml and env file"
|
||||
include_tasks: copy-docker-compose-and-env.yml
|
||||
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
|
@ -9,5 +9,4 @@
|
||||
domain: "{{ domains | get_domain(application_id) }}"
|
||||
http_port: "{{ ports.localhost.http[application_id] }}"
|
||||
|
||||
- name: "copy docker-compose.yml and env file"
|
||||
include_tasks: copy-docker-compose-and-env.yml
|
||||
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
|
||||
|
@ -10,5 +10,4 @@
|
||||
domain: "{{ domains | get_domain(application_id) }}"
|
||||
http_port: "{{ ports.localhost.http[application_id] }}"
|
||||
|
||||
- name: "copy docker-compose.yml and env file"
|
||||
include_tasks: copy-docker-compose-and-env.yml
|
||||
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
|
||||
|
@ -10,5 +10,4 @@
|
||||
domain: "{{ domains | get_domain(application_id) }}"
|
||||
http_port: "{{ ports.localhost.http[application_id] }}"
|
||||
|
||||
- name: "copy docker-compose.yml and env file"
|
||||
include_tasks: copy-docker-compose-and-env.yml
|
||||
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
|
@ -26,5 +26,4 @@
|
||||
domain: "{{ domains | get_domain(application_id) }}"
|
||||
http_port: "{{ ports.localhost.http[application_id] }}"
|
||||
|
||||
- name: "copy docker-compose.yml and env file"
|
||||
include_tasks: copy-docker-compose-and-env.yml
|
||||
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
|
@ -12,10 +12,4 @@
|
||||
become: true
|
||||
ignore_errors: true
|
||||
|
||||
- name: add docker-compose.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
|
||||
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
|
||||
|
@ -10,5 +10,4 @@
|
||||
domain: "{{ domains | get_domain(application_id) }}"
|
||||
http_port: "{{ ports.localhost.http[application_id] }}"
|
||||
|
||||
- name: "copy docker-compose.yml and env file"
|
||||
include_tasks: copy-docker-compose-and-env.yml
|
||||
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
|
||||
|
@ -22,5 +22,4 @@
|
||||
domain: "{{ domains | get_domain(application_id) }}"
|
||||
http_port: "{{ ports.localhost.http[application_id] }}"
|
||||
|
||||
- name: "copy docker-compose.yml and env file"
|
||||
include_tasks: copy-docker-compose-and-env.yml
|
||||
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
|
@ -27,5 +27,4 @@
|
||||
force: yes
|
||||
notify: docker compose project setup
|
||||
|
||||
- name: "copy docker-compose.yml and env file"
|
||||
include_tasks: copy-docker-compose-and-env.yml
|
||||
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
|
||||
|
@ -28,5 +28,4 @@
|
||||
dest: "{{docker_compose_init}}"
|
||||
notify: docker compose project build and setup
|
||||
|
||||
- name: "copy docker-compose.yml and env file"
|
||||
include_tasks: copy-docker-compose-and-env.yml
|
||||
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
|
||||
|
@ -25,14 +25,7 @@
|
||||
dest: "{{ host_msmtp_conf }}"
|
||||
notify: docker compose project build and setup
|
||||
|
||||
- name: "Transfering Dockerfile to {{ docker_compose.directories.instance }}"
|
||||
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
|
||||
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
|
||||
|
||||
- name: "Install wordpress"
|
||||
include_tasks: install.yml
|
||||
|
@ -1,4 +1,4 @@
|
||||
FROM wordpress
|
||||
FROM wordpress:{{applications[application_id].version}}
|
||||
|
||||
# Install msmtp and update system
|
||||
RUN apt-get update && \
|
@ -10,5 +10,4 @@
|
||||
domain: "{{ domains | get_domain(application_id) }}"
|
||||
http_port: "{{ ports.localhost.http[application_id] }}"
|
||||
|
||||
- name: "copy docker-compose.yml and env file"
|
||||
include_tasks: copy-docker-compose-and-env.yml
|
||||
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.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
|
||||
|
||||
- name: "Integrate Docker Role includes"
|
||||
include_tasks: "include-docker-roles.yml"
|
||||
include_tasks: "./tasks/utils/docker-roles.yml"
|
||||
|
||||
# Native Webserver Roles
|
||||
- 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