Last active
June 10, 2022 02:07
-
-
Save denzuko/7f1e0c01b69f809bc48ebce42c68d864 to your computer and use it in GitHub Desktop.
Yet Another Ansible clone of ssh+make in GNU Make
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Execute: | |
## NUM_THREADS=4 make --jobs=${NUM_THREADS} RHOSTS="host1.local host2.local host3.local" CMD="whoami" RUSER="${USER}" | |
## RUNTIME flags | |
NUM_THREADS := 1 | |
RHOSTS := example.com | |
CMD := uptime | |
RUSER := root | |
SSH_FLAGS := -l $(RUSER) | |
### | |
all: $(RHOSTS) | |
$(RHOSTS): | |
@ssh $(SSH_FLAGS) $@ $(CMD) | |
addkey: | |
@echo $(RHOSTS) | xargs -I{} ssh-copy-id $(RUSER)@{} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment