diff --git a/README.md b/README.md index 734cc36..213cb55 100644 --- a/README.md +++ b/README.md @@ -108,6 +108,3 @@ AWX tar -xzf k9s_*.tar.gz -C . ln -s /etc/kubernetes/k9s/k9s /usr/bin/k9s kubectl taint nodes --all node-role.kubernetes.io/master- - -Wordpress Database Dump - ansible-playbook upload-database-dumb.yml -e "cluster_services_str='connect,connect_wordpress' stage='dev' upload_file="smardigo/wordpress_portal.sql.gz"" diff --git a/create-database-backup.yml b/create-database-backup.yml index a17ebdd..983b26b 100644 --- a/create-database-backup.yml +++ b/create-database-backup.yml @@ -10,9 +10,10 @@ # stage := the type of the stage (e.g. dev, int, qa, prod) # tenant_id := (unique key for the tenant, e.g. customer) # cluster_name := (business name for the cluster, e.g. product, department ) -# cluster_size := (WIP node count for the cluster) (Currently max is 2 master/slave) -# cluster_services_str := (services to setup, e.g. 'connect,wordpress') -# custom_backup_name := defines a substring for backup file => {{ stage }}_{{ tenant_id }}_{{ cluster_name }}_{{ cluster_services_str }}__gehtdichnixan.sql +# cluster_size := (WIP node count for the cluster) +# cluster_service := (service to setup, e.g. 'connect', ...) +# cluster_features := (optional features to use, e.g. ['wordpress', 'resubmission', ...]) +# custom_backup_name := defines a substring for backup file => {{ stage }}_{{ tenant_id }}_{{ cluster_name }}_{{ cluster_service }}__gehtdichnixan.sql # smardigo message callback # scope_id := (scope id of the management process) # process_instance_id := (process instance id of the management process) @@ -34,11 +35,12 @@ - ansible_version.minor >= 10 msg: "The ansible version has to be at least ({{ ansible_version.full }})" - - name: "Parsing cluster_services_str into cluster_services" - set_fact: - cluster_services: "{{ cluster_services_str | split(',') }}" - tags: - - always + - name: "Add <{{ stage }}-smardigo-management-message> to hosts" + add_host: + name: "{{ stage }}-smardigo-management-message" + groups: + - "stage_{{ stage }}" + changed_when: False tasks: - name: "Add postgres servers to hosts if necessary" @@ -48,19 +50,19 @@ - "stage_{{ stage }}" - "{{ item }}" changed_when: False - with_items: "{{ cluster_services }}" - when: item in ['connect', 'management_connect', 'keycloak', 'webdav', 'gitea', 'workflow_index', 'workflow_proxy'] + with_items: "{{ cluster_features }}" + when: item in ['connect', 'management_connect', 'keycloak', 'webdav', 'gitea', 'workflow_index', 'workflow_proxy', 'pdns'] ############################################################# -# create database backup +# Creating database backups for created inventory ############################################################# -- hosts: "stage_{{ stage }}" +- hosts: "stage_{{ stage }}:!{{ stage }}-smardigo-management-message" serial: "{{ serial_number | default(1) }}" remote_user: root vars: - ansible_ssh_host: "{{ stage_server_domain }}" postgres_backup_state: dump + ansible_ssh_host: "{{ stage_server_domain }}" roles: - role: connect-postgres @@ -82,10 +84,10 @@ when: "'workflow_proxy' in group_names" ############################################################# -# Sending smardigo management message to process +# Sending smardigo management message to process ############################################################# -- hosts: "stage_{{ stage }}" +- hosts: "{{ stage }}-smardigo-management-message" serial: "{{ serial_number | default(1) }}" gather_facts: false connection: local diff --git a/create-database.yml b/create-database.yml index 03901dc..c831967 100644 --- a/create-database.yml +++ b/create-database.yml @@ -17,8 +17,9 @@ # stage := the type of the stage (e.g. dev, int, qa, prod) # tenant_id := (unique key for the tenant, e.g. customer) # cluster_name := (business name for the cluster, e.g. product, department ) -# cluster_size := (WIP node count for the cluster) (Currently max is 2 master/slave) -# cluster_services_str := (services to setup, e.g. 'connect,wordpress') +# cluster_size := (WIP node count for the cluster) +# cluster_service := (service to setup, e.g. 'connect', ...) +# cluster_features := (optional features to use, e.g. ['wordpress', 'resubmission', ...]) # smardigo message callback # scope_id := (scope id of the management process) # process_instance_id := (process instance id of the management process) @@ -40,35 +41,39 @@ - ansible_version.minor >= 10 msg: "The ansible version has to be at least ({{ ansible_version.full }})" - - set_fact: - cluster_services: "{{ cluster_services_str | split(',') }}" + - name: "Add <{{ stage }}-smardigo-management-message> to hosts" + add_host: + name: "{{ stage }}-smardigo-management-message" + groups: + - "stage_{{ stage }}" + changed_when: False tasks: - - name: Add postgres servers to hosts if necessary + - name: "Add postgres servers to hosts if necessary" add_host: name: "{{ stage }}-postgres-01" groups: - "stage_{{ stage }}" - "{{ item }}" changed_when: False - with_items: "{{ cluster_services }}" + with_items: "{{ cluster_features }}" when: item in ['connect', 'management_connect', 'keycloak', 'webdav', 'gitea', 'workflow_index', 'workflow_proxy', 'pdns'] - - name: Add maria servers to hosts if necessary + - name: "Add maria servers to hosts if necessary" add_host: name: "{{ stage }}-maria-01" groups: - "stage_{{ stage }}" - "{{ item }}" changed_when: False - with_items: "{{ cluster_services }}" + with_items: "{{ cluster_features }}" when: item in ['connect_wordpress'] ############################################################# -# Setup databases for created inventory +# Creating databases for created inventory ############################################################# -- hosts: "stage_{{ stage }}" +- hosts: "stage_{{ stage }}:!{{ stage }}-smardigo-management-message" serial: "{{ serial_number | default(1) }}" remote_user: root vars: @@ -78,14 +83,10 @@ - name: "Import autodiscover pre-tasks" include_tasks: tasks/autodiscover_pre_tasks.yml - - name: "Parsing cluster_services_str into cluster_services" - set_fact: - cluster_services: "{{ cluster_services_str | split(',') }}" - roles: - role: connect-postgres when: "'connect' in group_names" - + - role: pdns-postgres vars: initialize: True @@ -93,7 +94,7 @@ - role: pdns-admin-postgres vars: - initialize: True + initialize: True when: "'pdns' in group_names" - role: gitea-postgres @@ -115,10 +116,10 @@ when: "'connect_wordpress' in group_names" ############################################################# -# Sending smardigo management message to process +# Sending smardigo management message to process ############################################################# -- hosts: "stage_{{ stage }}" +- hosts: "{{ stage }}-smardigo-management-message" serial: "{{ serial_number | default(1) }}" gather_facts: false connection: local diff --git a/create-kibana-objects.yml b/create-kibana-objects.yml index d64bc83..f5831fa 100644 --- a/create-kibana-objects.yml +++ b/create-kibana-objects.yml @@ -10,8 +10,9 @@ # stage := the type of the stage (e.g. dev, int, qa, prod) # tenant_id := (unique key for the tenant, e.g. customer) # cluster_name := (business name for the cluster, e.g. product, department ) -# cluster_size := (WIP node count for the cluster) (Currently max is 2 master/slave) -# cluster_services_str := (services to setup, e.g. 'connect,wordpress') +# cluster_size := (WIP node count for the cluster) +# cluster_service := (service to setup, e.g. 'connect', ...) +# cluster_features := (optional features to use, e.g. ['wordpress', 'resubmission', ...]) # smardigo message callback # scope_id := (scope id of the management process) # process_instance_id := (process instance id of the management process) @@ -33,22 +34,26 @@ - ansible_version.minor >= 10 msg: "The ansible version has to be at least ({{ ansible_version.full }})" - - set_fact: - cluster_services: "{{ cluster_services_str | split(',') }}" - - tasks: - - name: Add kibana server(s) to hosts if necessary + - name: "Add <{{ stage }}-smardigo-management-message> to hosts" add_host: - name: "{{ stage }}-elastic-stack-kibana-01-kibana" + name: "{{ stage }}-smardigo-management-message" groups: - "stage_{{ stage }}" - with_items: "{{ cluster_services }}" - when: item in ['connect'] + changed_when: False + + tasks: + - name: Add hosts + add_host: + name: "{{ stage }}-{{ tenant_id }}-{{ cluster_name }}-{{ '%02d' | format(item|int) }}" + groups: "{{ ['stage_' + stage ] + [cluster_service] + cluster_features }}" + with_sequence: start=1 end={{ cluster_size | default(1) }} + changed_when: False ############################################################# -# configure elastic search objects +# Creating kibana search objects for created inventory ############################################################# -- hosts: "stage_{{ stage }}" + +- hosts: "stage_{{ stage }}:!{{ stage }}-smardigo-management-message" serial: "{{ serial_number | default(1) }}" gather_facts: no remote_user: root @@ -121,8 +126,8 @@ - osquery - savedObjectsTagging es_indexpattern_name: '{{ stage }}-{{ tenant_id }}-{{ cluster_name }}-*' - es_search_name: '{{ stage }}-{{ tenant_id }}-{{ cluster_name }}-{{ cluster_services_str }}' - es_dashboard_name: '{{ stage }}-{{ tenant_id }}-{{ cluster_name }}-{{ cluster_services_str }}' + es_search_name: '{{ stage }}-{{ tenant_id }}-{{ cluster_name }}-{{ cluster_service }}' + es_dashboard_name: '{{ stage }}-{{ tenant_id }}-{{ cluster_name }}-{{ cluster_service }}' tasks: - name: "Do some stuff in elastic with spaces ... " @@ -184,10 +189,10 @@ - es-importobjects ############################################################# -# Sending smardigo management message to process +# Sending smardigo management message to process ############################################################# -- hosts: "stage_{{ stage }}" +- hosts: "{{ stage }}-smardigo-management-message" serial: "{{ serial_number | default(1) }}" gather_facts: false connection: local diff --git a/create-realm.yml b/create-realm.yml index 81d0b4a..e84d570 100644 --- a/create-realm.yml +++ b/create-realm.yml @@ -9,7 +9,8 @@ # tenant_id := (unique key for the tenant, e.g. customer) # cluster_name := (business name for the cluster, e.g. product, department ) # cluster_size := (WIP node count for the cluster) -# cluster_services_str := (services to setup, e.g. 'connect,wordpress') +# cluster_service := (service to setup, e.g. 'connect', ...) +# cluster_features := (optional features to use, e.g. ['wordpress', 'resubmission', ...]) # playbook roles (keycloak / oidc) # current_realm_name := # current_realm_display_name := @@ -34,22 +35,26 @@ - ansible_version.minor >= 10 msg: "The ansible version has to be at least ({{ ansible_version.full }})" - - set_fact: - cluster_services: "{{ cluster_services_str | split(',') }}" + - name: "Add <{{ stage }}-smardigo-management-message> to hosts" + add_host: + name: "{{ stage }}-smardigo-management-message" + groups: + - "stage_{{ stage }}" + changed_when: False tasks: - name: Add hosts add_host: name: "{{ stage }}-{{ tenant_id }}-{{ cluster_name }}-{{ '%02d' | format(item|int) }}" - groups: "{{ ['stage_' + stage ] + cluster_services }}" + groups: "{{ ['stage_' + stage ] + [cluster_service] + cluster_features }}" with_sequence: start=1 end={{ cluster_size | default(1) }} changed_when: False ############################################################# -# Setup realms for created inventory +# Creating realms for created inventory ############################################################# -- hosts: "stage_{{ stage }}" +- hosts: "stage_{{ stage }}:!{{ stage }}-smardigo-management-message" serial: "{{ serial_number | default(1) }}" gather_facts: false @@ -61,25 +66,21 @@ - name: "Import autodiscover pre-tasks" include_tasks: tasks/autodiscover_pre_tasks.yml - - name: "Parsing cluster_services_str into cluster_services" - set_fact: - cluster_services: "{{ cluster_services_str | split(',') }}" - roles: - role: connect-realm - when: '"connect" in cluster_services' + when: '"connect" in group_names' - role: gitea-realm - when: '"gitea" in cluster_services' + when: '"gitea" in group_names' - role: workflow-proxy-realm - when: '"workflow-proxy" in cluster_services' + when: '"workflow-proxy" in group_names' ############################################################# -# Sending smardigo management message to process +# Sending smardigo management message to process ############################################################# -- hosts: "stage_{{ stage }}" +- hosts: "{{ stage }}-smardigo-management-message" serial: "{{ serial_number | default(1) }}" gather_facts: false connection: local diff --git a/create-server.yml b/create-server.yml index 3c1aa86..8c0a60f 100644 --- a/create-server.yml +++ b/create-server.yml @@ -6,7 +6,7 @@ # tenant_id := (unique key for the tenant, e.g. customer) # cluster_name := (business name for the cluster, e.g. product, department ) # cluster_size := (WIP node count for the cluster) -# cluster_services := (services to setup, e.g. ['connect', 'wordpress', ...]) +# cluster_service := (service to setup, e.g. 'connect', ...) # smardigo message callback # scope_id := (scope id of the management process) # process_instance_id := (process instance id of the management process) @@ -28,6 +28,13 @@ - ansible_version.minor >= 10 msg: "The ansible version has to be at least ({{ ansible_version.full }})" + - name: "Add <{{ stage }}-smardigo-management-message> to hosts" + add_host: + name: "{{ stage }}-smardigo-management-message" + groups: + - "stage_{{ stage }}" + changed_when: False + tasks: - name: Add hosts add_host: @@ -39,10 +46,10 @@ changed_when: False ############################################################# -# Provisioning servers for created inventory +# Creating servers for created inventory ############################################################# -- hosts: "stage_{{ stage }}" +- hosts: "stage_{{ stage }}:!{{ stage }}-smardigo-management-message" serial: "{{ serial_number | default(5) }}" gather_facts: false @@ -83,10 +90,10 @@ - role: hcloud ############################################################# -# Setup servers for created inventory +# Provisioning servers for created inventory ############################################################# -- hosts: "stage_{{ stage }}" +- hosts: "stage_{{ stage }}:!{{ stage }}-smardigo-management-message" serial: "{{ serial_number | default(1) }}" remote_user: root vars: @@ -129,10 +136,10 @@ when: traefik_enabled | default(True) ############################################################# -# Sending smardigo management message to process +# Sending smardigo management message to process ############################################################# -- hosts: "stage_{{ stage }}" +- hosts: "{{ stage }}-smardigo-management-message" serial: "{{ serial_number | default(1) }}" gather_facts: false connection: local diff --git a/create-service.yml b/create-service.yml index 47dc631..d4d98be 100644 --- a/create-service.yml +++ b/create-service.yml @@ -6,7 +6,8 @@ # tenant_id := (unique key for the tenant, e.g. customer) # cluster_name := (business name for the cluster, e.g. product, department ) # cluster_size := (WIP node count for the cluster) -# cluster_services_str := (services to setup, e.g. 'connect,wordpress') +# cluster_service := (service to setup, e.g. 'connect', ...) +# cluster_features := (optional features to use, e.g. ['wordpress', 'resubmission', ...]) # smardigo message callback # scope_id := (scope id of the management process) # process_instance_id := (process instance id of the management process) @@ -28,29 +29,26 @@ - ansible_version.minor >= 10 msg: "The ansible version has to be at least ({{ ansible_version.full }})" - - name: "Parsing cluster_services_str into cluster_services" - set_fact: - cluster_services: "{{ cluster_services_str | split(',') }}" + - name: "Add <{{ stage }}-smardigo-management-message> to hosts" + add_host: + name: "{{ stage }}-smardigo-management-message" + groups: + - "stage_{{ stage }}" + changed_when: False tasks: - name: Add hosts add_host: - name: "{{ stage }}-{{ tenant_id }}-{{ cluster_name }}-01" -# name: "{{ stage }}-{{ tenant_id }}-{{ cluster_name }}-{{ '%02d' | format(item|int) }}" - groups: - - "stage_{{ stage }}" - - "{{ cluster_service }}" - - "{{ item }}" + name: "{{ stage }}-{{ tenant_id }}-{{ cluster_name }}-{{ '%02d' | format(item|int) }}" + groups: "{{ ['stage_' + stage ] + [cluster_service] + cluster_features }}" + with_sequence: start=1 end={{ cluster_size | default(1) }} changed_when: False -# with_sequence: start=1 end={{ cluster_count | default(1) }} - with_items: "{{ cluster_services }}" - when: item in ['connect', 'connect_wordpress'] ############################################################# -# Setup services for created inventory +# Creating services for created inventory ############################################################# -- hosts: "stage_{{ stage }}" +- hosts: "stage_{{ stage }}:!{{ stage }}-smardigo-management-message" serial: "{{ serial_number | default(1) }}" remote_user: root vars: @@ -60,10 +58,6 @@ - name: "Import autodiscover pre-tasks" include_tasks: tasks/autodiscover_pre_tasks.yml - - name: "Parsing cluster_services_str into cluster_services" - set_fact: - cluster_services: "{{ cluster_services_str | split(',') }}" - roles: - role: connect when: "'connect' in group_names" @@ -72,10 +66,10 @@ when: "'connect_wordpress' in group_names" ############################################################# -# Sending smardigo management message to process +# Sending smardigo management message to process ############################################################# -- hosts: "stage_{{ stage }}" +- hosts: "{{ stage }}-smardigo-management-message" serial: "{{ serial_number | default(1) }}" gather_facts: false connection: local diff --git a/group_vars/connect_resubmission/man.yml b/group_vars/connect_resubmission/man.yml new file mode 100644 index 0000000..486df6b --- /dev/null +++ b/group_vars/connect_resubmission/man.yml @@ -0,0 +1,3 @@ +--- + +connect_resubmission_enabled: "true" diff --git a/group_vars/management/plain.yml b/group_vars/management/plain.yml index 7f38f23..7647b33 100644 --- a/group_vars/management/plain.yml +++ b/group_vars/management/plain.yml @@ -14,7 +14,6 @@ spring_profiles_include: "prod,postgres,elastic,swagger" tenant_id: "{{ management_oidc_realm }}" cluster_size: "1" cluster_name: "{{ management_oidc_client_id }}" -cluster_services_str: "connect" current_realm_name: "management" current_realm_display_name: "Stage Management" diff --git a/import-database.yml b/import-database.yml index b988bf2..ee2c5a7 100644 --- a/import-database.yml +++ b/import-database.yml @@ -5,8 +5,9 @@ # stage := the type of the stage (e.g. dev, int, qa, prod) # tenant_id := (unique key for the tenant, e.g. customer) # cluster_name := (business name for the cluster, e.g. product, department ) -# cluster_size := (WIP node count for the cluster) (Currently max is 2 master/slave) -# cluster_services_str := (services to setup, e.g. 'connect,wordpress') +# cluster_size := (WIP node count for the cluster) +# cluster_service := (service to setup, e.g. 'connect', ...) +# cluster_features := (optional features to use, e.g. ['wordpress', 'resubmission', ...]) # database_backup_file := the dump file to import, has to be on the database server under /tmp (e.g. wordpress_portal.sql) # target_database := (optional) the database to import into ( see {{ connect_wordpress_maria_database }}) # smardigo message callback @@ -29,26 +30,30 @@ - ansible_version.major >= 2 - ansible_version.minor >= 10 msg: "The ansible version has to be at least ({{ ansible_version.full }})" - - name: "Parsing cluster_services_str into cluster_services" - set_fact: - cluster_services: "{{ cluster_services_str | split(',') }}" + + - name: "Add <{{ stage }}-smardigo-management-message> to hosts" + add_host: + name: "{{ stage }}-smardigo-management-message" + groups: + - "stage_{{ stage }}" + changed_when: False tasks: - - name: Add hosts + - name: Add maria servers to hosts if necessary add_host: name: "{{ stage }}-maria-01" groups: - "stage_{{ stage }}" - "{{ item }}" - cluster_service: "{{ item }}" changed_when: False - with_items: "{{ cluster_services }}" + with_items: "{{ cluster_features }}" + when: item in ['connect_wordpress'] ############################################################# -# Setup services for created inventory +# Importing database backups for created inventory ############################################################# -- hosts: "stage_{{ stage }}" +- hosts: "stage_{{ stage }}:!{{ stage }}-smardigo-management-message" serial: "{{ serial_number | default(1) }}" remote_user: root vars: @@ -57,9 +62,6 @@ pre_tasks: - name: "Import autodiscover pre-tasks" include_tasks: tasks/autodiscover_pre_tasks.yml - - name: "Parsing cluster_services_str into cluster_services" - set_fact: - cluster_services: "{{ cluster_services_str | split(',') }}" roles: - role: import-maria-database @@ -67,6 +69,7 @@ - "'connect_wordpress' in group_names" - "target_database is defined" - "database_backup_file is defined" + - role: import-maria-database vars: target_database: "{{ connect_wordpress_maria_database }}" @@ -75,10 +78,10 @@ - "database_backup_file is defined" ############################################################# -# Sending smardigo management message to process +# Sending smardigo management message to process ############################################################# -- hosts: "stage_{{ stage }}" +- hosts: "{{ stage }}-smardigo-management-message" serial: "{{ serial_number | default(1) }}" gather_facts: false connection: local diff --git a/remove-database.yml b/remove-database.yml index 21671a6..715d8a7 100644 --- a/remove-database.yml +++ b/remove-database.yml @@ -9,8 +9,9 @@ # stage := the type of the stage (e.g. dev, int, qa, prod) # tenant_id := (unique key for the tenant, e.g. customer) # cluster_name := (business name for the cluster, e.g. product, department ) -# cluster_size := (WIP node count for the cluster) (Currently max is 2 master/slave) -# cluster_services_str := (services to setup, e.g. 'connect,wordpress') +# cluster_size := (WIP node count for the cluster) +# cluster_service := (service to setup, e.g. 'connect', ...) +# cluster_features := (optional features to use, e.g. ['wordpress', 'resubmission', ...]) # smardigo message callback # scope_id := (scope id of the management process) # process_instance_id := (process instance id of the management process) @@ -31,8 +32,13 @@ - ansible_version.major >= 2 - ansible_version.minor >= 10 msg: "The ansible version has to be at least ({{ ansible_version.full }})" - - set_fact: - cluster_services: "{{ cluster_services_str | split(',') }}" + + - name: "Add <{{ stage }}-smardigo-management-message> to hosts" + add_host: + name: "{{ stage }}-smardigo-management-message" + groups: + - "stage_{{ stage }}" + changed_when: False tasks: - name: Add postgres servers to hosts if necessary @@ -42,8 +48,8 @@ - "stage_{{ stage }}" - "{{ item }}" changed_when: False - with_items: "{{ cluster_services }}" - when: item in ['connect', 'management_connect', 'keycloak', 'webdav', 'pdns'] + with_items: "{{ cluster_features }}" + when: item in ['connect', 'management_connect', 'keycloak', 'webdav', 'gitea', 'workflow_index', 'workflow_proxy', 'pdns'] - name: Add maria servers to hosts if necessary add_host: @@ -52,30 +58,26 @@ - "stage_{{ stage }}" - "{{ item }}" changed_when: False - with_items: "{{ cluster_services }}" + with_items: "{{ cluster_features }}" when: item in ['connect_wordpress'] ############################################################# -# Setup databases for created inventory +# Deleting databases for created inventory ############################################################# -- hosts: "stage_{{ stage }}" +- hosts: "stage_{{ stage }}:!{{ stage }}-smardigo-management-message" serial: "{{ serial_number | default(1) }}" remote_user: root vars: + database_state: absent ansible_ssh_host: "{{ stage_server_domain }}" pre_tasks: - name: "Import autodiscover pre-tasks" include_tasks: tasks/autodiscover_pre_tasks.yml - - name: "Parsing cluster_services_str into cluster_services" - set_fact: - cluster_services: "{{ cluster_services_str | split(',') }}" roles: - role: connect-postgres - vars: - database_state: absent when: "'connect' in group_names" - role: pdns-admin-postgres @@ -85,23 +87,19 @@ when: "'pdns' in group_names" - role: keycloak-postgres - vars: - database_state: absent when: "'keycloak' in group_names" - role: webdav-postgres - vars: - database_state: absent when: "'webdav' in group_names" - role: connect-wordpress-maria when: "'connect_wordpress' in group_names" ############################################################# -# Sending smardigo management message to process +# Sending smardigo management message to process ############################################################# -- hosts: "stage_{{ stage }}" +- hosts: "{{ stage }}-smardigo-management-message" serial: "{{ serial_number | default(1) }}" gather_facts: false connection: local diff --git a/remove-realm.yml b/remove-realm.yml index de2b90a..0b9e1df 100644 --- a/remove-realm.yml +++ b/remove-realm.yml @@ -9,7 +9,8 @@ # tenant_id := (unique key for the tenant, e.g. customer) # cluster_name := (business name for the cluster, e.g. product, department ) # cluster_size := (WIP node count for the cluster) -# cluster_services_str := (services to setup, e.g. 'connect,wordpress') +# cluster_service := (service to setup, e.g. 'connect', ...) +# cluster_features := (optional features to use, e.g. ['wordpress', 'resubmission', ...]) # playbook roles (keycloak / oidc) # current_realm_name := # current_realm_display_name := @@ -33,22 +34,27 @@ - ansible_version.major >= 2 - ansible_version.minor >= 10 msg: "The ansible version has to be at least ({{ ansible_version.full }})" - - set_fact: - cluster_services: "{{ cluster_services_str | split(',') }}" + + - name: "Add <{{ stage }}-smardigo-management-message> to hosts" + add_host: + name: "{{ stage }}-smardigo-management-message" + groups: + - "stage_{{ stage }}" + changed_when: False tasks: - name: Add hosts add_host: name: "{{ stage }}-{{ tenant_id }}-{{ cluster_name }}-{{ '%02d' | format(item|int) }}" - groups: "{{ ['stage_' + stage ] + cluster_services }}" + groups: "{{ ['stage_' + stage ] + [cluster_service] + cluster_features }}" with_sequence: start=1 end={{ cluster_size | default(1) }} changed_when: False ############################################################# -# Setup realms for created inventory +# Deleting client for created inventory ############################################################# -- hosts: "stage_{{ stage }}" +- hosts: "stage_{{ stage }}:!{{ stage }}-smardigo-management-message" serial: "{{ serial_number | default(1) }}" gather_facts: false @@ -70,10 +76,10 @@ client_name: "{{ cluster_name }}" ############################################################# -# Sending smardigo management message to process +# Sending smardigo management message to process ############################################################# -- hosts: "stage_{{ stage }}" +- hosts: "{{ stage }}-smardigo-management-message" serial: "{{ serial_number | default(1) }}" gather_facts: false connection: local diff --git a/remove-server.yml b/remove-server.yml index bc90ee7..73e74ca 100644 --- a/remove-server.yml +++ b/remove-server.yml @@ -6,7 +6,7 @@ # tenant_id := (unique key for the tenant, e.g. customer) # cluster_name := (business name for the cluster, e.g. product, department ) # cluster_size := (WIP node count for the cluster) -# cluster_services := (services to setup, e.g. ['connect', 'wordpress', ...]) +# cluster_service := (service to setup, e.g. 'connect', ...) # smardigo message callback # scope_id := (scope id of the management process) # process_instance_id := (process instance id of the management process) @@ -33,6 +33,13 @@ - ansible_version.minor >= 10 msg: "The ansible version has to be at least ({{ ansible_version.full }})" + - name: "Add <{{ stage }}-smardigo-management-message> to hosts" + add_host: + name: "{{ stage }}-smardigo-management-message" + groups: + - "stage_{{ stage }}" + changed_when: False + tasks: - name: Add hosts add_host: @@ -48,7 +55,7 @@ - cluster_service is defined ############################################################# -# Delete and DNS servers for created inventory +# Deleting servers/domains for created inventory ############################################################# - hosts: "stage_{{ stage }}" @@ -62,6 +69,7 @@ tasks_from: _set_server_state vars: - server_state: "absent" + - name: "Delete DNS entry <{{ inventory_hostname }}> for <{{ domain }}>" include_role: name: _digitalocean @@ -70,10 +78,10 @@ record_to_remove: '{{ inventory_hostname }}' ############################################################# -# Sending smardigo management message to process +# Sending smardigo management message to process ############################################################# -- hosts: "stage_{{ stage }}" +- hosts: "{{ stage }}-smardigo-management-message" serial: "{{ serial_number | default(1) }}" gather_facts: false connection: local diff --git a/remove-service.yml b/remove-service.yml index 90a6d2c..882e572 100644 --- a/remove-service.yml +++ b/remove-service.yml @@ -6,7 +6,8 @@ # tenant_id := (unique key for the tenant, e.g. customer) # cluster_name := (business name for the cluster, e.g. product, department ) # cluster_size := (WIP node count for the cluster) -# cluster_services_str := (services to setup, e.g. 'connect,wordpress') +# cluster_service := (service to setup, e.g. 'connect', ...) +# cluster_features := (optional features to use, e.g. ['wordpress', 'resubmission', ...]) # smardigo message callback # scope_id := (scope id of the management process) # process_instance_id := (process instance id of the management process) @@ -27,34 +28,24 @@ - ansible_version.major >= 2 - ansible_version.minor >= 10 msg: "The ansible version has to be at least ({{ ansible_version.full }})" - - name: "Parsing cluster_services_str into cluster_services" - set_fact: - cluster_services: "{{ cluster_services_str | split(',') }}" - tasks: - - name: Add hosts + - name: "Add <{{ stage }}-smardigo-management-message> to hosts" add_host: - name: "{{ stage }}-{{ tenant_id }}-{{ cluster_name }}-01" + name: "{{ stage }}-smardigo-management-message" groups: - "stage_{{ stage }}" - - "{{ cluster_service }}" - - "{{ item }}" changed_when: False - with_items: "{{ cluster_services }}" - when: item in ['connect'] + + tasks: - name: Add hosts add_host: - name: "{{ stage }}-{{ tenant_id }}-{{ cluster_name }}-01" - groups: - - "stage_{{ stage }}" - - "{{ cluster_service }}" - - "{{ item }}" + name: "{{ stage }}-{{ tenant_id }}-{{ cluster_name }}-{{ '%02d' | format(item|int) }}" + groups: "{{ ['stage_' + stage ] + [cluster_service] + cluster_features }}" + with_sequence: start=1 end={{ cluster_size | default(1) }} changed_when: False - with_items: "{{ cluster_services }}" - when: item in ['connect_wordpress'] ############################################################# -# Setup services for created inventory +# Removing services for created inventory ############################################################# - hosts: "stage_{{ stage }}" @@ -83,10 +74,10 @@ when: "'connect_wordpress' in group_names" ############################################################# -# Sending smardigo management message to process +# Sending smardigo management message to process ############################################################# -- hosts: "stage_{{ stage }}" +- hosts: "{{ stage }}-smardigo-management-message" serial: "{{ serial_number | default(1) }}" gather_facts: false connection: local diff --git a/restore-database-backup.yml b/restore-database-backup.yml index cdd17e4..32decda 100644 --- a/restore-database-backup.yml +++ b/restore-database-backup.yml @@ -10,9 +10,9 @@ # stage := the type of the stage (e.g. dev, int, qa, prod) # tenant_id := (unique key for the tenant, e.g. customer) # cluster_name := (business name for the cluster, e.g. product, department ) -# cluster_size := (WIP node count for the cluster) (Currently max is 2 master/slave) -# cluster_services_str := (services to setup, e.g. 'connect,wordpress') -# custom_backup_name := defines a substring for backup file => {{ stage }}_{{ tenant_id }}_{{ cluster_name }}_{{ cluster_services_str }}__gehtdichnixan.sql +# cluster_service := (service to setup, e.g. 'connect', ...) +# cluster_features := (optional features to use, e.g. ['wordpress', 'resubmission', ...]) +# custom_backup_name := defines a substring for backup file => {{ stage }}_{{ tenant_id }}_{{ cluster_name }}_{{ cluster_service }}__gehtdichnixan.sql # smardigo message callback # scope_id := (scope id of the management process) # process_instance_id := (process instance id of the management process) @@ -34,11 +34,12 @@ - ansible_version.minor >= 10 msg: "The ansible version has to be at least ({{ ansible_version.full }})" - - name: "Parsing cluster_services_str into cluster_services" - set_fact: - cluster_services: "{{ cluster_services_str | split(',') }}" - tags: - - always + - name: "Add <{{ stage }}-smardigo-management-message> to hosts" + add_host: + name: "{{ stage }}-smardigo-management-message" + groups: + - "stage_{{ stage }}" + changed_when: False tasks: - name: "Add postgres servers to hosts if necessary" @@ -48,19 +49,19 @@ - "stage_{{ stage }}" - "{{ item }}" changed_when: False - with_items: "{{ cluster_services }}" - when: item in ['connect', 'management_connect', 'keycloak', 'webdav', 'gitea', 'workflow_index', 'workflow_proxy'] + with_items: "{{ cluster_features }}" + when: item in ['connect', 'management_connect', 'keycloak', 'webdav', 'gitea', 'workflow_index', 'workflow_proxy', 'pdns'] ############################################################# -# Setup databases for created inventory +# Restoring databases for created inventory ############################################################# -- hosts: "stage_{{ stage }}" +- hosts: "stage_{{ stage }}:!{{ stage }}-smardigo-management-message" serial: "{{ serial_number | default(1) }}" remote_user: root vars: - ansible_ssh_host: "{{ stage_server_domain }}" postgres_backup_state: restore + ansible_ssh_host: "{{ stage_server_domain }}" roles: - role: connect-postgres @@ -82,10 +83,10 @@ when: "'workflow_proxy' in group_names" ############################################################# -# Sending smardigo management message to process +# Sending smardigo management message to process ############################################################# -- hosts: "stage_{{ stage }}" +- hosts: "{{ stage }}-smardigo-management-message" serial: "{{ serial_number | default(1) }}" gather_facts: false connection: local diff --git a/roles/connect/vars/main.yml b/roles/connect/vars/main.yml index 3cd2444..6f574a4 100644 --- a/roles/connect/vars/main.yml +++ b/roles/connect/vars/main.yml @@ -68,6 +68,7 @@ connect_environment: [ "ELASTIC_MESSAGE_INDEX: \"{{ connect_elastic_message_index | default('message') }}\"", "ELASTIC_ANALYSIS_INDEX: \"{{ connect_elastic_analysis_index | default('analysis') }}\"", + "RESUBMISSION_ENABLED: \"{{ connect_resubmission_enabled | default('false') }}\"", "ELEMENT_TEMPLATE_ENABLED: \"{{ connect_element_template_enabled | default('true') }}\"", "CONFIG_DELETE_SCOPE_ENABLED: \"{{ connect_config_delete_scope_enabled | default('true') }}\"", "EXTERNAL_TASK_SCRIPT_WORKER_ENABLED: \"{{ connect_external_task_script_worker_enabled | default('true') }}\"", @@ -85,6 +86,8 @@ connect_environment: [ "SMA_CORS_ALLOWED_HEADERS: \"*\"", "SMA_CORS_PATH_PATTERN: \"/**\"", + "LOG_LEVEL_CAMUNDA: \"{{ connect_loglevel_camunda | default('OFF') }}\"", + "LOG_LEVEL_JASYPT: \"{{ connect_loglevel_jasypt | default('ERROR') }}\"", "LOG_LEVEL_MESSAGE_QUEUE: \"{{ connect_loglevel_message_queue | default('INFO') }}\"", "LOG_LEVEL_DOCUMENT_INDEX: \"{{ connect_loglevel_document_index | default('INFO') }}\"", "LOG_LEVEL_WORKFLOW_INDEX: \"{{ connect_loglevel_workflow_index | default('INFO') }}\"", diff --git a/smardigo/provisioning/datasource-file/connect-features.xlsx b/smardigo/provisioning/datasource-file/connect-features.xlsx index df0f90a..7cacd79 100644 Binary files a/smardigo/provisioning/datasource-file/connect-features.xlsx and b/smardigo/provisioning/datasource-file/connect-features.xlsx differ diff --git a/smardigo/provisioning/datasource-file/connect-versions.xlsx b/smardigo/provisioning/datasource-file/connect-versions.xlsx new file mode 100644 index 0000000..aba9d32 Binary files /dev/null and b/smardigo/provisioning/datasource-file/connect-versions.xlsx differ diff --git a/smardigo/provisioning/datasource/connect-versions.json b/smardigo/provisioning/datasource/connect-versions.json new file mode 100644 index 0000000..e60f521 --- /dev/null +++ b/smardigo/provisioning/datasource/connect-versions.json @@ -0,0 +1 @@ +{"name":"connect-versions","restApi":true,"configKey":"connect-versions","payloadType":"EXCEL","config":[{"name":"file","type":"FILE","value":"connect-versions.xlsx"},{"name":"columnNames","type":"STRING","value":"label,value"},{"name":"sqlStatement","type":"STRING","value":"SELECT * from version"},{"name":"columnNameLineNumber","type":"INT","value":1},{"name":"skipEmptyLines","type":"BOOLEAN","value":false},{"name":"skipEmptyColumns","type":"BOOLEAN","value":false}]} \ No newline at end of file diff --git a/smardigo/provisioning/form/simple-connect.json b/smardigo/provisioning/form/simple-connect.json index c0a3b11..5f2dbd2 100644 --- a/smardigo/provisioning/form/simple-connect.json +++ b/smardigo/provisioning/form/simple-connect.json @@ -3,478 +3,469 @@ "configKey" : "simple-connect", "page" : 0, "components" : [ { - "label" : "HTML", - "labelPosition" : "left-left", - "className" : "", - "attrs" : [ { - "attr" : "", - "value" : "" - } ], - "content" : "
\n \n
\n", - "refreshOnChange" : true, + "label" : "Status", "mask" : false, "tableView" : true, "alwaysEnabled" : false, - "type" : "htmlelement", + "type" : "well", "input" : false, - "key" : "html", - "validate" : { - "customMessage" : "", - "json" : "", - "required" : false, - "custom" : "", - "customPrivate" : false - }, + "key" : "status", "conditional" : { "show" : "", "when" : "", - "json" : "", - "eq" : "" - }, - "tabs" : null, - "encrypted" : false, - "properties" : { }, - "tags" : null, - "customConditional" : "", - "logic" : [ ], - "refreshOn" : "data", - "reorder" : false, - "placeholder" : "", - "prefix" : "", - "customClass" : "", - "suffix" : "", - "multiple" : false, - "defaultValue" : null, - "protected" : false, - "unique" : false, - "persistent" : false, - "hidden" : false, - "clearOnHide" : true, - "dataGridLabel" : false, - "labelWidth" : 30, - "labelMargin" : 3, - "description" : "", - "errorLabel" : "", - "tooltip" : "", - "hideLabel" : false, - "tabindex" : "", - "disabled" : false, - "autofocus" : false, - "dbIndex" : false, - "customDefaultValue" : "", - "calculateValue" : "", - "allowCalculateOverride" : false, - "widget" : null, - "clearOnRefresh" : false, - "validateOn" : "change", - "tag" : "p", - "id" : "etzf4n" - }, { - "label" : "progress_current", - "labelPosition" : "left-left", - "hidden" : true, - "mask" : false, - "tableView" : true, - "alwaysEnabled" : false, - "type" : "number", - "input" : true, - "key" : "progress_current", - "validate" : { - "customMessage" : "", - "json" : "", - "required" : false, - "custom" : "", - "customPrivate" : false, - "min" : "", - "max" : "", - "step" : "any", - "integer" : "" - }, - "conditional" : { - "show" : "", - "when" : "", - "json" : "", - "eq" : "" + "json" : "" }, + "components" : [ { + "label" : "HTML", + "className" : "", + "attrs" : [ { + "attr" : "", + "value" : "" + } ], + "content" : "

