Re: [ansible-project] Ansible hangs on package installation for hours before connection to host is lost

2020-09-10 Thread Prasad Shetty
There are multiple way to improve the performance. I have noticed multiple
time yum ansible module slow down the performance.

Try to use the pipelining or mitogen

Please refer the below URL


https://www.toptechskills.com/ansible-tutorials-courses/speed-up-ansible-playbooks-pipelining-mitogen/#


On Thu, 10 Sep, 2020, 8:59 pm Pankaj Basnal, 
wrote:

> Hi,
> I'm new to ansible and I'm facing an issue with executing our playbook.
>
> Setup-
> * For 10 hosts on azure
> * all hosts are identical and newly created
> * ansible.cfg-
> [defaults]
>   host_key_checking = False
>
> * portion of playbook that is installing packages
>
> - name: Set Initscripts to be Installed
>   set_fact:
>
> packages_to_install: "{{ packages_to_install | default([]) + [ 
> 'initscripts' ] }}"
>   tags:
> - common
>   when: ansible_distribution_major_version is version_compare('7', '<')
>
> - name: Set Java to be Installed
>   set_fact:
>
> packages_to_install: "{{ packages_to_install | default([]) + [ 
> jboss_java_pkg_name ] }}"
>   when: install_java|bool
>   tags:
> - common
>
> - name: Set Unzip to be Installed
>   set_fact:
>
> packages_to_install: "{{ packages_to_install | default([]) + [ 'unzip' ] 
> }}"
>   tags:
> - common
>
> - name: Install packages
>   package:
> name: "{{ packages_to_install }}"
> state: present
>   register: packages_result
>   retries: 5
>   until: packages_result is success
>
> At the step of package installation, ansible will freeze without any log
> output for 2 hours and then finally it will throw ssh connection error that
> host is unreachable.
>
> Logs of the run
> * 9/8/2020 8:18:08 PM : "download_only": false,
>
> * 9/8/2020 8:18:20 PM : 17403 1599576500.81986: _low_level_execute_command(): 
> executing: /bin/sh -c 'rm -f -r 
> /home/wbuser/.ansible/tmp/ansible-tmp-1599576402.5-17403-228811267706642/ > 
> /dev/null 2>&1 && sleep 0'
> * 9/8/2020 8:18:20 PM : >>><<<
>
> * 9/8/2020 8:18:20 PM : 17403 1599576500.86101: attempt loop complete, 
> returning result
> * 9/8/2020 8:18:20 PM : 17403 1599576500.86111: dumping result to json
> * 9/8/2020 8:18:20 PM : "invocation": {
> * 9/8/2020 8:18:20 PM : "update_cache": false,
>
> * 9/8/2020 8:18:20 PM : "unzip-6.0-21.el7.x86_64 providing unzip is already 
> installed",
> * 9/8/2020 10:28:42 PM : 17410 1599584322.50669: stderr chunk (state=3):
> * 9/8/2020 10:28:42 PM : >>>Shared connection to 52.225.188.39 closed.
> * 9/8/2020 10:28:42 PM : <<<
> * 9/8/2020 10:28:42 PM : 17410 1599584322.50769: stderr chunk (state=3):
> * 9/8/2020 10:28:42 PM : >>><<<
> * 9/8/2020 10:28:42 PM : 17410 1599584322.50780: stdout chunk (state=3):
> * 9/8/2020 10:28:42 PM : >>><<<
>
> * 9/8/2020 10:28:42 PM : <52.225.188.39> (255, '', 'Shared connection to 
> 52.225.188.39 closed.\r\n')
>
> * 9/8/2020 10:28:42 PM : 17410 1599584322.50832: 
> _low_level_execute_command(): starting
>
> * 9/8/2020 10:28:42 PM : 17410 1599584322.50843: 
> _low_level_execute_command(): executing: /bin/sh -c 'rm -f -r 
> /home/wbuser/.ansible/tmp/ansible-tmp-1599576402.86-17410-193336400580842/ > 
> /dev/null 2>&1 && sleep 0'
>
> * 9/8/2020 10:28:42 PM : <52.225.188.39> ESTABLISH SSH CONNECTION FOR USER: 
> wbuser
>
> * 9/8/2020 10:28:42 PM : <52.225.188.39> SSH: EXEC ssh -C -o 
> ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 
> Port=33000 -o 'IdentityFile="/tmp/AnsibleFiles/id_rsa"' -o 
> KbdInteractiveAuthentication=no -o 
> PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o 
> PasswordAuthentication=no -o 'User="wbuser"' -o ConnectTimeout=10 -o 
> StrictHostKeyChecking=no -o ControlPath=/root/.ansible/cp/cccd982d88 
> 52.225.188.39 '/bin/sh -c '"'"'rm -f -r 
> /home/wbuser/.ansible/tmp/ansible-tmp-1599576402.86-17410-193336400580842/ > 
> /dev/null 2>&1 && sleep 0'"'"''
> * 9/8/2020 10:28:43 PM : 17410 1599584323.14653: stderr chunk (state=2):
> * 9/8/2020 10:28:43 PM : >>><<<
> * 9/8/2020 10:28:43 PM : 17410 1599584323.14667: stdout chunk (state=2):
> * 9/8/2020 10:28:43 PM : >>><<<
> * 9/8/2020 10:28:43 PM : <52.225.188.39> (0, '', '')
>
> * 9/8/2020 10:28:43 PM : 17410 1599584323.14703: _low_level_execute_command() 
> done: rc=0, stdout=, stderr=
> * 9/8/2020 10:28:43 PM : 17410 1599584323.14742: _execute() done
> * 9/8/2020 10:28:43 PM : 17410 1599584323.14745: dumping result to json
>
> * 9/8/2020 10:28:43 PM : 17410 1599584323.14750: done dumping result, 
> returning
>
> * 9/8/2020 10:28:43 PM : 17410 1599584323.14777: done running TaskExecutor() 
> for JbossEAP-26/TASK: jboss_common_role : Install packages 
> [000d3ae7-f205-69c8-6cc1-00c9]
>
> * 9/8/2020 10:28:43 PM : 17410 1599584323.14799: sending task result for task 
> 000d3ae7-f205-69c8-6cc1-00c9
>
> * 9/8/2020 10:28:43 PM : 17410 1599584323.15331: done sending task result for 
> task 000d3ae7-f205-69c8-6cc1-00c9
> * 9/8/2020 10:28:43 PM : 17410 1599584323.15339: WORKER PROCESS EXITING
> * 9/8/2020 10:28:43 PM 

Re: [ansible-project] CIS Bencjmarks - Rhel 7

2020-09-10 Thread Prasad Shetty
There are many just have a glance on ansible glaxy

On Thu, 10 Sep, 2020, 2:05 pm Abhijeet Kasurde,  wrote:

> I have not tried this but you can check -
> https://github.com/ansible/ansible-lockdown
>
> On Thu, Sep 10, 2020 at 1:56 PM Josephsimon Arokiaraj 
> wrote:
>
>> Hi All,
>>
>> How you doing?
>>
>> Do we have any playbooks/roles for doing audit and remediation  on CIS
>> benchmarks for Rhel 7?
>>
>> Cheers,
>> Joseph
>>
>> --
>> 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/CAPbGgO2aq_WL55j_WkNkNH--O3wtw8Dqys5Fr639VwdgN1w5JQ%40mail.gmail.com
>> 
>> .
>>
>
>
> --
> Thanks,
> Abhijeet Kasurde
>
> --
> 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/CAFwWkHrt5_w6DjR3DGApz%3DZoAaBp3GUYuwStqO3ZGfzPHJ%2B87A%40mail.gmail.com
> 
> .
>

-- 
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/CAKG6amcxzijhbYdnX50R44p7zVCMNbHsbAH3T4Vuyqb%3DNvQWVg%40mail.gmail.com.


Re: [ansible-project] AWX SAML Configuration

2020-09-10 Thread Prasad Shetty
Thank you Raju
I am currently using LDAP mapping and it is working fine.I was looking very
specifically SAML mapping options.


On Thu, 10 Sep, 2020, 10:50 am Raju Das,  wrote:

> Hi,
>
> Please find Redhat Doc if it helps...
>
> Mapping between organization admins/users and LDAP groups
>
> The org mapping parameters controls what users are placed into what Tower
> organizations relative to their LDAP group
> memberships. Some things to note:
>
>- Keys are organization names.
>- Organizations will be created if not present.
>- Values are dictionaries defining the options for each organization's
>membership.
>- For each organization it is possible to specify what groups are
>automatically users of the organization and also what
>groups can administer the organization.
>
>- admins: None, True/False, string or list/tuple of strings.
>  - If None, organization admins will not be updated based on LDAP
>  values.
>  - If True, all users in LDAP will automatically be added as
>  admins of the organization.
>  - If False, no LDAP users will be automatically added as admins
>  of the organiation.
>  - If a string or list of strings, specifies the group DN(s) that
>  will be added of the organization if they match any of the specified 
> groups.
>   - remove_admins: True/False. Defaults to True.
>  - If True, a user who is not an member of the given groups will
>  be removed from the organization's administrative list.
>   - users: None, True/False, string or list/tuple of strings. Same
>   rules apply as for admins.
>   - remove_users: True/False. Defaults to True. Same rules as apply
>   for remove_admins
>
> Here is an example input for Organization mapping:
>
> {
> "Test Org": {
> "admins": "CN=Domain Admins,CN=Users,DC=example,DC=com",
> "users": ["CN=Domain Users,CN=Users,DC=example,DC=com"],
> "remove_users" : "True",
> "remove_admins" : "True"
> },
> "Test Org 2": {
> "admins": ["CN=Administrators,CN=Builtin,DC=example,DC=com"],
> "users": "True",
> "remove_users" : "True",
> "remove_admins" : "True"
> }
> }
>
> Mapping between team members (users) and LDAP groups.
>
> The team mapping parameters controls what users are placed into what Tower 
> teams relative to their LDAP group
> memberships. Some things to note:
>
>- Keys are team names (will be created if not present).
>- Values are dictionaries of options for each team's membership, where 
> each can contain the following parameters:
>- organization: string. The name of the organization to which the team 
> belongs. The team will be created if the combination of organization and team 
> name does not exist. The organization will first be created if it does not 
> exist.
>   - users: None, True/False, string or list/tuple of strings.
>  - If None, team members will not be updated.
>  - If True/False, all LDAP users will be added/removed as team 
> members.
>  - If a string or list of strings, specifies the group DN(s). User 
> will be added as a team member if the user is a member of ANY of these groups.
>   - remove: True/False. Defaults to False. If True, a user who is not a 
> member of the given groups will be removed from the team.
>
> Here is an example input for Team mapping:
>
> {
> "My Team": {
> "organization": "Test Org",
> "users": ["CN=Domain Users,CN=Users,DC=example,DC=com"],
> "remove": "True"
> },
> "Other Team": {
> "organization": "Test Org 2",
> "users": "CN=Other Users,CN=Users,DC=example,DC=com",
> "remove": "False"
> }
> }
>
> With Regards
>
> Raju Das
>
>
>
> On Thu, Sep 10, 2020 at 10:02 AM Prasad Shetty  wrote:
>
>> Hello Everyone-
>>
>> I was trying to setup a SAML team map in AWX . I am able to achieve the
>> same using LDAP but in SAML it bit confusing. Could you please help me on
>> the same. If anyone already configured. Please share the real example
>> configuration for my reference.
>>
>>
>> SAML ORGANIZATION ATTRIBUTE MAPPING
>> SAML TEAM MAP
>> SAML TEAM ATTRIBUTE MAPPING
>>
>> --
>> 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/CAKG6amcUQY%2BKrFtjLvS4anrLdN2pPe2DGstoWgyNKQB9e0OCGA%40mail.gmail.com
>> 
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving 

Re: [ansible-project] Ansible hangs on package installation for hours before connection to host is lost

2020-09-10 Thread Pankaj Basnal
This playbook works with less number of hosts. As the number of hosts 
increase the probability of error increases. There are a few runs which 
have completed successfully with less number of hosts. Though I don't have 
logs for them.
I'll take your suggestions and try without until and retry. But if the 
problem is with the dictionary check then it would have failed for all the 
hosts. But it failed for only 1 host and completed for the other 9. 

I can attach the complete log file if that helps
On Thursday, September 10, 2020 at 9:22:08 PM UTC+5:30 dick@geant.org 
wrote:

> On Thu, 10 Sep 2020 at 17:29, Pankaj Basnal  wrote:
> >
> > Hi,
> > I'm new to ansible and I'm facing an issue with executing our playbook.
> >
> > Setup-
> > * For 10 hosts on azure
> > * all hosts are identical and newly created
> > * ansible.cfg-
> > [defaults]
> > host_key_checking = False
> >
> > * portion of playbook that is installing packages
> >
> > - name: Set Initscripts to be Installed
> > set_fact:
> > packages_to_install: "{{ packages_to_install | default([]) + [ 
> 'initscripts' ] }}"
>
> IIRC this should not work - it will get into an endless loop.
>
> This may or may not be your problem.
> It occurs elsewhere below as well.
>

