From eee9d7fba152f39e90d87d60450cf3d1f890ff78 Mon Sep 17 00:00:00 2001 From: Paul B Date: Mon, 2 Apr 2018 00:46:01 +0200 Subject: [PATCH] feat: new 'inventory' task to fetch dynamic inventories from contrib --- Makefile | 6 ++++++ README.md | 1 + 2 files changed, 7 insertions(+) diff --git a/Makefile b/Makefile index e995e09..4408ae9 100644 --- a/Makefile +++ b/Makefile @@ -47,6 +47,12 @@ endif install: ## make install [roles_path=roles/] # Install roles dependencies @ansible-galaxy install --roles-path="$(roles_path)" --role-file="requirements.yml" +.PHONY: inventory +inventory: ## make inventory [provider=] [env=hosts] # Download dynamic inventory from Ansible's contrib + @wget https://raw.githubusercontent.com/ansible/ansible/devel/contrib/inventory/$(provider).py + @chmod +x $(provider).py + mv $(provider).py $(env) + .PHONY: lint lint: ## make lint [playbook=setup] [env=hosts] [args=] # Check syntax of a playbook @env=$(env) ansible-playbook --inventory-file="$(env)" --syntax-check $(opts) "$(playbook).yml" diff --git a/README.md b/README.md index cedaa12..c22b916 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,7 @@ debug make debug host=hostname [env=hosts] [args=] [limit=] [args=] # Run a playbook in dry run mode facts make facts [group=all] [env=hosts] [args=] # Gather facts from your hosts install make install [roles_path=roles/] # Install roles dependencies +inventory make inventory [provider=] [env=hosts] # Download dynamic inventory from Ansible's contrib lint make lint [playbook=setup] [env=hosts] [args=] # Check syntax of a playbook list make list [group=all] [env=hosts] # List hosts inventory run make run [playbook=setup] [env=hosts] [tag=] [limit=] [args=] # Run a playbook