Skip to content

Commit 2baff60

Browse files
Wpb 21356 wiab changes (#826)
* fix: wpb-17321 fix coturn secrets for demo-wiab * fix: wpb-17321 fix postgresql secrets for demo-wiab * enable: wpb-17321 kube-prometheus-stack values and enabled monitoring support from wire-server * enable: wpb-17321 add values for wire-utility in demo-wiab * enable: wpb-17321 sync serviceMonitor for ingress-nginx-controller for prod to disable monitoring * enable: wpb-17321 add changelogs * enable: wpb-17321 refactor and fixes for wiab-demo (#827) * enable: wpb-17321 refactor and fixes for wiab-demo, added all changes in changelog * fix: create a new tag for wire_secrets and handle errors from zauth wpb-17321 * fix wpb-17321: made wire_secrets playbook idempotent * fix wpb-17321: handle wire-utility deploy issues and update documentation for demo-wiab * Update changelog.d/3-deploy-builds/demo-wiab-ansible-fixes Co-authored-by: Sukanta <[email protected]> * Update changelog.d/3-deploy-builds/demo-wiab-ansible-fixes Co-authored-by: Sukanta <[email protected]> * fix wpb-17321: parameterize y-go version in install_pkgs playbook * fix wpb-17321: change http check to netcat based check in hairpin networking * fix wpb-17321: refactor offline_deploy_k8s.sh to work with envs and update wire_values accoordingly * fix wpb-17321: refactor wire_secrets to be idempotent and move all secret management to it * fix wpb-17321: when conditions in deploy_wiab to better manage common tasks for minikube networking * fix wpb-17321: cert-manager deploy control with cert_manager_networking tag * fix wpb-17321: update the documentation for demo-wiab * fix wpb-17321: added minio secrets in demo-values and removed extra BASE_DIR in wire_values * fix wpb-17321: move away from yq-go to ansible native yaml updates and added minio creds * fix wpb-17321: fix basc script suggestions from sonarcloud * fix wpb-17321: fix wire_secrets for cargohold * fix wpb-17321: fix wire_secrets for fake-aws-s3 * fix wpb-17321: fix clean_cluster permissions * fix: wpb-17321 add coturn empty values file, ignore the download task file permissions error * fix: wpb-17321 fix wire_secrets for non-prepared secrets, fixed flow using tags in deploy_wiab and update the documentation * Wpb 17321 enable demo cd (#828) * enable: wpb-17321 add terraform and bash scripts to enable cd-demo * enable: wpb-17321 added changelog and a note to old wiab-staging scripts * fix: wpb-17321 remove the debugging statements from cd-demo.sh --------- Co-authored-by: Sukanta <[email protected]> * fix: wpb-21356 suggestions highligted by shellcheck.sh linting * fix: wpb-21356 fix the when condition for wire_values and cert manager task * Update cd_demo.sh to test cert_manager deployment --------- Co-authored-by: Sukanta <[email protected]>
1 parent 61f48ff commit 2baff60

39 files changed

+1278
-441
lines changed

.github/workflows/deploy-wiab.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# This playbook is not-up-to-date, requires to be updated to match with current developments
2+
# A new WIAB (wire in a box) dev solution has been created https://docs.wire.com/latest/how-to/install/demo-wiab.html and can be used until this (wiab-staging) gets updated
13
name: Deploy on Hetzner WIAB setup
24
on:
35
workflow_run:

.github/workflows/offline.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,23 @@ jobs:
157157
AWS_SECRET_ACCESS_KEY: "${{ secrets.AWS_SECRET_ACCESS_KEY }}"
158158
AWS_REGION: "eu-west-1"
159159

160+
- name: Install terraform
161+
uses: hashicorp/setup-terraform@v3
162+
with:
163+
terraform_version: "^1.3.7"
164+
terraform_wrapper: false
165+
166+
- name: Deploy offline demo-wiab environment to hetzner
167+
run: ./offline/cd_demo.sh
168+
env:
169+
HCLOUD_TOKEN: '${{ secrets.HCLOUD_TOKEN }}'
170+
171+
- name: Clean up hetzner wiab environment; just in case
172+
if: always()
173+
run: (cd terraform/examples/wiab-demo-hetzner ; terraform init && terraform destroy -auto-approve)
174+
env:
175+
HCLOUD_TOKEN: '${{ secrets.HCLOUD_TOKEN }}'
176+
160177
- name: Cleanup demo build assets
161178
run: rm -rf offline/demo-build/output/
162179

ansible/hetzner-single-deploy.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# This playbook is not-up-to-date, requires to be updated to match with current developments
2+
# A new WIAB (wire in a box) dev solution has been created https://docs.wire.com/latest/how-to/install/demo-wiab.html and can be used until this (wiab-staging) gets updated
13
- hosts: all
24
become: true
35
vars:

ansible/inventory/demo/host.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
12
wiab:
23
hosts:
34
deploy_node:
45
ansible_host: example.com
5-
ansible_ssh_common_args: '-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null'
6+
ansible_ssh_common_args: '-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ServerAliveInterval=60 -o ServerAliveCountMax=3 -o TCPKeepAlive=yes'
67
ansible_user: 'ubuntu'
78
ansible_ssh_private_key_file: "~/.ssh/wiab-demo.pem"
89

@@ -17,7 +18,7 @@ wiab:
1718
wire_ip: ""
1819

1920
# artifact_hash
20-
artifact_hash: "89e4fa122e6ddba9df2f81612de1ee45ec2238b3"
21+
artifact_hash: "8e5087a0d9c58a9bd34c6c02f87514abe8b3ce0e"
2122

2223
# docker vars
2324
docker_ce_version: "5:28.1.1-1~ubuntu.24.04~noble"
@@ -47,14 +48,16 @@ wiab:
4748
# list of helm charts to deploy
4849
charts_to_deploy:
4950
- fake-aws
50-
- demo-smtp
51+
- smtp
5152
- rabbitmq
5253
- databases-ephemeral
54+
- postgresql # postgresql chart should be deployed before deploying wire-server
5355
- reaper
56+
- smallstep-accomp
57+
- kube-prometheus-stack
5458
- wire-server
5559
- webapp
5660
- account-pages
5761
- team-settings
58-
- smallstep-accomp
5962
- ingress-nginx-controller
6063
- nginx-ingress-services

ansible/wiab-demo/clean_cluster.yml

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
- name: Clean the installation
22
hosts: deploy_node
3-
become: yes
43
tasks:
54
# stopping the cluster defined in minikube_cluster playbook
65
- name: clean minikube
7-
become_user: "{{ ansible_user }}"
6+
tags: [never, remove_minikube]
87
block:
98
- name: Check if Minikube is running
109
shell: minikube status --profile="{{ minikube_profile }}"
@@ -22,11 +21,11 @@
2221
minikube delete --profile="{{ minikube_profile }}"
2322
when: "'Running' in minikube_status.stdout"
2423

25-
when: "remove_minikube is defined and remove_minikube | bool"
26-
2724
# following packages were installed in install_pkgs playbook
2825
# these packages can only be removed post stopping the minikube cluster
2926
- name: remove packages
27+
tags: [never, remove_packages]
28+
become: yes
3029
block:
3130
- name: Remove Minikube
3231
file:
@@ -75,11 +74,11 @@
7574
apt:
7675
update_cache: yes
7776

78-
when: (uninstall_pkgs | default(false) | bool) and (remove_minikube | default(false) | bool)
79-
8077
# remove the iptables rules defined by iptables_rules playbook
8178
# it makes sense to remove them when removing the k8s cluster or individually to clean them
8279
- name: remove iptables rules
80+
tags: [never, remove_iptables]
81+
become: yes
8382
vars:
8483
iptables_rules_comment: "Wire Iptables Rules"
8584
iptables_save_dir: "/home/{{ ansible_user }}/wire-iptables-rules"
@@ -135,28 +134,30 @@
135134
- "{{ iptables_save_dir }}/rules_post_wire.v4"
136135
- "{{ iptables_save_dir }}"
137136

138-
when: (remove_iptables | default(false) | bool) or (remove_minikube | default(false) | bool)
139-
140137
- name: Remove ssh keys
138+
tags: [never, remove_ssh]
139+
become_user: "{{ ansible_user }}"
141140
block:
142141
- name: Remove SSH key if it exist
143142
shell: |
144-
if [ -f "/home/{{ ansible_user }}/.ssh/id_rsa_wire" ]; then
145-
rm "/home/{{ ansible_user }}/.ssh/id_rsa_wire"
143+
if [ -f "{{ ansible_user_dir }}/.ssh/id_rsa_wire" ]; then
144+
rm "{{ ansible_user_dir }}/.ssh/id_rsa_wire"
146145
fi
147-
when: "remove_ssh is defined and remove_ssh | bool"
148-
146+
149147
- name: remove the downloaded artifacts
148+
tags: [never, remove_artifacts]
150149
file:
151150
path: "{{ item }}"
152151
state: absent
153152
loop:
154-
- "/home/{{ ansible_user }}/wire-server-deploy"
155-
- "/home/{{ ansible_user }}/wire-server-deploy-static-demo-{{ artifact_hash }}.tgz"
156-
- "/home/{{ ansible_user }}/wire_ip"
157-
when: "remove_artifacts is defined and remove_artifacts | bool"
153+
- "{{ ansible_user_dir }}/wire-server-deploy"
154+
- "{{ ansible_user_dir }}/wire-server-deploy-static-demo-{{ artifact_hash }}.tgz"
155+
- "{{ ansible_user_dir }}/wire_ip"
156+
- "{{ ansible_user_dir }}/wire_secrets"
158157

159158
- name: clean asset_host artifacts and remove service
159+
tags: [never, clean_assethost]
160+
become: yes
160161
block:
161162
- name: Stop and disable serve-assets systemd service
162163
systemd:
@@ -178,5 +179,3 @@
178179
file:
179180
path: /opt/assets/containers-helm
180181
state: absent
181-
182-
when: "clean_assethost is defined and clean_assethost | bool"

0 commit comments

Comments
 (0)