-- 
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/2e0b338b-7b94-46b2-80fa-20267b167d65n%40googlegroups.com.


Re: [ansible-project] Ansible hangs on package installation for hours before connection to host is lost

2020-09-10 Thread Dick Visser
On Thu, 10 Sep 2020 at 17:29, Pankaj Basnal  wrote:
>
> Hi,
> I'm new to ansible and I'm facing an issue with executing our playbook.
>
> Setup-
> * For 10 hosts on azure
> * all hosts are identical and newly created
> * ansible.cfg-
> [defaults]
>   host_key_checking = False
>
> * portion of playbook that is installing packages
>
> - name: Set Initscripts to be Installed
>   set_fact:
> packages_to_install: "{{ packages_to_install | default([]) + [ 
> 'initscripts' ] }}"

IIRC this should not work - it will get into an endless loop.

This may or may not be your problem.
It occurs elsewhere below as well.

-- 
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/CAL8fbwOBjULa9Sxqz%3DQy%2BRwMVD2pZ3Vn701Su1AWGUNmDY5onA%40mail.gmail.com.


Re: [ansible-project] Ansible hangs on package installation for hours before connection to host is lost

2020-09-10 Thread Stefan Hornburg (Racke)
On 9/10/20 5:29 PM, Pankaj Basnal wrote:
> Hi,
> I'm new to ansible and I'm facing an issue with executing our playbook. 
> 
> Setup-
> * For 10 hosts on azure
> * all hosts are identical and newly created
> * ansible.cfg- 
>     [defaults]
>           host_key_checking = False
> 
> * portion of playbook that is installing packages
> 
> - name: Set Initscripts to be Installed
>   set_fact:
> packages_to_install: "{{ packages_to_install | default([]) + [ 
> 'initscripts' ] }}"
>   tags:
> - common
>   when: ansible_distribution_major_version is version_compare('7', '<')
> 
> - name: Set Java to be Installed
>   set_fact:
> packages_to_install: "{{ packages_to_install | default([]) + [ 
> jboss_java_pkg_name ] }}"
>   when: install_java|bool
>   tags:
> - common
> 
> - name: Set Unzip to be Installed
>   set_fact:
> packages_to_install: "{{ packages_to_install | default([]) + [ 'unzip' ] 
> }}"
>   tags:
> - common
> 
> - name: Install packages
>   package:
> name: "{{ packages_to_install }}"
> state: present
>   register: packages_result
>   retries: 5
>   until: packages_result is success

There is really no point to retrying package installation. Better look at the 
output when it fails first.

Also your until: condition compares a dict with a variable named success. So it 
will never return a true
value.

Regards
 Racke

