Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWill Chandler <wchandler@gitlab.com>2023-01-06 06:30:20 +0300
committerWill Chandler <wchandler@gitlab.com>2023-01-17 20:28:17 +0300
commitad11f0d4e77e46f093a50de7a89be79e773e8521 (patch)
treed89ce4681ad07f0a7d6670a9ae0c30ef47cccd40 /_support
parent1d88c6c19e5bac15fc40334a3913ceb2090eb854 (diff)
benchmarking: Add destroy role
Add an additional role to tear down a benchmarking instance when it is no longer required. This also removes the destroyed instances' host keys from known hosts as GCP will frequently re-use the same IP address on new nodes. This causes host key verification errors if we don't clean up known hosts.
Diffstat (limited to '_support')
-rwxr-xr-x_support/benchmarking/destroy-benchmark-instance2
-rw-r--r--_support/benchmarking/destroy.yml7
-rw-r--r--_support/benchmarking/roles/destroy/handlers/main.yml5
-rw-r--r--_support/benchmarking/roles/destroy/tasks/main.yml8
4 files changed, 22 insertions, 0 deletions
diff --git a/_support/benchmarking/destroy-benchmark-instance b/_support/benchmarking/destroy-benchmark-instance
new file mode 100755
index 000000000..f5eaf5128
--- /dev/null
+++ b/_support/benchmarking/destroy-benchmark-instance
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec ansible-playbook -i hosts.ini destroy.yml "$@"
diff --git a/_support/benchmarking/destroy.yml b/_support/benchmarking/destroy.yml
new file mode 100644
index 000000000..da95995fb
--- /dev/null
+++ b/_support/benchmarking/destroy.yml
@@ -0,0 +1,7 @@
+---
+- name: Destroy benchmark cluster
+ hosts: localhost
+ roles:
+ - destroy
+ become: false
+ gather_facts: no
diff --git a/_support/benchmarking/roles/destroy/handlers/main.yml b/_support/benchmarking/roles/destroy/handlers/main.yml
new file mode 100644
index 000000000..b2bb0d182
--- /dev/null
+++ b/_support/benchmarking/roles/destroy/handlers/main.yml
@@ -0,0 +1,5 @@
+---
+- name: Remove SSH keys from known hosts
+ command: "ssh-keygen -R {{ item }}"
+ loop: "{{ groups['gitaly'] | list + groups['client'] }}"
+ listen: remove hostkeys
diff --git a/_support/benchmarking/roles/destroy/tasks/main.yml b/_support/benchmarking/roles/destroy/tasks/main.yml
new file mode 100644
index 000000000..38c0d1f12
--- /dev/null
+++ b/_support/benchmarking/roles/destroy/tasks/main.yml
@@ -0,0 +1,8 @@
+---
+- name: terraform destroy
+ terraform:
+ project_path: "{{ playbook_dir }}/terraform"
+ variables_file: terraform.tfvars
+ state: absent
+ notify:
+ - remove hostkeys