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

2020-05-21 Thread Asmitha j.s
I'm refering to https://docs.ansible.com/ansible/latest/plugins/lookup/hashi_vault.html document. It requires hvac (python library). and i have already installed it. Im trying connect by github token. On Thursday, May 21, 2020 at 12:00:05 AM UTC+5:30, vinoth kumar wrote: > > > Have you

[ansible-project] Handling password prompt -- IOS_command module

2020-05-21 Thread rajthecomputerguy
Hi Team, How to handle password prompt when doing scp file transfer. Actually server is generating banner message along with password prompt. Please help how to resolve the issue. - name: transfer the image ios_command: commands: - command: 'copy scp://{{ ansible_user }}@{{

Re: [ansible-project] Comparing two files registering the difference

2020-05-21 Thread Stefan Hornburg (Racke)
On 5/21/20 9:01 AM, Sivakumar Saravanamuthu wrote: > hi > > I have requirement to compare local file with remote file. Example I have a > copy of standard /etc/hosts  file and I need > to compare that file with remote host /etc/hosts file to check the > difference. If there is difference it

[ansible-project] Comparing two files registering the difference

2020-05-21 Thread Sivakumar Saravanamuthu
hi I have requirement to compare local file with remote file. Example I have a copy of standard /etc/hosts file and I need to compare that file with remote host /etc/hosts file to check the difference. If there is difference it should register it and proceed with next task. I tried various

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

2020-05-21 Thread Harshavardhan Reddy A
Here you go... https://www.reddit.com/r/ansible/comments/di4o6h/how_to_break_the_loop/ On Thursday, December 11, 2014 at 10:41:55 AM UTC-5, Hugh Saunders wrote: > > Hi All, > I've been asking on IRC, twitter > , and github >

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

2020-05-21 Thread Stefan Hornburg (Racke)
On 5/21/20 11:41 AM, Diyawary wrote: > Hi Rack, > > As you suggested I have increased the timeout to 20 min but still getting the > same error and task stops before the > timeout value. > So it is most likely that the API causes your problems. Please investigate at that end. Regards

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

2020-05-21 Thread Stefan Hornburg (Racke)
On 5/21/20 12:20 PM, Diyawary wrote: > thanks Rack one more thing I have observed sometimes i am getting  belwo > connection failure and some time  Read > operation timeout error. > Status code was -1 and not [200]: Connection failure: connection was closed > before a valid response was

[ansible-project] Re: bad PATH when running "apt" module

2020-05-21 Thread Karol Szczeciński
Try using: ssh user@host -t "sudo bash -l -c 'echo \$PATH'" As per: https://superuser.com/questions/306530/run-remote-ssh-command-with-full-login-shell -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and

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

2020-05-21 Thread Diyawary
Thanks Racke for you help. On Thursday, 21 May 2020 05:33:22 UTC-5, Stefan Hornburg (Racke) wrote: > > On 5/21/20 12:20 PM, Diyawary wrote: > > thanks Rack one more thing I have observed sometimes i am getting belwo > connection failure and some time Read > > operation timeout error. > >

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

2020-05-21 Thread Diyawary
Hi Rack, As you suggested I have increased the timeout to 20 min but still getting the same error and task stops before the timeout value. On Wednesday, 20 May 2020 10:08:16 UTC-5, Stefan Hornburg (Racke) wrote: > > On 5/20/20 3:52 PM, Diyawary wrote: > > Please find the complete tasks out

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

2020-05-21 Thread Diyawary
thanks Rack one more thing I have observed sometimes i am getting belwo connection failure and some time Read operation timeout error. Status code was -1 and not [200]: Connection failure: connection was closed before a valid response was received: ''" could you please suggest what the

[ansible-project] Re: WINRM CONNECTION ERROR: function takes at most 2 arguments (3 given)