> 
> At the step of package installation, ansible will freeze without any log 
> output for 2 hours and then finally it will
> throw ssh connection error that host is unreachable.
> 
> Logs of the run
> * 9/8/2020 8:18:08 PM : "download_only": false,
> * 9/8/2020 8:18:20 PM : 17403 1599576500.81986: _low_level_execute_command(): 
> executing: /bin/sh -c 'rm -f -r 
> /home/wbuser/.ansible/tmp/ansible-tmp-1599576402.5-17403-228811267706642/ > 
> /dev/null 2>&1 && sleep 0'
> * 9/8/2020 8:18:20 PM : >>><<<
> * 9/8/2020 8:18:20 PM : 17403 1599576500.86101: attempt loop complete, 
> returning result
> * 9/8/2020 8:18:20 PM : 17403 1599576500.86111: dumping result to json
> * 9/8/2020 8:18:20 PM : "invocation": {
> * 9/8/2020 8:18:20 PM : "update_cache": false,
> * 9/8/2020 8:18:20 PM : "unzip-6.0-21.el7.x86_64 providing unzip is already 
> installed",
> * 9/8/2020 10:28:42 PM : 17410 1599584322.50669: stderr chunk (state=3):
> * 9/8/2020 10:28:42 PM : >>>Shared connection to 52.225.188.39 closed.
> * 9/8/2020 10:28:42 PM : <<<
> * 9/8/2020 10:28:42 PM : 17410 1599584322.50769: stderr chunk (state=3):
> * 9/8/2020 10:28:42 PM : >>><<<
> * 9/8/2020 10:28:42 PM : 17410 1599584322.50780: stdout chunk (state=3):
> * 9/8/2020 10:28:42 PM : >>><<<
> * 9/8/2020 10:28:42 PM : <52.225.188.39> (255, '', 'Shared connection to 
> 52.225.188.39 closed.\r\n')
> * 9/8/2020 10:28:42 PM : 17410 1599584322.50832: 
> _low_level_execute_command(): starting
> * 9/8/2020 10:28:42 PM : 17410 1599584322.50843: 
> _low_level_execute_command(): executing: /bin/sh -c 'rm -f -r 
> /home/wbuser/.ansible/tmp/ansible-tmp-1599576402.86-17410-193336400580842/ > 
> /dev/null 2>&1 && sleep 0'
> * 9/8/2020 10:28:42 PM : <52.225.188.39> ESTABLISH SSH CONNECTION FOR USER: 
> wbuser
> * 9/8/2020 10:28:42 PM : <52.225.188.39> SSH: EXEC ssh -C -o 
> ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 
> Port=33000 -o 'IdentityFile="/tmp/AnsibleFiles/id_rsa"' -o 
> KbdInteractiveAuthentication=no -o 
> PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o 
> PasswordAuthentication=no -o 'User="wbuser"' -o ConnectTimeout=10 -o 
> StrictHostKeyChecking=no -o ControlPath=/root/.ansible/cp/cccd982d88 
> 52.225.188.39 '/bin/sh -c '"'"'rm -f -r 
> /home/wbuser/.ansible/tmp/ansible-tmp-1599576402.86-17410-193336400580842/ > 
> /dev/null 2>&1 && sleep 0'"'"''
> * 9/8/2020 10:28:43 PM : 17410 1599584323.14653: stderr chunk (state=2):
> * 9/8/2020 10:28:43 PM : >>><<<
> * 9/8/2020 10:28:43 PM : 17410 1599584323.14667: stdout chunk (state=2):
> * 9/8/2020 10:28:43 PM : >>><<<
> * 9/8/2020 10:28:43 PM : <52.225.188.39> (0, '', '')
> * 9/8/2020 10:28:43 PM : 17410 1599584323.14703: _low_level_execute_command() 
> done: rc=0, stdout=, stderr=
> * 9/8/2020 10:28:43 PM : 17410 1599584323.14742: _execute() done
> * 9/8/2020 10:28:43 PM : 17410 1599584323.14745: dumping result to json
> * 9/8/2020 10:28:43 PM : 17410 1599584323.14750: done dumping result, 
> returning
> * 9/8/2020 10:28:43 PM : 17410 1599584323.14777: done running TaskExecutor() 
> for JbossEAP-26/TASK: jboss_common_role : Install packages 
> [000d3ae7-f205-69c8-6cc1-00c9]
> * 9/8/2020 10:28:43 PM : 17410 1599584323.14799: sending task result for task 
> 000d3ae7-f205-69c8-6cc1-00c9
> * 9/8/2020 10:28:43 PM : 17410 1599584323.15331: done sending task result for 
> task 000d3ae7-f205-69c8-6cc1-00c9
> * 9/8/2020 10:28:43 PM : 17410 1599584323.15339: WORKER PROCESS EXITING
> * 9/8/2020 10:28:43 PM : fatal: [JbossEAP-26]: UNREACHABLE! => {
> * 9/8/2020 10:28:43 PM : "changed": false,

[ansible-project] Re: Nominating blockers to 2.10.0 [Was Re: Ansible 2.10.0 beta 1]

2020-09-10 Thread Toshio Kuratomi
And yes... apparently I suck at email :-(.  Posting this to the
correct subthread in case anyone is following this conversation on the
google groups forum interface instead of via a threaded email client:

One more piece of information:  The meeting on the 17th of September
will take place in the #ansible-community channel on irc.freenode.net.
Note that if you haven't used freenode before, you can use online
webchat to access freenode: https://webchat.freenode.net/

Because of issues with spam and harassment, you'll need to register to
participate in our channels:
https://freenode.net/kb/answer/registration  I highly recommend
registering and testing that you are able to participate in
#ansible-community discussions before the meeting on the 17th!

-Toshio

On Thu, Sep 10, 2020 at 8:29 AM Toshio Kuratomi  wrote:
>
> Howdy folks!
>
> We're entering the final weeks of the Ansible 2.10.0 release cycle and
> I wanted to let anyone testing the Ansible betas and release candidate
> on how to nominate a bug as a release blocker.
>
> * If you find something major enough to block the Ansible release,
> please add a comment on the Community Meeting Agenda:
> https://github.com/ansible/community/issues/539 asking us to consider
> whether the issue is a blocker.  If the issue has a ticket open
> elsewhere, linking to the ticket will be appreciated.
>
> * If at all possible, attend the IRC meeting on Thursday, September
> 17th, 2020, 18:00 UTC to state your case as to why the issue should
> block the release.
>
> * We'll decide at the meeting whether to slip the Ansible-2.10.0 final
> release for any of the listed blockers.
>
> *Important*: If the Meeting Agenda does not contain any comments
> listing potential blockers when the meeting starts on Thursday, we'll
> end the meeting early.  We will wait for five minutes or so to see if
> anyone proposes a blocker at   the start of the meeting itself but
> otherwise we'll cut the meeting short.  So please, if you have a
> candidate blocker; get your issue listed on the Community Agenda ASAP.
>
> What should you do if you notice a blocker after the meeting time?
> You can still report it on the Community Meeting Agenda.  However,
> it's likely that only myself and a few other people will be able to
> look at and evaluate it before   the release date and we'll likely
> lean towards fixing anything that wasn't noticed previously in the
> Ansible-2.10.1 release.  So please test out the beta and release
> candidate now and report candidate blockers before the meeting.
>
> Thank you,
> Toshio Kuratomi
>
> On Tue, Sep 1, 2020 at 11:21 PM Toshio Kuratomi  wrote:
> >
> > Hi all-
> >
> > For all those wanting to test the next version of Ansible, we're happy
> > to announce that Ansible 2.10.0 beta1 is now available on PyPI!
> >
> > Ansible 2.10.0b1 pulls in the ansible-base-2.10.1 (presently rc2)
> > package via a dependency and includes a range of Ansible Collections.
> > The Ansible 2.10 PyPI packages provide similar functionality to
> > Ansible 2.9 and earlier versions, but from multiple sources. The
> > included Ansible Collections are maintained by a host of open source
> > contributors who want to add to what ansible-base has to offer.
> >
> > For an overview of "Ansible Collections" and the differences between
> > `ansible-base` and `ansible`  please see
> > https://github.com/ansible-collections/overview/blob/master/README.rst
> >
> > We need your help
> > -
> >
> > This new `ansible` package *should* be a drop-in replacement for
> > Ansible 2.9. The roles and playbooks that you currently use should
> > work out of the box with ansible-2.10.0 beta1.
> >
> > Please let us know if:
> >
> > * Your playbooks don't work
> > * There are any installation issues
> > * Whether the collections are found OK
> > * If the updated and new modules in the collections work
> >
> > How to get it
> > -
> >
> > Due to a limitation in pip, you need to uninstall Ansible 2.9 (or
> > earlier) before installing the 2.10 version:
> >
> > $ pip uninstall ansible
> > $ pip install ansible==2.10.0b1 --user
> >
> > The tar.gz of the release can be found here:
> >
> > * Ansible 2.10.0b1
> >   https://pypi.python.org/packages/source/a/ansible/ansible-2.10.0b1.tar.gz
> >   SHA256: 081c1b1ea95a0b67f8bf1e5c3c45b8e8dd8bafd1f8d05838f96239da3496ce8f
> >
> >
> > What's new in Ansible 2.10.0b1
> > --
> >
> > * Collections which have opted into being a part of the Ansible-2.10.0
> > unified changelog will have an entry on this page:
> > https://github.com/ansible-community/ansible-build-data/blob/main/2.10/CHANGELOG-v2.10.rst
> >
> > * For other collections, consult the list of included collections in
> > the link below and check their entry on https://galaxy.ansible.com for
> > information about their changes.
> >
> > * List of collections included in the 2.10.0b1 release:
> >   * 
> > 

[ansible-project] Re: Ansible 2.10.0 beta 1

2020-09-10 Thread Toshio Kuratomi
One more piece of information:  The meeting on the 17th of September
will take place in the #ansible-community channel on irc.freenode.net.
Note that if you haven't used freenode before, you can use online
webchat to access freenode: https://webchat.freenode.net/

Because of issues with spam and harassment, you'll need to register to
participate in our channels:
https://freenode.net/kb/answer/registration  I highly recommend
registering and testing that you are able to participate in
#ansible-community discussions before the meeting on the 17th!

-Toshio

On Tue, Sep 1, 2020 at 11:21 PM Toshio Kuratomi  wrote:
>
> Hi all-
>
> For all those wanting to test the next version of Ansible, we're happy
> to announce that Ansible 2.10.0 beta1 is now available on PyPI!
>
> Ansible 2.10.0b1 pulls in the ansible-base-2.10.1 (presently rc2)
> package via a dependency and includes a range of Ansible Collections.
> The Ansible 2.10 PyPI packages provide similar functionality to
> Ansible 2.9 and earlier versions, but from multiple sources. The
> included Ansible Collections are maintained by a host of open source
> contributors who want to add to what ansible-base has to offer.
>
> For an overview of "Ansible Collections" and the differences between
> `ansible-base` and `ansible`  please see
> https://github.com/ansible-collections/overview/blob/master/README.rst
>
> We need your help
> -
>
> This new `ansible` package *should* be a drop-in replacement for
> Ansible 2.9. The roles and playbooks that you currently use should
> work out of the box with ansible-2.10.0 beta1.
>
> Please let us know if:
>
> * Your playbooks don't work
> * There are any installation issues
> * Whether the collections are found OK
> * If the updated and new modules in the collections work
>
> How to get it
> -
>
> Due to a limitation in pip, you need to uninstall Ansible 2.9 (or
> earlier) before installing the 2.10 version:
>
> $ pip uninstall ansible
> $ pip install ansible==2.10.0b1 --user
>
> The tar.gz of the release can be found here:
>
> * Ansible 2.10.0b1
>   https://pypi.python.org/packages/source/a/ansible/ansible-2.10.0b1.tar.gz
>   SHA256: 081c1b1ea95a0b67f8bf1e5c3c45b8e8dd8bafd1f8d05838f96239da3496ce8f
>
>
> What's new in Ansible 2.10.0b1
> --
>
> * Collections which have opted into being a part of the Ansible-2.10.0
> unified changelog will have an entry on this page:
> https://github.com/ansible-community/ansible-build-data/blob/main/2.10/CHANGELOG-v2.10.rst
>
> * For other collections, consult the list of included collections in
> the link below and check their entry on https://galaxy.ansible.com for
> information about their changes.
>
> * List of collections included in the 2.10.0b1 release:
>   * 
> https://github.com/ansible-community/ansible-build-data/blob/2.10.0b1/2.10/ansible-2.10.0b1.deps
>   * You can find more information for those on
> https://galaxy.ansible.com/.  For instance, the community.crypto
> collection listed in the ansible-2.10.0b1.deps file has a galaxy page
> here at https://galaxy.ansible.com/community/crypto/
>
> * Changelog for ansible-base-2.10.1 which this release of ansible installs:
>   
> https://github.com/ansible/ansible/blob/stable-2.10/changelogs/CHANGELOG-v2.10.rst
>
>
> Caveats and known bugs
> --
>
> * The individual collections that make up the ansible-2.10.0 package
> can be viewed independently.  However, they aren't currently listed by
> ansible-galaxy.  A workaround for this is to explicitly specify where
> ansible has installed the collections::
>
> COLLECTION_INSTALL=$(python -c 'import ansible, os.path ;
> print("%s/../ansible_collections" %
> os.path.dirname(ansible.__file__))') ansible-galaxy collection list -p
> "$COLLECTION_INSTALL"
>
>   * A fix has been proposed but was not be merged for 2.10.0. This is
> being tracked in this bug report:
> https://github.com/ansible/ansible/issues/70147
>
> * Due to a limitation in pip, you cannot `pip install --upgrade` from
> ansible-2.9 or earlier to ansible-2.10 or higher.  Instead, you must
> explicitly `pip uninstall ansible` before pip installing the new
> version.  The install of the ansible package has been modified to warn
> you if you attempt to upgrade via pip with instructions to uninstall
> first.
>
>
> What's the schedule for the rest of the 2.10.0 release cycle?
> -
>
> ansible-2.10.0rc1 is due to be released on 2020-09-10
> ansible-2.10.0 final is due out on 2020-09-22
>
> The ansible-2.10 roadmap reflects these dates:
> https://docs.ansible.com/ansible/devel/roadmap/COLLECTIONS_2_10.html
>
> Porting Help
> 
>
> There's a unified porting guide for collections which have opted-in.
> You can find that at:
> https://github.com/ansible/ansible/blob/devel/docs/docsite/rst/porting_guides/porting_guide_2.10.rst
>
> If you encounter any bugs, please report them.  We're putting 

[ansible-project] Ansible hangs on package installation for hours before connection to host is lost

2020-09-10 Thread Pankaj Basnal
Hi,
I'm new to ansible and I'm facing an issue with executing our playbook. 

Setup-
* For 10 hosts on azure
* all hosts are identical and newly created
* ansible.cfg- 
[defaults]
  host_key_checking = False

* portion of playbook that is installing packages

- name: Set Initscripts to be Installed
  set_fact:
packages_to_install: "{{ packages_to_install | default([]) + [ 
'initscripts' ] }}"
  tags:
- common
  when: ansible_distribution_major_version is version_compare('7', '<')

- name: Set Java to be Installed
  set_fact:
packages_to_install: "{{ packages_to_install | default([]) + [ 
jboss_java_pkg_name ] }}"
  when: install_java|bool
  tags:
