Re: [ansible-project] one email for multiple hosts

2021-10-22 Thread Dick Visser
I think run_once only works when in a playbook task. Not when it's buried inside a role On Fri, 22 Oct 2021 at 19:56, Raja Natte wrote: > Yes > > On Fri, Oct 22, 2021, 1:55 PM Dick Visser wrote: > >> So this mail task is part of that role? >> >> >> On Fri, 22 Oct 2021 at 16:09, Raj wrote: >>

Re: [ansible-project] one email for multiple hosts

2021-10-22 Thread Raja Natte
Yes On Fri, Oct 22, 2021, 1:55 PM Dick Visser wrote: > So this mail task is part of that role? > > > On Fri, 22 Oct 2021 at 16:09, Raj wrote: > >> Hi, VGM >> >> my playbook call roles ssl scan ( final part is email to send once) >> but it is sending 100 emails >> >> --- >> - hosts: "{{ web

Re: [ansible-project] one email for multiple hosts

2021-10-22 Thread Dick Visser
So this mail task is part of that role? On Fri, 22 Oct 2021 at 16:09, Raj wrote: > Hi, VGM > > my playbook call roles ssl scan ( final part is email to send once) but > it is sending 100 emails > > --- > - hosts: "{{ web }}" > gather_facts: yes > roles: > - SSL_scan > > On Thursday,

Re: [ansible-project] one email for multiple hosts

2021-10-22 Thread Raja Natte
Yes.. No errors email sending included run one and delegate_to localhost Thanks On Fri, Oct 22, 2021, 10:19 AM Stefan Hornburg (Racke) wrote: > On 22/10/2021 16:09, Raj wrote: > > Hi, VGM > > > > my playbook call roles ssl scan ( final part is email to send once) > but it is sending 100

Re: [ansible-project] one email for multiple hosts

2021-10-22 Thread Stefan Hornburg (Racke)
On 22/10/2021 16:09, Raj wrote: Hi, VGM my playbook call roles  ssl scan  ( final part is email to send once)  but it is sending 100 emails Did you ever check the indentation on your task sending email as advised? delegate_to should really work. Regards     Racke --- - hosts: 

Re: [ansible-project] one email for multiple hosts

2021-10-22 Thread Raj
Hi, VGM my playbook call roles ssl scan ( final part is email to send once) but it is sending 100 emails --- - hosts: "{{ web }}" gather_facts: yes roles: - SSL_scan On Thursday, October 14, 2021 at 11:09:29 AM UTC-4 dick@geant.org wrote: > So, post that playbook > > On Thu, 14

Re: [ansible-project] one email for multiple hosts

2021-10-14 Thread Stefan Hornburg (Racke)
On 14/10/2021 15:12, Raj wrote: Hi Racke, This is my code - name: Sending email to about SSL scan   mail:     host: x     port: 25     subject:     body:      from: xxx     to:    # -     -   delegate_to: localhost   run_once: true The mail module apparently doesn't

Re: [ansible-project] one email for multiple hosts

2021-10-14 Thread Dick Visser
So, post that playbook On Thu, 14 Oct 2021 at 17:03, Raja Natte wrote: > Hi.. > > > Yes it is running in same playbook. > > On Thu, Oct 14, 2021, 10:21 AM Dick Visser wrote: > >> This is just the one mail task. >> It must be part of a playbook, where other things happen as well, and >> which

Re: [ansible-project] one email for multiple hosts

2021-10-14 Thread Raja Natte
Hi.. Yes it is running in same playbook. On Thu, Oct 14, 2021, 10:21 AM Dick Visser wrote: > This is just the one mail task. > It must be part of a playbook, where other things happen as well, and > which will reveal the cause. > > Also, you say "I am trying to send one email to team after

Re: [ansible-project] one email for multiple hosts

2021-10-14 Thread Dick Visser
This is just the one mail task. It must be part of a playbook, where other things happen as well, and which will reveal the cause. Also, you say "I am trying to send one email to team after job is successfully completed". I guess this "job" is the running of the playbook? On Thu, 14 Oct 2021

Re: [ansible-project] one email for multiple hosts

2021-10-14 Thread Raj
Hi Racke, This is my code - name: Sending email to about SSL scan mail: host: x port: 25 subject: body: from: xxx to: # - - delegate_to: localhost run_once: true On Thursday, October 14, 2021 at 1:28:05 AM UTC-4 ra...@linuxia.de

Re: [ansible-project] one email for multiple hosts

2021-10-13 Thread Stefan Hornburg (Racke)
On 13/10/2021 22:13, Raj wrote: Hi All, I am trying to send one email to team after job is successfully completed.  Issue is playbook sending (if inventory have 100 servers ). It is sending 100 emails. I tried in my code:  delegate_to: localhost and run_once: true it doesn't help please

[ansible-project] one email for multiple hosts

2021-10-13 Thread Raj
Hi All, I am trying to send one email to team after job is successfully completed. Issue is playbook sending (if inventory have 100 servers ). It is sending 100 emails. I tried in my code: delegate_to: localhost and run_once: true it doesn't help please provide your inputs it really helpful