Re: [ansible-project] My playbook hangs during a task.

2020-02-25 Thread Ansible Krazy
We faced the same problem in our production. So if the node is
slow//sluggish or goes unresponsive while playbook is running, Ansible will
not leave the connection or in other words will keep waiting for output
from the node(s). Well, in the case, playbooks seems to be hang.

Try to use async poll in the task:
https://docs.ansible.com/ansible/latest/user_guide/playbooks_async.html

On Fri, Feb 21, 2020 at 1:24 AM Stefan Hornburg (Racke) 
wrote:

> On 2/20/20 6:26 PM, Keith Koene wrote:
> > I have written a playbook that checks for accessible hosts, then copies
> a script to those hosts, runs the script, copies
> > output to file and then looks for that file and copies it back to the
> local machine.  I ran this playbook through a
> > couple of linters and even ran it using the --syntax-check flag and
> everything checks out fine.  When I run the playbook
> > against a small list of hosts, it hangs on the task "Copy Files".  Not
> sure what the problem is and am hoping a fresh
> > set of eyes on this will point out something I missed.  I am running
> this on an Oracle Linux 7 server and the hosts are
> > all Oracle Linux 7.
> >
>
> First step would be to verify whether the list of hosts in reachable group
> is accurate (use debug to get a list of the
> hosts in this group).
>
> Second step would be to login into the host and find out what causes the
> hanging.
>
> Regards
>  Racke
>
> >
> > |
> > ---
> > - name: check reachable hosts
> >   hosts: all
> >   gather_facts: no
> >   tasks:
> > - command: ping -c1 {{ inventory_hostname }}
> >   delegate_to: localhost
> >   register: ping_result
> >   ignore_errors: yes
> > - group_by: key=reachable
> >   when: ping_result|success
> >
> > - name: Get sudoers info
> >   hosts: reachable
> >   become: true
> >   gather_facts: false
> >   tasks:
> >
> >   - name: Copy files
> > copy:
> >src: /home/KXK1754/getsudoers.sh
> >dest: /tmp/getsudoers.sh
> >owner: root
> >group: root
> >mode: 0700
> >
> >   - name: Run script
> > shell: /tmp/getsudoers.sh
> > ignore_errors: yes
> >
> >   - name: Find results
> > find:
> >paths: "/tmp/"
> >patterns: "sdoers.*"
> >register: file_to_copy
> >
> >   - name: Fetch results
> > fetch:
> >   src: "{{ item.path }}"
> >   dest: /var/ftp/keithtest/
> >   with_items: "{{ file_to_copy.files }}"
> >   ignore_errors: yes
> >   flat: yes
> > |
> >
> >
> >
> >
> >
> > --
> > 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  ansible-project+unsubscr...@googlegroups.com>.
> > To view this discussion on the web visit
> >
> https://groups.google.com/d/msgid/ansible-project/ec5b47bd-5f38-4311-9a0b-65e90aa34f47%40googlegroups.com
> > <
> https://groups.google.com/d/msgid/ansible-project/ec5b47bd-5f38-4311-9a0b-65e90aa34f47%40googlegroups.com?utm_medium=email_source=footer
> >.
>
>
> --
> Ecommerce and Linux consulting + Perl and web application programming.
> Debian and Sympa administration. Provisioning with Ansible.
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/a64bc285-2bf0-0164-5f52-038d4e18e784%40linuxia.de
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAPWPJXaA1c6%3Dh6XH%3DFO9iWwm-E0MUTCk77XKL%3DHQ-xNmDYYpNA%40mail.gmail.com.


[ansible-project] Callback plugins works with ansible command?

2020-02-22 Thread Ansible Krazy
 Hi Guys,

We have been using customized callback plugin with playbooks
ansile-playbooks command. I've been trying callback plugin to improve the
output on screen with ansible command, however it is not working.

Does callback plugin only works with ansible-playbooks or that's not the
case?

Thanks!

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAPWPJXZ9fc4nO7O_cXNW7ichqnR58xSb30u11nK%3DZYMXXN%2BWRQ%40mail.gmail.com.


Re: [ansible-project] Ansible custom plugin path change

2020-01-28 Thread Ansible Krazy
Thanks

Custom callback path is defined in custom ansible.cfg. Even after
specifying that, it looks for everyone's home directory and always pick the
one present in home directory ~/.ansible/plugins/callback

On Tue, Jan 28, 2020 at 1:03 PM Stefan Hornburg (Racke) 
wrote:

> On 1/28/20 8:26 AM, Ansible Krazy wrote:
> > Right now, by default custom plugins are stored in home directory :
> ~/.ansible/plugins/callback Our custom plugins are
> > placed in comman directory : say : /var/ansible/plugin
> >
> > We dont have comman user to login to perform production activities, so
> if we make some changes in plugin placed in
> > command directory, we have to ask everyone to copy it into their home
> directories (~/.ansible/plugins/callback)
> >
> > Is there a way to avoid asking people and make it general.
> >
> > Thanks!
> >
>
>
> https://docs.ansible.com/ansible/latest/dev_guide/developing_locally.html#adding-a-plugin-locally
>
> Regards
>  Racke
>
> > --
> > 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  ansible-project+unsubscr...@googlegroups.com>.
> > To view this discussion on the web visit
> >
> https://groups.google.com/d/msgid/ansible-project/CAPWPJXaj8_-MBzj_MJ0Y3mzp5nSOOJtxBaoju9qrwjxGbzHuaQ%40mail.gmail.com
> > <
> https://groups.google.com/d/msgid/ansible-project/CAPWPJXaj8_-MBzj_MJ0Y3mzp5nSOOJtxBaoju9qrwjxGbzHuaQ%40mail.gmail.com?utm_medium=email_source=footer
> >.
>
>
> --
> Ecommerce and Linux consulting + Perl and web application programming.
> Debian and Sympa administration. Provisioning with Ansible.
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/1571a158-cc9b-40fb-5977-9bd6eca0ea5c%40linuxia.de
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAPWPJXYNjXnYC9emdTTv6LN1WQDSMysCE6d_LRzstSR8VeXGHA%40mail.gmail.com.


[ansible-project] Ansible custom plugin path change

2020-01-27 Thread Ansible Krazy
Right now, by default custom plugins are stored in home directory :
~/.ansible/plugins/callback Our custom plugins are placed in comman
directory : say : /var/ansible/plugin

We dont have comman user to login to perform production activities, so if
we make some changes in plugin placed in command directory, we have to ask
everyone to copy it into their home directories
(~/.ansible/plugins/callback)

Is there a way to avoid asking people and make it general.

Thanks!

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAPWPJXaj8_-MBzj_MJ0Y3mzp5nSOOJtxBaoju9qrwjxGbzHuaQ%40mail.gmail.com.


[ansible-project] Doc for plugin development

2020-01-08 Thread Ansible Krazy
Hi All,

Is there any document to write own callback plugin.

For example: in the below, what parameters result contains. Similarly
variable_manager = play.get_variable_manager() def v2_runner_on_ok(self,
result):

Thanks!
Megha

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAPWPJXbM0kO%3DdAEjZB7nact0O49YfqKybKB8B5zNeqJQDZuXnA%40mail.gmail.com.


[ansible-project] Ansible running command in two hosts and compare the outputs in one playbook

2019-01-28 Thread Ansible Krazy
 Ask Question 
-1

I've one playbook which runs on 2,3 hosts. I want to compare output of a
command run on host 1 with output of command run on host 2

Something like below


- hosts: 1,2,3

  tasks:
   - name: Check file in tmp
 shell: ls -ltrh /tmp/a.txt
 register : tmp1
 when: "'1' in group_names"

   - name: Checking file in /tmp
 shell: ls -ltrh /tmp/b.txt
 when: "'2' in group_names"
 register: tmp2

   - name: Checking file in /tmp
 command: /bin/true
 failed_when:  tmp1 != tmp2

It is not evaluating the condition. Giving error :