- common

- name: Set Unzip to be Installed
  set_fact:
packages_to_install: "{{ packages_to_install | default([]) + [ 'unzip' ] }}"
  tags:
- common

- name: Install packages
  package:
name: "{{ packages_to_install }}"
state: present
  register: packages_result
  retries: 5
  until: packages_result is success

At the step of package installation, ansible will freeze without any log 
output for 2 hours and then finally it will throw ssh connection error that 
host is unreachable.

Logs of the run
* 9/8/2020 8:18:08 PM : "download_only": false,
* 9/8/2020 8:18:20 PM : 17403 1599576500.81986: _low_level_execute_command(): 
executing: /bin/sh -c 'rm -f -r 
/home/wbuser/.ansible/tmp/ansible-tmp-1599576402.5-17403-228811267706642/ > 
/dev/null 2>&1 && sleep 0'
* 9/8/2020 8:18:20 PM : >>><<<
* 9/8/2020 8:18:20 PM : 17403 1599576500.86101: attempt loop complete, 
returning result
* 9/8/2020 8:18:20 PM : 17403 1599576500.86111: dumping result to json
* 9/8/2020 8:18:20 PM : "invocation": {
* 9/8/2020 8:18:20 PM : "update_cache": false,
* 9/8/2020 8:18:20 PM : "unzip-6.0-21.el7.x86_64 providing unzip is already 
installed",
* 9/8/2020 10:28:42 PM : 17410 1599584322.50669: stderr chunk (state=3):
* 9/8/2020 10:28:42 PM : >>>Shared connection to 52.225.188.39 closed.
* 9/8/2020 10:28:42 PM : <<<
* 9/8/2020 10:28:42 PM : 17410 1599584322.50769: stderr chunk (state=3):
* 9/8/2020 10:28:42 PM : >>><<<
* 9/8/2020 10:28:42 PM : 17410 1599584322.50780: stdout chunk (state=3):
* 9/8/2020 10:28:42 PM : >>><<<
* 9/8/2020 10:28:42 PM : <52.225.188.39> (255, '', 'Shared connection to 
52.225.188.39 closed.\r\n')
* 9/8/2020 10:28:42 PM : 17410 1599584322.50832: _low_level_execute_command(): 
starting
* 9/8/2020 10:28:42 PM : 17410 1599584322.50843: _low_level_execute_command(): 
executing: /bin/sh -c 'rm -f -r 
/home/wbuser/.ansible/tmp/ansible-tmp-1599576402.86-17410-193336400580842/ > 
/dev/null 2>&1 && sleep 0'
* 9/8/2020 10:28:42 PM : <52.225.188.39> ESTABLISH SSH CONNECTION FOR USER: 
wbuser
* 9/8/2020 10:28:42 PM : <52.225.188.39> SSH: EXEC ssh -C -o ControlMaster=auto 
-o ControlPersist=60s -o StrictHostKeyChecking=no -o Port=33000 -o 
'IdentityFile="/tmp/AnsibleFiles/id_rsa"' -o KbdInteractiveAuthentication=no -o 
PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o 
PasswordAuthentication=no -o 'User="wbuser"' -o ConnectTimeout=10 -o 
StrictHostKeyChecking=no -o ControlPath=/root/.ansible/cp/cccd982d88 
52.225.188.39 '/bin/sh -c '"'"'rm -f -r 
/home/wbuser/.ansible/tmp/ansible-tmp-1599576402.86-17410-193336400580842/ > 
/dev/null 2>&1 && sleep 0'"'"''
* 9/8/2020 10:28:43 PM : 17410 1599584323.14653: stderr chunk (state=2):
* 9/8/2020 10:28:43 PM : >>><<<
* 9/8/2020 10:28:43 PM : 17410 1599584323.14667: stdout chunk (state=2):
* 9/8/2020 10:28:43 PM : >>><<<
* 9/8/2020 10:28:43 PM : <52.225.188.39> (0, '', '')
* 9/8/2020 10:28:43 PM : 17410 1599584323.14703: _low_level_execute_command() 
done: rc=0, stdout=, stderr=
* 9/8/2020 10:28:43 PM : 17410 1599584323.14742: _execute() done
* 9/8/2020 10:28:43 PM : 17410 1599584323.14745: dumping result to json
* 9/8/2020 10:28:43 PM : 17410 1599584323.14750: done dumping result, returning
* 9/8/2020 10:28:43 PM : 17410 1599584323.14777: done running TaskExecutor() 
for JbossEAP-26/TASK: jboss_common_role : Install packages 
[000d3ae7-f205-69c8-6cc1-00c9]
* 9/8/2020 10:28:43 PM : 17410 1599584323.14799: sending task result for task 
000d3ae7-f205-69c8-6cc1-00c9
* 9/8/2020 10:28:43 PM : 17410 1599584323.15331: done sending task result for 
task 000d3ae7-f205-69c8-6cc1-00c9
* 9/8/2020 10:28:43 PM : 17410 1599584323.15339: WORKER PROCESS EXITING
* 9/8/2020 10:28:43 PM : fatal: [JbossEAP-26]: UNREACHABLE! => {
* 9/8/2020 10:28:43 PM : "changed": false,
* 9/8/2020 10:28:43 PM : "msg": "Failed to connect to the host via ssh: Shared 
connection to 52.225.188.39 closed.",
* 9/8/2020 10:28:43 PM : "unreachable": true
* 9/8/2020 10:28:43 PM : }

Can anyone help in understanding why this would be happening and what 
measures I can take to prevent this? 

-- 
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] Nominating blockers to 2.10.0 [Was Re: Ansible 2.10.0 beta 1]

2020-09-10 Thread Toshio Kuratomi
Howdy folks!

We're entering the final weeks of the Ansible 2.10.0 release cycle and
I wanted to let anyone testing the Ansible betas and release candidate
on how to nominate a bug as a release blocker.

* If you find something major enough to block the Ansible release,
please add a comment on the Community Meeting Agenda:
https://github.com/ansible/community/issues/539 asking us to consider
whether the issue is a blocker.  If the issue has a ticket open
elsewhere, linking to the ticket will be appreciated.

* If at all possible, attend the IRC meeting on Thursday, September
17th, 2020, 18:00 UTC to state your case as to why the issue should
block the release.

* We'll decide at the meeting whether to slip the Ansible-2.10.0 final
release for any of the listed blockers.

*Important*: If the Meeting Agenda does not contain any comments
listing potential blockers when the meeting starts on Thursday, we'll
end the meeting early.  We will wait for five minutes or so to see if
anyone proposes a blocker at   the start of the meeting itself but
otherwise we'll cut the meeting short.  So please, if you have a
candidate blocker; get your issue listed on the Community Agenda ASAP.

What should you do if you notice a blocker after the meeting time?
You can still report it on the Community Meeting Agenda.  However,
it's likely that only myself and a few other people will be able to
look at and evaluate it before   the release date and we'll likely
lean towards fixing anything that wasn't noticed previously in the
Ansible-2.10.1 release.  So please test out the beta and release
candidate now and report candidate blockers before the meeting.

Thank you,
Toshio Kuratomi

On Tue, Sep 1, 2020 at 11:21 PM Toshio Kuratomi  wrote:
>
> Hi all-
>
> For all those wanting to test the next version of Ansible, we're happy
> to announce that Ansible 2.10.0 beta1 is now available on PyPI!
>
> Ansible 2.10.0b1 pulls in the ansible-base-2.10.1 (presently rc2)
> package via a dependency and includes a range of Ansible Collections.
> The Ansible 2.10 PyPI packages provide similar functionality to
> Ansible 2.9 and earlier versions, but from multiple sources. The
> included Ansible Collections are maintained by a host of open source
> contributors who want to add to what ansible-base has to offer.
>
> For an overview of "Ansible Collections" and the differences between
> `ansible-base` and `ansible`  please see
> https://github.com/ansible-collections/overview/blob/master/README.rst
>
> We need your help
> -
>
> This new `ansible` package *should* be a drop-in replacement for
> Ansible 2.9. The roles and playbooks that you currently use should
> work out of the box with ansible-2.10.0 beta1.
>
> Please let us know if:
>
> * Your playbooks don't work
> * There are any installation issues
> * Whether the collections are found OK
> * If the updated and new modules in the collections work
>
> How to get it
> -
>
> Due to a limitation in pip, you need to uninstall Ansible 2.9 (or
> earlier) before installing the 2.10 version:
>
> $ pip uninstall ansible
> $ pip install ansible==2.10.0b1 --user
>
> The tar.gz of the release can be found here:
>
> * Ansible 2.10.0b1
>   https://pypi.python.org/packages/source/a/ansible/ansible-2.10.0b1.tar.gz
>   SHA256: 081c1b1ea95a0b67f8bf1e5c3c45b8e8dd8bafd1f8d05838f96239da3496ce8f
>
>
> What's new in Ansible 2.10.0b1
> --
>
> * Collections which have opted into being a part of the Ansible-2.10.0
> unified changelog will have an entry on this page:
> https://github.com/ansible-community/ansible-build-data/blob/main/2.10/CHANGELOG-v2.10.rst
>
> * For other collections, consult the list of included collections in
> the link below and check their entry on https://galaxy.ansible.com for
> information about their changes.
>
> * List of collections included in the 2.10.0b1 release:
>   * 
> https://github.com/ansible-community/ansible-build-data/blob/2.10.0b1/2.10/ansible-2.10.0b1.deps
>   * You can find more information for those on
> https://galaxy.ansible.com/.  For instance, the community.crypto
> collection listed in the ansible-2.10.0b1.deps file has a galaxy page
> here at https://galaxy.ansible.com/community/crypto/
>
> * Changelog for ansible-base-2.10.1 which this release of ansible installs:
>   
> https://github.com/ansible/ansible/blob/stable-2.10/changelogs/CHANGELOG-v2.10.rst
>
>
> Caveats and known bugs
> --
>
> * The individual collections that make up the ansible-2.10.0 package
> can be viewed independently.  However, they aren't currently listed by
> ansible-galaxy.  A workaround for this is to explicitly specify where
> ansible has installed the collections::
>
> COLLECTION_INSTALL=$(python -c 'import ansible, os.path ;
> print("%s/../ansible_collections" %
> os.path.dirname(ansible.__file__))') ansible-galaxy collection list -p
> "$COLLECTION_INSTALL"
>
>   * A fix has been proposed but was not be merged for 

[ansible-project] Branching/conditional statements to install different editions and versions of MS SQL Server

2020-09-10 Thread Rahul puli
 

Hello,

I have created a role to install MSSQL for different versions 
(2014,2016,2017,2019) and its working fine for all the versions. 

For installing MS SQL 2014 developer version I need to comment the others 
developer versions in main.yml file and need to change the product ID 
(mssql/tasks/run_mssql_setup.yml).

Is there any other solution where I can use branching/conditional 
statements to install different editions and versions of MS SQL Server 
without commenting the other version in main.yml file.

 

Below is the main.yml file which looks.

# tasks file for mssql

---

- include: createtemporaryfolder.yml

- include: install_dotnet3.5.yml 

- include: install_dotnet4.5.yml

 

# MSSQL DEVELOPER -

 

- include: download_mssql_2014_developer.yml

#- include: download_mssql_2016_developer.yml

#- include: download_mssql_2017_developer.yml 

#- include: download_mssql_2019_developer.yml

.

.

.




 You can get see the role from the below link

https://github.com/rahulpuli/Install-MSSQL-Devloper-edition-using-Ansible


Thanks,

Rahul

-- 
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/3ca0f81f-3c3a-48a9-9ddf-61f96f0faf0an%40googlegroups.com.


Re: [ansible-project] Ansible Google Pubsub

2020-09-10 Thread Yantram Cloud
Yes, i think it seems to be very old, 

ansible 2.9.12

Name: google-cloud-pubsub
Version: 1.7.0

Name: google-auth
Version: 1.21.1



On Thursday, September 10, 2020 at 6:56:08 PM UTC+5:30 dick@geant.org 
wrote:

> I meant:
>
> 1. what version of ansible are you using (ansible --version)
> 2. what versions of google-auth and google-cloud-pubsub are you using (pip 
> list)
>
>
> The docs link you send is about ansible 2.3 which is ancient by now -
> not sure if you intended this though.
>
>
> On Thu, 10 Sep 2020 at 10:59, Yantram Cloud  wrote:
> >
> >
> >
> > We are writing a playbook with ansible gcp_pubsub follwoing this.
> >
> > 
> https://docs.ansible.com/ansible/2.3/gcpubsub_module.html#requirements-on-host-that-executes-module
> > It errors out even in creating topic.
> >
> > "gcp_pubsub.yml"
> >
> > - name: create a topic [ gcpubsub ]
> > gcpubsub:
> > topic: "{{ topic_name }}"
> > state: present
> > project_id: "{{ gcp_project }}"
> > credentials_file: "{{ gcp_cred_file }}"
> >
> > - name: create subscription[ gcpubsub ]
> > gcpubsub:
> > topic: "{{ topic_name }}"
> > subscription:
> > name: "{{ subscription_name }}"
> > state: present
> > project_id: "{{ gcp_project }}"
> > credentials_file: "{{ gcp_cred_file }}"
> >
> >
> > Just for info ,
> > However when i use gcp_pubsub_topic to create topic and 
> gcp_pubsub_subscription to create subscription , it works. but this is 
> limited only to these.
> >
> >
> > Thanks,
> >
> >
> > On Thursday, September 10, 2020 at 11:47:04 AM UTC+5:30 
> dick@geant.org wrote:
> >>
> >> ansible --version
> >>
> >> What does the entire playbook look like?
> >>
> >>
> >> On Thu, 10 Sep 2020 at 05:55, Yantram Cloud  
> wrote:
> >>>
> >>> I am trying to create a subscription for google pubsub through ansible 
> playbook.
> >>> this is my task.
> >>> - name: create a subscription
> >>>
> >>> gcpubsub:
> >>> topic: test-topic1
> >>> state: present
> >>> credentials_file: "{{ gcp_cred_file }}"
> >>> project_id: "{{ gcp_project }}"
> >>>
> >>>
> >>> Now it does not seem to work,i have installed google-cloud-pubsub
> >>>
> >>> getting this error regarding client.
> >>>
> >>> Any help how can i debug this?
> >>>
> >>> Here is the error.
> >>>
> >>> The full traceback is:
> >>> Traceback (most recent call last):
> >>> File 
> "/home/rashmi/.ansible/tmp/ansible-tmp-1599709674.061256-7651-29288875173708/AnsiballZ_gcpubsub.py",
>  
> line 102, in 
> >>> _ansiballz_main()
> >>> File 
> "/home/rashmi/.ansible/tmp/ansible-tmp-1599709674.061256-7651-29288875173708/AnsiballZ_gcpubsub.py",
>  
> line 94, in _ansiballz_main
> >>> invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
> >>> File 
> "/home/rashmi/.ansible/tmp/ansible-tmp-1599709674.061256-7651-29288875173708/AnsiballZ_gcpubsub.py",
>  
> line 40, in invoke_module
> >>> runpy.run_module(mod_name='ansible.modules.cloud.google.gcpubsub', 
> init_globals=None, run_name='__main__', alter_sys=True)
> >>> File "/home/rashmi/anaconda3/lib/python3.7/runpy.py", line 205, in 
> run_module
> >>> return _run_module_code(code, init_globals, run_name, mod_spec)
> >>> File "/home/rashmi/anaconda3/lib/python3.7/runpy.py", line 96, in 
> _run_module_code
> >>> mod_name, mod_spec, pkg_name, script_name)
> >>> File "/home/rashmi/anaconda3/lib/python3.7/runpy.py", line 85, in 
> _run_code
> >>> exec(code, run_globals)
> >>> File 
> "/tmp/ansible_gcpubsub_payload_soisvl0x/ansible_gcpubsub_payload.zip/ansible/modules/cloud/google/gcpubsub.py",
>  
> line 333, in 
> >>> File 
> "/tmp/ansible_gcpubsub_payload_soisvl0x/ansible_gcpubsub_payload.zip/ansible/modules/cloud/google/gcpubsub.py",
>  
> line 265, in main
> >>> AttributeError: module 'google.cloud.pubsub' has no attribute 'Client'
> >>> fatal: [localhost]: FAILED! => {
> >>> "changed": false,
> >>> "module_stderr": "Traceback (most recent call last):\n File 
> \"/home/rashmi/.ansible/tmp/ansible-tmp-1599709674.061256-7651-29288875173708/AnsiballZ_gcpubsub.py\",
>  
> line 102, in \n _ansiballz_main()\n File 
> \"/home/rashmi/.ansible/tmp/ansible-tmp-1599709674.061256-7651-29288875173708/AnsiballZ_gcpubsub.py\",
>  
> line 94, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, 
> ANSIBALLZ_PARAMS)\n File 
> \"/home/rashmi/.ansible/tmp/ansible-tmp-1599709674.061256-7651-29288875173708/AnsiballZ_gcpubsub.py\",
>  
> line 40, in invoke_module\n 
> runpy.run_module(mod_name='ansible.modules.cloud.google.gcpubsub', 
> init_globals=None, run_name='__main__', alter_sys=True)\n File 
> \"/home/rashmi/anaconda3/lib/python3.7/runpy.py\", line 205, in 
> run_module\n return _run_module_code(code, init_globals, run_name, 
> mod_spec)\n File \"/home/rashmi/anaconda3/lib/python3.7/runpy.py\", line 
> 96, in _run_module_code\n mod_name, mod_spec, pkg_name, script_name)\n File 
> \"/home/rashmi/anaconda3/lib/python3.7/runpy.py\", line 85, in _run_code\n 
> exec(code, run_globals)\n File 
> 

