On 12.01.2015 17:46, Alan McKinnon wrote:
> You'd have to define it yourself in your plays somewhere
>
> Several ways present themselves:
>
> - Group customers together by customer name and use the group name.
>
> - Define the customer directly in the inventory. Generally it isn't
> recommended to define variable there, but I think this is one of the few
> case where it does make sense. Sort of like this:
>
> acme_web_server ansible_ssh_host=1.2.3.4 customer=acme
>
> {{ customer }} then is available for that host whenever the host is in scope
>
>
>
> One thing you'll find with ansible is there's always a way to do
> something, often more than one way (like perl). And all ways often make
> sense (unlike perl)
sorry for the delay ... busy week
I still haven't wrapped my head around how to properly define my groups
and sets of hosts.. but I am on my way, thanks ;-)
"learning" ... when it is better to have a group or a when-clause (when
OS = Gentoo) ...
Reading/rsyncing all the configs in isn't first priority now. Although
it already is nice-to-have as a server stopped to work this week.
OK, backups on tape etc ... but I like that basic "profile" with /etc
and @world as well.
-
I hesitate to mention it as everything with the term "systemd" in it
seems to trigger not-directly-helpful replies here ... but I see issues
with playbooks/tasks controlling services on hosts running systemd:
I have openrc and systemd installed/merged (installed with openrc, then
migrated to run systemd and openrc still there, but not active ... not
removing openrc just to keep it as some fallback) ... and when I try to
control services via the service-module of ansible I don't always get
valid results. It seems that the module detects openrc installed and
doesn't check further (is openrc *active* as well?) ... so I get
misleading replies/states in.
IMO ansible should correctly detect the running PID1 .. and it tries to
as far as I understand the code of the service-module.
For example I tried to write a task to ensure that ntpd is down/disabled
and chrony is installed/enabled/started ... no real success so far.
I will provide more info if needed ... saturday night now, so excuse me
stopping here ;-)
Stefan