Renamed DOCKER_COMPOSE to COMPOSE

This commit is contained in:
kevinveenbirkenbach committed 2026-02-06 10:33:50 +01:00
1 parent b0c29b6ea0
commit 1db08dbb79
23 files changed
+53 -55

No files matched your search

+2 -2
View File
@@ -3,9 +3,9 @@
PATH_ADMINISTRATOR_HOME: "/home/administrator/"
PATH_ROOT_SCRIPTS: "/opt/scripts/"
PATH_SYSTEMCTL_SCRIPTS: "{{ [ PATH_ROOT_SCRIPTS, 'systemctl' ] | path_join }}"
PATH_DOCKER_COMPOSE_INSTANCES: "/opt/compose/"
PATH_COMPOSE_INSTANCES: "/opt/compose/"
PATH_SYSTEM_SERVICE_DIR: "/etc/systemd/system"
PATH_DOCKER_COMPOSE_PULL_LOCK_DIR: "/run/ansible/compose-pull/"
PATH_COMPOSE_PULL_LOCK_DIR: "/run/ansible/compose-pull/"
# Executable files
PATH_BIN: "/usr/local/bin/"
+3 -3
View File
@@ -21,7 +21,7 @@
# IMPORTANT (your requested change):
# - This lookup NO LONGER reads variables['docker_compose'].
# - It ALWAYS builds docker_compose paths via module_utils.docker_paths_utils.get_docker_paths()
# using PATH_DOCKER_COMPOSE_INSTANCES.
# using PATH_COMPOSE_INSTANCES.
from __future__ import annotations
@@ -129,10 +129,10 @@ class LookupModule(LookupBase):
templar = getattr(self, "_templar", None)
# ALWAYS build docker_compose via module_utils (no dependency on variables['docker_compose'])
base_dir = _as_str(variables.get("PATH_DOCKER_COMPOSE_INSTANCES"))
base_dir = _as_str(variables.get("PATH_COMPOSE_INSTANCES"))
if not base_dir:
raise AnsibleError(
"compose_f_args: missing required variable 'PATH_DOCKER_COMPOSE_INSTANCES'"
"compose_f_args: missing required variable 'PATH_COMPOSE_INSTANCES'"
)
docker_compose = get_docker_paths(application_id, base_dir)
+2 -2
View File
@@ -21,7 +21,7 @@ class LookupModule(LookupBase):
Inputs:
- term[0] = database_consumer_id
- reads these from Ansible vars:
applications, ports, PATH_DOCKER_COMPOSE_INSTANCES
applications, ports, PATH_COMPOSE_INSTANCES
Output keys (no prefixes):
id,
@@ -52,7 +52,7 @@ class LookupModule(LookupBase):
vars_ = variables or self._templar.available_variables
applications = self._require_var(vars_, "applications")
ports = self._require_var(vars_, "ports")
path_instances = self._require_var(vars_, "PATH_DOCKER_COMPOSE_INSTANCES")
path_instances = self._require_var(vars_, "PATH_COMPOSE_INSTANCES")
consumer_entity = get_entity_name(consumer_id)
+2 -4
View File
@@ -39,11 +39,9 @@ class LookupModule(LookupBase):
if not application_id:
raise AnsibleError("lookup('docker'): application_id is empty")
base = _as_str((variables or {}).get("PATH_DOCKER_COMPOSE_INSTANCES"))
base = _as_str((variables or {}).get("PATH_COMPOSE_INSTANCES"))
if not base:
raise AnsibleError(
"lookup('docker'): PATH_DOCKER_COMPOSE_INSTANCES not set"
)
raise AnsibleError("lookup('docker'): PATH_COMPOSE_INSTANCES not set")
docker_dict = get_docker_paths(application_id, base)
+1 -1
View File
@@ -45,7 +45,7 @@ BKP_DOCKER_2_LOC_CLI_ARGS_LIST:
# Main baudolo command
BKP_DOCKER_2_LOC_EXEC: >-
/usr/bin/baudolo
--compose-dir {{ PATH_DOCKER_COMPOSE_INSTANCES }}
--compose-dir {{ PATH_COMPOSE_INSTANCES }}
--databases-csv {{ PATH_INFINITO_DATABASE_SECRETS }}
--backups-dir {{ PATH_INFINITO_BACKUP_DIR }}
--dump-only
@@ -9,7 +9,7 @@
system_service_on_calendar: "{{ SYS_SCHEDULE_REPAIR_DOCKER_HARD }}"
system_service_timer_enabled: true
system_service_tpl_exec_start_pre: '/usr/bin/python {{ PATH_LOCK }} {{ SYS_SERVICE_GROUP_MANIPULATION | join(" ") }} --ignore {{ SYS_SERVICE_REPAIR_CONTAINER_HARD }} {{ SYS_SERVICE_GROUP_CLEANUP | join(" ") }} --timeout "{{ SYS_TIMEOUT_CONTAINER_RPR_HARD }}"'
system_service_tpl_exec_start: '{{ system_service_script_exec }} {{ PATH_DOCKER_COMPOSE_INSTANCES }}'
system_service_tpl_exec_start: '{{ system_service_script_exec }} {{ PATH_COMPOSE_INSTANCES }}'
system_service_tpl_exec_start_post: "/usr/bin/systemctl start {{ SYS_SERVICE_CLEANUP_ANONYMOUS_VOLUMES }}"
system_service_tpl_on_failure: "{{ SYS_SERVICE_ON_FAILURE_COMPOSE }}"
system_service_force_linear_sync: true
@@ -9,7 +9,7 @@
system_service_tpl_on_failure: "{{ SYS_SERVICE_ON_FAILURE_COMPOSE }}"
system_service_tpl_exec_start_pre: "/usr/bin/python {{ PATH_LOCK }} {{ SYS_SERVICE_GROUP_MANIPULATION | join(' ') }} --ignore {{ SYS_SERVICE_GROUP_CLEANUP| join(' ') }} {{ SYS_SERVICE_REPAIR_CONTAINER_SOFT }} --timeout '{{ SYS_TIMEOUT_CONTAINER_RPR_SOFT }}'"
system_service_tpl_exec_start: >
/bin/sh -c '{{ system_service_script_exec }} --manipulation-string "{{ SYS_SERVICE_GROUP_MANIPULATION | join(" ") }}" {{ PATH_DOCKER_COMPOSE_INSTANCES }}'
/bin/sh -c '{{ system_service_script_exec }} --manipulation-string "{{ SYS_SERVICE_GROUP_MANIPULATION | join(" ") }}" {{ PATH_COMPOSE_INSTANCES }}'
system_service_force_linear_sync: true
- include_tasks: utils/once/flag.yml
+1 -1
View File
@@ -1,3 +1,3 @@
docker_compose_flush_handlers: false # Set to true in the vars/main.yml of the including role to autoflush after docker compose routine
docker_git_repository_pull: "{{ docker_git_repository_address is defined and docker_git_repository_address is string and docker_git_repository_address | length > 0 }}"
DOCKER_COMPOSE_LOAD_SERVICES: true # Implemented to deploy roles during development faster by skipping dependencies
COMPOSE_LOAD_SERVICES: true # Implemented to deploy roles during development faster by skipping dependencies
+1 -1
View File
@@ -24,7 +24,7 @@
--project {{ application_id | get_entity_name }}
--compose-files {{ lookup('compose_f_args', application_id, include_ca=False) | quote }}
{% if lookup('docker', application_id, 'files.env') is file %}--env-file {{ lookup('docker', application_id, 'files.env') }}{% endif %}
--lock-dir {{ PATH_DOCKER_COMPOSE_PULL_LOCK_DIR }}
--lock-dir {{ PATH_COMPOSE_PULL_LOCK_DIR }}
--lock-key {{ lookup('docker', application_id, 'directories.instance') | hash('sha1') }}
--attempts 6
--sleep 20
+4 -4
View File
@@ -7,16 +7,16 @@
- name: Remove all docker compose pull locks
file:
path: "{{ PATH_DOCKER_COMPOSE_PULL_LOCK_DIR }}"
path: "{{ PATH_COMPOSE_PULL_LOCK_DIR }}"
state: absent
- name: "reset (if enabled) for {{ role_name}}"
include_tasks: 02_reset.yml
when: MODE_RESET | bool
- name: "create {{ PATH_DOCKER_COMPOSE_INSTANCES }}"
- name: "create {{ PATH_COMPOSE_INSTANCES }}"
file:
path: "{{ PATH_DOCKER_COMPOSE_INSTANCES }}"
path: "{{ PATH_COMPOSE_INSTANCES }}"
state: directory
mode: 0700
owner: root
@@ -42,4 +42,4 @@
- sys-ctl-rpr-container-hard
loop_control:
loop_var: service_role
when: DOCKER_COMPOSE_LOAD_SERVICES | bool
when: COMPOSE_LOAD_SERVICES | bool
+6 -6
View File
@@ -1,16 +1,16 @@
# It is necessary to shut the projects down, when reset is activated.
# Otherwise it can lead to this bug:
# https://github.com/ansible/ansible/issues/10244
- name: "pkgmgr install '{{ DOCKER_COMPOSE_DOWN_ALL_PACKAGE }}'"
- name: "pkgmgr install '{{ COMPOSE_DOWN_ALL_PACKAGE }}'"
include_role:
name: pkgmgr-install
vars:
package_name: "{{ DOCKER_COMPOSE_DOWN_ALL_PACKAGE }}"
package_name: "{{ COMPOSE_DOWN_ALL_PACKAGE }}"
- name: Shutdown all docker compose instances in '{{ PATH_DOCKER_COMPOSE_INSTANCES }}' with '{{ DOCKER_COMPOSE_DOWN_ALL_PACKAGE }}'
command: "{{ DOCKER_COMPOSE_DOWN_ALL_PACKAGE }} {{ PATH_DOCKER_COMPOSE_INSTANCES }}"
- name: Shutdown all docker compose instances in '{{ PATH_COMPOSE_INSTANCES }}' with '{{ COMPOSE_DOWN_ALL_PACKAGE }}'
command: "{{ COMPOSE_DOWN_ALL_PACKAGE }} {{ PATH_COMPOSE_INSTANCES }}"
- name: "Remove directory '{{ PATH_DOCKER_COMPOSE_INSTANCES }}' and all its contents"
- name: "Remove directory '{{ PATH_COMPOSE_INSTANCES }}' and all its contents"
file:
path: "{{ PATH_DOCKER_COMPOSE_INSTANCES }}"
path: "{{ PATH_COMPOSE_INSTANCES }}"
state: absent
+1 -1
View File
@@ -1 +1 @@
DOCKER_COMPOSE_DOWN_ALL_PACKAGE: "docodol"
COMPOSE_DOWN_ALL_PACKAGE: "docodol"
+2 -2
View File
@@ -1,7 +1,7 @@
---
- name: "Check if {{ PATH_DOCKER_COMPOSE_INSTANCES }} directory exists"
- name: "Check if {{ PATH_COMPOSE_INSTANCES }} directory exists"
stat:
path: "{{ PATH_DOCKER_COMPOSE_INSTANCES }}"
path: "{{ PATH_COMPOSE_INSTANCES }}"
register: docker_compose_directory_stat
- name: "Update with pacman"
@@ -40,8 +40,8 @@
set_fact:
BBB_ENV_FILE_LINK: "{{ [ docker_repository_path, '.env' ] | path_join }}"
BBB_ENV_FILE_ORIGINE: "{{ lookup('docker', application_id, 'files.env') }}"
BBB_DOCKER_COMPOSE_FILE_ORIGINE: "{{ [ docker_repository_path, 'docker-compose.yml' ] | path_join }}"
BBB_DOCKER_COMPOSE_FILE_FINAL: "{{ [ lookup('docker', application_id, 'directories.instance'), 'docker-compose.yml' ] | path_join }}"
BBB_COMPOSE_FILE_ORIGINE: "{{ [ docker_repository_path, 'docker-compose.yml' ] | path_join }}"
BBB_COMPOSE_FILE_FINAL: "{{ [ lookup('docker', application_id, 'directories.instance'), 'docker-compose.yml' ] | path_join }}"
- name: Write docker-compose.override.yml for BigBlueButton
template:
@@ -8,13 +8,13 @@
- name: Slurp docker-compose.yml from remote host
slurp:
src: "{{ BBB_DOCKER_COMPOSE_FILE_ORIGINE }}"
src: "{{ BBB_COMPOSE_FILE_ORIGINE }}"
register: compose_slurp
- name: Transform docker-compose.yml with compose_mods
copy:
content: "{{ compose_slurp.content | b64decode | compose_mods(docker_repository_path, lookup('docker', application_id, 'files.env')) }}"
dest: "{{ BBB_DOCKER_COMPOSE_FILE_FINAL }}"
dest: "{{ BBB_COMPOSE_FILE_FINAL }}"
notify:
- docker compose up
+2 -2
View File
@@ -5,9 +5,9 @@
It is a helper role only. Direct use would lead to confusion due to application_id mismatch.
when: role_name == "web-app-oauth2-proxy"
- name: "Transfering oauth2-proxy-keycloak.cfg.j2 to {{( application_id | get_docker_paths(PATH_DOCKER_COMPOSE_INSTANCES) ).directories.volumes }}"
- name: "Transfering oauth2-proxy-keycloak.cfg.j2 to {{( application_id | get_docker_paths(PATH_COMPOSE_INSTANCES) ).directories.volumes }}"
template:
src: "{{ playbook_dir }}/roles/web-app-oauth2-proxy/templates/oauth2-proxy-keycloak.cfg.j2"
dest: "{{( application_id | get_docker_paths(PATH_DOCKER_COMPOSE_INSTANCES) ).directories.volumes }}{{ applications | get_app_conf('web-app-oauth2-proxy','configuration_file') }}"
dest: "{{( application_id | get_docker_paths(PATH_COMPOSE_INSTANCES) ).directories.volumes }}{{ applications | get_app_conf('web-app-oauth2-proxy','configuration_file') }}"
notify:
- docker compose up
+1 -1
View File
@@ -101,7 +101,7 @@ docker volume rm pixelfed_application_data pixelfed_database pixelfed_redis
To update your Pixelfed instance, navigate to the directory where your `docker-compose.yml` file is located and run these commands:
```bash
cd {{ PATH_DOCKER_COMPOSE_INSTANCES }}pixelfed/ &&
cd {{ PATH_COMPOSE_INSTANCES }}pixelfed/ &&
docker-compose down &&
docker network prune -f &&
docker-compose pull &&
@@ -1,8 +1,8 @@
- name: "Run Taiga migrations (required before admin creation)"
command: >
docker compose
-f {{ TAIGA_DOCKER_COMPOSE_PATH }}
-f {{ TAIGA_DOCKER_COMPOSE_INIT_PATH }}
-f {{ TAIGA_COMPOSE_PATH }}
-f {{ TAIGA_COMPOSE_INIT_PATH }}
run --rm {{ TAIGA_MANAGER_SERVICE }}
migrate --noinput
args:
@@ -13,8 +13,8 @@
- name: "Create Taiga admin user (idempotent)"
command: >
docker compose
-f {{ TAIGA_DOCKER_COMPOSE_PATH }}
-f {{ TAIGA_DOCKER_COMPOSE_INIT_PATH }}
-f {{ TAIGA_COMPOSE_PATH }}
-f {{ TAIGA_COMPOSE_INIT_PATH }}
run --rm {{ TAIGA_MANAGER_SERVICE }}
createsuperuser --noinput
--username {{ TAIGA_SUPERUSER_NAME }}
@@ -33,8 +33,8 @@
- name: "Upsert Taiga admin via manage.py shell"
command: >
docker compose
-f {{ TAIGA_DOCKER_COMPOSE_PATH }}
-f {{ TAIGA_DOCKER_COMPOSE_INIT_PATH }}
-f {{ TAIGA_COMPOSE_PATH }}
-f {{ TAIGA_COMPOSE_INIT_PATH }}
run --rm
-e DJANGO_SUPERUSER_PASSWORD={{ TAIGA_SUPERUSER_PASSWORD | quote }}
{{ TAIGA_MANAGER_SERVICE }}
+2 -2
View File
@@ -15,10 +15,10 @@
notify: docker compose up
loop: "{{ TAIGA_SETTING_FILES }}"
- name: "create {{ TAIGA_DOCKER_COMPOSE_INIT_PATH }}"
- name: "create {{ TAIGA_COMPOSE_INIT_PATH }}"
template:
src: "docker-compose-inits.yml.j2"
dest: "{{ TAIGA_DOCKER_COMPOSE_INIT_PATH }}"
dest: "{{ TAIGA_COMPOSE_INIT_PATH }}"
notify: docker compose up
- name: "Include Taiga administrator routines"
+2 -2
View File
@@ -22,8 +22,8 @@ TAIGA_FLAVOR_TAIGAIO: "{{ TAIGA_OIDC_FLAVOR == 'taigaio' }}"
TAIGA_TAIGAIO_ENABLED: "{{ TAIGA_OIDC_ENABLED and TAIGA_FLAVOR_TAIGAIO }}"
## Docker
TAIGA_DOCKER_COMPOSE_INIT_PATH: "{{ [ lookup('docker', application_id, 'directories.instance'),'docker-compose-inits.yml' ] | path_join }}"
TAIGA_DOCKER_COMPOSE_PATH: "{{ [ lookup('docker', application_id, 'directories.instance'),'docker-compose.yml' ] | path_join }}"
TAIGA_COMPOSE_INIT_PATH: "{{ [ lookup('docker', application_id, 'directories.instance'),'docker-compose-inits.yml' ] | path_join }}"
TAIGA_COMPOSE_PATH: "{{ [ lookup('docker', application_id, 'directories.instance'),'docker-compose.yml' ] | path_join }}"
TAIGA_DOCKER_IMAGE_BACKEND: "{{ 'robrotheram/taiga-back-openid' if TAIGA_ROBROTHERAM_ENABLED else 'taigaio/taiga-back' }}"
TAIGA_DOCKER_IMAGE_FRONTEND: "{{ 'robrotheram/taiga-front-openid' if TAIGA_ROBROTHERAM_ENABLED else 'taigaio/taiga-front' }}"
TAIGA_FRONTEND_CONF_PATH: "{{ [ lookup('docker', application_id, 'directories.config'),'conf.json' ] | path_join }}"
@@ -44,9 +44,9 @@ class TestComposeFArgs(unittest.TestCase):
self.lookup._templar = object()
# compose_f_args no longer reads variables['docker_compose'].
# It builds docker_compose via get_docker_paths(application_id, PATH_DOCKER_COMPOSE_INSTANCES).
# It builds docker_compose via get_docker_paths(application_id, PATH_COMPOSE_INSTANCES).
self.vars = {
"PATH_DOCKER_COMPOSE_INSTANCES": "/x/",
"PATH_COMPOSE_INSTANCES": "/x/",
"domains": {
"web-app-a": "example.invalid",
},
+5 -5
View File
@@ -64,7 +64,7 @@ class DatabaseLookupTests(unittest.TestCase):
vars_ = {
"applications": applications,
"ports": ports,
"PATH_DOCKER_COMPOSE_INSTANCES": "/opt/compose/",
"PATH_COMPOSE_INSTANCES": "/opt/compose/",
}
lookup = self._make_lookup(vars_)
@@ -125,7 +125,7 @@ class DatabaseLookupTests(unittest.TestCase):
vars_ = {
"applications": applications,
"ports": ports,
"PATH_DOCKER_COMPOSE_INSTANCES": "/opt/compose/",
"PATH_COMPOSE_INSTANCES": "/opt/compose/",
}
lookup = self._make_lookup(vars_)
@@ -187,7 +187,7 @@ class DatabaseLookupTests(unittest.TestCase):
vars_ = {
"applications": applications,
"ports": ports,
"PATH_DOCKER_COMPOSE_INSTANCES": "/opt/compose/",
"PATH_COMPOSE_INSTANCES": "/opt/compose/",
}
lookup = self._make_lookup(vars_)
@@ -246,7 +246,7 @@ class DatabaseLookupTests(unittest.TestCase):
vars_ = {
"applications": applications,
"ports": ports,
"PATH_DOCKER_COMPOSE_INSTANCES": "/opt/compose/",
"PATH_COMPOSE_INSTANCES": "/opt/compose/",
}
lookup = self._make_lookup(vars_)
@@ -298,7 +298,7 @@ class DatabaseLookupTests(unittest.TestCase):
vars_ = {
"applications": applications,
"ports": ports,
"PATH_DOCKER_COMPOSE_INSTANCES": "/opt/compose/",
"PATH_COMPOSE_INSTANCES": "/opt/compose/",
}
lookup = self._make_lookup(vars_)
+2 -2
View File
@@ -28,7 +28,7 @@ class TestLookupDocker(unittest.TestCase):
def setUp(self):
self.lookup = self.LookupModule()
self.vars_ok = {"PATH_DOCKER_COMPOSE_INSTANCES": "/opt/compose/"}
self.vars_ok = {"PATH_COMPOSE_INSTANCES": "/opt/compose/"}
self.fake_paths = {
"directories": {
@@ -99,7 +99,7 @@ class TestLookupDocker(unittest.TestCase):
with patch.object(self.mod, "get_docker_paths", return_value=self.fake_paths):
with self.assertRaises(AnsibleError) as ctx:
self.lookup.run(["web-app-mailu"], variables={})
self.assertIn("PATH_DOCKER_COMPOSE_INSTANCES not set", str(ctx.exception))
self.assertIn("PATH_COMPOSE_INSTANCES not set", str(ctx.exception))
def test_empty_application_id_raises(self):
with patch.object(self.mod, "get_docker_paths", return_value=self.fake_paths):