Status

", + "refreshOnChange" : false, + "mask" : false, + "tableView" : true, + "alwaysEnabled" : false, + "type" : "htmlelement", + "input" : false, + "key" : "html5", + "validate" : { + "customMessage" : "", + "json" : "" + }, + "conditional" : { + "show" : "", + "when" : "", + "json" : "" + }, + "tabs" : null, + "encrypted" : false, + "properties" : { }, + "tags" : null, + "customConditional" : "", + "logic" : [ ], + "reorder" : false + }, { + "label" : "HTML", + "labelPosition" : "left-left", + "className" : "", + "attrs" : [ { + "attr" : "", + "value" : "" + } ], + "content" : "
\n \n
\n", + "refreshOnChange" : true, + "mask" : false, + "tableView" : true, + "alwaysEnabled" : false, + "type" : "htmlelement", + "input" : false, + "key" : "html", + "validate" : { + "customMessage" : "", + "json" : "" + }, + "conditional" : { + "show" : "", + "when" : "", + "json" : "" + }, + "tabs" : null, + "encrypted" : false, + "properties" : { }, + "tags" : null, + "customConditional" : "", + "logic" : [ ], + "refreshOn" : "data", + "reorder" : false + }, { + "label" : "progress_current", + "labelPosition" : "left-left", + "hidden" : true, + "mask" : false, + "tableView" : true, + "alwaysEnabled" : false, + "type" : "number", + "input" : true, + "key" : "progress_current", + "validate" : { + "customMessage" : "", + "json" : "" + }, + "conditional" : { + "show" : "", + "when" : "", + "json" : "" + }, + "tabs" : null, + "delimiter" : false, + "requireDecimal" : false, + "encrypted" : false, + "properties" : { }, + "tags" : [ ], + "decimalLimit" : null, + "customConditional" : "", + "logic" : [ ], + "reorder" : false + }, { + "label" : "progress_max", + "labelPosition" : "left-left", + "hidden" : true, + "mask" : false, + "tableView" : true, + "alwaysEnabled" : false, + "type" : "number", + "input" : true, + "key" : "progress_max", + "validate" : { + "customMessage" : "", + "json" : "" + }, + "conditional" : { + "show" : "", + "when" : "", + "json" : "" + }, + "tabs" : null, + "delimiter" : false, + "requireDecimal" : false, + "encrypted" : false, + "decimalLimit" : null, + "properties" : { }, + "tags" : [ ], + "customConditional" : "", + "logic" : [ ], + "reorder" : false + } ], "tabs" : null, - "delimiter" : false, - "requireDecimal" : false, - "encrypted" : false, - "properties" : { }, - "tags" : [ ], - "decimalLimit" : null, - "customConditional" : "", - "logic" : [ ], "reorder" : false, - "placeholder" : "", - "prefix" : "", - "customClass" : "", - "suffix" : "", - "multiple" : false, - "defaultValue" : null, - "protected" : false, - "unique" : false, - "persistent" : true, - "clearOnHide" : true, - "dataGridLabel" : false, - "labelWidth" : 30, - "labelMargin" : 3, - "description" : "", - "errorLabel" : "", - "tooltip" : "", - "hideLabel" : false, - "tabindex" : "", - "disabled" : false, - "autofocus" : false, - "dbIndex" : false, - "customDefaultValue" : "", - "calculateValue" : "", - "allowCalculateOverride" : false, - "widget" : null, - "refreshOn" : "", - "clearOnRefresh" : false, - "validateOn" : "change", - "id" : "e57exg" - }, { - "label" : "progress_max", - "labelPosition" : "left-left", - "hidden" : true, - "mask" : false, - "tableView" : true, - "alwaysEnabled" : false, - "type" : "number", - "input" : true, - "key" : "progress_max", - "validate" : { - "customMessage" : "", - "json" : "", - "required" : false, - "custom" : "", - "customPrivate" : false, - "min" : "", - "max" : "", - "step" : "any", - "integer" : "" - }, - "conditional" : { - "show" : "", - "when" : "", - "json" : "", - "eq" : "" - }, - "tabs" : null, - "delimiter" : false, - "requireDecimal" : false, - "encrypted" : false, - "decimalLimit" : null, "properties" : { }, - "tags" : [ ], + "tags" : null, "customConditional" : "", - "logic" : [ ], - "reorder" : false, - "placeholder" : "", - "prefix" : "", - "customClass" : "", - "suffix" : "", - "multiple" : false, - "defaultValue" : null, - "protected" : false, - "unique" : false, - "persistent" : true, - "clearOnHide" : true, - "dataGridLabel" : false, - "labelWidth" : 30, - "labelMargin" : 3, - "description" : "", - "errorLabel" : "", - "tooltip" : "", - "hideLabel" : false, - "tabindex" : "", - "disabled" : false, - "autofocus" : false, - "dbIndex" : false, - "customDefaultValue" : "", - "calculateValue" : "", - "allowCalculateOverride" : false, - "widget" : null, - "refreshOn" : "", - "clearOnRefresh" : false, - "validateOn" : "change", - "id" : "eoxj7p" + "logic" : [ ] }, { - "label" : "HTML", - "labelPosition" : "left-left", - "className" : "", - "attrs" : [ { - "attr" : "", - "value" : "" - } ], - "content" : "
\n connect-admin:connect-admin\n
\n
\n \n {{ 'https://' + (!!(data.cluster)?data.cluster.stage:'cluster.stage') + '-' + (!!(data.tenant)?data.tenant.key:'tenant.key') + '-' + (!!(data.cluster)?data.cluster.name:'cluster.name') + '-01-connect.smardigo.digital' }}\n \n
", - "refreshOnChange" : true, + "label" : "Links", "mask" : false, "tableView" : true, "alwaysEnabled" : false, - "type" : "htmlelement", + "type" : "well", "input" : false, - "key" : "html2", - "validate" : { - "customMessage" : "", - "json" : "", - "required" : false, - "custom" : "", - "customPrivate" : false - }, + "key" : "links", "conditional" : { "show" : "", "when" : "", - "json" : "", - "eq" : "" + "json" : "" }, + "components" : [ { + "label" : "HTML", + "className" : "", + "attrs" : [ { + "attr" : "", + "value" : "" + } ], + "content" : "

