Hi Kai,

(apology for taking six weeks to answer from other mail applies hier as
well)

On Tue, Apr 03, 2018 at 09:58:56PM +0200, Kai Stian Olstad wrote:
> On 02.04.2018 16:53, Marc Haber wrote:
> > On Sat, Mar 31, 2018 at 09:39:37PM +0200, Kai Stian Olstad wrote:
> > > On Saturday, 31 March 2018 20.35.46 CEST Marc Haber wrote:
> > > > First ansible run:
> > > > [51/5036]mh@drop:~/git/zgansibletest (master * u+1) (crm) $ 
> > > > ansible-playbook --ask-become-pass --inventory=hosts.yml site.yml
> > > 
> > > <snip />
> > > 
> > > > TASK [common : zda-sid-mc.list] 
> > > > *********************************************************************************************************************
> > > > changed: [sid01]
> > > > changed: [sid02]
> > > >
> > > > RUNNING HANDLER [common : apt update] 
> > > > ***************************************************************************************************************
> > > > changed: [sid01]
> > > 
> > > Here is the problem, the task zda-sid-mc.list is changed on both
> > > host but only one of them run the handler.
> > > Why this happen i don't know but at fist glance it looks like a bug.
> > > What is your Ansible version?
> > 
> > All systems in the test setup are Debian unstable, which ansible 2.5.0.
> > 
> > > You could also try more detailed logging to see if that gives more
> > > info:
> > >   ANSIBLE_STDOUT_CALLBACK=debug ansible-playbook -vvv
> > > --ask-become-pass --inventory=hosts.yml site.yml
> > 
> > That's 98 kB, too much for this list. I have uploadd to
> > http://q.bofh.de/~mh/stuff/ansible-log.txt
> > 
> > What confuses me is that no handling of the presentsourceslistfiles
> > variable is logged at all.
> 
> 
> The tasks run, but you don't see the content of the variable, you would need
> to use debug for that.

So even with -vvv I won't see variables being handled without explicit
debug being written down?

> And the log show it handles both notify but only one host is added by
> add_host.

But why?

> Your task "delete source.list.d files" is on role zzhandleapt so that will
> only be run/deleted when the notify is run, and notify is on zda-sid-mc.list
> task.

That notify is a leftover from the original try; the current version is
meant to built a list of hosts that need "apt update" in the
apt_action_hosts lists, which the zzhandleapt being called conditionally
for all hosts in the list from the site.yml.

> If the only go is to run apt update, why don't you just notify apt module
> directly?

Because that will run apt update multiple times per host, resulting in
wasted time, and not all jobs called this way are idempotent.

Greetings
Marc

-- 
-----------------------------------------------------------------------------
Marc Haber         | "I don't trust Computers. They | Mailadresse im Header
Leimen, Germany    |  lose things."    Winona Ryder | Fon: *49 6224 1600402
Nordisch by Nature |  How to make an American Quilt | Fax: *49 6224 1600421

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/20180517165800.rcltcovpq3rliyjt%40torres.zugschlus.de.
For more options, visit https://groups.google.com/d/optout.

Reply via email to