[ansible-project] how to use extends_documentation_fragment. getting error while using it

2020-05-20 Thread alok ranjan
Hi , I am new to ansible and this is my first ansible project. I am writing my own ansible modules which shares the same document acroos multiple modules which i need to develop. As per the ansible website https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_documenting.html we

[ansible-project] How to access group variables of the same host in different groups?

2020-05-20 Thread Durai Arasan
This is my ansible inventory file: [slurm_master] slurm-gpu-0 ansible_host=192.168.0.24 ansible_connection=local [slurm_compute] slurm-gpu-1 ansible_host=192.168.0.200 cpus=16 gpus=2 slurm-gpu-2 ansible_host=192.168.0.124 cpus=1 gpus=0 [slurm_partition_gpu]

[ansible-project] How to check process running time

2020-05-20 Thread Jenisha T
I need to kill a process if its older than 1 hour. I have process id how to check if its older than 1 hour -- 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 a

Re: [ansible-project] How to check process running time

2020-05-20 Thread Dick Visser
Hi How is this related to ansible? On Wed, 20 May 2020 at 09:29, Jenisha T wrote: > I need to kill a process if its older than 1 hour. I have process id how > to check if its older than 1 hour > > -- > You received this message because you are subscribed to the Google Groups > "Ansible Projec

[ansible-project] Passing data from ansible to service now table

2020-05-20 Thread Diyawary
Hi Team, I am sending data from ansible to service now using uri, data is passing to snow table but job status is not showing successful. I am getting "The read operation timed out" error ,Please suggest me how this can be resolved - name: Passing Data to Snow uri: url: "https://t

Re: [ansible-project] How to check process running time

2020-05-20 Thread Vladimir Botka
On Wed, 20 May 2020 00:29:19 -0700 (PDT) Jenisha T wrote: > I need to kill a process if its older than 1 hour. I have process id how > to check if its older than 1 hour There is no such Ansible module. It'll be necessary to use 'command'. For example, in Linux or *BSD, get elapsed time of the

[ansible-project] SharePointDSC parameter PsDscRunAsCredential with Kerberos

2020-05-20 Thread jn bedag
Hi According to the documentation, for SharePointDCS modules to work, we have to specify PsDscRunAsCredentials in win_dcs module: - name: set shell admin for farmaccount win_dsc: resource_name: SPShellAdmins IsSingleInstance: "Yes" MembersToInclude: "farmadmin_user" AllDatabases

[ansible-project] Response' object has no attribute '__getitem__ while running the lookup plugin 'hashi_vault'

2020-05-20 Thread Asmitha j.s
I'm using hashi_vault to retrieve secrets from HashiCorp’s vault in ansible playbook. - name: Return all secrets from a path set_fact: vault_result: "{{ lookup('hashi_vault', 'secret=secret/key:value token=token url=https://vaultaddress/ui/vault/secrets/secret/list/folder/subfolder

[ansible-project] Re: how to run an if/else test in a task

2020-05-20 Thread Jerome Meyer
Thanks for your reply and tips. So, has requested I've checked out the stdout message: I've received only message when the domain already joined, like: ok: [localhost] => { "ad_join_status.stdout_lines": [ " 3 server_name@domain", " 3 server_name@domain", " 3 ser

Re: [ansible-project] Re: how to run an if/else test in a task

2020-05-20 Thread Stefan Hornburg (Racke)
On 5/20/20 12:23 PM, Jerome Meyer wrote: > Thanks for your reply and tips. > So, has requested I've checked out the stdout message: > > I've received only message when the domain already joined, like: > > | > ok:[localhost]=>{ >     "ad_join_status.stdout_lines":[ >         "   3 server_name@doma

[ansible-project] OpenBSD network_cli

2020-05-20 Thread John D
I've installed the ansible pkg via pkg_add. I cannot get the ansible network_cli module to work in OpenBSD. Tried in version 6.6 and also 6.7 and both hang at "using connection plugin network_cli". It never times out, hangs here forever. I copied my ansible configuration files over to a fedora

Re: [ansible-project] Passing data from ansible to service now table

2020-05-20 Thread Stefan Hornburg (Racke)
On 5/20/20 9:57 AM, Diyawary wrote: > Hi Team, > > I am sending data from ansible to service now using uri, data is passing to > snow table but job status is not showing > successful. > I am getting "The read operation timed out" error ,Please suggest me how this > can be resolved > - name: Pass

Re: [ansible-project] Passing data from ansible to service now table

2020-05-20 Thread Diyawary
Hi Racke, I have already increase the timeout but still getting the same error. "Status code was -1 and not [200]: 'The read operation timed out'" On Wednesday, 20 May 2020 07:35:52 UTC-5, Stefan Hornburg (Racke) wrote: > > On 5/20/20 9:57 AM, Diyawary wrote: > > Hi Team, > > > > I am sending

[ansible-project] Re: Passing data from ansible to service now table

2020-05-20 Thread Diyawary
On Wednesday, 20 May 2020 02:57:43 UTC-5, Diyawary wrote: > > Hi Team, > > I am sending data from ansible to service now using uri, data is passing > to snow table but job status is not showing successful. > I am getting "The read operation timed out" error ,Please suggest me how > this can be

Re: [ansible-project] Passing data from ansible to service now table

2020-05-20 Thread Diyawary
Please find the complete tasks out put- { "status": -1, "_ansible_no_log": false, "url": "https://test.service-now.com/api/eplc/table_update_integration/create";, "changed": false, "elapsed": 10, "content": "", "invocation": { "module_args": { "direc

Re: [ansible-project] Passing data from ansible to service now table

2020-05-20 Thread Stefan Hornburg (Racke)
On 5/20/20 3:52 PM, Diyawary wrote: > Please find the complete tasks out put- > { >     "status": -1, >     "_ansible_no_log": false, >     "url": > "https://test.service-now.com/api/eplc/table_update_integration/create";, >     "changed": false, >     "elapsed": 10, >     "content": "", >     "in

[ansible-project] Create list in playbook (Fortigate automation)

2020-05-20 Thread Luis Arizaga
Hi everybody, I'm using Ansible to automate Fortigate Firewalls provisioning and I'm having the following problems. 1. I have a playbook that first creates a couple of object addresses using one module (task Configure one fortinet address) 2. Then I want the playbook to pass a list wit

[ansible-project] CSV to JSON

2020-05-20 Thread shyam rpm
Hi, Is it possible to convert CSV file to JSON format using Ansible modules, I have searched for the modules have't found. Or else do we need to use any scripting language to achieve this powershell or python ? Thank you, Shyam. -- You received this message because you are subscribed to t

Re: [ansible-project] Response' object has no attribute '__getitem__ while running the lookup plugin 'hashi_vault'

2020-05-20 Thread vinoth kumar
Have you installed pip hashi vault module . I think you have to install the pip module for this connection. Check in hashi vault module page in official ansible document . In first few line you can see the requirements. Fix that it will work . On Wed 20. May 2020 at 12:02, Asmitha j.s wrote: > I

[ansible-project] Is it possible to use jinja withing Ansible playbook yml file

2020-05-20 Thread Aidan Wong
Hi Is it possible to write jinja "if" conditionals within a playbook like so? If not can someone suggest an alternative? - name: Deploy the VMs without an anti-affinity group. cs_instance: zone: "{{ cs_zone }}" api_region: "{{ cs_api_region | upper }}" display_name: "{{ item.insta

Re: [ansible-project] Is it possible to use jinja withing Ansible playbook yml file

2020-05-20 Thread Matt Martz
Not in that manner, you need to use a jinja within `service_offering` instead: service_offering: '{{ item.cs_instance|default(cs_template, true) }}' That will use cs_template if cs_instance is undefined or falsy On Wed, May 20, 2020 at 1:42 PM Aidan Wong wrote: > Hi > > Is it possible to write

Re: [ansible-project] CSV to JSON

2020-05-20 Thread Antony Stone
On Wednesday 20 May 2020 at 20:07:50, shyam rpm wrote: > Hi, > > Is it possible to convert CSV file to JSON format using Ansible modules, Thsi really sounds like the wrong tool for the job, to me. > Or else do we need to use any scripting language to achieve this powershell > or python ? I've

[ansible-project] loop after loop conditional

2020-05-20 Thread Jerry Jerry
Trying to check if a user exists locally and if true, check to see if it has sudo rights. I can't seem to process the second loop. I tried using out.results.item but error: fatal: [hostname]: FAILED! => {"msg": "'list object' has no attribute 'item'"} --- - hosts: all gather_facts: no be

[ansible-project] User authentication with LDAP

2020-05-20 Thread Johnny Medlock
Hello, I am writing to inquire some information in regards to User Permission management with LDAP authentication. I have searched around and have found conflicting answers. I currently have an Ansible AWX 2.9.5 environment stood up on a CentOS 8 VM and am wanting to integrate LDAP authenticat

[ansible-project] Re: SharePointDSC parameter PsDscRunAsCredential with Kerberos

2020-05-20 Thread Jordan Borean
Unfortunately no, the DSC engine requires explicit username and password and cannot be configured to run using an existing access token. It is probably needed because the DSC engine runs each task as the SYSTEM account so any network authentication will appear as it came from the AD computer ac

Re: [ansible-project] loop after loop conditional

2020-05-20 Thread Dick Visser
You forgot the output. Also, what is your high level goal. Why do you need to know if a user exists and has sudo permission. On Wed, 20 May 2020 at 21:21, Jerry Jerry wrote: > Trying to check if a user exists locally and if true, check to see if it > has sudo rights. I can't seem to process the

Re: [ansible-project] loop after loop conditional

2020-05-20 Thread Jerry Jerry
My bigger question is how to run a loop with with_items then process the output in the second play. The objective is to see if user1, user2, user3 exist locally make sure they have sudo rights. when my play tries to process out.results.item: - name: check if existing user is in sudoers

[ansible-project] Re: loop after loop conditional

2020-05-20 Thread Jerry Jerry
If I leave the playbook like this: - name: check if existing user is in sudoers command: grep {{ item }} /etc/sudoers with_items: "{{ out.results }}" register: message it attempts to run a grep on all output from out.results. On Wednesday, May 20, 2020 at 3:21:31 PM UT

[ansible-project] Provide select access to future objects

2020-05-20 Thread jitendra kumar singh
Hi, I am using ansible-playbook to create a dev user which should have only read access in PostgreSQL but after creating dev user, the user is able to perform DML commands within his user scope and also not able to read to future objects or tables means the dev user can't access the tables creat

Re: [ansible-project] User authentication with LDAP

2020-05-20 Thread Michael Ströder
On 5/20/20 9:30 PM, Johnny Medlock wrote: > I am writing to inquire some information in regards to User Permission > management with LDAP authentication. I have searched around and have > found conflicting answers. > > I currently have an Ansible AWX 2.9.5 environment stood up on a CentOS 8 > VM a

Re: [ansible-project] Re: copy restricted files from server A to B

2020-05-20 Thread Laci
Thank you guys! It worked, this is the playbook for anyone having the same issues. At the end I added a test to remove files from buffer *serverA% ls -l* *-rw---. 1 root 6 May 20 16:11 ezaz.txt* - hosts: serverA gather_facts: no tasks: - name: fetch test file fetch: src=/tmp/ez

Re: [ansible-project] loop after loop conditional

2020-05-20 Thread Dick Visser
On Wed, 20 May 2020 at 21:58, Jerry Jerry wrote: > My bigger question is how to run a loop with with_items then process the > output in the second play. > > The objective is to see if user1, user2, user3 exist locally make sure > they have sudo rights. > See https://docs.ansible.com/ansible/late

Re: [ansible-project] Provide select access to future objects

2020-05-20 Thread Dick Visser
On Wed, 20 May 2020 at 22:51, jitendra kumar singh < jitendrakrsingh...@gmail.com> wrote: > Hi, > I am using ansible-playbook to create a dev user which should have only > read access in PostgreSQL but after creating dev user, the user is able to > perform DML commands within his user scope and al

Re: [ansible-project] CSV to JSON

2020-05-20 Thread Dominik Bessler
Take a Look at Miller. https://github.com/johnkerl/miller On Wed, May 20, 2020 at 15:06 Antony Stone < antony.st...@ansible.open.source.it> wrote: > On Wednesday 20 May 2020 at 20:07:50, shyam rpm wrote: > > > Hi, > > > > Is it possible to convert CSV file to JSON format using Ansible modules, >

Re: [ansible-project] loop after loop conditional

2020-05-20 Thread Jerry Jerry
This almost works but I cant make it skip when the grep root /etc/password fails. I dont understand how to access out.rc when using a loop. My when statement doesnt work. I am not as interested in this task as I am pulling rc from a loop then using it in the next loop. --- - hosts: all gather

Re: [ansible-project] CSV to JSON

2020-05-20 Thread Brian Coca
As already mentioned, Ansible is not the best tool for data conversion ... however, the csv lookup and a template with the to_json filter CAN do the work . -- -- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubs

[ansible-project] Re: vmotion condition

2020-05-20 Thread Mani
Hi David, Thank you for the info. On Tuesday, 19 May 2020 18:38:54 UTC+5:30, David Foley wrote: > > Hi Mani, > > > Your best bet would be to use PowerCLI, > https://communities.vmware.com/thread/539904?start=15&tstart=0 > -- You received this message because you are subscribed to the Google Gr

[ansible-project] ERROR! 'retries' is not a valid attribute for a TaskInclude

2020-05-20 Thread Shifa Shaikh
My requirement is to run the script stop-all as many times (5 retries) until the output of ps -fu user1 |wc -l becomes less than 2. I wrote the below ansible playbook for the same: cat stop.yml - hosts: dest_nodes tasks: - name: Start service include_tasks: "{{ playbook-dir

Re: [ansible-project] How to access group variables of the same host in different groups?

2020-05-20 Thread Brian Coca
They don't exist outside inventory, all variables are either per host or per play object, inventory always gets flattened to the host, so if a host is part of 2 groups and both have the same variable, you will only get 1 value https://docs.ansible.com/ansible/latest/user_guide/intro_inventory.html

Re: [ansible-project] how to use extends_documentation_fragment. getting error while using it

2020-05-20 Thread Brian Coca
you are missing `options:` in your fragment, you are listing them directly at top level which won't be understood. ``` class ModuleDocFragment(object): DOCUMENTATION = r''' options: array_ip: description: - "The storage system IP address." required: True array_passw

Re: [ansible-project] Re: Exit with_items loop after first success?

2020-05-20 Thread Brian Coca
It is something i would like to add as part of a full looping revamp https://github.com/ansible/proposals/issues/140 -- -- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receivi

Re: [ansible-project] Getting the version of an Ansible Galaxy role

2020-05-20 Thread Brian Coca
nothing internal, you'll have to shell out to use `ansilbe-galaxy info --offline` -- -- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email

Re: [ansible-project] ERROR! 'retries' is not a valid attribute for a TaskInclude

2020-05-20 Thread Stefan Hornburg (Racke)
On 5/21/20 4:48 AM, Shifa Shaikh wrote: > My requirement is to run the script stop-all as many times (5 retries) until > the output of ps -fu user1 |wc -l becomes > less than 2. > > I wrote the below ansible playbook for the same: > > cat stop.yml > > | >   -hosts:dest_nodes >     tasks: >