[ansible-project] What is the ansible_network_os for FXOS devices.

2020-07-09 Thread Susethira Ramamoorthy
Is there any way to automate the FXOS Firepower 2130 devices using ansible? 

Please reply me for the same

-- 
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/014073ee-1559-471d-a3fe-ed5d9a40dee0o%40googlegroups.com.


[ansible-project] Need help in polling the ansible task

2020-07-09 Thread Rahul Kumar
Hi Geeks ,
 I have a task as below which returns me some data.  I want to continuously
poll this request until I get a specific attribute in response as true.
Here is the response from the playbook sample1.yml:

{"_id":"89494fnfi04m0","price":"$17","isFetched": false}

cat sample1.yml
---
name: My application configuration
  uri:
url: https://{{ my_app_ip | default(ansible_fqdn)
}}:8080/app-config/rest/vegetables
body_format: json
method: GET
user: "{{ my_restapi_user }}"
password: "{{ my_restapi_password }}"
force_basic_auth: true
follow_redirects: all
validate_certs: no

As per above sample response , i want to continuously poll above REST API
until i get "isFetched": true in response ! How can I do that?


Another question i have :

I have another playbook as below: (it imports above sample1.yml)
cat master.yml

---
- import_playbook: sample1.yml
- import_playbook: sample2.yml


Can I make sample2.yml import as conditional based on sample1.yml
invocation result ? For example:
include sample2.yml only iff isFetched= true in previous playbook response !
Are variables persisted across playbooks ?

Regards
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/CAGH8rEx2aHfjP-ob5RW%3DmTD0%2BAjL6u-WYn%2B4Vhe88%3DoPhNpdgw%40mail.gmail.com.


RE: [ansible-project] cisco ios connect ssh error

2020-07-09 Thread sandy.hung
Thanks , I have solved.

 �

BR

Sandy

 �

From: ansible-project@googlegroups.com  On 
Behalf Of Srinivas Naram
Sent: Tuesday, July 7, 2020 6:01 PM
To: ansible-project@googlegroups.com
Subject: Re: [ansible-project] cisco ios connect ssh error

 �

Username, Password is null. How are you passing user credentials ?

 �

Would it be possible �to share playbook ?

 �

On Tue, Jul 7, 2020 at 2:50 PM mailto:sandy.h...@abagile.com> > wrote:

Yes , I can connect ssh,but still show error 

 �

 �

“ssh sandy@

Password:

 �

 � � � � � � � � � � � � � � ---  Global Limited ---

 �

 � � � �  Unauthorized access is strictly prohibited *** tpesw-01#

tpesw-01#  � �“

 �

 �

fatal: [tpesw-01]: FAILED! => {

 � � � "ansible_facts": {},

 � � � "changed": false,

 � � � "failed_modules": {

 � � � � � � � "ios_facts": {

 � � � � � � � � � � � "exception": "WARNING: The below traceback may *not* be 
related to t � � � � � � � � � � � � � � � � � � � � � � � � he actual 
failure.\n � File \"/tmp/ansible_ios_facts_payload_NZrxLz/ansible_ios_f � � � � 
� � � � � � � � � � � � � � � � � � � � 
acts_payload.zip/ansible/module_utils/network/common/network.py\", line 229, in 
� � � � � � � � � � � � � � � � � � � � � � � � � get_capabilities\n � � � 
capabilities = Connection(module._socket_path).get_capabil � � � � � � � � � � 
� � � � � � � � � � � � � � ities()\n � File 
\"/tmp/ansible_ios_facts_payload_NZrxLz/ansible_ios_facts_payloa � � � � � � � 
� � � �  � � � � � � � � � � � � �d.zip/ansible/module_utils/connection.py\", 
line 185, in __rpc__\n � � � raise Conn � � � � � � � � � � � � � � � � � � � � 
� � � � ectionError(to_text(msg, errors='surrogate_then_replace'), 
code=code)\n",

 � � � � � � � � � � � "failed": true,

 � � � � � � � � � � � "invocation": {

 � � � � � � �  � � � � � � � �"module_args": {

 � � � � � � � � � � � � � � � � � � � "auth_pass": null,

 � � � � � � � � � � � � � � � � � � � "authorize": null,

 � � � � � � � � � � � � � � � � � � � "gather_network_resources": null,

 � � � � � � � � � � � � � � � � � � � "gather_subset": [

 � � � � � � � � � � � � � � � � � � � � � � � "all"

 � � � � � � � � � � � � � � � � � � � ],

 � � � � � �  � � � � � � � � � � � � �"host": null,

 � � � � � � � � � � � � � � � � � � � "password": null,

 � � � � � � � � � � � � � � � � � � � "port": null,

 � � � � � � � � � � � � � � � � � � � "provider": null,

 � � � � � � � � � � � � � � � � � � � "ssh_keyfile": null,

 � � � � � � � � � � � � � � � � � � � "timeout": null,

 � � � � � � � � � � � � � � � � � � � "username": null

 � � �  � � � � � � � � � � � �}

 � � � � � � � � � � � },

 � � � � � � � � � � � "msg": "[Errno -2] Name or service not known"

 � � � � � � � }

 � � � },

 � � � "msg": "The following modules failed to execute: ios_facts\n"

}

