From 2f457b2a23c5627e87a33919d18a5790b337a857 Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Tue, 9 Jan 2024 19:08:43 +0200 Subject: [PATCH] Remove inventory/ directory tree to allow people to manage it as a git repository (etc.) Related to https://github.com/spantaleev/matrix-docker-ansible-deploy/pull/3086 --- .gitignore | 5 +---- {inventory/scripts => bin}/ansible-all-hosts.sh | 0 docs/configuring-playbook.md | 4 +++- examples/host.yml | 2 +- inventory/.gitkeep | 0 inventory/host_vars/.gitkeep | 0 6 files changed, 5 insertions(+), 6 deletions(-) rename {inventory/scripts => bin}/ansible-all-hosts.sh (100%) mode change 100755 => 100644 delete mode 100644 inventory/.gitkeep delete mode 100644 inventory/host_vars/.gitkeep diff --git a/.gitignore b/.gitignore index 6b56900a8..380d0fa41 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,4 @@ -/inventory/* -!/inventory/.gitkeep -!/inventory/host_vars/.gitkeep -!/inventory/scripts +/inventory /roles/**/files/scratchpad .DS_Store .python-version diff --git a/inventory/scripts/ansible-all-hosts.sh b/bin/ansible-all-hosts.sh old mode 100755 new mode 100644 similarity index 100% rename from inventory/scripts/ansible-all-hosts.sh rename to bin/ansible-all-hosts.sh diff --git a/docs/configuring-playbook.md b/docs/configuring-playbook.md index d4195c581..16d8956ed 100644 --- a/docs/configuring-playbook.md +++ b/docs/configuring-playbook.md @@ -18,7 +18,9 @@ You can then follow these steps inside the playbook directory: 1. edit the inventory hosts file (`inventory/hosts`) to your liking -1. (optional, advanced) to run Ansible against multiple servers with different `sudo` credentials, you can copy the sample inventory hosts yaml file for each of your hosts: (`cp examples/host.yml inventory/my_host1.yml` …) and use the [`ansible-all-hosts.sh`](../inventory/scripts/ansible-all-hosts.sh) script [in the installation step](installing.md). +2. (optional, advanced) you may wish to keep your `inventory` directory under version control with [git](https://git-scm.com/) or any other version-control system. + +3. (optional, advanced) to run Ansible against multiple servers with different `sudo` credentials, you can copy the sample inventory hosts yaml file for each of your hosts: (`cp examples/host.yml inventory/my_host1.yml` …) and use the [`ansible-all-hosts.sh`](../bin/ansible-all-hosts.sh) script [in the installation step](installing.md). For a basic Matrix installation, that's all you need. For a more custom setup, see the [Other configuration options](#other-configuration-options) below. diff --git a/examples/host.yml b/examples/host.yml index e9ba2810b..85d2f3170 100644 --- a/examples/host.yml +++ b/examples/host.yml @@ -1,6 +1,6 @@ --- -# This is a host file for usage with the `ansible-all-hosts.sh` script, +# This is a host file for usage with the `../bin/ansible-all-hosts.sh` script, # which runs Ansible against a bunch of hosts, each with its own `sudo` password. matrix_servers: hosts: diff --git a/inventory/.gitkeep b/inventory/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/inventory/host_vars/.gitkeep b/inventory/host_vars/.gitkeep deleted file mode 100644 index e69de29bb..000000000