DEV-173: review/regression/cleanup: connect + wordpress
parent
7f4b338477
commit
38b103e363
@ -1,24 +0,0 @@
|
|||||||
- hosts: localhost
|
|
||||||
connection: local
|
|
||||||
gather_facts: false
|
|
||||||
vars:
|
|
||||||
repository: "git@git.dev-at.de:smardigo/maven/smardigo-maven-versions.git"
|
|
||||||
branch_type: "spike"
|
|
||||||
branch_ticket: "TST-0001"
|
|
||||||
|
|
||||||
pre_tasks:
|
|
||||||
- name: "Checkout git repository"
|
|
||||||
ansible.builtin.git:
|
|
||||||
repo: "{{ repository }}"
|
|
||||||
dest: "./checkout"
|
|
||||||
version: "master"
|
|
||||||
|
|
||||||
- name: "Insert/Update branch configuration"
|
|
||||||
template:
|
|
||||||
src: 'create-branch-maven.j2'
|
|
||||||
dest: './checkout/.ci_create-branch-maven'
|
|
||||||
|
|
||||||
- name: "Branching project"
|
|
||||||
shell: ". .ci_create-branch-maven"
|
|
||||||
args:
|
|
||||||
chdir: "./checkout"
|
|
||||||
@ -1,50 +1,9 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
connect_wordpress_maria_database_name: "{{ stage }}_{{ tenant_id }}_{{ cluster_name }}_{{ cluster_service }}"
|
|
||||||
connect_wordpress_maria_username: "{{ connect_wordpress_maria_database_name }}"
|
|
||||||
connect_wordpress_maria_password: "connect-wordpress-maria-admin"
|
|
||||||
|
|
||||||
connect_wordpress_maria_host: "{{ shared_service_maria_hostname }}"
|
connect_wordpress_maria_host: "{{ shared_service_maria_hostname }}"
|
||||||
connect_wordpress_maria_database_name: "{{ stage }}_{{ tenant_id }}_{{ cluster_name }}_{{ cluster_service }}"
|
connect_wordpress_maria_database: "{{ stage }}_{{ tenant_id }}_{{ cluster_name }}_connect_wordpress"
|
||||||
connect_wordpress_maria_username: "{{ connect_wordpress_maria_database_name }}"
|
connect_wordpress_maria_username: "{{ connect_wordpress_maria_database }}"
|
||||||
connect_wordpress_maria_password: "connect-wordpress-maria-admin"
|
connect_wordpress_maria_password: "connect-wordpress-maria-admin"
|
||||||
|
|
||||||
wordpress_domain_external: "https://{{ stage_server_url_host }}"
|
|
||||||
wordpress_client_id: "{{ cluster_name }}"
|
|
||||||
wordpress_buergerportal_username: "wordpress-admin"
|
|
||||||
wordpress_buergerportal_password: "wordpress-admin"
|
|
||||||
|
|
||||||
current_realm_users: [
|
|
||||||
{
|
|
||||||
"username": "{{ wordpress_buergerportal_username }}",
|
|
||||||
"password": "{{ wordpress_buergerportal_password }}",
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
||||||
current_realm_clients: [
|
|
||||||
{
|
|
||||||
clientId: "{{ wordpress_client_id }}",
|
|
||||||
name: '{{ wordpress_client_id }}',
|
|
||||||
admin_url: '',
|
|
||||||
root_url: '',
|
|
||||||
redirect_uris: '
|
|
||||||
[
|
|
||||||
"https://{{ service_name }}.{{ domain }}/*",
|
|
||||||
]',
|
|
||||||
secret: '{{ cluster_name }}',
|
|
||||||
web_origins: '
|
|
||||||
[
|
|
||||||
"https://{{ service_name }}.{{ domain }}/*",
|
|
||||||
]',
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
||||||
wordpress_oidc_client_id: "{{ wordpress_client_id }}"
|
|
||||||
wordpress_oidc_client_secret: "{{ cluster_name }}"
|
|
||||||
|
|
||||||
sk_nrw_issuer: "idc"
|
|
||||||
sk_nrw_provider_url: "idc"
|
|
||||||
sk_nrw_client_id: "idc"
|
|
||||||
sk_nrw_client_secret: "idc"
|
|
||||||
smardigo_auth_token_name: "idc"
|
smardigo_auth_token_name: "idc"
|
||||||
smardigo_auth_token_value: "idc"
|
smardigo_auth_token_value: "idc"
|
||||||
|
|||||||
@ -0,0 +1,11 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
hetzner_server_type: cpx11
|
||||||
|
hetzner_server_labels: "stage={{ stage }} service=connect"
|
||||||
|
|
||||||
|
management_connect_jwt_secret: "f1a291c1946f47e1815b73d01a7da814"
|
||||||
|
|
||||||
|
management_connect_postgres_host: "{{ shared_service_pg_master_hostname }}"
|
||||||
|
management_connect_postgres_database: "dev_management_smardigo_connect"
|
||||||
|
management_connect_postgres_username: "{{ connect_postgres_database }}"
|
||||||
|
management_connect_postgres_password: "connect-postgres-admin"
|
||||||
@ -1,10 +1,10 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
connect_auth_module: oidc
|
hetzner_server_type: cpx21
|
||||||
connect_oidc_client_id: management-smardigo
|
|
||||||
connect_oidc_client_secret: f1f852b4-2e75-889a-2453-3c55d53ce405
|
|
||||||
connect_oidc_registration_id: management-smardigo
|
|
||||||
connect_oidc_issuer_uri: https://{{ shared_service_keycloak_hostname }}/auth/realms/smardigo
|
|
||||||
|
|
||||||
connect_password_change_url: https://{{ shared_service_keycloak_hostname }}/auth/realms/smardigo/account/password
|
connect_elastic_prefix: "dev_management_smardigo_connect"
|
||||||
connect_iam_user_management_url: https://{{ shared_service_keycloak_hostname }}/auth/admin/smardigo/console
|
connect_postgres_database: "dev_management_smardigo_connect"
|
||||||
|
|
||||||
|
current_realm_name: "smardigo"
|
||||||
|
connect_client_id: "management-smardigo"
|
||||||
|
connect_oidc_client_secret: "f1f852b4-2e75-889a-2453-3c55d53ce405"
|
||||||
|
|||||||
@ -1,55 +0,0 @@
|
|||||||
---
|
|
||||||
|
|
||||||
- name: "Check if landing page service table exists"
|
|
||||||
stat:
|
|
||||||
path: "{{ caddy_landing_page_service_table_file_path_full }}"
|
|
||||||
register: check_caddy_landing_page_service_table_file
|
|
||||||
tags:
|
|
||||||
- update_deployment
|
|
||||||
|
|
||||||
- name: "Read landing page service table data"
|
|
||||||
slurp:
|
|
||||||
src: "{{ caddy_landing_page_service_table_file_path_full }}"
|
|
||||||
register: landing_page_service_table_plain
|
|
||||||
when: check_caddy_landing_page_service_table_file.stat.exists
|
|
||||||
tags:
|
|
||||||
- update_deployment
|
|
||||||
|
|
||||||
- name: "Set landing page service table as variable"
|
|
||||||
set_fact:
|
|
||||||
landing_page_service_table: "{{ landing_page_service_table_plain['content'] | b64decode }}"
|
|
||||||
when: check_caddy_landing_page_service_table_file.stat.exists
|
|
||||||
tags:
|
|
||||||
- update_deployment
|
|
||||||
|
|
||||||
- name: "Read landing page service table data"
|
|
||||||
set_fact:
|
|
||||||
landing_page_service_table: []
|
|
||||||
when: not check_caddy_landing_page_service_table_file.stat.exists
|
|
||||||
tags:
|
|
||||||
- update_deployment
|
|
||||||
|
|
||||||
- name: "Update landing page service table variable"
|
|
||||||
set_fact:
|
|
||||||
landing_page_service_table: "{{ ([item] + landing_page_service_table) | unique(attribute='current_name') }}"
|
|
||||||
with_items: "{{ current_services }}"
|
|
||||||
tags:
|
|
||||||
- update_deployment
|
|
||||||
|
|
||||||
- name: 'Ensures {{ caddy_landing_page_service_table_folder_path_full }} directory exists'
|
|
||||||
file:
|
|
||||||
state: directory
|
|
||||||
path: '{{ caddy_landing_page_service_table_folder_path_full }}'
|
|
||||||
tags:
|
|
||||||
- update_deployment
|
|
||||||
- update_config
|
|
||||||
|
|
||||||
- name: "Write landing page service table"
|
|
||||||
copy:
|
|
||||||
content: "{{ landing_page_service_table | to_nice_json }}"
|
|
||||||
dest: "{{ caddy_landing_page_service_table_file_path_full }}"
|
|
||||||
owner: "{{ docker_owner }}"
|
|
||||||
group: "{{ docker_group }}"
|
|
||||||
mode: 0644
|
|
||||||
tags:
|
|
||||||
- update_deployment
|
|
||||||
@ -1 +0,0 @@
|
|||||||
---
|
|
||||||
@ -1 +0,0 @@
|
|||||||
---
|
|
||||||
@ -1 +0,0 @@
|
|||||||
---
|
|
||||||
@ -1 +1,32 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
|
# configuration for the connect realm
|
||||||
|
connect_realm_admin_username: "connect-realm-admin"
|
||||||
|
connect_realm_admin_password: "connect-realm-admin"
|
||||||
|
connect_client_admin_username: "connect-admin"
|
||||||
|
connect_client_admin_password: "connect-admin"
|
||||||
|
|
||||||
|
current_realm_clients: [
|
||||||
|
{
|
||||||
|
name: '{{ connect_client_id }}',
|
||||||
|
clientId: "{{ connect_client_id }}",
|
||||||
|
admin_url: '',
|
||||||
|
root_url: '',
|
||||||
|
redirect_uris: '
|
||||||
|
[
|
||||||
|
"{{ http_s }}://{{ connect_base_url }}/*",
|
||||||
|
]',
|
||||||
|
secret: '{{ cluster_name }}',
|
||||||
|
web_origins: '
|
||||||
|
[
|
||||||
|
"{{ http_s }}://{{ connect_base_url }}/*",
|
||||||
|
]',
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
current_realm_users: [
|
||||||
|
{
|
||||||
|
"username": "{{ connect_client_admin_username }}",
|
||||||
|
"password": "{{ connect_client_admin_password }}",
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|||||||
@ -1 +0,0 @@
|
|||||||
---
|
|
||||||
@ -1 +0,0 @@
|
|||||||
---
|
|
||||||
@ -1 +0,0 @@
|
|||||||
---
|
|
||||||
@ -1,3 +1,3 @@
|
|||||||
---
|
---
|
||||||
upload_directory: /tmp
|
|
||||||
|
|
||||||
|
upload_directory: /tmp
|
||||||
|
|||||||
@ -0,0 +1,35 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
### tags:
|
||||||
|
### update_deployment
|
||||||
|
|
||||||
|
- name: "Send mattermost message"
|
||||||
|
uri:
|
||||||
|
url: "{{ mattermost_hook_smardigo }}"
|
||||||
|
method: POST
|
||||||
|
body: "{{ lookup('template','mattermost-deploy-start.json.j2') }}"
|
||||||
|
body_format: json
|
||||||
|
headers:
|
||||||
|
Content-Type: "application/json"
|
||||||
|
delegate_to: 127.0.0.1
|
||||||
|
become: false
|
||||||
|
when:
|
||||||
|
- send_status_messages
|
||||||
|
|
||||||
|
- name: "Setup postgres for {{ inventory_hostname }}"
|
||||||
|
include_role:
|
||||||
|
name: postgres
|
||||||
|
tasks_from: _postgres-acls
|
||||||
|
|
||||||
|
- name: "Send mattermost messsge"
|
||||||
|
uri:
|
||||||
|
url: "{{ mattermost_hook_smardigo }}"
|
||||||
|
method: POST
|
||||||
|
body: "{{ lookup('template','mattermost-deploy-end.json.j2') }}"
|
||||||
|
body_format: json
|
||||||
|
headers:
|
||||||
|
Content-Type: "application/json"
|
||||||
|
delegate_to: 127.0.0.1
|
||||||
|
become: false
|
||||||
|
when:
|
||||||
|
- send_status_messages
|
||||||
@ -0,0 +1,32 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
- name: "Send mattermost message"
|
||||||
|
uri:
|
||||||
|
url: "{{ mattermost_hook_smardigo }}"
|
||||||
|
method: POST
|
||||||
|
body: "{{ lookup('template','mattermost-deploy-start.json.j2') }}"
|
||||||
|
body_format: json
|
||||||
|
headers:
|
||||||
|
Content-Type: "application/json"
|
||||||
|
delegate_to: 127.0.0.1
|
||||||
|
become: false
|
||||||
|
when:
|
||||||
|
- send_status_messages
|
||||||
|
|
||||||
|
- name: "Setup postgres for {{ inventory_hostname }}"
|
||||||
|
include_role:
|
||||||
|
name: postgres
|
||||||
|
tasks_from: _postgres-acls
|
||||||
|
|
||||||
|
- name: "Send mattermost messsge"
|
||||||
|
uri:
|
||||||
|
url: "{{ mattermost_hook_smardigo }}"
|
||||||
|
method: POST
|
||||||
|
body: "{{ lookup('template','mattermost-deploy-end.json.j2') }}"
|
||||||
|
body_format: json
|
||||||
|
headers:
|
||||||
|
Content-Type: "application/json"
|
||||||
|
delegate_to: 127.0.0.1
|
||||||
|
become: false
|
||||||
|
when:
|
||||||
|
- send_status_messages
|
||||||
@ -1,4 +0,0 @@
|
|||||||
---
|
|
||||||
|
|
||||||
postgres_image_name: "postgres"
|
|
||||||
postgres_image_version: "12"
|
|
||||||
@ -1 +0,0 @@
|
|||||||
---
|
|
||||||
@ -1 +0,0 @@
|
|||||||
---
|
|
||||||
@ -1,83 +0,0 @@
|
|||||||
---
|
|
||||||
|
|
||||||
### tags:
|
|
||||||
### update_deployment
|
|
||||||
|
|
||||||
- name: "Send mattermost message"
|
|
||||||
uri:
|
|
||||||
url: "{{ mattermost_hook_smardigo }}"
|
|
||||||
method: POST
|
|
||||||
body: "{{ lookup('template','mattermost-deploy-start.json.j2') }}"
|
|
||||||
body_format: json
|
|
||||||
headers:
|
|
||||||
Content-Type: "application/json"
|
|
||||||
delegate_to: 127.0.0.1
|
|
||||||
become: false
|
|
||||||
when:
|
|
||||||
- send_status_messages
|
|
||||||
|
|
||||||
- name: "Check if {{ postgres_id }}/docker-compose.yml exists"
|
|
||||||
stat:
|
|
||||||
path: '{{ service_base_path }}/{{ postgres_id }}/docker-compose.yml'
|
|
||||||
register: check_docker_compose_file
|
|
||||||
tags:
|
|
||||||
- update_deployment
|
|
||||||
|
|
||||||
- name: "Stop {{ postgres_id }}"
|
|
||||||
shell: docker-compose down
|
|
||||||
args:
|
|
||||||
chdir: '{{ service_base_path }}/{{ postgres_id }}'
|
|
||||||
when: check_docker_compose_file.stat.exists
|
|
||||||
ignore_errors: yes
|
|
||||||
tags:
|
|
||||||
- update_deployment
|
|
||||||
|
|
||||||
- name: "Deploy docker templates for {{ postgres_id }}"
|
|
||||||
include_role:
|
|
||||||
name: _deploy
|
|
||||||
tasks_from: templates
|
|
||||||
vars:
|
|
||||||
current_config: "_docker"
|
|
||||||
current_base_path: "{{ service_base_path }}"
|
|
||||||
current_destination: "{{ postgres_id }}"
|
|
||||||
current_owner: "{{ docker_owner }}"
|
|
||||||
current_group: "{{ docker_group }}"
|
|
||||||
current_docker: "{{ postgres_docker }}"
|
|
||||||
|
|
||||||
- name: "Deploy service templates for {{ postgres_id }}"
|
|
||||||
include_role:
|
|
||||||
name: _deploy
|
|
||||||
tasks_from: templates
|
|
||||||
vars:
|
|
||||||
current_config: "connect"
|
|
||||||
current_base_path: "{{ service_base_path }}"
|
|
||||||
current_destination: "{{ postgres_id }}"
|
|
||||||
current_owner: "{{ docker_owner }}"
|
|
||||||
current_group: "{{ docker_group }}"
|
|
||||||
|
|
||||||
- name: "Update {{ postgres_id }}"
|
|
||||||
shell: docker-compose pull
|
|
||||||
args:
|
|
||||||
chdir: '{{ service_base_path }}/{{ postgres_id }}'
|
|
||||||
tags:
|
|
||||||
- update_deployment
|
|
||||||
|
|
||||||
- name: "Start {{ postgres_id }}"
|
|
||||||
shell: docker-compose up -d
|
|
||||||
args:
|
|
||||||
chdir: '{{ service_base_path }}/{{ postgres_id }}'
|
|
||||||
tags:
|
|
||||||
- update_deployment
|
|
||||||
|
|
||||||
- name: "Send mattermost messsge"
|
|
||||||
uri:
|
|
||||||
url: "{{ mattermost_hook_smardigo }}"
|
|
||||||
method: POST
|
|
||||||
body: "{{ lookup('template','mattermost-deploy-end.json.j2') }}"
|
|
||||||
body_format: json
|
|
||||||
headers:
|
|
||||||
Content-Type: "application/json"
|
|
||||||
delegate_to: 127.0.0.1
|
|
||||||
become: false
|
|
||||||
when:
|
|
||||||
- send_status_messages
|
|
||||||
@ -1,36 +0,0 @@
|
|||||||
---
|
|
||||||
|
|
||||||
postgres_id: "{{ service_name }}-postgres_{{ cluster_service }}"
|
|
||||||
|
|
||||||
postgres_docker: {
|
|
||||||
networks: [
|
|
||||||
{
|
|
||||||
name: back-tier,
|
|
||||||
external: true,
|
|
||||||
}
|
|
||||||
],
|
|
||||||
volumes: [
|
|
||||||
{
|
|
||||||
name: "{{ postgres_id }}-data"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
services: [
|
|
||||||
{
|
|
||||||
name: "{{ postgres_id }}",
|
|
||||||
image_name: "{{ postgres_image_name }}",
|
|
||||||
image_version: "{{ postgres_image_version }}",
|
|
||||||
environment: [
|
|
||||||
"POSTGRES_DB: \"{{ hostvars[inventory_hostname][cluster_service + '_postgres_database'] | default('postgres') }}\"",
|
|
||||||
"POSTGRES_USER: \"{{ hostvars[inventory_hostname][cluster_service + '_postgres_admin_username'] | default('postgres-admin') }}\"",
|
|
||||||
"POSTGRES_PASSWORD: \"{{ hostvars[inventory_hostname][cluster_service + '_postgres_admin_password'] | default('postgres-admin') }}\"",
|
|
||||||
],
|
|
||||||
volumes: [
|
|
||||||
'"{{ postgres_id }}-data:/var/lib/postgresql/data"',
|
|
||||||
],
|
|
||||||
networks: [
|
|
||||||
'"back-tier"',
|
|
||||||
],
|
|
||||||
ports: "{{ postgres_ports | default([]) }}",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
}
|
|
||||||
@ -1 +0,0 @@
|
|||||||
---
|
|
||||||
@ -1 +0,0 @@
|
|||||||
---
|
|
||||||
@ -1 +0,0 @@
|
|||||||
---
|
|
||||||
Binary file not shown.
@ -0,0 +1,31 @@
|
|||||||
|
{
|
||||||
|
"name" : "connect-features",
|
||||||
|
"restApi" : true,
|
||||||
|
"configKey" : "connect-features",
|
||||||
|
"payloadType" : "EXCEL",
|
||||||
|
"config" : [ {
|
||||||
|
"name" : "file",
|
||||||
|
"type" : "FILE",
|
||||||
|
"value" : "connect-features.xlsx"
|
||||||
|
}, {
|
||||||
|
"name" : "columnNames",
|
||||||
|
"type" : "STRING",
|
||||||
|
"value" : ""
|
||||||
|
}, {
|
||||||
|
"name" : "sqlStatement",
|
||||||
|
"type" : "STRING",
|
||||||
|
"value" : "select * from features"
|
||||||
|
}, {
|
||||||
|
"name" : "columnNameLineNumber",
|
||||||
|
"type" : "INT",
|
||||||
|
"value" : 1
|
||||||
|
}, {
|
||||||
|
"name" : "skipEmptyLines",
|
||||||
|
"type" : "BOOLEAN",
|
||||||
|
"value" : false
|
||||||
|
}, {
|
||||||
|
"name" : "skipEmptyColumns",
|
||||||
|
"type" : "BOOLEAN",
|
||||||
|
"value" : false
|
||||||
|
} ]
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,3 +1,3 @@
|
|||||||
{
|
{
|
||||||
"text": "Role role {{ role_name }} on <{{ service_name }}> finished successfully."
|
"text": "Role role {{ role_name }} on <{{ inventory_hostname }}> finished successfully."
|
||||||
}
|
}
|
||||||
@ -1,3 +1,3 @@
|
|||||||
{
|
{
|
||||||
"text": "Start role {{ role_name }} on <{{ service_name }}>."
|
"text": "Start role {{ role_name }} on <{{ inventory_hostname }}>."
|
||||||
}
|
}
|
||||||
@ -1,3 +1,3 @@
|
|||||||
{
|
{
|
||||||
"text": "Removed {{ service_name }} on {{ stage_server_url_host }} successfully."
|
"text": "Removed {{ inventory_hostname }} on {{ stage_server_domain }} successfully."
|
||||||
}
|
}
|
||||||
@ -1,3 +1,3 @@
|
|||||||
{
|
{
|
||||||
"text": "Removing {{ service_name }} on {{ stage_server_url_host }}."
|
"text": "Removing {{ inventory_hostname }} on {{ stage_server_domain }}."
|
||||||
}
|
}
|
||||||
@ -1,10 +0,0 @@
|
|||||||
git archive --format zip --output ../hetzner-ansible.zip master
|
|
||||||
scp ../hetzner-ansible.zip sven.ketelsen@dev-awx-01.smardigo.digital:~/hetzner-ansible.zip
|
|
||||||
|
|
||||||
#cd /var/lib/rancher/k3s/storage/pvc-57241168-6a49-4a8e-be84-748267fe1c5a_default_awx-projects-claim
|
|
||||||
#mv hetzner-ansible hetzner-ansible-old<...>
|
|
||||||
#mkdir hetzner-ansible
|
|
||||||
#cd hetzner-ansible
|
|
||||||
#cp ~/hetzner-ansible.zip .
|
|
||||||
#unzip hetzner-ansible.zip
|
|
||||||
#hetzner-ansible.zip
|
|
||||||
Loading…
Reference in New Issue