Re: [ansible-project] CIS Bencjmarks - Rhel 7

2020-09-10 Thread Josephsimon Arokiaraj
Hi James,

I have seen this role. This is based on the CIS baseline 2.2.0. I will try
to use this ..


Cheers,
Joseph

On Thu, Sep 10, 2020 at 2:34 PM James Cassell 
wrote:

> The galaxy releases are lagging behind, but this probably is what you
> want: https://github.com/ansible-lockdown/RHEL7-CIS
>
> V/r,
> James Cassell
>
>
> On Thu, Sep 10, 2020, at 4:26 AM, Josephsimon Arokiaraj wrote:
> > Hi All,
> >
> > How you doing?
> >
> > Do we have any playbooks/roles for doing audit and remediation  on CIS
> > benchmarks for Rhel 7?
> >
> > Cheers,
> > Joseph
> >
>
> --
> 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/72c806a4-56dd-408b-8cc2-58669eca7d28%40www.fastmail.com
> .
>

-- 
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/CAPbGgO1kkLbtuW%3DXhKS6B%3D3_5esMcydo%2Bx7-L40Yf7YcWMNu%2BA%40mail.gmail.com.


Re: [ansible-project] CIS Bencjmarks - Rhel 7

2020-09-10 Thread James Cassell
The galaxy releases are lagging behind, but this probably is what you want: 
https://github.com/ansible-lockdown/RHEL7-CIS

