On 11/01/2015 17:12, Stefan G. Weichinger wrote: > And at keeping /etc in git: > > So far I made it a habit to do that on customer servers. Keeping track > of changes is a good thing and helpful. I still wonder how to centralize > this as I would like to have these, let's call them "profiles" in my own > LAN as well. People tend to forget their backups etc ... I feel better > with a copy locally. > > This leads to finding a structure of managing this. > > The /etc-git-repos so far are local to the customer servers. > Sure, I can add remote repos and use ansible to push the content up there. > > One remote-repo per server-machine? I want to run these remote-repos on > one of my inhouse-servers ... > > For now I wrote a small playbook that allows me to rsync /etc and > world-file from all the Gentoo-boxes out there (and only /etc from > firewalls and other non-gentoo-machines). > > As mentioned I don't have FQDNs for all hosts and this leads to the > problem that there are several lines like "ipfire" in several groups. > > Rsyncing stuff into a path containing the hostname leads to conflicts: > > - name: "sync /etc from remote host to inventory host" > synchronize: | > mode=pull > src=/etc > dest={{ local_storage_path }}/"{{ inventory_hostname > }}"/etc > delete=yes > recursive=yes > > > So I assume I should just setup some kind of talking names like: > > [smith] > ipfire_smith .... > > [brown] > ipfire_brown .... > > ... and use these just as "labels" ? > > Another idea is to generate some kind of UUID for each host and use that?
The trick is to use a system that guarantees you a unique "label" or identifier for each host. Perhaps {{ customer_name }}/{{ hostname }} works? This would fail if you have two customers with the same company name (rare, but not impossible) or customers have machines with the same name (silly, but possible). In that case, you'd probably have to go with UUIDs or similar. -- Alan McKinnon alan.mckin...@gmail.com