git.lirion.de

Of git, get, and gud

aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Pfeiffer <harald.pfeiffer _ bechtle.com> 2020-01-23 08:18:53 +0100
committerHarald Pfeiffer <harald.pfeiffer _ bechtle.com> 2020-01-23 08:18:53 +0100
commit272ca610a74dc3c80264a89797b8642f0dfb6864 (patch)
treeee0857ffb969b7534313df2ac974203494c9f116
parentc85384312e49541198c34739401cebe4bb64c21e (diff)
downloadansible-272ca610a74dc3c80264a89797b8642f0dfb6864.tar.bz2
example inventory merger sxcript plus inventory. all yaml.
-rw-r--r--apt-upgrade.yml10
-rw-r--r--hosts-primary19
-rw-r--r--update-inventory6
3 files changed, 30 insertions, 5 deletions
diff --git a/apt-upgrade.yml b/apt-upgrade.yml
index 10ee164..cc8b233 100644
--- a/apt-upgrade.yml
+++ b/apt-upgrade.yml
@@ -21,11 +21,11 @@
# incompetence with incompetence, so this feels sufficient. Later versions may
# or may not include adequate variable handling (like host.gitlabshutdown or whatever)
tasks:
- - name: Update apt cache on apt-cacher
- apt:
- update_cache: yes
- become: true
- delegate_to: acng
+# - name: Update apt cache on apt-cacher
+# apt:
+# update_cache: yes
+# become: true
+# delegate_to: acng
- name: Update apt cache
apt:
update_cache: yes
diff --git a/hosts-primary b/hosts-primary
new file mode 100644
index 0000000..afd78fb
--- /dev/null
+++ b/hosts-primary
@@ -0,0 +1,19 @@
+---
+all:
+ children:
+ foo:
+ hosts:
+ foo.example.com:
+ children:
+ bar:
+ baz.example.com:
+ pr0nhost.example.com:
+# HOST SPECIFIC VARIABLES:
+ hosts:
+ foo.example.com:
+ vars:
+ location: "wanne-eickel.datacenters.example.com"
+ pr0nhost.example.com:
+ vars:
+ location: "pr0ncent0r"
+
diff --git a/update-inventory b/update-inventory
new file mode 100644
index 0000000..eee109d
--- /dev/null
+++ b/update-inventory
@@ -0,0 +1,6 @@
+#!/usr/bin/env bash
+
+sudo su -c "printf -- '---\nall:\n children:\n' > hosts"
+sudo su -c "sed -n '1,/# HOST SPECIFIC VARIABLES/ p' hosts-primary|grep -v '^# HOST SPECIFIC VARIABLES'|grep -vP '^---$|^all:|^ children:' >> hosts"
+sudo su -c "grep -vP '^---$|^all:|^ children:' hosts-sec-* >> hosts"
+sudo su -c "sed -n '/# HOST SPECIFIC VARIABLES/,$ p' hosts-primary >> hosts"