V/r,
James Cassell


On Thu, Sep 10, 2020, at 4:26 AM, Josephsimon Arokiaraj wrote:
> Hi All,
> 
> How you doing?
> 
> Do we have any playbooks/roles for doing audit and remediation  on CIS 
> benchmarks for Rhel 7?
> 
> Cheers,
> Joseph 
> 

-- 
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/72c806a4-56dd-408b-8cc2-58669eca7d28%40www.fastmail.com.


Re: [ansible-project] CIS Bencjmarks - Rhel 7

2020-09-10 Thread Josephsimon Arokiaraj
Thanks a lot Kiran/Abhijeet and Philippe for your updates. I will look into
it.

Cheers,
Joseph

On Thu, Sep 10, 2020 at 11:17 AM Philippe Eveque 
wrote:

> https://github.com/openstack/ansible-hardening
>
>
> Le jeu. 10 sept. 2020 à 11:31, Kiran Kumar  a écrit :
>
>> I would suggest - https://galaxy.ansible.com/MindPointGroup/RHEL7-CIS/
>>
>> On Thu, Sep 10, 2020 at 1:26 AM Josephsimon Arokiaraj 
>> wrote:
>>
>>> Hi All,
>>>
>>> How you doing?
>>>
>>> Do we have any playbooks/roles for doing audit and remediation  on CIS
>>> benchmarks for Rhel 7?
>>>
>>> Cheers,
>>> Joseph
>>>
>>> --
>>> 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/CAPbGgO2aq_WL55j_WkNkNH--O3wtw8Dqys5Fr639VwdgN1w5JQ%40mail.gmail.com
>>> 
>>> .
>>>
>> --
>> 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/CAGhW9JuxCPGmhOAnh6BBZ%2B_%2Bo56VRA%3DL586WuPaRpe_4-Wc_TQ%40mail.gmail.com
>> 
>> .
>>
> --
> 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/CAB1FMuQ1jfTxbrvP3DNyrgFWmVTRwf%2BTVAm3%3DgXympp4cyN6eQ%40mail.gmail.com
> 
> .
>

-- 
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/CAPbGgO0N2T9Q1QQqCe3H6_WnmDscq2gtDwC3vtdLq0kcUL5ykQ%40mail.gmail.com.


Re: [ansible-project] Ansible Google Pubsub

2020-09-10 Thread Dick Visser
I meant:

1. what version of ansible are you using (ansible --version)
2. what versions of google-auth and google-cloud-pubsub are you using (pip list)


The docs link you send is about ansible 2.3 which is ancient by now -
not sure if you intended this though.


On Thu, 10 Sep 2020 at 10:59, Yantram Cloud  wrote:
>
>
>
> We are writing a playbook with ansible gcp_pubsub follwoing this.
>
> https://docs.ansible.com/ansible/2.3/gcpubsub_module.html#requirements-on-host-that-executes-module
> It errors out even in creating topic.
>
> "gcp_pubsub.yml"
>
> - name: create a topic [ gcpubsub ]
>   gcpubsub:
> topic: "{{ topic_name }}"
> state: present
> project_id: "{{ gcp_project }}"
> credentials_file: "{{ gcp_cred_file }}"
>
> - name: create subscription[ gcpubsub ]
>   gcpubsub:
> topic: "{{ topic_name }}"
> subscription:
>   name: "{{ subscription_name }}"
> state: present
> project_id: "{{ gcp_project }}"
> credentials_file: "{{ gcp_cred_file }}"
>
>
> Just for info ,
> However when i use gcp_pubsub_topic to create topic and 
> gcp_pubsub_subscription to create subscription , it works. but this is 
> limited only to these.
>
>
> Thanks,
>
>
> On Thursday, September 10, 2020 at 11:47:04 AM UTC+5:30 dick@geant.org 
> wrote:
>>
>> ansible --version
>>
>> What does the entire playbook look like?
>>
>>
>> On Thu, 10 Sep 2020 at 05:55, Yantram Cloud  wrote:
>>>
>>> I am trying to create a subscription for google pubsub through ansible 
>>> playbook.
>>>  this is my task.
>>> - name: create a subscription
>>>
>>>   gcpubsub:
>>> topic: test-topic1
>>> state: present
>>> credentials_file: "{{ gcp_cred_file }}"
>>> project_id: "{{ gcp_project }}"
>>>
>>>
>>> Now it does not seem to work,i have installed google-cloud-pubsub
>>>
>>> getting this error regarding client.
>>>
>>> Any help how can i debug this?
>>>
>>> Here is the error.
>>>
>>> The full traceback is:
>>> Traceback (most recent call last):
>>>   File 
>>> "/home/rashmi/.ansible/tmp/ansible-tmp-1599709674.061256-7651-29288875173708/AnsiballZ_gcpubsub.py",
>>>  line 102, in 
>>> _ansiballz_main()
>>>   File 
>>> "/home/rashmi/.ansible/tmp/ansible-tmp-1599709674.061256-7651-29288875173708/AnsiballZ_gcpubsub.py",
>>>  line 94, in _ansiballz_main
>>> invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
>>>   File 
>>> "/home/rashmi/.ansible/tmp/ansible-tmp-1599709674.061256-7651-29288875173708/AnsiballZ_gcpubsub.py",
>>>  line 40, in invoke_module
>>> runpy.run_module(mod_name='ansible.modules.cloud.google.gcpubsub', 
>>> init_globals=None, run_name='__main__', alter_sys=True)
>>>   File "/home/rashmi/anaconda3/lib/python3.7/runpy.py", line 205, in 
>>> run_module
>>> return _run_module_code(code, init_globals, run_name, mod_spec)
>>>   File "/home/rashmi/anaconda3/lib/python3.7/runpy.py", line 96, in 
>>> _run_module_code
>>> mod_name, mod_spec, pkg_name, script_name)
>>>   File "/home/rashmi/anaconda3/lib/python3.7/runpy.py", line 85, in 
>>> _run_code
>>> exec(code, run_globals)
>>>   File 
>>> "/tmp/ansible_gcpubsub_payload_soisvl0x/ansible_gcpubsub_payload.zip/ansible/modules/cloud/google/gcpubsub.py",
>>>  line 333, in 
>>>   File 
>>> "/tmp/ansible_gcpubsub_payload_soisvl0x/ansible_gcpubsub_payload.zip/ansible/modules/cloud/google/gcpubsub.py",
>>>  line 265, in main
>>> AttributeError: module 'google.cloud.pubsub' has no attribute 'Client'
>>> fatal: [localhost]: FAILED! => {
>>> "changed": false,
>>> "module_stderr": "Traceback (most recent call last):\n  File 
>>> \"/home/rashmi/.ansible/tmp/ansible-tmp-1599709674.061256-7651-29288875173708/AnsiballZ_gcpubsub.py\",
>>>  line 102, in \n_ansiballz_main()\n  File 
>>> \"/home/rashmi/.ansible/tmp/ansible-tmp-1599709674.061256-7651-29288875173708/AnsiballZ_gcpubsub.py\",
>>>  line 94, in _ansiballz_main\ninvoke_module(zipped_mod, temp_path, 
>>> ANSIBALLZ_PARAMS)\n  File 
>>> \"/home/rashmi/.ansible/tmp/ansible-tmp-1599709674.061256-7651-29288875173708/AnsiballZ_gcpubsub.py\",
>>>  line 40, in invoke_module\n
>>> runpy.run_module(mod_name='ansible.modules.cloud.google.gcpubsub', 
>>> init_globals=None, run_name='__main__', alter_sys=True)\n  File 
>>> \"/home/rashmi/anaconda3/lib/python3.7/runpy.py\", line 205, in 
>>> run_module\nreturn _run_module_code(code, init_globals, run_name, 
>>> mod_spec)\n  File \"/home/rashmi/anaconda3/lib/python3.7/runpy.py\", line 
>>> 96, in _run_module_code\nmod_name, mod_spec, pkg_name, script_name)\n  
>>> File \"/home/rashmi/anaconda3/lib/python3.7/runpy.py\", line 85, in 
>>> _run_code\nexec(code, run_globals)\n  File 
>>> \"/tmp/ansible_gcpubsub_payload_soisvl0x/ansible_gcpubsub_payload.zip/ansible/modules/cloud/google/gcpubsub.py\",
>>>  line 333, in \n  File 
>>> \"/tmp/ansible_gcpubsub_payload_soisvl0x/ansible_gcpubsub_payload.zip/ansible/modules/cloud/google/gcpubsub.py\",
>>>  line 265, in main\nAttributeError: module 'google.cloud.pubsub' has 