fatal: [host2]: FAILED! => {"msg": "The conditional check 'tmp1 != tmp2'
failed. The error was: error while evaluating conditional ( tmp1 != tmp2):
'dict object' has no attribute 'stdout'"}

-- 
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/CAPWPJXZ3GXaSvhgyapuK7ANRXj1ejq%2BdTuW%3DCwamtf2dCLf2ag%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Ansible way to show only failed tasks not any other

2018-05-22 Thread Ansible Krazy
HI all,

I tried actionable and other callback plugins however it shows changed
tasks also.

Is there way to show only and only failed tasks on the screen

Thanks

-- 
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/CAPWPJXaH5chHd%3DxE8uiXBYxFa-pXRqijW4_NJAqFVx1u9%3DwgUg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Run multiple play books according to role

2018-02-22 Thread Ansible Krazy
So what if I want to run playbook a,b,c if group a and c,d,e if group type
is b

can it be achieved via one combined playbook

On Thu, Feb 22, 2018 at 12:53 AM, Brian Coca  wrote:

> Your roles sounds like 'other type of group', i.e webserver, dbserver,
> just define those as groups in Ansible. and then:
>
> hosts; rolea:
>
> ^ play runs against hosts in BOTH groups.
>
>
> In Ansible 'role' means a 'reusable component' that can be
> tasks/templates/vars/etc, it is not associated to a host directly,
> that is what plays do.
>
>
> --
> --
> Brian Coca
>
> --
> 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/CACVha7fpmuhoM-LS-vU-nTwDqTMRZ95%3DWwmP1DrP_cQ%
> 3D81tSoQ%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAPWPJXYvQhyRV%2BTrWU%2BdX2nFL1opHH7mAiLZ%2BP7a1Udr__LPgg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Running yml inside a playbook but different inventories

2018-02-01 Thread Ansible Krazy
Hi All,

I've a requirement where i want to run a playbook inside the main playbook,
however inventory(host) for inside playbook will be different

For example : main.ini will be having hosts

a, b, c, d

whereas inside.ini

r , h

Is it possible to achieve this ?

Any help will be appreciated

-- 
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/CAPWPJXYS%2BGpowci32uy9tYYscB6bCuxC-nPhxS5EHzUATQM%2BnQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: callback plugin log_plays double output in logs

2018-01-30 Thread Ansible Krazy
Is it also work if I use custom ansible.cfg file ... how to call callback
plugins in custom ansible.cfg

On Fri, Jan 12, 2018 at 2:27 PM, Kai Stian Olstad <
ansible-project+l...@olstad.com> wrote:

> On 09.01.2018 22:00, ansiblekr...@gmail.com wrote:
>
>> So I defined it under /usr/share/ansible/plugins/callback ansible one.
>>
>
> What do you mean with defined?
>
> log_plays is bundled with Ansible 2.4 so you only need to set
> "stdout_callback = log_plays" in ansible.cfg or set the environment
> variable ANSIBLE_STDOUT_CALLBACK=log_plays
>
>
> --
> Kai Stian Olstad
>
> --
> 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/ms
> gid/ansible-project/f6de30bb598b696c28fb45b0c120810d%40olstad.com.
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAPWPJXZt67NJQJJWqyebmwQ-E_sLv6DVMOAVUzZ%3DXf1z9e88iQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Help in developing custom plugin

2017-12-29 Thread Ansible Krazy
Hi All,

Can someone please guide me to develop/enhance some plugin. Want to know
how to add debug statement in current plugin and test in Ansible.

Thanks in advance

-- 
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/CAPWPJXZxZs818zPiJibYJhM9SkZ1tdCFmTstUb0hjXuVUWTu0g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Enable playbook logging via callback plugin

2017-12-19 Thread Ansible Krazy
Okay...

can someone please help me with the code to enable log rotation for
log_plays module

On Tue, Dec 19, 2017 at 8:55 PM, Brian Coca  wrote:

> You can create your own plugin to get the exact format you would like.
> There are plenty of callbacks, but they normally meet the needs of the
> creator.
>
>
>
>
>
> --
> --
> Brian Coca
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Ansible Project" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/ansible-project/GH8w-4TJFi0/unsubscribe.
> To unsubscribe from this group and all its topics, 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/CACVha7dRenPxSOcX4bF2CCMLLwM%
> 3DDar28GNVE%3DR2dKk9COu2pQ%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAPWPJXaPJTzfYvjyGE%3D1ArjUpfZm0s3VT5QeT%3Du-Yk0LEqwQbw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.