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