Re: [ansible-project] CIS Bencjmarks - Rhel 7

2020-09-10 Thread Philippe Eveque
https://github.com/openstack/ansible-hardening


Le jeu. 10 sept. 2020 à 11:31, Kiran Kumar  a écrit :

> I would suggest - https://galaxy.ansible.com/MindPointGroup/RHEL7-CIS/
>
> On Thu, Sep 10, 2020 at 1:26 AM Josephsimon Arokiaraj 
> wrote:
>
>> Hi All,
>>
>> How you doing?
>>
>> Do we have any playbooks/roles for doing audit and remediation  on CIS
>> benchmarks for Rhel 7?
>>
>> Cheers,
>> Joseph
>>
>> --
>> 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/CAPbGgO2aq_WL55j_WkNkNH--O3wtw8Dqys5Fr639VwdgN1w5JQ%40mail.gmail.com
>> 
>> .
>>
> --
> 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/CAGhW9JuxCPGmhOAnh6BBZ%2B_%2Bo56VRA%3DL586WuPaRpe_4-Wc_TQ%40mail.gmail.com
> 
> .
>

-- 
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/CAB1FMuQ1jfTxbrvP3DNyrgFWmVTRwf%2BTVAm3%3DgXympp4cyN6eQ%40mail.gmail.com.


Re: [ansible-project] CIS Bencjmarks - Rhel 7

2020-09-10 Thread Kiran Kumar
I would suggest - https://galaxy.ansible.com/MindPointGroup/RHEL7-CIS/

On Thu, Sep 10, 2020 at 1:26 AM Josephsimon Arokiaraj 
wrote:

> Hi All,
>
> How you doing?
>
> Do we have any playbooks/roles for doing audit and remediation  on CIS
> benchmarks for Rhel 7?
>
> Cheers,
> Joseph
>
> --
> 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/CAPbGgO2aq_WL55j_WkNkNH--O3wtw8Dqys5Fr639VwdgN1w5JQ%40mail.gmail.com
> 
> .
>

-- 
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/CAGhW9JuxCPGmhOAnh6BBZ%2B_%2Bo56VRA%3DL586WuPaRpe_4-Wc_TQ%40mail.gmail.com.


Re: [ansible-project] Ansible Google Pubsub

2020-09-10 Thread Yantram Cloud


We are writing a playbook with ansible gcp_pubsub follwoing this.

https://docs.ansible.com/ansible/2.3/gcpubsub_module.html#requirements-on-host-that-executes-module
It errors out even in creating topic.

"gcp_pubsub.yml" 

- name: create a topic [ gcpubsub ]
  gcpubsub:
topic: "{{ topic_name }}"
state: present
project_id: "{{ gcp_project }}"
credentials_file: "{{ gcp_cred_file }}"

- name: create subscription[ gcpubsub ]
  gcpubsub:
topic: "{{ topic_name }}"
subscription:
  name: "{{ subscription_name }}"
state: present
project_id: "{{ gcp_project }}"
credentials_file: "{{ gcp_cred_file }}"
   

Just for info , 
However when i use gcp_pubsub_topic to create topic and 
gcp_pubsub_subscription to create subscription , it works. but this is 
limited only to these.


Thanks,


On Thursday, September 10, 2020 at 11:47:04 AM UTC+5:30 dick@geant.org 
wrote:

> ansible --version
>
> What does the entire playbook look like?
>
>
> On Thu, 10 Sep 2020 at 05:55, Yantram Cloud  wrote:
>
>> I am trying to create a subscription for google pubsub through ansible 
>> playbook.
>>  this is my task.
>> - name: create a subscription
>>
>>   gcpubsub:
>> topic: test-topic1
>> state: present
>> credentials_file: "{{ gcp_cred_file }}"
>> project_id: "{{ gcp_project }}"
>>
>>
>> Now it does not seem to work,i have installed google-cloud-pubsub
>>
>> getting this error regarding client.
>>
>> Any help how can i debug this?
>>
>> Here is the error.
>>
>> The full traceback is:
>> Traceback (most recent call last):
>>   File 
>> "/home/rashmi/.ansible/tmp/ansible-tmp-1599709674.061256-7651-29288875173708/AnsiballZ_gcpubsub.py",
>>  line 102, in 
>> _ansiballz_main()
>>   File 
>> "/home/rashmi/.ansible/tmp/ansible-tmp-1599709674.061256-7651-29288875173708/AnsiballZ_gcpubsub.py",
>>  line 94, in _ansiballz_main
>> invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
>>   File 
>> "/home/rashmi/.ansible/tmp/ansible-tmp-1599709674.061256-7651-29288875173708/AnsiballZ_gcpubsub.py",
>>  line 40, in invoke_module
>> runpy.run_module(mod_name='ansible.modules.cloud.google.gcpubsub', 
>> init_globals=None, run_name='__main__', alter_sys=True)
>>   File "/home/rashmi/anaconda3/lib/python3.7/runpy.py", line 205, in 
>> run_module
>> return _run_module_code(code, init_globals, run_name, mod_spec)
>>   File "/home/rashmi/anaconda3/lib/python3.7/runpy.py", line 96, in 
>> _run_module_code
>> mod_name, mod_spec, pkg_name, script_name)
>>   File "/home/rashmi/anaconda3/lib/python3.7/runpy.py", line 85, in _run_code
>> exec(code, run_globals)
>>   File 
>> "/tmp/ansible_gcpubsub_payload_soisvl0x/ansible_gcpubsub_payload.zip/ansible/modules/cloud/google/gcpubsub.py",
>>  line 333, in 
>>   File 
>> "/tmp/ansible_gcpubsub_payload_soisvl0x/ansible_gcpubsub_payload.zip/ansible/modules/cloud/google/gcpubsub.py",
>>  line 265, in main
>> AttributeError: module 'google.cloud.pubsub' has no attribute 'Client'
>> fatal: [localhost]: FAILED! => {
>> "changed": false,
>> "module_stderr": "Traceback (most recent call last):\n  File 
>> \"/home/rashmi/.ansible/tmp/ansible-tmp-1599709674.061256-7651-29288875173708/AnsiballZ_gcpubsub.py\",
>>  line 102, in \n_ansiballz_main()\n  File 
>> \"/home/rashmi/.ansible/tmp/ansible-tmp-1599709674.061256-7651-29288875173708/AnsiballZ_gcpubsub.py\",
>>  line 94, in _ansiballz_main\ninvoke_module(zipped_mod, temp_path, 
>> ANSIBALLZ_PARAMS)\n  File 
>> \"/home/rashmi/.ansible/tmp/ansible-tmp-1599709674.061256-7651-29288875173708/AnsiballZ_gcpubsub.py\",
>>  line 40, in invoke_module\n
>> runpy.run_module(mod_name='ansible.modules.cloud.google.gcpubsub', 
>> init_globals=None, run_name='__main__', alter_sys=True)\n  File 
>> \"/home/rashmi/anaconda3/lib/python3.7/runpy.py\", line 205, in run_module\n 
>>return _run_module_code(code, init_globals, run_name, mod_spec)\n  File 
>> \"/home/rashmi/anaconda3/lib/python3.7/runpy.py\", line 96, in 
>> _run_module_code\nmod_name, mod_spec, pkg_name, script_name)\n  File 
>> \"/home/rashmi/anaconda3/lib/python3.7/runpy.py\", line 85, in _run_code\n   
>>  exec(code, run_globals)\n  File 
>> \"/tmp/ansible_gcpubsub_payload_soisvl0x/ansible_gcpubsub_payload.zip/ansible/modules/cloud/google/gcpubsub.py\",
>>  line 333, in \n  File 
>> \"/tmp/ansible_gcpubsub_payload_soisvl0x/ansible_gcpubsub_payload.zip/ansible/modules/cloud/google/gcpubsub.py\",
>>  line 265, in main\nAttributeError: module 'google.cloud.pubsub' has no 
>> attribute 'Client'\n",
>> "module_stdout": "",
>> "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
>> "rc": 1
>> }
>>
>> PLAY RECAP 
>> 
>> localhost  : ok=3changed=0

Re: [ansible-project] CIS Bencjmarks - Rhel 7

2020-09-10 Thread Abhijeet Kasurde
I have not tried this but you can check -
https://github.com/ansible/ansible-lockdown

On Thu, Sep 10, 2020 at 1:56 PM Josephsimon Arokiaraj 
wrote:

> Hi All,
>
> How you doing?
>
> Do we have any playbooks/roles for doing audit and remediation  on CIS
> benchmarks for Rhel 7?
>
> Cheers,
> Joseph
>
> --
> 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/CAPbGgO2aq_WL55j_WkNkNH--O3wtw8Dqys5Fr639VwdgN1w5JQ%40mail.gmail.com
> 
> .
>


-- 
Thanks,
Abhijeet Kasurde

-- 
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/CAFwWkHrt5_w6DjR3DGApz%3DZoAaBp3GUYuwStqO3ZGfzPHJ%2B87A%40mail.gmail.com.


[ansible-project] CIS Bencjmarks - Rhel 7

