1 |
On 11/01/2015 17:12, Stefan G. Weichinger wrote: |
2 |
|
3 |
> And at keeping /etc in git: |
4 |
> |
5 |
> So far I made it a habit to do that on customer servers. Keeping track |
6 |
> of changes is a good thing and helpful. I still wonder how to centralize |
7 |
> this as I would like to have these, let's call them "profiles" in my own |
8 |
> LAN as well. People tend to forget their backups etc ... I feel better |
9 |
> with a copy locally. |
10 |
> |
11 |
> This leads to finding a structure of managing this. |
12 |
> |
13 |
> The /etc-git-repos so far are local to the customer servers. |
14 |
> Sure, I can add remote repos and use ansible to push the content up there. |
15 |
> |
16 |
> One remote-repo per server-machine? I want to run these remote-repos on |
17 |
> one of my inhouse-servers ... |
18 |
> |
19 |
> For now I wrote a small playbook that allows me to rsync /etc and |
20 |
> world-file from all the Gentoo-boxes out there (and only /etc from |
21 |
> firewalls and other non-gentoo-machines). |
22 |
> |
23 |
> As mentioned I don't have FQDNs for all hosts and this leads to the |
24 |
> problem that there are several lines like "ipfire" in several groups. |
25 |
> |
26 |
> Rsyncing stuff into a path containing the hostname leads to conflicts: |
27 |
> |
28 |
> - name: "sync /etc from remote host to inventory host" |
29 |
> synchronize: | |
30 |
> mode=pull |
31 |
> src=/etc |
32 |
> dest={{ local_storage_path }}/"{{ inventory_hostname |
33 |
> }}"/etc |
34 |
> delete=yes |
35 |
> recursive=yes |
36 |
> |
37 |
> |
38 |
> So I assume I should just setup some kind of talking names like: |
39 |
> |
40 |
> [smith] |
41 |
> ipfire_smith .... |
42 |
> |
43 |
> [brown] |
44 |
> ipfire_brown .... |
45 |
> |
46 |
> ... and use these just as "labels" ? |
47 |
> |
48 |
> Another idea is to generate some kind of UUID for each host and use that? |
49 |
|
50 |
|
51 |
The trick is to use a system that guarantees you a unique "label" or |
52 |
identifier for each host. |
53 |
|
54 |
Perhaps {{ customer_name }}/{{ hostname }} works? |
55 |
|
56 |
This would fail if you have two customers with the same company name |
57 |
(rare, but not impossible) or customers have machines with the same name |
58 |
(silly, but possible). In that case, you'd probably have to go with |
59 |
UUIDs or similar. |
60 |
|
61 |
|
62 |
-- |
63 |
Alan McKinnon |
64 |
alan.mckinnon@×××××.com |