Re: [ansible-project] Ansible Python API 2.0 - capture warnings
Hey Guys Badly need some pointers here - as I am running out of options Fiddling with the display Utils gives me the needed verbose but to stdout and not the callbacks Thanks, Suren VB From: Suren Baskaran <surenz...@gmail.com> Sent: Friday, April 13, 2018 4:36:41 AM To: ansible-project@googlegroups.com; Ansible Project Subject: Re: [ansible-project] Ansible Python API 2.0 - capture warnings Hey Brain Appreciate some pointers here Thanks, Suren VB From: Suren Baskaran <surenz...@gmail.com> Sent: Thursday, April 12, 2018 11:52:23 AM To: ansible-project@googlegroups.com; Ansible Project Subject: Re: [ansible-project] Ansible Python API 2.0 - capture warnings Thanks for the prompt response Brian Any examples or references on how to integrate the display with playbook executor callbacks ? Appreciate your response Thanks, Suren VB From: ansible-project@googlegroups.com <ansible-project@googlegroups.com> on behalf of Brian Coca <bc...@redhat.com> Sent: Wednesday, April 11, 2018 7:18:50 PM To: Ansible Project Subject: Re: [ansible-project] Ansible Python API 2.0 - capture warnings Warnings are not currently handled by callbacks, the Display class handles them. -- -- 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/CACVha7eFcKLzY5_doDDmQ17UTpsXkLCHkUwM6j2MgyLfFKJY6Q%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/DM5PR14MB1563C9615C45BA397A8F0C94AAB00%40DM5PR14MB1563.namprd14.prod.outlook.com. For more options, visit https://groups.google.com/d/optout.
Re: [ansible-project] Ansible Python API 2.0 - capture warnings
Hey Brain Appreciate some pointers here Thanks, Suren VB From: Suren Baskaran <surenz...@gmail.com> Sent: Thursday, April 12, 2018 11:52:23 AM To: ansible-project@googlegroups.com; Ansible Project Subject: Re: [ansible-project] Ansible Python API 2.0 - capture warnings Thanks for the prompt response Brian Any examples or references on how to integrate the display with playbook executor callbacks ? Appreciate your response Thanks, Suren VB From: ansible-project@googlegroups.com <ansible-project@googlegroups.com> on behalf of Brian Coca <bc...@redhat.com> Sent: Wednesday, April 11, 2018 7:18:50 PM To: Ansible Project Subject: Re: [ansible-project] Ansible Python API 2.0 - capture warnings Warnings are not currently handled by callbacks, the Display class handles them. -- -- 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/CACVha7eFcKLzY5_doDDmQ17UTpsXkLCHkUwM6j2MgyLfFKJY6Q%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/DM5PR14MB1563C07A3F63C6EB44FFA37CAABC0%40DM5PR14MB1563.namprd14.prod.outlook.com. For more options, visit https://groups.google.com/d/optout.
Re: [ansible-project] Ansible Python API 2.0 - capture warnings
Thanks for the prompt response Brian Any examples or references on how to integrate the display with playbook executor callbacks ? Appreciate your response Thanks, Suren VB From: ansible-project@googlegroups.comon behalf of Brian Coca Sent: Wednesday, April 11, 2018 7:18:50 PM To: Ansible Project Subject: Re: [ansible-project] Ansible Python API 2.0 - capture warnings Warnings are not currently handled by callbacks, the Display class handles them. -- -- 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/CACVha7eFcKLzY5_doDDmQ17UTpsXkLCHkUwM6j2MgyLfFKJY6Q%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/DM5PR14MB15633D56E8A3CE8778568922AABC0%40DM5PR14MB1563.namprd14.prod.outlook.com. For more options, visit https://groups.google.com/d/optout.
[ansible-project] Ansible Python API 2.0 - capture warnings
Hello All Been circling around the Callbackbase with all possible tries , but I could not find a way till now to capture these warnings from a playbook execution with the API output [WARNING]: * Failed to parse hosts/UAT/ dictionary, got: [WARNING]: * Failed to parse /hosts/UAT/ssh_keys/dbrun_46186_1_uat with ini plugin:: Expected key=value host variable assignment, got: RSA [WARNING]: Could not match supplied host pattern, ignoring: primary_host Appreciate some help - on how to capture these warning messages when we run playbooks via the API? -- 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/ef04a81d-e203-4f5c-afc1-6570e2bbaeb2%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[ansible-project] Ansible command-line like verbose > 3 using python API 2.0
Hi So when we run a ansible playbook in command line with -vvv [ verbosity=3] we get all these below information like "Task path" , "using module" and the internals of how each hosts gets connectivity established. TASK [SHOW THE LAST 10 ALERTS ] ** task path: Using module file /usr/lib/python2.7/site-packages/ansible/modules/commands/command.py ESTABLISH SSH CONNECTION FOR USER: SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=tpeng -o ConnectTimeout=10 -o ControlPath=XX '/bin/sh -c '"'"'echo ~ && sleep 0'"'"'' (255, '', 'ssh: connect to host XX port 22: Connection timed out\r\n') fatal: [gmcrou07.uk.db.com]: UNREACHABLE! => { "changed": false, "msg": "Failed to connect to the host via ssh: ssh: connect to host port 22: Connection timed out\r\n", "unreachable": true } Whereas when I set the same verbosity using the python API , I just an detailed info why the SSH failed to connect like below Failed to connect to the host via ssh: OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 1: Applying options for *\r\ndebug1: /etc/ssh/ssh_config line 4: Deprecated option \"rhostsauthentication\"\r\ndebug1: /etc/ssh/ssh_config line 8: Deprecated option \"fallbacktorsh\"\r\ndebug1: /etc/ssh/ssh_config line 9: Deprecated option \"usersh\"\r\ndebug1: auto-mux: Trying existing master\r\ndebug1: Control socket \"/home/eqops_dev/.ansible/cp/26dab4b3e8\" does not exist\r\ndebug2: resolving \"X\" port 22\r\ndebug2: ssh_connect_direct: needpriv 0\r\ndebug1: Connecting to gmcrou07.uk.db.com [10.236.110.107] port 22.\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug1: connect to address Xx port 22: Connection timed out\r\nssh: connect to host XX port 22: Connection timed out but not the other details , not sure if am missing any callback settings. ideally m thinking of a way to get the command line like verbose [ Ansible versions , config files , task path etc... ] with the Python API Appreciate some help here -- 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/dbbf07ab-734b-4bf1-b08d-4f8edea4ae23%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.