2020-09-10 Thread Josephsimon Arokiaraj
Hi All,

How you doing?

Do we have any playbooks/roles for doing audit and remediation  on CIS
benchmarks for Rhel 7?

Cheers,
Joseph

-- 
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/CAPbGgO2aq_WL55j_WkNkNH--O3wtw8Dqys5Fr639VwdgN1w5JQ%40mail.gmail.com.


[ansible-project] How to get UNREACHABLE hosts in ansible-playbook

2020-09-10 Thread Mohtashim S
Below is my playbook

- name: Play 1.5 - Check each target
  hosts: all_hosts
  ignore_unreachable: yes
  ignore_errors: yes
  gather_facts: true

  tasks:

   - raw: "echo {{ inventory_hostname }} is UNREACHABLE"
 delegate_to: localhost
 when: 

I need help with the when condition in the above playbook.

When i run the play against unreachable hosts the debug output clearly 
shows that the output is in JSON format and there must a variable that 
captures inventory_host connection status

Please see the output below:

TASK [Gathering Facts] 
*
task path: /app/Ansible/playbook/check/check.yml:55
<10.9.80.111> Attempting python interpreter discovery
<10.9.80.111> ESTABLISH SSH CONNECTION FOR USER: root
<10.9.80.111> SSH: EXEC ssh -o 
'IdentityFile="/app/automation/ssh_keys/id_rsa"' -o 
KbdInteractiveAuthentication=no -o 
PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey 
-o PasswordAuthentication=no -o 'User="root"' -o ConnectTimeout=10 -o 
StrictHostKeyChecking=no 10.9.80.111 '/bin/sh -c '"'"'echo PLATFORM; uname; 
echo FOUND; command -v '"'"'"'"'"'"'"'"'/usr/bin/python'"'"'"'"'"'"'"'"'; 
command -v '"'"'"'"'"'"'"'"'python3.7'"'"'"'"'"'"'"'"'; command -v 
'"'"'"'"'"'"'"'"'python3.6'"'"'"'"'"'"'"'"'; command -v 
'"'"'"'"'"'"'"'"'python3.5'"'"'"'"'"'"'"'"'; command -v 
'"'"'"'"'"'"'"'"'python2.7'"'"'"'"'"'"'"'"'; command -v 
'"'"'"'"'"'"'"'"'python2.6'"'"'"'"'"'"'"'"'; command -v 
'"'"'"'"'"'"'"'"'/usr/libexec/platform-python'"'"'"'"'"'"'"'"'; command -v 
'"'"'"'"'"'"'"'"'/usr/bin/python3'"'"'"'"'"'"'"'"'; command -v 
'"'"'"'"'"'"'"'"'python'"'"'"'"'"'"'"'"'; echo ENDFOUND && sleep 0'"'"''
<10.9.80.111> (255, '', 'ssh: connect to host 10.9.80.111 port 22: 
Connection timed out\r\n')
[WARNING]: Unhandled error in Python interpreter discovery for host 
10.9.80.111: Failed to connect to the host via ssh: ssh: connect to host 
10.9.80.111 port 22:
Connection timed out

Using module file 
/usr/lib/python2.7/site-packages/ansible/modules/system/setup.py
Pipelining is enabled.
<10.9.80.111> ESTABLISH SSH CONNECTION FOR USER: root
<10.9.80.111> SSH: EXEC ssh -o 
'IdentityFile="/app/axmw/misc_automation/ssh_keys/axmw_id_rsa"' -o 
KbdInteractiveAuthentication=no -o 
PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey 
-o PasswordAuthentication=no -o 'User="root"' -o ConnectTimeout=10 -o 
StrictHostKeyChecking=no 10.9.80.111 '/bin/sh -c '"'"'/usr/bin/python && 
sleep 0'"'"''
fatal: [10.9.80.111]: UNREACHABLE! => {
"changed": false,
"msg": "Data could not be sent to remote host \"10.9.80.111\". Make 
sure this host can be reached over ssh: ssh: connect to host 10.9.80.111 
port 22: Connection timed out\r\n",
"skip_reason": "Host 10.9.80.111 is unreachable",
"unreachable": true
}
META: ran handlers 
>From the output above i want to get the variable that has the below values:

fatal: [10.9.80.111]: UNREACHABLE! => {
"changed": false,
"msg": "Data could not be sent to remote host \"10.9.80.111\". Make 
sure this host can be reached over ssh: ssh: connect to host 10.9.80.111 
port 22: Connection timed out\r\n",
"skip_reason": "Host 10.9.80.111 is unreachable",
"unreachable": true

Thus, I wish to capture the unreachable": true status from there.

Can someone please guide ?

-- 
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/dd3ce383-b066-46a6-89c6-72ab587d81f4n%40googlegroups.com.


Re: [ansible-project] Ansible Google Pubsub

2020-09-10 Thread Dick Visser
ansible --version

What does the entire playbook look like?


On Thu, 10 Sep 2020 at 05:55, Yantram Cloud  wrote:

> I am trying to create a subscription for google pubsub through ansible
> playbook.
>  this is my task.
> - name: create a subscription
>
>   gcpubsub:
> topic: test-topic1
> state: present
> credentials_file: "{{ gcp_cred_file }}"
> project_id: "{{ gcp_project }}"
>
>
> Now it does not seem to work,i have installed google-cloud-pubsub
>
> getting this error regarding client.
>
> Any help how can i debug this?
>
> Here is the error.
>
> The full traceback is:
> Traceback (most recent call last):
>   File 
> "/home/rashmi/.ansible/tmp/ansible-tmp-1599709674.061256-7651-29288875173708/AnsiballZ_gcpubsub.py",
>  line 102, in 
> _ansiballz_main()
>   File 
> "/home/rashmi/.ansible/tmp/ansible-tmp-1599709674.061256-7651-29288875173708/AnsiballZ_gcpubsub.py",
>  line 94, in _ansiballz_main
> invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
>   File 
> "/home/rashmi/.ansible/tmp/ansible-tmp-1599709674.061256-7651-29288875173708/AnsiballZ_gcpubsub.py",
>  line 40, in invoke_module
> runpy.run_module(mod_name='ansible.modules.cloud.google.gcpubsub', 
> init_globals=None, run_name='__main__', alter_sys=True)
>   File "/home/rashmi/anaconda3/lib/python3.7/runpy.py", line 205, in 
> run_module
> return _run_module_code(code, init_globals, run_name, mod_spec)
>   File "/home/rashmi/anaconda3/lib/python3.7/runpy.py", line 96, in 
> _run_module_code
> mod_name, mod_spec, pkg_name, script_name)
>   File "/home/rashmi/anaconda3/lib/python3.7/runpy.py", line 85, in _run_code
> exec(code, run_globals)
>   File 
> "/tmp/ansible_gcpubsub_payload_soisvl0x/ansible_gcpubsub_payload.zip/ansible/modules/cloud/google/gcpubsub.py",
>  line 333, in 
>   File 
> "/tmp/ansible_gcpubsub_payload_soisvl0x/ansible_gcpubsub_payload.zip/ansible/modules/cloud/google/gcpubsub.py",
>  line 265, in main
> AttributeError: module 'google.cloud.pubsub' has no attribute 'Client'
> fatal: [localhost]: FAILED! => {
> "changed": false,
> "module_stderr": "Traceback (most recent call last):\n  File 
> \"/home/rashmi/.ansible/tmp/ansible-tmp-1599709674.061256-7651-29288875173708/AnsiballZ_gcpubsub.py\",
>  line 102, in \n_ansiballz_main()\n  File 
> \"/home/rashmi/.ansible/tmp/ansible-tmp-1599709674.061256-7651-29288875173708/AnsiballZ_gcpubsub.py\",
>  line 94, in _ansiballz_main\ninvoke_module(zipped_mod, temp_path, 
> ANSIBALLZ_PARAMS)\n  File 
> \"/home/rashmi/.ansible/tmp/ansible-tmp-1599709674.061256-7651-29288875173708/AnsiballZ_gcpubsub.py\",
>  line 40, in invoke_module\n
> runpy.run_module(mod_name='ansible.modules.cloud.google.gcpubsub', 
> init_globals=None, run_name='__main__', alter_sys=True)\n  File 
> \"/home/rashmi/anaconda3/lib/python3.7/runpy.py\", line 205, in run_module\n  
>   return _run_module_code(code, init_globals, run_name, mod_spec)\n  File 
> \"/home/rashmi/anaconda3/lib/python3.7/runpy.py\", line 96, in 
> _run_module_code\nmod_name, mod_spec, pkg_name, script_name)\n  File 
> \"/home/rashmi/anaconda3/lib/python3.7/runpy.py\", line 85, in _run_code\n
> exec(code, run_globals)\n  File 
> \"/tmp/ansible_gcpubsub_payload_soisvl0x/ansible_gcpubsub_payload.zip/ansible/modules/cloud/google/gcpubsub.py\",
>  line 333, in \n  File 
> \"/tmp/ansible_gcpubsub_payload_soisvl0x/ansible_gcpubsub_payload.zip/ansible/modules/cloud/google/gcpubsub.py\",
>  line 265, in main\nAttributeError: module 'google.cloud.pubsub' has no 
> attribute 'Client'\n",
> "module_stdout": "",
> "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
> "rc": 1
> }
>
> PLAY RECAP 
> 
> localhost  : ok=3changed=0unreachable=0failed=1   
>  skipped=0rescued=0ignored=0
>
> 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/CAJ4U50WrcdL4OHQCi5OqunFDYK_b%2B%2B71e4dcQpgrnTexjDiFTw%40mail.gmail.com
> 
> .
>
>
> --
Sent from a mobile device - please excuse the brevity, spelling and
punctuation.

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