mirror of
https://github.com/spantaleev/matrix-docker-ansible-deploy.git
synced 2026-07-13 10:42:15 +10:00
Add add-inventory-host command for bootstrapping the inventory
Running `just add-inventory-host example.com 1.2.3.4` (or `make add-inventory-host domain=example.com ip=1.2.3.4`) adds a new host to the inventory, creating inventory/hosts and inventory/host_vars/matrix.DOMAIN/vars.yml from the example files, with strong secrets generated automatically. Existing configuration is never overwritten. The command refuses to run if the host is already in the inventory, so it can also be used for adding more hosts later. Based on the idea proposed in https://github.com/spantaleev/matrix-docker-ansible-deploy/pull/4682 by @Ser5 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -2,11 +2,14 @@
|
||||
#
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
.PHONY: roles lint
|
||||
.PHONY: roles lint add-inventory-host
|
||||
|
||||
help: ## Show this help.
|
||||
@grep -F -h "##" $(MAKEFILE_LIST) | grep -v grep | sed -e 's/\\$$//' | sed -e 's/##//'
|
||||
|
||||
add-inventory-host: ## Adds a new host to the inventory, creating the inventory files if necessary (e.g. `make add-inventory-host domain=example.com ip=1.2.3.4`)
|
||||
@./bin/add-inventory-host.sh "$(domain)" "$(ip)"
|
||||
|
||||
roles: ## Pull roles
|
||||
rm -rf roles/galaxy
|
||||
ansible-galaxy install -r requirements.yml -p roles/galaxy/ --force
|
||||
|
||||
Reference in New Issue
Block a user