feat: ping all dos VMs

This commit is contained in:
Aravinth Manivannan 2023-08-14 09:16:20 +05:30
parent 423da6005f
commit 46b8ba769a
Signed by: realaravinth
GPG key ID: AD9F0F08E855ED88
4 changed files with 31 additions and 0 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
venv

18
Makefile Normal file
View file

@ -0,0 +1,18 @@
# SPDX-FileCopyrightText: 2023 Aravinth Manivannan <realaravinth@batsense.net>
#
# 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}'

12
ansible/ping.yml Normal file
View file

@ -0,0 +1,12 @@
# SPDX-FileCopyrightText: 2023 Aravinth Manivannan <realaravinth@batsense.net>
#
# 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: