Re: [ansible-project] Ansible IDE with syntax help

2021-10-06 Thread John Petro
I have used it before I knew about the Ansible extension, and it supports
YAML right out of the box, so that might help.  Also, I use an extension
called Indent Rainbow which has been REALLY helpful in debugging
indentation errors.

On Wed, Oct 6, 2021 at 4:52 PM simon clarke  wrote:

> will the RedHat Ansible extension assist with syntax and indentation
> errors?
>
> On Wednesday, October 6, 2021 at 9:49:34 PM UTC+1 simon clarke wrote:
>
>> Thanks for the advice Pat much appreciated
>>
>>
>> On Wednesday, October 6, 2021 at 6:25:17 PM UTC+1
>> pat@networktocode.com wrote:
>>
>>> During Ansiblefest 2021, multiple presenters said they were now using
>>> Microsoft Virtual Studio Code (VSCODE available at no cost on Win10, Mac, &
>>> Linux) with the no-cost RedHat Ansible extension. Of course that is one of
>>> many options but VSCODE has been well received by many.
>>>
>>> On Wed, Oct 6, 2021 at 11:44 AM simon clarke  wrote:
>>>
 Hi,

 I wondered if someone could advise me what the best IDE to use for
 Ansible is?

 I want to be able to use a plugin for syntax/indentation help

 I am a begineer so appologies if this is a basic question and
 appreciate any help

 Simon

 --
 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-proje...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/662f52fd-6821-4f53-ae6e-3b4f3d915d8dn%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/11d8ceac-4c46-44fa-baaf-17bd4ebadfc4n%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/CAPAjob8S9%3DcKgrLiu-bdvOXZ1TOJ0izBbMjE34shnzHWxv-ong%40mail.gmail.com.


Re: [ansible-project] Ansible IDE with syntax help

2021-10-06 Thread simon clarke
will the RedHat Ansible extension assist with syntax and indentation 
errors? 

On Wednesday, October 6, 2021 at 9:49:34 PM UTC+1 simon clarke wrote:

> Thanks for the advice Pat much appreciated 
>
>
> On Wednesday, October 6, 2021 at 6:25:17 PM UTC+1 
> pat@networktocode.com wrote:
>
>> During Ansiblefest 2021, multiple presenters said they were now using 
>> Microsoft Virtual Studio Code (VSCODE available at no cost on Win10, Mac, & 
>> Linux) with the no-cost RedHat Ansible extension. Of course that is one of 
>> many options but VSCODE has been well received by many. 
>>
>> On Wed, Oct 6, 2021 at 11:44 AM simon clarke  wrote:
>>
>>> Hi, 
>>>
>>> I wondered if someone could advise me what the best IDE to use for 
>>> Ansible is?
>>>
>>> I want to be able to use a plugin for syntax/indentation help 
>>>
>>> I am a begineer so appologies if this is a basic question and appreciate 
>>> any help 
>>>
>>> Simon 
>>>
>>> -- 
>>> 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-proje...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/ansible-project/662f52fd-6821-4f53-ae6e-3b4f3d915d8dn%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/11d8ceac-4c46-44fa-baaf-17bd4ebadfc4n%40googlegroups.com.


Re: [ansible-project] Ansible IDE with syntax help

2021-10-06 Thread simon clarke
Thanks for the advice Pat much appreciated 


On Wednesday, October 6, 2021 at 6:25:17 PM UTC+1 pat@networktocode.com 
wrote:

> During Ansiblefest 2021, multiple presenters said they were now using 
> Microsoft Virtual Studio Code (VSCODE available at no cost on Win10, Mac, & 
> Linux) with the no-cost RedHat Ansible extension. Of course that is one of 
> many options but VSCODE has been well received by many. 
>
> On Wed, Oct 6, 2021 at 11:44 AM simon clarke  wrote:
>
>> Hi, 
>>
>> I wondered if someone could advise me what the best IDE to use for 
>> Ansible is?
>>
>> I want to be able to use a plugin for syntax/indentation help 
>>
>> I am a begineer so appologies if this is a basic question and appreciate 
>> any help 
>>
>> Simon 
>>
>> -- 
>> 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-proje...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/662f52fd-6821-4f53-ae6e-3b4f3d915d8dn%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/56f7e689-ecd4-4bba-a845-70211ec84ec1n%40googlegroups.com.


Re: [ansible-project] Re: Combining several facts into one array

2021-10-06 Thread lift...@gmail.com
I wanted to let you know that I got this working.  I looped through the 
users list that was generated and skipped over the folders I didn't need by 
using:

when: item.homedirectory[0] not in ["/home/admin", "/home/test2"]

I also referenced the UID and GID in a similar manner (item.uid[0] and 
item.gidnumber[0]) and was able to use the information I needed to complete 
the task.

Thanks for the tips!
Harry

On Wednesday, October 6, 2021 at 10:51:18 AM UTC-4 Sandip Bhattacharya 
wrote:

>
>
> On 06.10.21 14:38, lift...@gmail.com wrote:
> > However, in my other thread about removing items from the list, I'm 
> trying the suggestion as follows:
> > 
> >   - name: Print output
> > debug:
> >   msg: "{{ item.uid[0] }}:  {{ item.gidnumber[0] }}:  {{ 
> item.homedirectory[0] }}"
> > loop: "{{ user_find.json.result.result|difference(deny) }}"
> > vars:
> > deny: ["/home/admin","/home/test"]
> > 
> > This gives me the following validation error:
> > 
> > ERROR! conflicting action statements: debug, deny
>
> 'deny' is wrongly indented. It is a variable. Should be indented under 
> 'vars'.
>
> -- 
> https://blog.sandipb.net
> https://twitter.com/sandipb
>

-- 
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/9612b23e-c250-42a2-be1d-ec0372a0909bn%40googlegroups.com.


Re: [ansible-project] Ansible IDE with syntax help

2021-10-06 Thread 'Pat Kelly' via Ansible Project
During Ansiblefest 2021, multiple presenters said they were now using
Microsoft Virtual Studio Code (VSCODE available at no cost on Win10, Mac, &
Linux) with the no-cost RedHat Ansible extension. Of course that is one of
many options but VSCODE has been well received by many.

On Wed, Oct 6, 2021 at 11:44 AM simon clarke  wrote:

> Hi,
>
> I wondered if someone could advise me what the best IDE to use for Ansible
> is?
>
> I want to be able to use a plugin for syntax/indentation help
>
> I am a begineer so appologies if this is a basic question and appreciate
> any help
>
> Simon
>
> --
> 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/662f52fd-6821-4f53-ae6e-3b4f3d915d8dn%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/CAGRZ9E%3DgQZ%3DGfYct9teKU%2B05EFC5LL%3Dj_TtybZFe1hqJvuMUgg%40mail.gmail.com.


[ansible-project] Ansible IDE with syntax help

2021-10-06 Thread simon clarke
Hi, 

I wondered if someone could advise me what the best IDE to use for Ansible 
is?

I want to be able to use a plugin for syntax/indentation help 

I am a begineer so appologies if this is a basic question and appreciate 
any help 

Simon 

-- 
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/662f52fd-6821-4f53-ae6e-3b4f3d915d8dn%40googlegroups.com.


Re: [ansible-project] Re: Combining several facts into one array

2021-10-06 Thread Sandip Bhattacharya




On 06.10.21 14:38, lift...@gmail.com wrote:

However, in my other thread about removing items from the list, I'm trying the 
suggestion as follows:

   - name: Print output
     debug:
       msg: "{{ item.uid[0] }}:  {{ item.gidnumber[0] }}:  {{ item.homedirectory[0] 
}}"
     loop: "{{ user_find.json.result.result|difference(deny) }}"
     vars:
     deny: ["/home/admin","/home/test"]

This gives me the following validation error:

ERROR! conflicting action statements: debug, deny


'deny' is wrongly indented. It is a variable. Should be indented under 'vars'.

--
https://blog.sandipb.net
https://twitter.com/sandipb

--
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/254ce446-cc77-6716-2975-fa00904be712%40showmethesource.org.


[ansible-project] Looking for an option to exclude particular playbook not to created as job_template by tower-cli

2021-10-06 Thread Deepan M
Command # tower-cli job_template create --name "projectname" --inventory 
"invfile" --ask-variables-on-launch true --playbook "reldir/name.ext" 

in these tower-cli command  options, I want to exclude one specific name 
playbook.yml, which doesn't have header "---". please suggesr.

Thanks,
Deepan M

-- 
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/2990ddc7-c409-4d2c-86ec-1634f707be96n%40googlegroups.com.


[ansible-project] Re: Combining several facts into one array

2021-10-06 Thread lift...@gmail.com
So I'm close.  I am able to get the items from the returned list via the 
IPA API:

  - name: Run user_find from IDM API using previously stored session cookie
uri:
  url: "https://{{idmfqdn}}/ipa/session/json";
  method: POST
  headers:
Cookie: "{{ login.set_cookie }}"
Referer: "https://{{idmfqdn}}/ipa";
Content-Type: "application/json"
Accept: "application/json"
  body_format: json
  body: "{\"method\": \"user_find/1\",\"params\": [[],{\"version\": 
\"{{ api_vers }}\"}]}"
register: user_find

I can print them out and get the info I need:

  - name: Print output
debug:
  msg: "{{ item.uid[0] }}:  {{ item.gidnumber[0] }}:  {{ 
item.homedirectory[0] }}"
with_items: "{{ user_find.json.result.result| }}"

However, in my other thread about removing items from the list, I'm trying 
the suggestion as follows:

  - name: Print output
debug:
  msg: "{{ item.uid[0] }}:  {{ item.gidnumber[0] }}:  {{ 
item.homedirectory[0] }}"
loop: "{{ user_find.json.result.result|difference(deny) }}"
vars:
deny: ["/home/admin","/home/test"]

This gives me the following validation error:

ERROR! conflicting action statements: debug, deny

I won't be using debug in the final version of the playbook, so since I 
know that I can get the info I need, should I  just move onto that?  Or is 
there a way to get debug and deny to coexist to I can be SURE I'm getting 
what I need first?

Thanks,
Harry
On Tuesday, October 5, 2021 at 6:03:38 PM UTC-4 flowerysong wrote:

> While the use of json_query obscures the actual structure that you're 
> dealing with (and you haven't provided an example), this looks an awful lot 
> like you're taking something where you already have all of the information 
> you want in a list, and turning it into three lists. Is there a reason you 
> can't just use user_find.json.result.result directly?
>
> On Tuesday, October 5, 2021 at 2:28:09 PM UTC-4 lift...@gmail.com wrote:
>
>> I'm querying our FreeIPA server for user information.  What I need is 
>> there UID, GID, and Home directory.  I can get those individually, but how 
>> can I set a fact that combines all of these items?  Here's the 3 separate 
>> facts, I just can't figure out how to have an array of them:
>>
>>   - name: Set User facts
>> set_fact:
>>   user_uid: "{{ user_find.json.result | json_query('result[].uid[]') 
>> }}"
>>   user_gid: "{{ user_find.json.result | 
>> json_query('result[].gidnumber[]') }}"
>>   user_list: "{{ user_find.json.result | 
>> json_query('result[].homedirectory[]') }}"
>>
>> Any ideas?
>> Harry
>>
>

-- 
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/00264fe9-de8b-41ef-94f9-4dbbfa3b8f61n%40googlegroups.com.


[ansible-project] Exclude Server From Task

2021-10-06 Thread 'Jitender J' via Ansible Project
Hi Team ,

I am running connection check on specific port on servers which i have 
comma seperated  in extra var "Nodes"
it is running fine but we have all server in inventory so server trying to 
check connection on itself as well, 

i  want to exclude the node so that it won't attempt connection check to 
itself 

it tried with below but it is only works for single hosts not for comma 
separated list 

-hosts: !{{ Nodes }}"

-- 
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/de46b903-76ff-4932-b0cf-11388b8037c2n%40googlegroups.com.


[ansible-project] ansible-test : ansible vault

2021-10-06 Thread David Milaveau
Hello, i use ansible-test to test my collection, it's works but i have a 
question.
I have some secrets in my scenarios, i use environment variables to use 
secret.
I want to store my secrets in my vars file and use ansible-vault to crypt 
them.

I configure ansible.cfg to define may vault information, it work when i 
launch some playbook but when i launch ansible-test it's not working and i 
don't know how to configure ansible vault in ansible-test flow :(

Thanks a lot for your help.

David.

-- 
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/1ed09581-2684-48cc-a6ca-937361d99757n%40googlegroups.com.