From 46b8ba769ae5933f692b9ba06233fa2fcfea5a0f Mon Sep 17 00:00:00 2001 From: Aravinth Manivannan Date: Mon, 14 Aug 2023 09:16:20 +0530 Subject: [PATCH] feat: ping all dos VMs --- .gitignore | 1 + Makefile | 18 ++++++++++++++++++ ansible/ping.yml | 12 ++++++++++++ .../dos/requirements.txt => requirements.txt | 0 4 files changed, 31 insertions(+) create mode 100644 .gitignore create mode 100644 Makefile create mode 100644 ansible/ping.yml rename terraform/dos/requirements.txt => requirements.txt (100%) diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5ceb386 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +venv diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..6b119db --- /dev/null +++ b/Makefile @@ -0,0 +1,18 @@ +# SPDX-FileCopyrightText: 2023 Aravinth Manivannan +# +# SPDX-License-Identifier: AGPL-3.0-or-later + + +define ping + . ./venv/bin/activate && \ + ansible-playbook -i $(INVENTORY) -f 10 ./ansible/ping.yml +endef + +# ```bash +# INVENTORY=./terraform/dos/hosts.ini make conf.ping +# ``` +conf.ping: ## Ping all DoS VMs + $(call ping) + +help: ## Prints help for targets with comments + @cat $(MAKEFILE_LIST) | grep -E '^[a-zA-Z_-].+:.*?## .*$$' | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' diff --git a/ansible/ping.yml b/ansible/ping.yml new file mode 100644 index 0000000..8fcead6 --- /dev/null +++ b/ansible/ping.yml @@ -0,0 +1,12 @@ +# SPDX-FileCopyrightText: 2023 Aravinth Manivannan +# +# SPDX-License-Identifier: AGPL-3.0-or-later + +--- +- name: Ping all servers + hosts: all + remote_user: atm + + tasks: + - name: Ensure all VMs are reachable + ansible.builtin.ping: diff --git a/terraform/dos/requirements.txt b/requirements.txt similarity index 100% rename from terraform/dos/requirements.txt rename to requirements.txt