Links

", + "refreshOnChange" : false, + "mask" : false, + "tableView" : true, + "alwaysEnabled" : false, + "type" : "htmlelement", + "input" : false, + "key" : "html6", + "validate" : { + "customMessage" : "", + "json" : "" + }, + "conditional" : { + "show" : "", + "when" : "", + "json" : "" + }, + "tabs" : null, + "encrypted" : false, + "properties" : { }, + "tags" : null, + "customConditional" : "", + "logic" : [ ], + "reorder" : false + }, { + "label" : "HTML", + "labelPosition" : "left-left", + "className" : "", + "attrs" : [ { + "attr" : "", + "value" : "" + } ], + "content" : "
\n connect-admin:connect-admin\n
\n
\n \n {{ 'https://' + (!!(data.cluster)?data.cluster.stage:'cluster.stage') + '-' + (!!(data.tenant)?data.tenant.key:'tenant.key') + '-' + (!!(data.cluster)?data.cluster.name:'cluster.name') + '-01-connect.smardigo.digital' }}\n \n
", + "refreshOnChange" : true, + "mask" : false, + "tableView" : true, + "alwaysEnabled" : false, + "type" : "htmlelement", + "input" : false, + "key" : "html2", + "validate" : { + "customMessage" : "", + "json" : "" + }, + "conditional" : { + "show" : "", + "when" : "", + "json" : "" + }, + "tabs" : null, + "encrypted" : false, + "properties" : { }, + "tags" : null, + "customConditional" : "", + "logic" : [ ], + "refreshOn" : "data", + "reorder" : false + }, { + "label" : "HTML", + "labelPosition" : "left-left", + "className" : "", + "attrs" : [ { + "attr" : "", + "value" : "" + } ], + "content" : "\n
\n \n {{ 'https://' + (!!(data.cluster)?data.cluster.stage:'cluster.stage') + '-' + (!!(data.tenant)?data.tenant.key:'tenant.key') + '-' + (!!(data.cluster)?data.cluster.name:'cluster.name') + '-01-wordpress.smardigo.digital' }}\n \n
\n
\n wordpress-admin:wordpress-admin\n
\n
\n \n {{ 'https://' + (!!(data.cluster)?data.cluster.stage:'cluster.stage') + '-' + (!!(data.tenant)?data.tenant.key:'tenant.key') + '-' + (!!(data.cluster)?data.cluster.name:'cluster.name') + '-01-wordpress.smardigo.digital/wp-admin' }}\n \n
", + "refreshOnChange" : true, + "mask" : false, + "tableView" : true, + "alwaysEnabled" : false, + "type" : "htmlelement", + "input" : false, + "key" : "html4", + "validate" : { + "customMessage" : "", + "json" : "" + }, + "conditional" : { + "show" : "", + "when" : "", + "json" : "" + }, + "tabs" : null, + "encrypted" : false, + "properties" : { }, + "tags" : null, + "customConditional" : "show = data['connect-features'].includes(\"connect_wordpress\") ", + "logic" : [ ], + "refreshOn" : "data", + "reorder" : false + }, { + "label" : "HTML", + "labelPosition" : "left-left", + "className" : "", + "attrs" : [ { + "attr" : "", + "value" : "" + } ], + "content" : "
\n connect-realm-admin:connect-realm-admin\n
\n
\n \n {{ 'https://' + (!!(data.cluster)?data.cluster.stage:'cluster.stage') + '-keycloak-01.smardigo.digital/auth/admin/' + (!!(data.tenant)?data.tenant.key:'tenant.key') + '/console' }}\n \n
", + "refreshOnChange" : true, + "mask" : false, + "tableView" : true, + "alwaysEnabled" : false, + "type" : "htmlelement", + "input" : false, + "key" : "html3", + "validate" : { + "customMessage" : "", + "json" : "" + }, + "conditional" : { + "show" : "", + "when" : "", + "json" : "" + }, + "tabs" : null, + "encrypted" : false, + "properties" : { }, + "tags" : null, + "customConditional" : "", + "logic" : [ ], + "refreshOn" : "data", + "reorder" : false + } ], "tabs" : null, - "encrypted" : false, + "reorder" : false, "properties" : { }, "tags" : null, "customConditional" : "", - "logic" : [ ], - "refreshOn" : "data", - "reorder" : false, - "placeholder" : "", - "prefix" : "", - "customClass" : "", - "suffix" : "", - "multiple" : false, - "defaultValue" : null, - "protected" : false, - "unique" : false, - "persistent" : false, - "hidden" : false, - "clearOnHide" : true, - "dataGridLabel" : false, - "labelWidth" : 30, - "labelMargin" : 3, - "description" : "", - "errorLabel" : "", - "tooltip" : "", - "hideLabel" : false, - "tabindex" : "", - "disabled" : false, - "autofocus" : false, - "dbIndex" : false, - "customDefaultValue" : "", - "calculateValue" : "", - "allowCalculateOverride" : false, - "widget" : null, - "clearOnRefresh" : false, - "validateOn" : "change", - "tag" : "p", - "id" : "e0g48vt" + "logic" : [ ] }, { - "label" : "HTML", - "labelPosition" : "left-left", - "className" : "", - "attrs" : [ { - "attr" : "", - "value" : "" - } ], - "content" : "\n
\n \n {{ 'https://' + (!!(data.cluster)?data.cluster.stage:'cluster.stage') + '-' + (!!(data.tenant)?data.tenant.key:'tenant.key') + '-' + (!!(data.cluster)?data.cluster.name:'cluster.name') + '-01-wordpress.smardigo.digital' }}\n \n
\n
\n wordpress-admin:wordpress-admin\n
\n
\n \n {{ 'https://' + (!!(data.cluster)?data.cluster.stage:'cluster.stage') + '-' + (!!(data.tenant)?data.tenant.key:'tenant.key') + '-' + (!!(data.cluster)?data.cluster.name:'cluster.name') + '-01-wordpress.smardigo.digital/wp-admin' }}\n \n
", - "refreshOnChange" : true, + "label" : "Status", "mask" : false, "tableView" : true, "alwaysEnabled" : false, - "type" : "htmlelement", + "type" : "well", "input" : false, - "key" : "html4", - "validate" : { - "customMessage" : "", - "json" : "", - "required" : false, - "custom" : "", - "customPrivate" : false - }, + "key" : "status2", "conditional" : { "show" : "", "when" : "", - "json" : "", - "eq" : "" + "json" : "" }, - "tabs" : null, - "encrypted" : false, - "properties" : { }, - "tags" : null, - "customConditional" : "show = data['connect-features'].includes(\"connect_wordpress\") ", - "logic" : [ ], - "refreshOn" : "data", - "reorder" : false, - "placeholder" : "", - "prefix" : "", - "customClass" : "", - "suffix" : "", - "multiple" : false, - "defaultValue" : null, - "protected" : false, - "unique" : false, - "persistent" : false, - "hidden" : false, - "clearOnHide" : true, - "dataGridLabel" : false, - "labelWidth" : 30, - "labelMargin" : 3, - "description" : "", - "errorLabel" : "", - "tooltip" : "", - "hideLabel" : false, - "tabindex" : "", - "disabled" : false, - "autofocus" : false, - "dbIndex" : false, - "customDefaultValue" : "", - "calculateValue" : "", - "allowCalculateOverride" : false, - "widget" : null, - "clearOnRefresh" : false, - "validateOn" : "change", - "tag" : "p", - "id" : "egrh2" - }, { - "label" : "HTML", - "labelPosition" : "left-left", - "className" : "", - "attrs" : [ { - "attr" : "", - "value" : "" + "components" : [ { + "label" : "HTML", + "className" : "", + "attrs" : [ { + "attr" : "", + "value" : "" + } ], + "content" : "

Features

", + "refreshOnChange" : false, + "mask" : false, + "tableView" : true, + "alwaysEnabled" : false, + "type" : "htmlelement", + "input" : false, + "key" : "html7", + "validate" : { + "customMessage" : "", + "json" : "" + }, + "conditional" : { + "show" : "", + "when" : "", + "json" : "" + }, + "tabs" : null, + "encrypted" : false, + "properties" : { }, + "tags" : null, + "customConditional" : "", + "logic" : [ ], + "reorder" : false + }, { + "label" : "Optionale Features", + "mask" : false, + "tableView" : true, + "alwaysEnabled" : false, + "type" : "dualmultiselect", + "input" : true, + "key" : "connect-features", + "defaultValue" : [ ], + "validate" : { + "customMessage" : "", + "json" : "" + }, + "conditional" : { + "show" : "", + "when" : "", + "json" : "" + }, + "data" : { + "url" : "api/v1/scopes/{{ context.scopeId }}/processes/{{ context.processId }}/datasources/connect-features/query", + "values" : [ { } ] + }, + "template" : "{{ item.key }}", + "tabs" : null, + "properties" : { }, + "tags" : [ ], + "encrypted" : false, + "customConditional" : "", + "logic" : [ ], + "projection" : "key", + "reorder" : false } ], - "content" : "
\n connect-realm-admin:connect-realm-admin\n
\n
\n \n {{ 'https://' + (!!(data.cluster)?data.cluster.stage:'cluster.stage') + '-keycloak-01.smardigo.digital/auth/admin/' + (!!(data.tenant)?data.tenant.key:'tenant.key') + '/console' }}\n \n
", - "refreshOnChange" : true, - "mask" : false, - "tableView" : true, - "alwaysEnabled" : false, - "type" : "htmlelement", - "input" : false, - "key" : "html3", - "validate" : { - "customMessage" : "", - "json" : "", - "required" : false, - "custom" : "", - "customPrivate" : false - }, - "conditional" : { - "show" : "", - "when" : "", - "json" : "", - "eq" : "" - }, "tabs" : null, - "encrypted" : false, + "reorder" : false, "properties" : { }, "tags" : null, "customConditional" : "", - "logic" : [ ], - "refreshOn" : "data", - "reorder" : false, - "placeholder" : "", - "prefix" : "", - "customClass" : "", - "suffix" : "", - "multiple" : false, - "defaultValue" : null, - "protected" : false, - "unique" : false, - "persistent" : false, - "hidden" : false, - "clearOnHide" : true, - "dataGridLabel" : false, - "labelWidth" : 30, - "labelMargin" : 3, - "description" : "", - "errorLabel" : "", - "tooltip" : "", - "hideLabel" : false, - "tabindex" : "", - "disabled" : false, - "autofocus" : false, - "dbIndex" : false, - "customDefaultValue" : "", - "calculateValue" : "", - "allowCalculateOverride" : false, - "widget" : null, - "clearOnRefresh" : false, - "validateOn" : "change", - "tag" : "p", - "id" : "eodf3h" + "logic" : [ ] }, { - "label" : "Optionale Features", + "label" : "Connect", "mask" : false, "tableView" : true, "alwaysEnabled" : false, - "type" : "dualmultiselect", + "type" : "container", "input" : true, - "key" : "connect-features", - "defaultValue" : [ ], + "key" : "connect", "validate" : { "customMessage" : "", - "json" : "", - "required" : false, - "custom" : "", - "customPrivate" : false + "json" : "" }, "conditional" : { "show" : "", "when" : "", - "json" : "", - "eq" : "" + "json" : "" }, - "data" : { - "url" : "api/v1/scopes/{{ context.scopeId }}/processes/{{ context.processId }}/datasources/connect-features/query", - "values" : [ { } ] - }, - "template" : "{{ item.key }}", + "components" : [ { + "label" : "Connect", + "hideLabel" : true, + "mask" : false, + "tableView" : true, + "alwaysEnabled" : false, + "type" : "well", + "input" : false, + "key" : "connect2", + "conditional" : { + "show" : "", + "when" : "", + "json" : "" + }, + "components" : [ { + "label" : "Version", + "labelPosition" : "left-left", + "mask" : false, + "tableView" : true, + "alwaysEnabled" : false, + "type" : "select", + "input" : true, + "key" : "version", + "defaultValue" : "latest", + "validate" : { + "select" : false, + "customMessage" : "", + "json" : "" + }, + "conditional" : { + "show" : "", + "when" : "", + "json" : "" + }, + "data" : { + "url" : "api/v1/scopes/{{context.scopeId}}/tags/{{context.scopeTag}}/datasources/connect-versions/query", + "headers" : [ { + "key" : "", + "value" : "" + } ], + "values" : [ ] + }, + "dataSrc" : "url", + "valueProperty" : "value", + "tabs" : null, + "properties" : { }, + "selectThreshold" : 0.3, + "encrypted" : false, + "lazyLoad" : false, + "selectValues" : "", + "disableLimit" : false, + "sort" : "", + "tags" : null, + "customConditional" : "", + "logic" : [ ], + "customDefaultValue" : "value='latest'", + "reorder" : false, + "reference" : false + } ], + "tabs" : null, + "reorder" : false, + "properties" : { }, + "tags" : null, + "customConditional" : "", + "logic" : [ ] + } ], "tabs" : null, - "properties" : { }, - "tags" : [ ], "encrypted" : false, + "properties" : { }, + "tags" : null, "customConditional" : "", "logic" : [ ], - "projection" : "key", - "reorder" : false, - "placeholder" : "", - "prefix" : "", - "customClass" : "", - "suffix" : "", - "multiple" : false, - "protected" : false, - "unique" : false, - "persistent" : true, - "hidden" : false, - "clearOnHide" : true, - "dataGridLabel" : false, - "labelPosition" : "top", - "labelWidth" : 30, - "labelMargin" : 3, - "description" : "", - "errorLabel" : "", - "tooltip" : "", - "hideLabel" : false, - "tabindex" : "", - "disabled" : false, - "autofocus" : false, - "dbIndex" : false, - "customDefaultValue" : "", - "calculateValue" : "", - "allowCalculateOverride" : false, - "widget" : null, - "refreshOn" : "", - "clearOnRefresh" : false, - "validateOn" : "change", - "dataSrc" : "url", - "filter" : true, - "filterPlaceholder" : "Tippen um zu filtern.", - "labelAll" : "Alle Werte", - "labelSelected" : "Ausgewählte Werte", - "buttonSelectAll" : "Alle auswählen", - "buttonDeselectAll" : "Alle abwählen", - "selectAll" : false, - "id" : "edyvsf" + "reorder" : false }, { "label" : "Cluster", "mask" : false, @@ -485,16 +476,12 @@ "key" : "cluster", "validate" : { "customMessage" : "", - "json" : "", - "required" : false, - "custom" : "", - "customPrivate" : false + "json" : "" }, "conditional" : { "show" : "", "when" : "", - "json" : "", - "eq" : "" + "json" : "" }, "components" : [ { "label" : "Cluster", @@ -507,8 +494,7 @@ "conditional" : { "show" : "", "when" : "", - "json" : "", - "eq" : "" + "json" : "" }, "components" : [ { "label" : "Stage", @@ -530,16 +516,12 @@ "minLength" : null, "maxLength" : null, "minWords" : null, - "maxWords" : null, - "custom" : "", - "customPrivate" : false, - "pattern" : "" + "maxWords" : null }, "conditional" : { "show" : "", "when" : "", - "json" : "", - "eq" : "" + "json" : "" }, "tabs" : null, "inputFormat" : "plain", @@ -549,42 +531,9 @@ "customConditional" : "", "logic" : [ ], "widget" : { - "type" : "", - "format" : "yyyy-MM-dd hh:mm a", - "dateFormat" : "yyyy-MM-dd hh:mm a", - "saveAs" : "text" + "type" : "" }, - "reorder" : false, - "placeholder" : "", - "prefix" : "", - "customClass" : "", - "suffix" : "", - "multiple" : false, - "protected" : false, - "unique" : false, - "persistent" : true, - "hidden" : false, - "clearOnHide" : true, - "dataGridLabel" : false, - "labelWidth" : 30, - "labelMargin" : 3, - "description" : "", - "errorLabel" : "", - "tooltip" : "", - "hideLabel" : false, - "tabindex" : "", - "autofocus" : false, - "dbIndex" : false, - "customDefaultValue" : "", - "calculateValue" : "", - "allowCalculateOverride" : false, - "refreshOn" : "", - "clearOnRefresh" : false, - "validateOn" : "change", - "mask" : false, - "inputType" : "text", - "inputMask" : "", - "id" : "e1sh16" + "reorder" : false }, { "label" : "Name", "labelPosition" : "left-left", @@ -598,22 +547,18 @@ "key" : "name", "defaultValue" : "", "validate" : { - "customMessage" : "Zeichenkette ohne Sonderzeichen, mindestens 4 und höchstens 15 Zeichen, alles kleingeschrieben", + "customMessage" : "", "json" : "", "required" : true, "minLength" : null, "maxLength" : null, "minWords" : null, - "maxWords" : null, - "pattern" : "^[a-z0-9]{4,15}$", - "custom" : "", - "customPrivate" : false + "maxWords" : null }, "conditional" : { "show" : "", "when" : "", - "json" : "", - "eq" : "" + "json" : "" }, "tabs" : null, "inputFormat" : "plain", @@ -623,43 +568,9 @@ "customConditional" : "", "logic" : [ ], "widget" : { - "type" : "", - "format" : "yyyy-MM-dd hh:mm a", - "dateFormat" : "yyyy-MM-dd hh:mm a", - "saveAs" : "text" + "type" : "" }, - "reorder" : false, - "placeholder" : "", - "prefix" : "", - "customClass" : "", - "suffix" : "", - "multiple" : false, - "protected" : false, - "unique" : false, - "persistent" : true, - "hidden" : false, - "clearOnHide" : true, - "dataGridLabel" : false, - "labelWidth" : 30, - "labelMargin" : 3, - "description" : "", - "errorLabel" : "", - "tooltip" : "", - "hideLabel" : false, - "tabindex" : "", - "disabled" : false, - "autofocus" : false, - "dbIndex" : false, - "customDefaultValue" : "", - "calculateValue" : "", - "allowCalculateOverride" : false, - "refreshOn" : "", - "clearOnRefresh" : false, - "validateOn" : "change", - "mask" : false, - "inputType" : "text", - "inputMask" : "", - "id" : "e7pf9ih" + "reorder" : false }, { "label" : "Size", "labelPosition" : "left-left", @@ -675,17 +586,12 @@ "json" : "", "required" : true, "min" : null, - "max" : null, - "custom" : "", - "customPrivate" : false, - "step" : "any", - "integer" : "" + "max" : null }, "conditional" : { "show" : "", "when" : "", - "json" : "", - "eq" : "" + "json" : "" }, "tabs" : null, "properties" : { }, @@ -696,36 +602,7 @@ "decimalLimit" : null, "customConditional" : "", "logic" : [ ], - "reorder" : false, - "placeholder" : "", - "prefix" : "", - "customClass" : "", - "suffix" : "", - "multiple" : false, - "defaultValue" : null, - "protected" : false, - "unique" : false, - "persistent" : true, - "hidden" : false, - "clearOnHide" : true, - "dataGridLabel" : false, - "labelWidth" : 30, - "labelMargin" : 3, - "description" : "", - "errorLabel" : "", - "tooltip" : "", - "hideLabel" : false, - "tabindex" : "", - "autofocus" : false, - "dbIndex" : false, - "customDefaultValue" : "", - "calculateValue" : "", - "allowCalculateOverride" : false, - "widget" : null, - "refreshOn" : "", - "clearOnRefresh" : false, - "validateOn" : "change", - "id" : "e5npzs" + "reorder" : false }, { "label" : "Service", "labelPosition" : "left-left", @@ -746,16 +623,12 @@ "minLength" : null, "maxLength" : null, "minWords" : null, - "maxWords" : null, - "custom" : "", - "customPrivate" : false, - "pattern" : "" + "maxWords" : null }, "conditional" : { "show" : "", "when" : "", - "json" : "", - "eq" : "" + "json" : "" }, "tabs" : null, "inputFormat" : "plain", @@ -765,85 +638,16 @@ "customConditional" : "", "logic" : [ ], "widget" : { - "type" : "", - "format" : "yyyy-MM-dd hh:mm a", - "dateFormat" : "yyyy-MM-dd hh:mm a", - "saveAs" : "text" + "type" : "" }, - "reorder" : false, - "placeholder" : "", - "prefix" : "", - "customClass" : "", - "suffix" : "", - "multiple" : false, - "protected" : false, - "unique" : false, - "persistent" : true, - "hidden" : false, - "clearOnHide" : true, - "dataGridLabel" : false, - "labelWidth" : 30, - "labelMargin" : 3, - "description" : "", - "errorLabel" : "", - "tooltip" : "", - "hideLabel" : false, - "tabindex" : "", - "autofocus" : false, - "dbIndex" : false, - "customDefaultValue" : "", - "calculateValue" : "", - "allowCalculateOverride" : false, - "refreshOn" : "", - "clearOnRefresh" : false, - "validateOn" : "change", - "mask" : false, - "inputType" : "text", - "inputMask" : "", - "id" : "eqxm1s" + "reorder" : false } ], "tabs" : null, "reorder" : false, "properties" : { }, "tags" : null, "customConditional" : "", - "logic" : [ ], - "placeholder" : "", - "prefix" : "", - "customClass" : "", - "suffix" : "", - "multiple" : false, - "defaultValue" : null, - "protected" : false, - "unique" : false, - "persistent" : false, - "hidden" : false, - "clearOnHide" : true, - "dataGridLabel" : false, - "labelPosition" : "top", - "labelWidth" : 30, - "labelMargin" : 3, - "description" : "", - "errorLabel" : "", - "tooltip" : "", - "hideLabel" : false, - "tabindex" : "", - "disabled" : false, - "autofocus" : false, - "dbIndex" : false, - "customDefaultValue" : "", - "calculateValue" : "", - "allowCalculateOverride" : false, - "widget" : null, - "refreshOn" : "", - "clearOnRefresh" : false, - "validateOn" : "change", - "validate" : { - "required" : false, - "custom" : "", - "customPrivate" : false - }, - "id" : "ebmljyd" + "logic" : [ ] } ], "tabs" : null, "encrypted" : false, @@ -851,38 +655,6 @@ "tags" : [ ], "customConditional" : "", "logic" : [ ], - "reorder" : false, - "placeholder" : "", - "prefix" : "", - "customClass" : "", - "suffix" : "", - "multiple" : false, - "defaultValue" : null, - "protected" : false, - "unique" : false, - "persistent" : true, - "hidden" : false, - "clearOnHide" : true, - "dataGridLabel" : false, - "labelPosition" : "top", - "labelWidth" : 30, - "labelMargin" : 3, - "description" : "", - "errorLabel" : "", - "tooltip" : "", - "hideLabel" : false, - "tabindex" : "", - "disabled" : false, - "autofocus" : false, - "dbIndex" : false, - "customDefaultValue" : "", - "calculateValue" : "", - "allowCalculateOverride" : false, - "widget" : null, - "refreshOn" : "", - "clearOnRefresh" : false, - "validateOn" : "change", - "tree" : true, - "id" : "exh01oc" + "reorder" : false } ] } \ No newline at end of file diff --git a/smardigo/provisioning/process-variable-declaration/simple-connect.json b/smardigo/provisioning/process-variable-declaration/simple-connect.json index 2f5ae5f..ed1a0da 100644 --- a/smardigo/provisioning/process-variable-declaration/simple-connect.json +++ b/smardigo/provisioning/process-variable-declaration/simple-connect.json @@ -11,6 +11,10 @@ "type" : "object", "classification" : "PRIVATE" }, + "connect" : { + "type" : "object", + "classification" : "PRIVATE" + }, "connect-features" : { "type" : "object", "classification" : "PRIVATE" diff --git a/smardigo/provisioning/process/simple-connect.bpmn b/smardigo/provisioning/process/simple-connect.bpmn index 8919734..25ca22d 100644 --- a/smardigo/provisioning/process/simple-connect.bpmn +++ b/smardigo/provisioning/process/simple-connect.bpmn @@ -66,8 +66,8 @@ - - [cluster.service] + execution.getVariable('connect-features') + + ['connect'] + execution.getVariable('connect-features') @@ -164,6 +164,7 @@ Flow_0ex5zxa Flow_0zcb7z2 Flow_1qghkm9 + Flow_0qc2wxt @@ -758,7 +759,6 @@ Variables.userId(authenticatedUserId) - ${$action == 'abbrechen'} @@ -897,6 +897,28 @@ Variables.userId(authenticatedUserId) Flow_1r4otto + + + Flow_0qc2wxt + + + Flow_14qlmwl + Flow_03lhlpu + + + Flow_14qlmwl + + ${vorgang_status == 50} + + + + Flow_03lhlpu + + ${vorgang_status == 92} + + + + Shared Service Server bei Hetzner erstellen @@ -1018,21 +1040,8 @@ Server bei Hetzner löschen Flow_1cnt5hf Flow_1nqz9ya - - - - - - ${extra_vars} - - - - - Flow_1nqz9ya - Flow_0rau5wd - - Flow_0rau5wd + Flow_1kxc9t0 Flow_0gcsmj7 @@ -1044,7 +1053,6 @@ Server bei Hetzner löschen Flow_1ju13h8 - @@ -1052,6 +1060,20 @@ Server bei Hetzner löschen + + + + + + ${extra_vars} + + + + + Flow_1nqz9ya + Flow_1kxc9t0 + + @@ -1082,6 +1104,27 @@ Server bei Hetzner löschen + + + + + + + + + + + + + + + + + + + + + @@ -1273,10 +1316,6 @@ Server bei Hetzner löschen - - - - @@ -1409,21 +1448,6 @@ Server bei Hetzner löschen - - - - - - - - - - - - - - - @@ -1768,6 +1792,27 @@ Server bei Hetzner löschen + + + + + + + + + + + + + + + + + + + + + @@ -1792,6 +1837,18 @@ Server bei Hetzner löschen + + + + + + + + + + + + @@ -1857,6 +1914,10 @@ Server bei Hetzner löschen + + + + @@ -1885,10 +1946,6 @@ Server bei Hetzner löschen - - - - @@ -1904,9 +1961,6 @@ Server bei Hetzner löschen - - - @@ -1919,6 +1973,9 @@ Server bei Hetzner löschen + + + diff --git a/smardigo/provisioning/script/ansible-start.groovy b/smardigo/provisioning/script/ansible-start.groovy index 8d467a8..0378863 100644 --- a/smardigo/provisioning/script/ansible-start.groovy +++ b/smardigo/provisioning/script/ansible-start.groovy @@ -1,34 +1,35 @@ def env = [ - scope_id: contextScopeId, - process_instance_id: execution.getProcessInstanceId(), - smardigo_management_action: smardigoManagementAction, + cluster_features: cluster_features, cluster_name: cluster.name, cluster_service: cluster.service, - cluster_services_str: ([cluster.service] + execution.getVariable('connect-features')).join(','), cluster_size: cluster.size, - stage: cluster.stage, + connect_image_version: connect.version, current_realm_name: tenant.key, current_realm_display_name: tenant.name, + process_instance_id: execution.getProcessInstanceId(), + scope_id: contextScopeId, + smardigo_management_action: smardigoManagementAction, + stage: cluster.stage, tenant_id: tenant.key ] if (binding.hasVariable('extraVariables')) { env << extraVariables } -def ansibleCommand= 'ansible-playbook ' + smardigoManagementAction + '.yml --vault-password-file ~/vault-pass' -def ansibleEnvironment= ' -e \"' +def filename = 'xvars-' + smardigoManagementAction + '-' + execution.getProcessInstanceId() + '.yml' +def ansibleCommand= 'ansible-playbook ' + smardigoManagementAction + '.yml --vault-password-file ~/vault-pass -e "@' + filename + '"' +def ansibleVariables= 'cat <> ' + filename + '\n' +ansibleVariables+= '---\n' env.each { key, val -> if (val instanceof List) { - ansibleEnvironment+= key + '=\'' + val.join(',') + '\' ' + ansibleVariables+= key + ':\n- \'' + val.join('\'\n- \'') + '\'\n' } else { - ansibleEnvironment+= key + '=\'' + val + '\' ' + ansibleVariables+= key + ': \'' + val + '\'\n' } } -ansibleEnvironment = ansibleEnvironment.substring(0, ansibleEnvironment.length() - 1); -ansibleEnvironment+= '\"' -ansibleCommand += ansibleEnvironment +ansibleVariables+= 'EOT' processes.byId(contextScopeId, contextProcessId).createComment(comment + ' gestartet') -processes.byId(contextScopeId, contextProcessId).createComment(ansibleCommand) +processes.byId(contextScopeId, contextProcessId).createComment(ansibleVariables + '\n' + ansibleCommand) ansibleCommand \ No newline at end of file diff --git a/smardigo/provisioning/script/create-awx-paramaters.groovy b/smardigo/provisioning/script/create-awx-paramaters.groovy index ae97f5a..6c52c36 100644 --- a/smardigo/provisioning/script/create-awx-paramaters.groovy +++ b/smardigo/provisioning/script/create-awx-paramaters.groovy @@ -1,14 +1,15 @@ def env = [ - scope_id: contextScopeId, - process_instance_id: execution.getProcessInstanceId(), - smardigo_management_action: smardigoManagementAction, + cluster_features: cluster_features, cluster_name: cluster.name, cluster_service: cluster.service, - cluster_services_str: ([cluster.service] + execution.getVariable('connect-features')).join(','), cluster_size: cluster.size, - stage: cluster.stage, + connect_image_version: connect.version, current_realm_name: tenant.key, current_realm_display_name: tenant.name, + process_instance_id: execution.getProcessInstanceId(), + scope_id: contextScopeId, + smardigo_management_action: smardigoManagementAction, + stage: cluster.stage, tenant_id: tenant.key ] if (binding.hasVariable('extraVariables')) { diff --git a/tasks/autodiscover_pre_tasks.yml b/tasks/autodiscover_pre_tasks.yml index d1b8f7c..667c1a0 100644 --- a/tasks/autodiscover_pre_tasks.yml +++ b/tasks/autodiscover_pre_tasks.yml @@ -164,5 +164,15 @@ become: false tags: - always - when: - - debug +# when: +# - debug + +- name: "Printing groups for {{ inventory_hostname }}" + debug: + msg: "{{ group_names }}" + delegate_to: 127.0.0.1 + become: false + tags: + - always +# when: +# - debug diff --git a/update-monitoring.yml b/update-monitoring.yml index a9ca5d1..31db9ef 100644 --- a/update-monitoring.yml +++ b/update-monitoring.yml @@ -25,16 +25,19 @@ - ansible_version.major >= 2 - ansible_version.minor >= 10 msg: "The ansible version has to be at least ({{ ansible_version.full }})" - tags: - - always + + - name: "Add <{{ stage }}-smardigo-management-message> to hosts" + add_host: + name: "{{ stage }}-smardigo-management-message" + groups: + - "stage_{{ stage }}" + changed_when: False - name: "Import autodiscover pre-tasks" include_tasks: tasks/autodiscover_pre_tasks.yml - tags: - - always tasks: - - name: Add prometheus servers to hosts if necessary + - name: Add all servers to hosts add_host: name: "{{ item.name }}" groups: @@ -43,11 +46,9 @@ stage_server_infos: "{{ stage_server_infos }}" changed_when: False with_items: "{{ stage_server_infos }}" - tags: - - always ############################################################# -# update monitoring +# Updating monitoring for all servers ############################################################# - hosts: "{{ stage }}-prometheus-01" @@ -60,14 +61,12 @@ - include_role: name: prometheus tasks_from: _update_config - tags: - - always ############################################################# -# Sending smardigo management message to process +# Sending smardigo management message to process ############################################################# -- hosts: "stage_{{ stage }}" +- hosts: "{{ stage }}-smardigo-management-message" serial: "{{ serial_number | default(1) }}" gather_facts: false connection: local diff --git a/update-service-state.yml b/update-service-state.yml index 02b9d0c..507f216 100644 --- a/update-service-state.yml +++ b/update-service-state.yml @@ -5,7 +5,7 @@ # stage := the type of the stage (e.g. dev, int, qa, prod) # tenant_id := (unique key for the tenant, e.g. customer) # cluster_name := (business name for the cluster, e.g. product, department ) -# cluster_services_str := (services to setup, e.g. 'connect,wordpress') +# cluster_services := (services to setup, e.g. ['connect', 'wordpress', ...]) # service_state := the state of the service (e.g. up, down, upgrade) # smardigo message callback # scope_id := (scope id of the management process) @@ -28,27 +28,26 @@ - ansible_version.minor >= 10 msg: "The ansible version has to be at least ({{ ansible_version.full }})" - - name: "Parsing cluster_services_str into cluster_services" - set_fact: - cluster_services: "{{ cluster_services_str | split(',') }}" + - name: "Add <{{ stage }}-smardigo-management-message> to hosts" + add_host: + name: "{{ stage }}-smardigo-management-message" + groups: + - "stage_{{ stage }}" + changed_when: False tasks: - name: Add hosts add_host: - name: "{{ stage }}-{{ tenant_id }}-{{ cluster_name }}-01" - groups: - - "stage_{{ stage }}" - - "{{ cluster_service }}" - - "{{ item }}" + name: "{{ stage }}-{{ tenant_id }}-{{ cluster_name }}-{{ '%02d' | format(item|int) }}" + groups: "{{ ['stage_' + stage ] + [cluster_service] + cluster_features }}" + with_sequence: start=1 end={{ cluster_size | default(1) }} changed_when: False - with_items: "{{ cluster_services }}" - when: item in ['connect', 'connect_wordpress'] ############################################################# -# Stop services for created inventory +# Stopping services for created inventory ############################################################# -- hosts: "stage_{{ stage }}" +- hosts: "stage_{{ stage }}:!{{ stage }}-smardigo-management-message" serial: "{{ serial_number | default(1) }}" remote_user: root vars: @@ -71,10 +70,10 @@ when: "'connect_wordpress' in group_names" ############################################################# -# Sending smardigo management message to process +# Sending smardigo management message to process ############################################################# -- hosts: "stage_{{ stage }}" +- hosts: "{{ stage }}-smardigo-management-message" serial: "{{ serial_number | default(1) }}" gather_facts: false connection: local diff --git a/upload-database-dumb.yml b/upload-database-dumb.yml index 7b5a4c7..b8a6dcc 100644 --- a/upload-database-dumb.yml +++ b/upload-database-dumb.yml @@ -12,7 +12,7 @@ # stage := the type of the stage (e.g. dev, int, qa, prod) # tenant_id := (unique key for the tenant, e.g. customer) # cluster_name := (business name for the cluster, e.g. product, department ) -# cluster_size := (WIP node count for the cluster) (Currently max is 2 master/slave) +# cluster_size := (WIP node count for the cluster) # cluster_services := (services to setup, e.g. ['connect', 'wordpress', ...]) # upload_file := the local file to upload (e.g. dumps/wordpress_portal.sql) # database_backup_file := the dump file to import (e.g. wordpress_portal.sql) @@ -36,25 +36,20 @@ - ansible_version.major >= 2 - ansible_version.minor >= 10 msg: "The ansible version has to be at least ({{ ansible_version.full }})" - - name: "Parsing cluster_services_str into cluster_services" - set_fact: - cluster_services: "{{ cluster_services_str | split(',') }}" - tags: - - always tasks: - - name: Add hosts + - name: "Add maria servers to hosts if necessary" add_host: name: "{{ stage }}-maria-01" groups: - "stage_{{ stage }}" - "{{ item }}" changed_when: False - with_items: "{{ cluster_services }}" + with_items: "{{ cluster_features }}" when: item in ['connect_wordpress'] ############################################################# -# Setup services for created inventory +# Uploading database backups for created inventory ############################################################# - hosts: "stage_{{ stage }}" @@ -66,11 +61,6 @@ pre_tasks: - name: "Import autodiscover pre-tasks" include_tasks: tasks/autodiscover_pre_tasks.yml - - name: "Parsing cluster_services_str into cluster_services" - set_fact: - cluster_services: "{{ cluster_services_str | split(',') }}" - tags: - - always roles: - role: upload-local-file