mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-30 07:18:09 +02:00
Restructure and cleaned up in preparation of new backup logic
This commit is contained in:
@@ -1,50 +0,0 @@
|
||||
- name: Assert all required application_id-based variables are defined
|
||||
vars:
|
||||
missing_keys: []
|
||||
block:
|
||||
- name: Check if applications[application_id] exists
|
||||
set_fact:
|
||||
missing_keys: "{{ missing_keys + ['applications'] }}"
|
||||
when: applications.get(application_id, None) is not defined
|
||||
|
||||
- name: Check if applications[application_id].docker.services.database.enabled exists
|
||||
set_fact:
|
||||
missing_keys: "{{ missing_keys + ['applications.{}.docker.services.database.enabled'.format(application_id)] }}"
|
||||
when: applications[application_id].docker.services.database is not defined
|
||||
|
||||
- name: Check if applications[application_id].docker.services.redis.enabled exists
|
||||
set_fact:
|
||||
missing_keys: "{{ missing_keys + ['applications.{}.docker.services.redis.enabled'.format(application_id)] }}"
|
||||
when: applications[application_id].docker.services.redis is not defined
|
||||
|
||||
- name: Check if applications | get_app_conf(application_id, 'images.' ~ application_id, True) exists
|
||||
set_fact:
|
||||
missing_keys: "{{ missing_keys + ['applications.{}.images.{}'.format(application_id, application_id)] }}"
|
||||
when: applications[application_id].images is not defined or applications[application_id].images.get(application_id) is not defined
|
||||
|
||||
- name: Check if applications[application_id].features exists
|
||||
set_fact:
|
||||
missing_keys: "{{ missing_keys + ['applications.{}.features'.format(application_id)] }}"
|
||||
when: applications[application_id].features is not defined
|
||||
|
||||
- name: Check if ports.localhost.oauth2_proxy[application_id] exists
|
||||
set_fact:
|
||||
missing_keys: "{{ missing_keys + ['ports.localhost.oauth2_proxy.{}'.format(application_id)] }}"
|
||||
when: ports.localhost.oauth2_proxy get(application_id, None) is not defined
|
||||
|
||||
- name: Check if ports.localhost.http[application_id] exists
|
||||
set_fact:
|
||||
missing_keys: "{{ missing_keys + ['ports.localhost.http.{}'.format(application_id)] }}"
|
||||
when: ports.localhost.http get(application_id, None) is not defined
|
||||
|
||||
- name: Check if networks.local[application_id].subnet exists (optional)
|
||||
set_fact:
|
||||
missing_keys: "{{ missing_keys + ['networks.local.{}.subnet'.format(application_id)] }}"
|
||||
when: networks.local.get(application_id, None) is not defined or networks.local[application_id].get('subnet', None) is not defined
|
||||
|
||||
- name: Fail if any required keys are missing
|
||||
debug:
|
||||
msg: |
|
||||
The following variables/keys for application_id {{ application_id }} are not defined or not accessible:
|
||||
{{ missing_keys | join('\n- ') }}
|
||||
Please define them in your group_vars, host_vars, or inventory.
|
@@ -2,10 +2,10 @@
|
||||
# Better load the repositories into /opt/docker/[servicename]/services, build them there and then use a docker-compose file for customizing
|
||||
# @todo Refactor\Remove
|
||||
# @deprecated
|
||||
- name: "Merge detached_files with applications['oauth2-proxy'].configuration_file"
|
||||
- name: "Merge detached_files with applications | get_app_conf('oauth2-proxy' 'configuration_file')"
|
||||
set_fact:
|
||||
merged_detached_files: "{{ detached_files + [applications['oauth2-proxy'].configuration_file] }}"
|
||||
when: applications[application_id].get('features', {}).get('oauth2', False) | bool
|
||||
merged_detached_files: "{{ detached_files + [applications | get_app_conf('oauth2-proxy' 'configuration_file')] }}"
|
||||
when: "{{ applications | get_app_conf(application_id,'features.oauth2')"
|
||||
|
||||
- name: "backup detached files"
|
||||
command: >
|
||||
|
Reference in New Issue
Block a user