BR

 �

 �

Sandy

 �

From: ansible-project@googlegroups.com 
  mailto:ansible-project@googlegroups.com> > On Behalf Of Srinivas Naram
Sent: Tuesday, July 7, 2020 3:49 PM
To: ansible-project@googlegroups.com  
Subject: Re: [ansible-project] cisco ios connect ssh error

 �

Are you able to connect to Cisco Switch from Ansible server via ssh ? The error 
says 'Connection Error'.

 �

On Tue, Jul 7, 2020 at 1:03 PM Sandy Hung mailto:sandy.h...@abagile.com> > wrote:

I connect cisco switch run playbook show error msg

please help thanks.

fatal: [tpesw-01]: FAILED! => {

 �  � "ansible_facts": {},

 �  � "changed": false,

 �  � "failed_modules": {

 �  �  �  � "ios_facts": {

 �  �  �  �  �  � "exception": "WARNING: The below traceback may *not* be 
related to the actual failure.\n � File 
\"/tmp/ansible_ios_facts_payload_8veYSP/ansible_ios_facts_payload.zip/ansible/module_utils/network/common/network.py\",
 line 229, in get_capabilities\n �  � capabilities = 
Connection(module._socket_path).get_capabilities()\n � File 
\"/tmp/ansible_ios_facts_payload_8veYSP/ansible_ios_facts_payload.zip/ansible/module_utils/connection.py\",
 line 185, in __rpc__\n �  � raise ConnectionError(to_text(msg, 
errors='surrogate_then_replace'), code=code)\n",

 �  �  �  �  �  � "failed": true,

 �  �  �  �  �  � "invocation": {

 �  �  �  �  �  �  �  � "module_args": {

 �  �  �  �  �  �  �  �  �  � "auth_pass": null,

 �  �  �  �  �  �  �  �  �  � "authorize": null,

 �  �  �  �  �  �  �  �  �  � "gather_network_resources": null,

 �  �  �  �  �  �  �  �  �  � "gather_subset": [

 �  �  �  �  �  �  �  �  �  �  �  � "all"

 �  �  �  �  �  �  �  �  �  � ],

 �  �  �  �  �  �  �  �  �  � "host": null,

 �  �  �  �  �  �  �  �  �  � "password": null,

 �  �  �  �  �  �  �  �  �  � "port": null,

 �  �  �  �  �  �  �  �  �  � "provider": null,

 �  �  �  �  �  �  �  �  �  � "ssh_keyfile": null,

 �  �  �  �  �  �  �  �  �  � "timeout": null,

 �  �  �  �  �  �  �  �  �  � "username": null

 �  �  �  �  �  �  �  � }

 �  �  �  �  �  � },

 �  �  �  �  �  � "msg": "[Errno -2] Name or se

Re: [ansible-project] What is the ansible_network_os for FXOS devices.

2020-07-09 Thread Vanshika Sagar
Here you go :-

https://developer.cisco.com/docs/ftd-ansible-v6-3/#!introduction-to-ftd-ansible/introduction-to-ansible-modules-for-ftd-6-3-0


Thanks
Ashish

On Thu, Jul 9, 2020 at 2:45 PM Susethira Ramamoorthy 
wrote:

> Is there any way to automate the FXOS Firepower 2130 devices using
> ansible?
>
> Please reply me for the same
>
> --
> 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/014073ee-1559-471d-a3fe-ed5d9a40dee0o%40googlegroups.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/CADa6Y5ZjzWP4BKSXFQjSiSA%3DAbQizjbVVH_SkCrs9yGQSPR1xA%40mail.gmail.com.


[ansible-project] Integrating Microsoft LAPS and ansible

2020-07-09 Thread harsh chawda
Hello All,

I am using ansible for patching windows machines in my domain. The process 
is working fine with patches being installed till date over Winrm and 
kerberos as authentication.

But now they have decided to use LAPS in the environment .So, the password 
keep on changing and i am not able to access with the same password and 
patch the servers. 

So, i tried researching on the internet about it and how to integrate it 
with the current setup.But I am not able to do it.

Is it feasible and possible with ansible to use LAPS to retrieve password 
and patch windows machines as I am patching 5-10 machines at a stretch and 
all are having different passwords. And also is it secure to integrate it 
with ansible

If anyone have used it in their environment and help me out in this ,it 
would be great. As, I am completely blank on this and how to integrate it.

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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/f806e457-705b-4b2d-a2cb-efbdf37c337co%40googlegroups.com.


[ansible-project] Playbook invocation/role invocation if some tags are specified with some values

2020-07-09 Thread ameya agashe
Hi,

Please find below my Ansible role and playbook which calls that role to 
deploy cloudformation template on to an AWS account:

main.yml file of patching-cf-ssm role

```
 cat main.yml
---

- name: Check the mandatory parameters are provided
  assert:
that:
  - ({{ variable_check }} is defined )
  - ({{ variable_check }} is not none )
  - ({{ variable_check }} | trim != '' )
  with_items:
- Managed
- Patching
  loop_control:
loop_var: variable_check

- name: Check the environment variables are provided
  assert:
that:
  - ({{ variable_check }} is defined )
  - ({{ variable_checl }} is not none )
  - ({{ variable_check }} | trim != '' )
  with_items:
- aws_region
- environment_type
- assumed_role
  loop_control:
   loop_var: variable_check

# tasks file for patching-cf-ssm
- include_vars: "{{playbook_dir}}/vars/patching-config.yml" #Variable file 
for the below template (MaintenanceWindow.yml)

- name: create a cloudformation stack
  cloudformation:
stack_name: "Melton-ansible-cloudformation"
state: "present"
disable_rollback: true
template: "roles/patching-cf-ssm/files/MaintenanceWindow.yml"
  #environment:
#AWS_ACCESS_KEY_ID: "{{ assumed_role.sts_creds.access_key }}"
#AWS_SECRET_ACCESS_KEY: "{{ assumed_role.sts_creds.secret_key }}"
#AWS_SECURITY_TOKEN: "{{ assumed_role.sts_creds.session_token }}"
*  when: {{ Managed: false }} | {{ Patching: disabled }} | {{ Backup: 
disabled }}*
*  when: {{ Managed: false }} | {{ Patching: enabled }} | {{ Backup: 
disabled }}*
*  when: {{ Managed: true }} | {{ Patching: disabled }} | {{ Backup: 
disabled }}*
...
pwd
ansible/playbooks/roles/patching-cf-ssm/tasks
```

and It's called in main.yml as below

```
cat patching.yml
---
- hosts: localhost
  roles:
- patching-cf-ssm
```


Challenge is I do *NOT* want to deploy any CF template if any one of the 
"when" conditions satisfy.

How do I go about it?

Please assist

Thanks
Ameya

-- 
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/d8fe99eb-73f5-4fbc-895e-b9ae00407fceo%40googlegroups.com.


Re: [ansible-project] NameError: global name 'fw offline' is not defined

2020-07-09 Thread Keith Nowosielski
I did actually. I've been troubleshooting for a week now, and I've made
some progress, however this seems to be a bug with Ansible.

Keith


On Wed, Jul 8, 2020 at 9:03 PM Dick Visser  wrote:

>
>
> On Thu, 9 Jul 2020 at 01:16, Keith Nowosielski 
> wrote:
>
>> I'm working on Ubuntu 18.04.4 LTS using ansible 2.5.1.
>>
>> I'm trying to get this project
>> to work
>> as its exactly what I'm trying to do.
>>
>
> That would be the first place to reach out for support.
>
>
> --
> Sent from a mobile device - please excuse the brevity, spelling and
> punctuation.
>
> --
> 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/LVrAJnyg46Q/unsubscribe.
> To unsubscribe from this group and all its topics, 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/CAL8fbwNezRk9wfzq_yHfvg6r6UJ4TniD%3DwfE-1SK%3DxEtUwpByg%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/CA%2BVsJzg_6VntsPgq1h%3D%2B%2BH_wWPax-XQj3uyw1OhZmo%2B5D0mZLQ%40mail.gmail.com.


Re: [ansible-project] NameError: global name 'fw offline' is not defined

2020-07-09 Thread Keith Nowosielski
I saw this, however this issue was posed and fixed back in 2018. I'm using
a current version of Ansible. I can dig into the python script however from
the comments I'm not clear on what would need to be done?

Keith


On Wed, Jul 8, 2020 at 10:10 PM Abhijeet Kasurde 
wrote:

> I think this issue is already fixed in Ansible
> https://github.com/ansible/ansible/issues/38161. Please update.
>
> On Thu, Jul 9, 2020 at 9:33 AM Dick Visser  wrote:
>
>>
>>
>> On Thu, 9 Jul 2020 at 01:16, Keith Nowosielski <
>> keith.nowosiel...@sjsu.edu> wrote:
>>
>>> I'm working on Ubuntu 18.04.4 LTS using ansible 2.5.1.
>>>
>>> I'm trying to get this project
>>> to work
>>> as its exactly what I'm trying to do.
>>>
>>
>> That would be the first place to reach out for support.
>>
>>
>> --
>> 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 this discussion on the web visit
>> https://groups.google.com/d/msgid/ansible-project/CAL8fbwNezRk9wfzq_yHfvg6r6UJ4TniD%3DwfE-1SK%3DxEtUwpByg%40mail.gmail.com
>> 
>> .
>>
>
>
> --
> Thanks,
> Abhijeet Kasurde
>
> --
> 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/LVrAJnyg46Q/unsubscribe.
> To unsubscribe from this group and all its topics, 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/CAFwWkHpT1bZbNOZx48wb-vUuMkHXbsEoA4tu6Eqyh7hic3Cdrw%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/CA%2BVsJziA1ZjUWxb34HQCmOhdoKYsRxPoqVb%3DCUpTnyjpr5wtTQ%40mail.gmail.com.


Re: [ansible-project] NameError: global name 'fw offline' is not defined

2020-07-09 Thread flowerysong
On Thursday, July 9, 2020 at 12:26:34 PM UTC-4 keith.no...@sjsu.edu wrote:

> I saw this, however this issue was posed and fixed back in 2018. I'm using 
> a current version of Ansible. I can dig into the python script however from 
> the comments I'm not clear on what would need to be done? 
>

You said you were using Ansible 2.5.1, which is far from current. (It is, 
in fact, from 2018.) You should upgrade to a supported version of Ansible, 
preferably 2.9.x.

-- 
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/3af80fa7-d6ec-4546-a980-a5712bf0bc93n%40googlegroups.com.


Re: [ansible-project] NameError: global name 'fw offline' is not defined

2020-07-09 Thread Keith Nowosielski
Sorry, that's what I came up with on a quick google search. Also this is a
fresh install.. ugh

Keith


On Thu, Jul 9, 2020 at 10:15 AM flowerysong  wrote:

> On Thursday, July 9, 2020 at 12:26:34 PM UTC-4 keith.no...@sjsu.edu wrote:
>
>> I saw this, however this issue was posed and fixed back in 2018. I'm
>> using a current version of Ansible. I can dig into the python script
>> however from the comments I'm not clear on what would need to be done?
>>
>
> You said you were using Ansible 2.5.1, which is far from current. (It is,
> in fact, from 2018.) You should upgrade to a supported version of Ansible,
> preferably 2.9.x.
>
> --
> 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/LVrAJnyg46Q/unsubscribe.
> To unsubscribe from this group and all its topics, 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/3af80fa7-d6ec-4546-a980-a5712bf0bc93n%40googlegroups.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/CA%2BVsJzh%2B_9URLmHWPQbOcxnc_9EdpwWUYQQhEXPUx-AmfDGQCA%40mail.gmail.com.


Re: [ansible-project] NameError: global name 'fw offline' is not defined

2020-07-09 Thread Keith Nowosielski
Updated to 2.9.10 (more trouble than it should have been). Then updating
states that were deprecated "installed>present", It now seems to be
working!

Thanks Everyone, and sorry I'm such a newbie at this!

Keith


On Thu, Jul 9, 2020 at 11:28 AM Keith Nowosielski <
keith.nowosiel...@sjsu.edu> wrote:

> Sorry, that's what I came up with on a quick google search. Also this is a
> fresh install.. ugh
>
> Keith
>
>
> On Thu, Jul 9, 2020 at 10:15 AM flowerysong  wrote:
>
>> On Thursday, July 9, 2020 at 12:26:34 PM UTC-4 keith.no...@sjsu.edu
>> wrote:
>>
>>> I saw this, however this issue was posed and fixed back in 2018. I'm
>>> using a current version of Ansible. I can dig into the python script
>>> however from the comments I'm not clear on what would need to be done?
>>>
>>
>> You said you were using Ansible 2.5.1, which is far from current. (It is,
>> in fact, from 2018.) You should upgrade to a supported version of Ansible,
>> preferably 2.9.x.
>>
>> --
>> 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/LVrAJnyg46Q/unsubscribe
>> .
>> To unsubscribe from this group and all its topics, 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/3af80fa7-d6ec-4546-a980-a5712bf0bc93n%40googlegroups.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/CA%2BVsJzhVtWkFTVcZyvHDg-0U0Tzb0AZf8X-bAC4Kz0uaNCRDkQ%40mail.gmail.com.


Re: [ansible-project] Need help in polling the ansible task

2020-07-09 Thread vinoth kumar
You can register it and use retries until it gets something you want . The.
You can call you second playbook with your when condition .


You have to provide the exact output to get condition .

Until: register.somthing.isFetched == true



On Thu 9. Jul 2020 at 11:26, Rahul Kumar  wrote:

> Hi Geeks ,
>  I have a task as below which returns me some data.  I want to
> continuously poll this request until I get a specific attribute in response
> as true.
> Here is the response from the playbook sample1.yml:
>
> {"_id":"89494fnfi04m0","price":"$17","isFetched": false}
>
> cat sample1.yml
> ---
> name: My application configuration
>   uri:
> url: https://{{ my_app_ip | default(ansible_fqdn)
> }}:8080/app-config/rest/vegetables
> body_format: json
> method: GET
> user: "{{ my_restapi_user }}"
> password: "{{ my_restapi_password }}"
> force_basic_auth: true
> follow_redirects: all
> validate_certs: no
>
> As per above sample response , i want to continuously poll above REST API
> until i get "isFetched": true in response ! How can I do that?
>
>
> Another question i have :
>
> I have another playbook as below: (it imports above sample1.yml)
> cat master.yml
>
> ---
> - import_playbook: sample1.yml
> - import_playbook: sample2.yml
>
>
> Can I make sample2.yml import as conditional based on sample1.yml
> invocation result ? For example:
> include sample2.yml only iff isFetched= true in previous playbook response
> !
> Are variables persisted across playbooks ?
>
> Regards
> 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/CAGH8rEx2aHfjP-ob5RW%3DmTD0%2BAjL6u-WYn%2B4Vhe88%3DoPhNpdgw%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/CAJ%2BRxtRRRL42-RrWkXWfk6bqreAC%2B8JV5P6qQJWKjt0RhZ%3DDkQ%40mail.gmail.com.


[ansible-project] How to declare a list of lists of lists

2020-07-09 Thread John Maag
I need to set up a list of volume groups. for each volume group there will 
be an attribute name and an attribute state. under each volume group is a 
list of one or more volumes. For each volume, there are attributes name, 
size, file system type, and mount point. Under each volume is a list of one 
or more disks. for each disk there are attributes bdevice and cdevice to 
indicate /dev/sda or /dev/sda1.

Something like this:

disks:
  - vgname: vg1
state: present
- lvname: lv1
  mntp: /u01
  lvsize: 100G
  fstype: xfs
  disk:
- {device: /dev/sda, pvname: /dev/sda1}

but this doesn't work. Lastly, I would like a technique to know how many 
elements of disks there are because if there is only one disk I do not want 
to use lvm.

-- 
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/8822f8aa-aac9-477c-8279-82256d85b97co%40googlegroups.com.


[ansible-project] installing flatpaks

2020-07-09 Thread Andrew Meyer
I am trying to install a list of flatpaks on my Fedora Workstation and 
getting the following errors when I run my playbook:

TASK [Install the flatpak packages from flathub for current user] 
*
task path: /home/user/Documents/automation/ansible/playbooks/roles/fedora-
workstation/tasks/flatpakpackages.yml:1
fatal: [10.150.1.172]: FAILED! => {
"msg": "The task includes an option with an undefined variable. The 
error was: 'item' is undefined\n\nThe error appears to be in 
'/home/user/Documents/automation/ansible/playbooks/roles/fedora-workstation/tasks/flatpakpackages.yml':
 
line 1, column 3, but may\nbe elsewhere in the file depending on the exact 
syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Install 
the flatpak packages from flathub for current user\n  ^ here\n"
}

Here is the list of flatpaks
- name: Install the flatpak packages from flathub for current user
  flatpak:
name: "{{ item }}"
state: present
method: user
with_items:
  - com.bluejeans.BlueJeans
  - us.zoom.Zoom
  - com.discordapp.Discord
  - com.dropbox.Client
  - com.microsoft.Teams
  - org.signal.Signal
  - ws.openarena.OpenArena
  - net.openra.OpenRA
  - org.fedoraproject.MediaWriter
  - org.raspberrypi.rpi-imager
  - io.neovim.nvim
  - com.anydesk.Anydesk
  - io.dbeaver.DBeaverCommunity
  - com.github.alecaddd.sequeler
  - com.notepadqq.Notepadqq
  - org.qownnotes.QOwnNotes
  - io.brackets.Brackets
  - io.atom.Atom
  - org.gnome.Boxes
  - com.jetbrains.PyCharm-Community
  - com.sublimetext.three
  - com.visualstudio.code

Kind of lost at where the issue is.

-- 
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/e3a6cbd5-3f45-46c8-ada4-cfcc20dd65c7o%40googlegroups.com.


Re: [ansible-project] installing flatpaks

2020-07-09 Thread Stefan Hornburg (Racke)
On 7/9/20 11:14 PM, Andrew Meyer wrote:
> I am trying to install a list of flatpaks on my Fedora Workstation and 
> getting the following errors when I run my playbook:
> 
> |
> TASK [Installthe flatpak packages fromflathub forcurrent
> user]*
> task 
> path:/home/user/Documents/automation/ansible/playbooks/roles/fedora-workstation/tasks/flatpakpackages.yml:1
> fatal:[10.150.1.172]:FAILED!=>{
>     "msg":"The task includes an option with an undefined variable. The error 
> was: 'item' is undefined\n\nThe error
> appears to be in 
> '/home/user/Documents/automation/ansible/playbooks/roles/fedora-workstation/tasks/flatpakpackages.yml':
> line 1, column 3, but may\nbe elsewhere in the file depending on the exact 
> syntax problem.\n\nThe offending line appears
> to be:\n\n\n- name: Install the flatpak packages from flathub for current 
> user\n  ^ here\n"
> }
> |
> 
> Here is the list of flatpaks
> |
> -name:Installthe flatpak packages fromflathub forcurrent user
>   flatpak:
>     name:"{{ item }}"
>     state:present
>     method:user
>     with_items:
>       -com.bluejeans.BlueJeans
>       -us.zoom.Zoom
>       -com.discordapp.Discord
>       -com.dropbox.Client
>       -com.microsoft.Teams
>       -org.signal.Signal
>       -ws.openarena.OpenArena
>       -net.openra.OpenRA
>       -org.fedoraproject.MediaWriter
>       -org.raspberrypi.rpi-imager
>       -io.neovim.nvim
>       -com.anydesk.Anydesk
>       -io.dbeaver.DBeaverCommunity
>       -com.github.alecaddd.sequeler
>       -com.notepadqq.Notepadqq
>       -org.qownnotes.QOwnNotes
>       -io.brackets.Brackets
>       -io.atom.Atom
>       -org.gnome.Boxes
>       -com.jetbrains.PyCharm-Community
>       -com.sublimetext.three
>       -com.visualstudio.code
> |
> 
> Kind of lost at where the issue is.

Indendation is wrong ... with_items is a general task parameter and not a 
module parameter.

flatpak:
  name:"{{ item }}"
  state:present
  method:user
with_items:
  ...

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 
> .
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/e3a6cbd5-3f45-46c8-ada4-cfcc20dd65c7o%40googlegroups.com
> .


-- 
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/20cf4230-8909-77e6-d291-9f0bfade640b%40linuxia.de.


signature.asc
Description: OpenPGP digital signature


Re: [ansible-project] How to declare a list of lists of lists

2020-07-09 Thread Vladimir Botka
On Thu, 9 Jul 2020 13:10:44 -0700 (PDT)
John Maag  wrote:

> - For each volume group there will be an attribute name and an attribute
>   state
> - Under each volume group is a list of one or more volumes.
> - For each volume, there are attributes name, 
>   size, file system type, and mount point
> - Under each volume is a list of one or more disks.
> - for each disk there are attributes bdevice and cdevice to 
>   indicate /dev/sda or /dev/sda1.
> 
> Something like this:
> 
> disks:
>   - vgname: vg1
> state: present
  volumes:
>   - lvname: lv1
> mntp: /u01
> lvsize: 100G
> fstype: xfs
> disk:
>   - device: /dev/sda
> pvname: /dev/sda1

The list of volumes must be an attribute too.

-- 
Vladimir Botka

-- 
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/20200710001527.02311ccc%40gmail.com.


pgp3mlCsRisJ8.pgp
Description: OpenPGP digital signature


Re: [ansible-project] How to declare a list of lists of lists

2020-07-09 Thread John Maag
Is there a way to walk *volumes* and *disk* lists? I can only find examples 
of walking *disks* and *volumes* with the subelements construct. Sorry 
there is both a disk and disks list construct.

On Thursday, July 9, 2020 at 5:15:47 PM UTC-5, Vladimir Botka wrote:
>
>
> > 
> > Something like this: 
> > 
> > disks: 
> >   - vgname: vg1 
> > state: present 
>   volumes: 
> >   - lvname: lv1 
> > mntp: /u01 
> > lvsize: 100G 
> > fstype: xfs 
> > disk: 
> >   - device: /dev/sda 
> > pvname: /dev/sda1 
>
> The list of volumes must be an attribute too. 
>
> -- 
> Vladimir Botka 
>

-- 
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/d5887e9d-6968-4739-a77b-cb88b814ff29o%40googlegroups.com.


Re: [ansible-project] installing flatpaks

2020-07-09 Thread Andrew Meyer
Thank You!

On Thursday, July 9, 2020 at 4:20:10 PM UTC-5, Stefan Hornburg (Racke) 
wrote:
>
> On 7/9/20 11:14 PM, Andrew Meyer wrote: 
> > I am trying to install a list of flatpaks on my Fedora Workstation and 
> getting the following errors when I run my playbook: 
> > 
> > | 
> > TASK [Installthe flatpak packages fromflathub forcurrent 
> > 
> user]*
>  
>
> > task 
> path:/home/user/Documents/automation/ansible/playbooks/roles/fedora-workstation/tasks/flatpakpackages.yml:1
>  
>
> > fatal:[10.150.1.172]:FAILED!=>{ 
> > "msg":"The task includes an option with an undefined variable. The 
> error was: 'item' is undefined\n\nThe error 
> > appears to be in 
> '/home/user/Documents/automation/ansible/playbooks/roles/fedora-workstation/tasks/flatpakpackages.yml':
>  
>
> > line 1, column 3, but may\nbe elsewhere in the file depending on the 
> exact syntax problem.\n\nThe offending line appears 
> > to be:\n\n\n- name: Install the flatpak packages from flathub for 
> current user\n  ^ here\n" 
> > } 
> > | 
> > 
> > Here is the list of flatpaks 
> > | 
> > -name:Installthe flatpak packages fromflathub forcurrent user 
> >   flatpak: 
> > name:"{{ item }}" 
> > state:present 
> > method:user 
> > with_items: 
> >   -com.bluejeans.BlueJeans 
> >   -us.zoom.Zoom 
> >   -com.discordapp.Discord 
> >   -com.dropbox.Client 
> >   -com.microsoft.Teams 
> >   -org.signal.Signal 
> >   -ws.openarena.OpenArena 
> >   -net.openra.OpenRA 
> >   -org.fedoraproject.MediaWriter 
> >   -org.raspberrypi.rpi-imager 
> >   -io.neovim.nvim 
> >   -com.anydesk.Anydesk 
> >   -io.dbeaver.DBeaverCommunity 
> >   -com.github.alecaddd.sequeler 
> >   -com.notepadqq.Notepadqq 
> >   -org.qownnotes.QOwnNotes 
> >   -io.brackets.Brackets 
> >   -io.atom.Atom 
> >   -org.gnome.Boxes 
> >   -com.jetbrains.PyCharm-Community 
> >   -com.sublimetext.three 
> >   -com.visualstudio.code 
> > | 
> > 
> > Kind of lost at where the issue is. 
>
> Indendation is wrong ... with_items is a general task parameter and not a 
> module parameter. 
>
> flatpak: 
>   name:"{{ item }}" 
>   state:present 
>   method:user 
> with_items: 
>   ... 
>
> 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...@googlegroups.com   ansible-project+unsubscr...@googlegroups.com >. 
> > To view this discussion on the web visit 
> > 
> https://groups.google.com/d/msgid/ansible-project/e3a6cbd5-3f45-46c8-ada4-cfcc20dd65c7o%40googlegroups.com
>  
> > <
> https://groups.google.com/d/msgid/ansible-project/e3a6cbd5-3f45-46c8-ada4-cfcc20dd65c7o%40googlegroups.com?utm_medium=email&utm_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/7e866979-c271-4512-8f0c-7bb712aa8b21o%40googlegroups.com.


Re: [ansible-project] How to declare a list of lists of lists

2020-07-09 Thread Vladimir Botka
On Thu, 9 Jul 2020 16:05:21 -0700 (PDT)
John Maag  wrote:


> > > disks: 
> > >   - vgname: vg1 
> > > state: present   
> >   volumes:   
> > >   - lvname: lv1 
> > > mntp: /u01 
> > > lvsize: 100G 
> > > fstype: xfs 
> > > disk: 
> > >   - device: /dev/sda 
> > > pvname: /dev/sda1   

> Is there a way to walk *volumes* and *disk* lists?

Yes. It is. Use "include_tasks" in the loop with subelements volumes. In
the included tasks loop "item.1.disk".

-- 
Vladimir Botka

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


pgpbKmjSPWa9L.pgp
Description: OpenPGP digital signature


Re: [ansible-project] How to declare a list of lists of lists

2020-07-09 Thread Vladimir Botka

> On Thu, 9 Jul 2020 16:05:21 -0700 (PDT)
> John Maag  wrote:
> > Is there a way to walk *volumes* and *disk* lists?  

Try this loop

- debug:
msg: "{{ outer_item.0.vgname }} {{ outer_item.1.lvname }}"
  loop: "{{ lookup('subelements', disks, 'volumes') }}"
  loop_control:
loop_var: outer_item
label: "{{ outer_item.0.vgname }}"


If it works then create a file to be included in the loop. For example

  shell> cat test.yml
  - debug:
  msg:
group [{{ outer_item.0.vgname }}]
volume [{{ outer_item.1.lvname }}]
device [{{ item.device }}]
pvname [{{ item.pvname }}]
loop: "{{ outer_item.1.disk }}"

and include it in the loop. For example

- include_tasks: test.yml
  loop: "{{ lookup('subelements', disks, 'volumes') }}"
  loop_control:
loop_var: outer_item
label: "{{ outer_item.0.vgname }}"

The result should be a list of messages with all combinations.

-- 
Vladimir Botka

-- 
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/20200710020633.264fc13e%40gmail.com.


pgpjsVi6KrDBS.pgp
Description: OpenPGP digital signature


Re: [ansible-project] Need help in polling the ansible task

2020-07-09 Thread Rahul Kumar
Thanks Vinoth ! Once i put condition like that:
until: result['results'][0].content.isFetched  == True
It says
"msg": "The conditional check 'result['results'][0].content.isFetched  ==
True' failed. The error was: error while evaluating conditional
(result['results'][0].content.isFetched  == True): 'dict object' has no
attribute 'results'"

But in next task if i print same thing:
- name: Print Response of status resource
  debug:
msg: "Boss Version: {{ result['results'][0].content.isFetched }}"

It gives me output:
"msg": "Boss Version: True"
I am not sure how until works   , does it wait till some condition becomes
true with continuous polling ?

Regards
Rahul

On Fri, 10 Jul 2020 at 01:15, vinoth kumar  wrote:

> You can register it and use retries until it gets something you want .
> The. You can call you second playbook with your when condition .
>
>
> You have to provide the exact output to get condition .
>
> Until: register.somthing.isFetched == true
>
>
>
> On Thu 9. Jul 2020 at 11:26, Rahul Kumar  wrote:
>
>> Hi Geeks ,
>>  I have a task as below which returns me some data.  I want to
>> continuously poll this request until I get a specific attribute in response
>> as true.
>> Here is the response from the playbook sample1.yml:
>>
>> {"_id":"89494fnfi04m0","price":"$17","isFetched": false}
>>
>> cat sample1.yml
>> ---
>> name: My application configuration
>>   uri:
>> url: https://{{ my_app_ip | default(ansible_fqdn)
>> }}:8080/app-config/rest/vegetables
>> body_format: json
>> method: GET
>> user: "{{ my_restapi_user }}"
>> password: "{{ my_restapi_password }}"
>> force_basic_auth: true
>> follow_redirects: all
>> validate_certs: no
>>
>> As per above sample response , i want to continuously poll above REST API
>> until i get "isFetched": true in response ! How can I do that?
>>
>>
>> Another question i have :
>>
>> I have another playbook as below: (it imports above sample1.yml)
>> cat master.yml
>>
>> ---
>> - import_playbook: sample1.yml
>> - import_playbook: sample2.yml
>>
>>
>> Can I make sample2.yml import as conditional based on sample1.yml
>> invocation result ? For example:
>> include sample2.yml only iff isFetched= true in previous playbook
>> response !
>> Are variables persisted across playbooks ?
>>
>> Regards
>> 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/CAGH8rEx2aHfjP-ob5RW%3DmTD0%2BAjL6u-WYn%2B4Vhe88%3DoPhNpdgw%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/CAJ%2BRxtRRRL42-RrWkXWfk6bqreAC%2B8JV5P6qQJWKjt0RhZ%3DDkQ%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/CAGH8rEwdzKzM9boxFQ1g53btTOn4pm6Upj4Bt5yA49R1W5nnLw%40mail.gmail.com.