git.lirion.de

Of git, get, and gud

aboutsummaryrefslogtreecommitdiffstats
path: root/update-inventory
blob: eee109daaa56b7a9c5334915ad4d31e66d7d8cf3 (plain)
1
2
3
4
5
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"