2020-05-21 Thread Kiran Kumar
Anyways i did below 1017 21/05/20 17:47:19 yum remove python-kerberos-1.1-15.el7.x86_64 1018 21/05/20 17:49:29 rpm -qa|grep -i kerb 1019 21/05/20 17:49:43 pip install pykerberos 1020 21/05/20 17:49:55 pip install requests-kerberos 1021 21/05/20 17:50:05 ansible windows -m win_ping

Re: [ansible-project] win_domain_computer module

2020-05-21 Thread Ramakrishnan M
I tried that too, if I put State present, it’s asking for ou parameter is required. I want to retrieve it’s OU location. It just keep on asking one by one parameters as required. The documentation page for this module only says name is mandatory parameter, rest is optional. Get-ADConputer will

Re: [ansible-project] Comparing two files registering the difference

2020-05-21 Thread Sivakumar Saravanamuthu
I resolved it tasks: - name: copy hosts for validation file copy: src: ./templates/hosts dest: /tmp/hosts owner: root group: root mode: '0644' backup: yes - name: compare md5 local copy host file stat: path: /tmp/hosts

[ansible-project] Re: WINRM CONNECTION ERROR: function takes at most 2 arguments (3 given)

2020-05-21 Thread Kiran Kumar
Thanks for the reply You mean : yum remove -y krb5-devel krb5-libs krb5-workstation And re-run *pip install pykerberos* On Thursday, May 21, 2020 at 5:37:40 PM UTC-7, Jordan Borean wrote: > > The issue here is the kerberos library you have installed is either too > old or

Re: [ansible-project] win_domain_computer module

2020-05-21 Thread Jordan Borean
According to the docs, dns_hostname is Required when *state=present*. > So you need to have this set for the module to work. Thanks Jordan -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving

[ansible-project] Re: WINRM CONNECTION ERROR: function takes at most 2 arguments (3 given)

2020-05-21 Thread Kiran Kumar
I used a fresh box & finally did below & wored yum install -y python3-devel pip install pykerberos Thanks @Jordan On Thursday, May 21, 2020 at 5:37:40 PM UTC-7, Jordan Borean wrote: > > The issue here is the kerberos library you have installed is either too > old or incompatible with what

[ansible-project] win_domain_computer module

