On 17/01/2015 23:29, Stefan G. Weichinger wrote:
> 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) ...

My advice:

Start with groups. If you find you need to have lots of "when" clauses
to make the plays work across more than one distro, and the whens follow
the same format, then you might want to split them into groups.
Make for example a "gentoo-www" group and a "debian-www" group, and
create a super-group "www" that includes both.

It's one of those questions you can only really answer once you've built
it for yourself and can see what works better in your environment


> 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.

If ansible confuses installed init systems with running init system,
then that will be a bug in ansible and should be reported

> 
> I will provide more info if needed ... saturday night now, so excuse me
> stopping here ;-)

:-)




-- 
Alan McKinnon
alan.mckin...@gmail.com


Reply via email to