I’m trying to figure out a way of checking out a git repository only once per play on the management host. I’ve solved this by registering an variable when I checked it out in normal playbooks, but it wont work if I make a “playbook of playbooks”.
The issue with doing it the simple way is that I would have to run everything in serial mode, otherwise git will find a .lock file which breaks the run.
Currently I use git module as a task and delegate_to, as the repository is located on the management node and I don’t want to checkout the repository on 17 nodes to only use a few of the files, so what I did was to register a checkout in a variable and check the variable every time the task runs to avoid doing it twice. However, this only seems to work in a normal playbooks and not in a master playbook.
What I was aiming for was to be able to run each playbook by itself as well as using them as building blocks to make “role” playbooks depending on what the server would do (i.e. infrastructure/customer server/monitoring/db server etc).
How is localhost intended to work with the cobbler hosts-script as it says “Make sure a cobbler --dns-name is set for each cobbler system”?
Sounds dangerous to have localhost in the DNS.
Issue is that i get “no hosts matched” for both localhost and 127.0.0.1.
Having localhost in DNS seems to be fine (RFC 1912):
"
The "localhost" address is a "special" address which always refers to
the local host. It should contain the following line:
localhost. IN A 127.0.0.1"
Question is to handle it in cobbler to avoid pitfalls.
... digging ...
You can in 1.1, use multiple inventory sources at once:
assume /path/to/inventory_directory contains:
a host file defining your localhost (this can be named anything)
your cobbler inventory script (this also can be named anything)
pass -i /path/to/inventory_directory to use both simultaneously!