2020-05-21 Thread Ramakrishnan M
Hi Guys, Why would I get missing parameter error when I use win_domain_computer module when the parameter is set as optional. win_domain_computer: name: '{{ hostname }}' register: computer_account Errors as... FAILED! => { "changed": false, "msg": "Get-AnsibleParam: Missing

Re: [ansible-project] win_domain_computer module

2020-05-21 Thread Ramakrishnan M
All I need is to get properties of a domain computer- Get-ADComputer. Ansible equivalent win_domain_computer. Sent from my iPhone > On May 21, 2020, at 17:09, David Foley wrote: > > If your looking at doing work on Active Directory; you may need to switch > over to "win_domain_membership" >

[ansible-project] Re: WINRM CONNECTION ERROR: function takes at most 2 arguments (3 given)

2020-05-21 Thread Kiran Kumar
Shall i do below yum remove python-kerberos-1.1-15.el7.x86_64 = Package

Re: [ansible-project] expected , but found '-'

2020-05-21 Thread thomas okonkwo
I ran into this error earlier today and i found the easiest way to fix problems like these and other indentation problem in yaml config file. check out www.yamllint.com **How it works**Open the URL and copy your yaml configuration file into the blank page and paste (of course, you can tweak

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

2020-05-21 Thread T. JENISHA
It worked . Thankyou Best Regards Jenisha T On Wed, 20 May 2020 at 13:56, Vladimir Botka wrote: > 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

[ansible-project] Re: WINRM CONNECTION ERROR: function takes at most 2 arguments (3 given)

2020-05-21 Thread Jordan Borean
The issue here is the kerberos library you have installed is either too old or incompatible with what requests-kerberos requires. Uninstall both kerberos and pykerberos and install just pykerberos. You may want to update requests-kerberos as well as 0.7.0 is quite old. -- You received this

[ansible-project] win_domain_computer module

2020-05-21 Thread David Foley
If your looking at doing work on Active Directory; you may need to switch over to "win_domain_membership" -- 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] WINRM CONNECTION ERROR: function takes at most 2 arguments (3 given)

2020-05-21 Thread Kiran Kumar
Hi, Goal : Use Linux centos 7.8 server with ansible version 2.9.7 to manage windows 2019 server Error : WINRM CONNECTION ERROR: function takes at most 2 arguments (3 given) ### Ansible Version : ansible 2.9.7 config file = /etc/ansible/ansible.cfg

[ansible-project] Process Monitoring in Ansible

2020-05-21 Thread Jenisha T
Is there a way in Ansible to find if process complete. I m running an os-copy process. How to check if the process completed. The hard way is to wait for 2hrs and read logs to find the word in the log is there a sentence "OS copy success". Is there any elegant way to do it in ansible check if

Re: [ansible-project] how to run specific task locally on ansible ?

2020-05-21 Thread vinod devops
Thank you! On Thursday, May 21, 2020 at 10:07:43 AM UTC-5, Stefan Hornburg (Racke) wrote: > > On 5/21/20 5:00 PM, vinod devops wrote: > > there are no of tasks in play book, > > > > all tasks are running remotely on host. I want to run only one task > locally. > > > > > > How do I do

Re: [ansible-project] how to run specific task locally on ansible ?

2020-05-21 Thread vinod devops
Thank you. On Thursday, May 21, 2020 at 10:36:47 AM UTC-5, gali.suneel wrote: > > You can use: > > > local_action or delegate_to: localhost at task level. > > -Suneel > > > Sent from my Samsung Galaxy smartphone. > > > Original message > From: Vivek Kothawale > > Date:

Re: [ansible-project] Process Monitoring in Ansible

2020-05-21 Thread Vladimir Botka
On Thu, 21 May 2020 17:59:15 -0700 (PDT) Jenisha T wrote: > Is there a way in Ansible to find if process complete. I m running an > os-copy process. How to check if the process completed. The hard way is to > wait for 2hrs and read logs to find the word in the log is there a > sentence "OS

Re: [ansible-project] win_domain_computer module

2020-05-21 Thread Jordan Borean
> The documentation page for this module only says name is mandatory parameter, rest is optional. There is only 1 option that is always required 'name', but if you read the description you can see that there are multiple others that are required when 'state=present'. > I want to retrieve it’s

[ansible-project] Re: problem passing var between tasks.

2020-05-21 Thread David Foley
Another way I know is to send the reg to the stdout and cat that stdout into the other playbook. similar to outputting to the File, but if the API Value is big you may be better off with the Text File. register: test - debug: msg="{{test.stdout}}" tasks: - shell: cat

Re: [ansible-project] Re: problem passing var between tasks.

2020-05-21 Thread Jeremy Hobbs
Suneel, I attempted your solution, but it didn't work with the way I was setting up the workflow. Dick, I tried the Dummy host and it worked perfectly. Thank you for your responses. Jeremy On Thursday, May 21, 2020 at 11:12:22 AM UTC-5, Dick Visser wrote: > > Not tried yet, but this

[ansible-project] Re: Handling password prompt -- IOS_command module

2020-05-21 Thread rajthecomputerguy
Any help would be appreciated. On Thursday, May 21, 2020 at 1:36:15 PM UTC+5:30, rajthecomputerguy wrote: > > Hi Team, > > How to handle password prompt when doing scp file transfer. Actually > server is generating banner message along with password prompt. Please help > how to resolve the

[ansible-project] Re: problem passing var between tasks.

2020-05-21 Thread David Foley
Why two Playbook ? But either way, Copy the Reg to a Local Json File Then in your Second Playbook Just read in the JSON File name: Read Json File shell: cat Info.json register: json_file (json_file.stdout | from_json).VALUE -- You received this message because you are subscribed

[ansible-project] Re: problem passing var between tasks.

2020-05-21 Thread Jeremy Hobbs
I simplified the playbook for the post. But, this specific call is used by many different playbooks. So instead of having to update each playbook if it changes, I want to abstract it out. Writing to a file seems a pretty crappy workaround. Is there not a way to pass variables between the

Re: [ansible-project] Re: problem passing var between tasks.

2020-05-21 Thread Dick Visser
Not tried yet, but this describes a dummy host: https://stackoverflow.com/a/47811099/12731515 On Thu, 21 May 2020 at 17:56, Jeremy Hobbs wrote: > > I simplified the playbook for the post. But, this specific call is used by > many different playbooks. So instead of having to update each

Re: [ansible-project] Re: problem passing var between tasks.

2020-05-21 Thread Suneel Gali
can you try to pass the variable to include_tasks? *Reference*: https://docs.ansible.com/ansible/devel/porting_guides/porting_guide_2.7.html#include-tasks-import-tasks-inline-variables -Suneel On Thu, May 21, 2020 at 9:26 PM Jeremy Hobbs wrote: > I simplified the playbook for the post. But,

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

2020-05-21 Thread Suneel Gali
" ERROR! 'retries' is not a valid attribute for a TaskInclude" Can we use "until" against include_tasks? Its like we are inserting the same tasks multiple times in the playbook ... Can you use until condition with the actual task itself and check? On Thu, May 21, 2020 at 6:22 PM Dick

Re: [ansible-project] Comparing two files registering the difference

2020-05-21 Thread Brian Coca
If you want to 'see the diff' , just use copy in check and diff mode -- -- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to

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

2020-05-21 Thread Dick Visser
This sounds all very much like pushing a round peg into a square hole. I would focus on fine tuning some systemd unit files and their dependencies, instead of the carpet stopping/starting approach. On Thu, 21 May 2020 at 14:46, Shifa Shaikh wrote: > @Stefan Our service involves a set of

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

2020-05-21 Thread Shifa Shaikh
@Stefan Our service involves a set of processes thus, the start script invokes those several processes and hence the need to count the number of processes using `wc -l` to determine if the service (not the process) is running or not. On Thursday, May 21, 2020 at 8:18:56 AM UTC+5:30, Shifa

Re: [ansible-project] how to run specific task locally on ansible ?

2020-05-21 Thread gali.suneel
You can use:local_action or delegate_to: localhost  at task level.-SuneelSent from my Samsung Galaxy smartphone. Original message From: Vivek Kothawale Date: 21/05/2020 20:35 (GMT+05:30) To: ansible-project@googlegroups.com Subject: Re: [ansible-project] how to run specific

[ansible-project] problem passing var between tasks.

2020-05-21 Thread Jeremy Hobbs
I have a problem passing a variable between playbooks that are chained together. Any thoughts? Playbook - audit_hardware_inventory.yml --- - name: "Compare API to actual" hosts: "all" gather_facts: "no" connection: "local" tasks: - name: "INCLUDE TASK: GET JSON WEB TOKEN FROM API"

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

2020-05-21 Thread David Foley
Is the Body Correct ? and that you aren't missing any JSON values? -- 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] how to run specific task locally on ansible ?

2020-05-21 Thread vinod devops
there are no of tasks in play book, all tasks are running remotely on host. I want to run only one task locally. How do I do that ? Thanks -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop

Re: [ansible-project] how to run specific task locally on ansible ?

2020-05-21 Thread Vivek Kothawale
Hi Use tags to achieve this. Thanks, Vivek On Thu, May 21, 2020, 8:30 PM vinod devops wrote: > there are no of tasks in play book, > > all tasks are running remotely on host. I want to run only one task > locally. > > > How do I do that ? Thanks > > > -- > You received this message because

Re: [ansible-project] how to run specific task locally on ansible ?

2020-05-21 Thread Stefan Hornburg (Racke)
On 5/21/20 5:00 PM, vinod devops wrote: > there are no of tasks in play book,  >    > all tasks are running remotely on  host. I want to run only one task locally. > > > How do I do that ? Thanks > - name: ... delegate_to: localhost You may also add the following: run_once: true