Re: [ansible-project] Unable to read variable in a loop using include_vars.

2020-03-02 Thread Dick Visser
Can you tell what is the big picture? What task is this intended for? On Tue, 3 Mar 2020 at 05:43, Shifa Shaikh wrote: > Below is my playbook which loads variables and passes it to ls command on > remote hosts. > >- name: Load repository > include_vars: >file="{{ playbook_dir

Re: [ansible-project] Simple Math with String to Int

2020-03-02 Thread Martin Krizek
On Tue, Mar 3, 2020 at 3:15 AM M F wrote: > > Hi All, > > Im having trouble with setting a fact, doing some math, and having the result > be an INT > > To start, i set the base Var > > set_fact: SOMENUMBER = 8 > > Ansible stores this value as a String > > Later, i need to divide that number by 2

Re: [ansible-project] Facing issue with URI module

2020-03-02 Thread Himanshu Pupneja
Hi Vishal, Does it make any difference in proxy when it is working fine with postman and curl and not with URI module? > >> -- 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,

Re: [ansible-project] Simple Math with String to Int

2020-03-02 Thread Vladimir Botka
On Mon, 2 Mar 2020 18:14:41 -0800 (PST) M F wrote: > I am having to resort to doing the following to get my answer of 4 > > set_fact: myvar = "{{ ((SOMENUMBER|int) / 2)|replace('.0','') }}" > > Is there a better way to take a single integer stored as a string, and > perform math and output an

[ansible-project] Unable to read variable in a loop using include_vars.

2020-03-02 Thread Shifa Shaikh
Below is my playbook which loads variables and passes it to ls command on remote hosts. - name: Load repository include_vars: file="{{ playbook_dir }}/vars/listing.yml" name=user1 - set_fact: allinonecmd: "{{ allinonecmd | default('') + 'ls -ltr ' + item.path

[ansible-project] Simple Math with String to Int

2020-03-02 Thread M F
Hi All, Im having trouble with setting a fact, doing some math, and having the result be an INT To start, i set the base Var set_fact: SOMENUMBER = 8 Ansible stores this value as a String Later, i need to divide that number by 2 and get the result as an INT set_fact: myvar = "{{ SOMENUMBER

[ansible-project] Re: Swapping credentials

2020-03-02 Thread Dave York
I think you got it figured out Jordan. I tried with a object that didn't previously exist and it worked. I've been manually deleting the old computer objects beforehand, but I dont think I've been giving it enough time to replicate (our AD structure is messy/slow right now) I'll probably work

Re: [ansible-project] Retrieving a document to a unique name?

2020-03-02 Thread Vladimir Botka
On Mon, 2 Mar 2020 14:41:28 -0600 Mike Eggleston wrote: > I will write a program that looks for network devices on its local network > and created a report of the findings. That’s easy. Using Ansible to push > out the program and execute the program is easy. But how do I pull the > report back

[ansible-project] -u not being set when running ad-hoc ansible run?

2020-03-02 Thread John Miller
Hello everyone, I'm trying to run the following ad hoc ansible command to run the date command remotely against an IP camera running Linux: myuser@myhost:$ ansible camera.site.example.org -i /path/to/inventory -u root -k -m raw -a date and receiving the following error: camera.site.example.org

Re: [ansible-project] Sum a list of items received

2020-03-02 Thread Kai Stian Olstad
On Mon, Mar 02, 2020 at 01:26:28PM -0800, harry devine wrote: > Is there a "not equal to" jinja filter? All of the documentation I find > shows there's an 'equalto' but I can't seem to find any "no equalto" > equivalent. Even a greater than would work but I can't find anything like > that

Re: [ansible-project] Sum a list of items received

2020-03-02 Thread harry devine
Is there a "not equal to" jinja filter? All of the documentation I find shows there's an 'equalto' but I can't seem to find any "no equalto" equivalent. Even a greater than would work but I can't find anything like that either. Harry On Monday, March 2, 2020 at 11:49:09 AM UTC-5, Daniel

[ansible-project] Retrieving a document to a unique name?

2020-03-02 Thread Mike Eggleston
I will write a program that looks for network devices on its local network and created a report of the findings. That’s easy. Using Ansible to push out the program and execute the program is easy. But how do I pull the report back to a unique name? For example the report is created as

Re: [ansible-project] Sum a list of items received

2020-03-02 Thread Daniel Whitley
Hey Harry- That's insightful information about heal_info actually being a list of dicts. With that being said, while you CAN create a sum (one such way is something like {{ heal_info | map(attribute='no_of_entries') | map('int') | sum() }}), I still question if that is truly necessary. It sounds

Re: [ansible-project] How to replace all occurrences of '_' by '-' in all keys of a YAML complex object

2020-03-02 Thread jean-christophe manciot
There is an issue: the values of key-1, key-2 and key--3 are modified. It seems that the translation does not stop at the first encountered key colon. With ansible 2.9.5 from pip3, I get: "ansible_facts": { "my_list2": [ { "key-1": "$.*?/|\\^(){}+@[]&_-",

Re: [ansible-project] Sum a list of items received

2020-03-02 Thread harry devine
On Thursday, February 27, 2020 at 1:44:39 PM UTC-5, harry devine wrote: > > Hey Daniel! This stem from ticket #02582900. Since the stance from > Support is “we don’t debug playbooks”, I care here. > > Their suggestion was to make sure that no healing operation was going on, > stop Gluster,

[ansible-project] Python 2, Python 3, Conda, and ansible modules dnf and docker_container

2020-03-02 Thread Julien Cochennec
Hi, When using Docker CE on RHEL 7, installed whith Ansible (python 2.7 on target), docker_container module fails, saying I should install docker or docker-py, but I can't find a way to make it work. Python 2.7 being unsupported since January, I tried to switch to Python 3. The yum module says

Re: [ansible-project] Facing issue with URI module

2020-03-02 Thread Vishal Bobade
Do u have any reverse proxy configured please check that. On Mon, 2 Mar, 2020, 5:32 PM Dick Visser, wrote: > If you use try with -vvv then you can see the parameters with which > the module was invoked. > > On Mon, 2 Mar 2020 at 12:44, Himanshu Pupneja > wrote: > > > > I am facing issue in URI

Re: [ansible-project] Facing issue with URI module

2020-03-02 Thread Dick Visser
If you use try with -vvv then you can see the parameters with which the module was invoked. On Mon, 2 Mar 2020 at 12:44, Himanshu Pupneja wrote: > > I am facing issue in URI module, Could you please help me in this > It works well with postman and curl command. > > > > Below module is failing >

[ansible-project] Re: Facing issue with URI module

2020-03-02 Thread Himanshu Pupneja
Just FYI) values in both headers(URI module and curl) are similar On Monday, 2 March 2020 17:13:57 UTC+5:30, Himanshu Pupneja wrote: > > I am facing issue in URI module, Could you please help me in this > It works well with postman and curl command. > > > > Below module is failing > >

[ansible-project] Facing issue with URI module

2020-03-02 Thread Himanshu Pupneja
I am facing issue in URI module, Could you please help me in this It works well with postman and curl command. Below module is failing = - name: Connect to website uri: url: https://xyz.com/api.php headers: apikey: "xyz1" apitoken: