From 1fe1ce6bbce2c69866723bdfedda58b85b00fb22 Mon Sep 17 00:00:00 2001 From: Alexander Dietrich Date: Mon, 16 May 2022 21:14:52 +0200 Subject: [PATCH] Use ansible-galaxy for external roles --- .gitignore | 3 +++ .gitmodules | 6 ------ README.md | 22 +++++++++++++++++++--- requirements-galaxy.yml | 7 +++++++ requirements-github.yml | 7 +++++++ roles/basics | 1 - roles/nginx | 1 - 7 files changed, 36 insertions(+), 11 deletions(-) delete mode 100644 .gitmodules create mode 100644 requirements-galaxy.yml create mode 100644 requirements-github.yml delete mode 160000 roles/basics delete mode 160000 roles/nginx diff --git a/.gitignore b/.gitignore index eff44fb..811e918 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,8 @@ +# Directories ENV/ tmp/ +# Files *.retry *.swp +ansible.cfg diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 4bb4354..0000000 --- a/.gitmodules +++ /dev/null @@ -1,6 +0,0 @@ -[submodule "roles/basics"] - path = roles/basics - url = https://github.com/7adietri/ansible-basics.git -[submodule "roles/nginx"] - path = roles/nginx - url = https://github.com/7adietri/ansible-nginx.git diff --git a/README.md b/README.md index db09e95..c2d62a9 100644 --- a/README.md +++ b/README.md @@ -8,9 +8,21 @@ erforderlich. [ansible]: https://docs.ansible.com/ansible/latest/ +Abhängigkeiten installieren: + +```bash +# Abhängigkeiten installieren mit Ansible Galaxy +ansible-galaxy install -r requirements-galaxy.yml + +# Abhängigkeiten installieren mit GitHub +ansible-galaxy install -r requirements-github.yml +``` + ## Anwenden der Konfiguration auf alle Server - ./site +```bash +./site +``` Das Skript führt das Playbook `site.yml` aus. Zum Testen kann `-C` angehängt werden. @@ -19,8 +31,12 @@ werden. Einschränken auf bestimmte Tags, z.B. `nginx`: - ./site -t nginx +```bash +./site -t nginx +``` Einschränken auf bestimmte Server: - ./site -l srv01 +```bash +./site -l srv01 +``` diff --git a/requirements-galaxy.yml b/requirements-galaxy.yml new file mode 100644 index 0000000..d091cc4 --- /dev/null +++ b/requirements-galaxy.yml @@ -0,0 +1,7 @@ +--- +- src: alxndr42.basics + name: basics + version: v1.11.0 +- src: alxndr42.nginx + name: nginx + version: v1.4.0 diff --git a/requirements-github.yml b/requirements-github.yml new file mode 100644 index 0000000..4baac94 --- /dev/null +++ b/requirements-github.yml @@ -0,0 +1,7 @@ +--- +- src: https://github.com/alxndr42/ansible-basics.git + name: basics + version: v1.11.0 +- src: https://github.com/alxndr42/ansible-nginx.git + name: nginx + version: v1.4.0 diff --git a/roles/basics b/roles/basics deleted file mode 160000 index d859daa..0000000 --- a/roles/basics +++ /dev/null @@ -1 +0,0 @@ -Subproject commit d859daa9e5a569af6a87d556a8add62b6ccffaab diff --git a/roles/nginx b/roles/nginx deleted file mode 160000 index 697304b..0000000 --- a/roles/nginx +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 697304bf0278e894a673592676419b615982de82