Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix wiab automation #742

Merged
merged 20 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ansible/hetzner-single-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
become: true
vars:
artifact_hash: d8fe36747614968ea73ebd43d47b99364c52f9c1
ubuntu_version: 22.04.4
ubuntu_version: 22.04.5
ssh_pubkey: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDPTGTo1lTqd3Ym/75MRyQvj8xZINO/GI6FzfIadSe5c [email protected]"
tasks:
- name: set ipv4 forward
Expand Down
15 changes: 14 additions & 1 deletion bin/autodeploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ msg ""
msg "INFO: starting Wire-in-a-box deployment for $TARGET_SYSTEM using artifact ID $ARTIFACT_HASH"
msg ""


for SUBDOMAIN in $SUBDOMAINS; do
if host "$SUBDOMAIN"."$TARGET_SYSTEM" >/dev/null 2>&1 ; then
msg "INFO: DNS A record exists: $SUBDOMAIN.$TARGET_SYSTEM"
Expand All @@ -107,6 +108,7 @@ else
die "ERROR: Can't log into $TARGET_SYSTEM via SSH, please check SSH connectivity."
fi


if curl --head --silent --fail https://s3-eu-west-1.amazonaws.com/public.wire.com/artifacts/wire-server-deploy-static-"$ARTIFACT_HASH".tgz >/dev/null 2>&1 ; then
msg "INFO: Artifact exists https://s3-eu-west-1.amazonaws.com/public.wire.com/artifacts/wire-server-deploy-static-$ARTIFACT_HASH.tgz"
else
Expand Down Expand Up @@ -134,12 +136,22 @@ system_cleanup() {
rm -f /home/$DEMO_USER/wire-server-deploy-static-*.tgz
}

# Make sure the host machine is up to date and has all required packages installed
ssh -p "$SSH_PORT" "$SSH_USER"@webapp."$TARGET_SYSTEM" "
sudo apt update && sudo apt upgrade -y && sudo apt install -y aptitude apt-transport-https bind9-host curl debian-goodies dnsutils git dnsmasq less lsof net-tools rsyslog screen sudo vim wget whois docker.io telnet python3-lxml qemu qemu-kvm qemu-utils libvirt-clients libvirt-daemon-system virtinst bridge-utils
jschumacher-wire marked this conversation as resolved.
Show resolved Hide resolved
"

preprovision_hetzner() {
msg ""
msg "INFO: running local ansible playbook for inital server deployment."
msg "INFO: This will setup up the Hetzner system with basic defaults, download and unpack the wire-server-deploy artifact."
sleep 5
export LC_ALL="C.UTF-8";
# on Mac devices C.UTF-8 is not available
if [[ $(uname) == "Darwin" ]]; then
export LC_ALL=en_US.UTF-8
else
export LC_ALL=C.UTF-8
fi
ansible-playbook ../ansible/hetzner-single-deploy.yml -e "artifact_hash=$ARTIFACT_HASH" -i $SSH_USER@webapp."$TARGET_SYSTEM", --diff
}

Expand Down Expand Up @@ -387,6 +399,7 @@ if [[ "$EXISTING_CONTAINERS" ]]; then
DO_SYSTEM_CLEANUP=true
fi


if [ "$DO_SYSTEM_CLEANUP" = false ]; then
msg ""
msg "INFO: Target system clean, no previous wire-server-deploy installation found."
Expand Down
Loading