# Ansible Project

**URL:** https://forum.ansible.com/c/archives/ansible-project/30.md?page=138

[Latest](https://forum.ansible.com/latest.md) · [Categories](https://forum.ansible.com/categories.md) · [Tags](https://forum.ansible.com/tags.md)

**Page:** 139

---

## [Need win\_shell to run with elevated privileges](https://forum.ansible.com/t/need-win-shell-to-run-with-elevated-privileges/32411)

<div class="topic-metadata">

**Author:** [@Arielle\_Adams](https://forum.ansible.com/u/Arielle_Adams)\
**Replies:** 1\
**Last updated:** [March 6, 2020, 10:03pm UTC](https://forum.ansible.com/t/need-win-shell-to-run-with-elevated-privileges/32411 "2020-03-06T22:03:32Z")

</div>

Hi, I’m unable to get win\_shell to run with elevated “run as admin” privileges. I have the details posted below in this issue: https://github.com/ansible/ansible/issues/68086 As stated, I tried to see if it could be a…

---

## [Retrieving a document to a unique name?](https://forum.ansible.com/t/retrieving-a-document-to-a-unique-name/32368)

<div class="topic-metadata">

**Author:** [@Mike\_Eggleston](https://forum.ansible.com/u/Mike_Eggleston)\
**Replies:** 2\
**Last updated:** [March 6, 2020, 5:52pm UTC](https://forum.ansible.com/t/retrieving-a-document-to-a-unique-name/32368 "2020-03-06T17:52:11Z")

</div>

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 r…

---

## [Unable to  access variables from host\_vars dir however can access the same variables when specified in roles/defaults/mail.yml](https://forum.ansible.com/t/unable-to-access-variables-from-host-vars-dir-however-can-access-the-same-variables-when-specified-in-roles-defaults-mail-yml/32382)

<div class="topic-metadata">

**Author:** [@Vishal\_Bobade](https://forum.ansible.com/u/Vishal_Bobade)\
**Replies:** 5\
**Last updated:** [March 6, 2020, 4:05pm UTC](https://forum.ansible.com/t/unable-to-access-variables-from-host-vars-dir-however-can-access-the-same-variables-when-specified-in-roles-defaults-mail-yml/32382 "2020-03-06T16:05:00Z")

</div>

I have created multiple inventory files specific to dev , qa etc env. under inventory dir. inventory/dev.domain.net.yml Any suggestions, would help as I am stucked here…

---

## [Calling powershell function via Ansible](https://forum.ansible.com/t/calling-powershell-function-via-ansible/32396)

<div class="topic-metadata">

**Author:** [@kzersatz](https://forum.ansible.com/u/kzersatz)\
**Replies:** 3\
**Last updated:** [March 6, 2020, 3:51pm UTC](https://forum.ansible.com/t/calling-powershell-function-via-ansible/32396 "2020-03-06T15:51:00Z")

</div>

I have a function, it works perfectly if I run it directly from my target server. \` powershell.exe -ExecutionPolicy ByPass -file “C:\\Scripts\\USERNAME\\dfsadd\_func.ps1”; dfsadd -junction Apps -obj\_name toast -prd\_vserver…

---

## [Using vars\_files](https://forum.ansible.com/t/using-vars-files/32406)

<div class="topic-metadata">

**Author:** [@Brandon\_Daly](https://forum.ansible.com/u/Brandon_Daly)\
**Replies:** 2\
**Last updated:** [March 6, 2020, 2:31pm UTC](https://forum.ansible.com/t/using-vars-files/32406 "2020-03-06T14:31:32Z")

</div>

I have a play that is creating yaml for each of my hosts and this is stored in './host\_vars/{{ inventory\_hostname }}/l3vpn.yml I then have a second play in which I wish to use this yaml. both are called from another pl…

---

## [Ansible Split JSON Return](https://forum.ansible.com/t/ansible-split-json-return/32392)

<div class="topic-metadata">

**Author:** [@David\_Foley](https://forum.ansible.com/u/David_Foley)\
**Replies:** 7\
**Last updated:** [March 6, 2020, 1:38pm UTC](https://forum.ansible.com/t/ansible-split-json-return/32392 "2020-03-06T13:38:03Z")

</div>

Have the Following Playbook Which Returns the following ok: \[localhost\] =\> { “mdb.json”: \[ { “mac-address”: “xx:xx:xx:xx:xx” } \] }

---

## [Ansible "failed\_when" not working as desired](https://forum.ansible.com/t/ansible-failed-when-not-working-as-desired/32405)

<div class="topic-metadata">

**Author:** [@Rakesh\_Parida](https://forum.ansible.com/u/Rakesh_Parida)\
**Replies:** 2\
**Last updated:** [March 6, 2020, 1:28pm UTC](https://forum.ansible.com/t/ansible-failed-when-not-working-as-desired/32405 "2020-03-06T13:28:37Z")

</div>

Hi, I have a task as follows: hosts: nodes gather\_facts: true tasks: name: CurlCP Status shell: “curl -Is -m 1 http://localhost:9113/cp/healthcheck” register: cp\_status failed\_when: “‘200 OK’ not in cp\_status.std…

---

## [How to incorporate if else statement in Jinja template.](https://forum.ansible.com/t/how-to-incorporate-if-else-statement-in-jinja-template/32404)

<div class="topic-metadata">

**Author:** [@Shifa\_Shaikh](https://forum.ansible.com/u/Shifa_Shaikh)\
**Replies:** 14\
**Last updated:** [March 6, 2020, 1:01pm UTC](https://forum.ansible.com/t/how-to-incorporate-if-else-statement-in-jinja-template/32404 "2020-03-06T13:01:10Z")

</div>

Here is my variable file \` layers: name: APP things: cactus lotus jasmine rose name: WAS things: mango apple \` Below is my jinja template file: \` {% for layer in layers %} {% for item …

---

## [Ansible 2.8 hanging with bash command](https://forum.ansible.com/t/ansible-2-8-hanging-with-bash-command/32394)

<div class="topic-metadata">

**Author:** [@John1](https://forum.ansible.com/u/John1)\
**Replies:** 2\
**Last updated:** [March 6, 2020, 12:41pm UTC](https://forum.ansible.com/t/ansible-2-8-hanging-with-bash-command/32394 "2020-03-06T12:41:16Z")

</div>

I have a task that searches logs for specific errors in various logs (up to 7 days worth of logs). When searching through just one log I never had an issue, but when searching through the 7 logs (used a wildcard to accom…

---

## [Getting a message if register failed inside a task](https://forum.ansible.com/t/getting-a-message-if-register-failed-inside-a-task/32402)

<div class="topic-metadata">

**Author:** [@dudu.c](https://forum.ansible.com/u/dudu.c)\
**Replies:** 2\
**Last updated:** [March 6, 2020, 11:47am UTC](https://forum.ansible.com/t/getting-a-message-if-register-failed-inside-a-task/32402 "2020-03-06T11:47:09Z")

</div>

HI, I have a task that create a folder on HDFS storage. If the folder exists I wish to show a message - hosts: gw become: true become\_user: hdfs tasks: - name: create folder in HDFS shell: hadoop dfs -mk…

---

## [Convert list to string in rendered Jinja template](https://forum.ansible.com/t/convert-list-to-string-in-rendered-jinja-template/32403)

<div class="topic-metadata">

**Author:** [@Shifa\_Shaikh](https://forum.ansible.com/u/Shifa_Shaikh)\
**Replies:** 3\
**Last updated:** [March 6, 2020, 9:08am UTC](https://forum.ansible.com/t/convert-list-to-string-in-rendered-jinja-template/32403 "2020-03-06T09:08:12Z")

</div>

I have a variable files like below: \` layers: name: APP things: cactus lotus jasmine rose bgcolor: sky blue name: WAS things: mango apple bgcolor: yellow \` Below is my jinja templa…

---

## [Need help construct a complex HTML using Jinja template.](https://forum.ansible.com/t/need-help-construct-a-complex-html-using-jinja-template/32401)

<div class="topic-metadata">

**Author:** [@Shifa\_Shaikh](https://forum.ansible.com/u/Shifa_Shaikh)\
**Replies:** 0\
**Last updated:** [March 6, 2020, 2:31am UTC](https://forum.ansible.com/t/need-help-construct-a-complex-html-using-jinja-template/32401 "2020-03-06T02:31:22Z")

</div>

Experts Hi, I have a variable file that has a set of flowers, colors, and countries. \` cat vars/DASHBOARD\_vars.yaml

---

## [New Ansible release 2.8.10](https://forum.ansible.com/t/new-ansible-release-2-8-10/32400)

<div class="topic-metadata">

**Author:** [@Matt\_Clay1](https://forum.ansible.com/u/Matt_Clay1)\
**Replies:** 0\
**Last updated:** [March 5, 2020, 9:56pm UTC](https://forum.ansible.com/t/new-ansible-release-2-8-10/32400 "2020-03-05T21:56:20Z")

</div>

Hi all- we’re happy to announce that the general release of Ansible 2.8.10 is now available! How do you get it?

---

## [File operations failing on shared file system #67410](https://forum.ansible.com/t/file-operations-failing-on-shared-file-system-67410/32358)

<div class="topic-metadata">

**Author:** [@Stephen\_Gevers](https://forum.ansible.com/u/Stephen_Gevers)\
**Replies:** 8\
**Last updated:** [March 5, 2020, 8:40pm UTC](https://forum.ansible.com/t/file-operations-failing-on-shared-file-system-67410/32358 "2020-03-05T20:40:39Z")

</div>

I opened an issue that was closed because the developer believes the problem is a race condition that can’t be dealt with in code. I created a playbook where two hosts that both mount a shared file system test for the ex…

---

## [Build a file based on list only when another part of list matches ansible\_hostname](https://forum.ansible.com/t/build-a-file-based-on-list-only-when-another-part-of-list-matches-ansible-hostname/32397)

<div class="topic-metadata">

**Author:** [@John1](https://forum.ansible.com/u/John1)\
**Replies:** 1\
**Last updated:** [March 5, 2020, 8:35pm UTC](https://forum.ansible.com/t/build-a-file-based-on-list-only-when-another-part-of-list-matches-ansible-hostname/32397 "2020-03-05T20:35:17Z")

</div>

I need to create a file based on the output of the csv\_content variable. Specifically I want to extract the ErrorMessage only, but the caveat is that I want only the errors associated with ansible\_hostname. That way on e…

---

## [Know if a variable come from extra\_vars](https://forum.ansible.com/t/know-if-a-variable-come-from-extra-vars/32373)

<div class="topic-metadata">

**Author:** [@Quentin\_Aveno](https://forum.ansible.com/u/Quentin_Aveno)\
**Replies:** 1\
**Last updated:** [March 5, 2020, 7:51pm UTC](https://forum.ansible.com/t/know-if-a-variable-come-from-extra-vars/32373 "2020-03-05T19:51:24Z")

</div>

Hi ! I think it's not possible, but is there a way to check than a variable came from extra\_vars and not from another location (inventory...) ?

---

## [Ansible deployng VM and transfering and execute shell script on remote host](https://forum.ansible.com/t/ansible-deployng-vm-and-transfering-and-execute-shell-script-on-remote-host/32386)

<div class="topic-metadata">

**Author:** [@Julio\_Cesar\_Caraca](https://forum.ansible.com/u/Julio_Cesar_Caraca)\
**Replies:** 4\
**Last updated:** [March 5, 2020, 6:59pm UTC](https://forum.ansible.com/t/ansible-deployng-vm-and-transfering-and-execute-shell-script-on-remote-host/32386 "2020-03-05T18:59:02Z")

</div>

Hi Guys, I got a playbook to deploy virtual machines and it´s working very well. And now I´m trying to transfer and execute a shell script during the deploy of virtual machine but I´m getting many issues when changing …

---

## [New Ansible releases 2.9.6 and 2.8.9](https://forum.ansible.com/t/new-ansible-releases-2-9-6-and-2-8-9/32390)

<div class="topic-metadata">

**Author:** [@Matt\_Clay1](https://forum.ansible.com/u/Matt_Clay1)\
**Replies:** 0\
**Last updated:** [March 5, 2020, 8:38am UTC](https://forum.ansible.com/t/new-ansible-releases-2-9-6-and-2-8-9/32390 "2020-03-05T08:38:30Z")

</div>

Hi all- we’re happy to announce that the general release of Ansible 2.9.6 and 2.8.9 are now available! How do you get it?

---

## [How to copy image files to IOS-XR device ?](https://forum.ansible.com/t/how-to-copy-image-files-to-ios-xr-device/32387)

<div class="topic-metadata">

**Author:** [@Mysimpia](https://forum.ansible.com/u/Mysimpia)\
**Replies:** 0\
**Last updated:** [March 4, 2020, 7:33pm UTC](https://forum.ansible.com/t/how-to-copy-image-files-to-ios-xr-device/32387 "2020-03-04T19:33:02Z")

</div>

Hi, there; In order to upgrade IOS-XR software, I need to copy IOS-XR image files to IOS-XR device. I was able to do it using scp from a Linux server CLI. However, I’d like to do it using Ansible playbook. Already trie…

---

## [Using GCP Creds in Ansible Tower](https://forum.ansible.com/t/using-gcp-creds-in-ansible-tower/32385)

<div class="topic-metadata">

**Author:** [@KDE](https://forum.ansible.com/u/KDE)\
**Replies:** 1\
**Last updated:** [March 4, 2020, 7:10pm UTC](https://forum.ansible.com/t/using-gcp-creds-in-ansible-tower/32385 "2020-03-04T19:10:26Z")

</div>

Hi, When using Ansible Tower, is it possible to interact with Google Cloud without needing to store credentials in a local JSON file? I can see there’s a google credential type although I’m struggling to find out how I…

---

## [AnsibleConnectionFailure: Name or service not known](https://forum.ansible.com/t/ansibleconnectionfailure-name-or-service-not-known/32384)

<div class="topic-metadata">

**Author:** [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Replies:** 2\
**Last updated:** [March 4, 2020, 6:07pm UTC](https://forum.ansible.com/t/ansibleconnectionfailure-name-or-service-not-known/32384 "2020-03-04T18:07:43Z")

</div>

Could you please state clearly ALL of the below: - What goal you are trying to achieve. - How you are doing this. - What problems you encounter. - Which command did you run, and what actual output did you get from t…

---

## [AnsibleConnectionFailure: Name or service not known](https://forum.ansible.com/t/ansibleconnectionfailure-name-or-service-not-known/32383)

<div class="topic-metadata">

**Author:** [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Replies:** 0\
**Last updated:** [March 4, 2020, 3:13pm UTC](https://forum.ansible.com/t/ansibleconnectionfailure-name-or-service-not-known/32383 "2020-03-04T15:13:36Z")

</div>

You are trying to connect to a host called 'cisco' but that does not resolve to something. So, you should fix your inventory (which you didn't post BTW, so we can't tell what's exactly wrong with that).

---

## [Keep items of for loop on the same line, but adding a new line when the loop is done (Jinja template)](https://forum.ansible.com/t/keep-items-of-for-loop-on-the-same-line-but-adding-a-new-line-when-the-loop-is-done-jinja-template/32381)

<div class="topic-metadata">

**Author:** [@K\_de\_Jong](https://forum.ansible.com/u/K_de_Jong)\
**Replies:** 1\
**Last updated:** [March 4, 2020, 1:44pm UTC](https://forum.ansible.com/t/keep-items-of-for-loop-on-the-same-line-but-adding-a-new-line-when-the-loop-is-done-jinja-template/32381 "2020-03-04T13:44:47Z")

</div>

The template code below is from my Postfix setup in Ansible. What I want to do is to put all domain names on a single line with a comma+space as separator. To do this, I make use of the “{%-” syntax. However, at the end …

---

## [Schedule not run](https://forum.ansible.com/t/schedule-not-run/32380)

<div class="topic-metadata">

**Author:** [@Mohamed\_Magdy](https://forum.ansible.com/u/Mohamed_Magdy)\
**Replies:** 0\
**Last updated:** [March 4, 2020, 10:08am UTC](https://forum.ansible.com/t/schedule-not-run/32380 "2020-03-04T10:08:29Z")

</div>

SUMMARY i try to make Schedule to run commend to get heap size every day from other server and after try to run Schedule successfully that include the commend and to run the playbook ISSUE TYPE- Documentation Report COM…

---

## [How to get IP address from controller's /etc/hosts file?](https://forum.ansible.com/t/how-to-get-ip-address-from-controllers-etc-hosts-file/32376)

<div class="topic-metadata">

**Author:** [@Robert\_F](https://forum.ansible.com/u/Robert_F)\
**Replies:** 6\
**Last updated:** [March 4, 2020, 4:50am UTC](https://forum.ansible.com/t/how-to-get-ip-address-from-controllers-etc-hosts-file/32376 "2020-03-04T04:50:01Z")

</div>

I’m trying to get the IP address of one of my remote hosts by querying my controller machine’s /etc/hosts file which happens to contain the IP addresses of all the servers I build with Ansible. My Ansible playbook looks …

---

## [Simple Math with String to Int](https://forum.ansible.com/t/simple-math-with-string-to-int/32370)

<div class="topic-metadata">

**Author:** [@M\_F](https://forum.ansible.com/u/M_F)\
**Replies:** 3\
**Last updated:** [March 3, 2020, 8:16pm UTC](https://forum.ansible.com/t/simple-math-with-string-to-int/32370 "2020-03-03T20:16:06Z")

</div>

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 tha…

---

## [Sum a list of items received](https://forum.ansible.com/t/sum-a-list-of-items-received/32342)

<div class="topic-metadata">

**Author:** [@harry\_devine](https://forum.ansible.com/u/harry_devine)\
**Replies:** 10\
**Last updated:** [March 3, 2020, 2:31pm UTC](https://forum.ansible.com/t/sum-a-list-of-items-received/32342 "2020-03-03T14:31:28Z")

</div>

I’m using the gluster\_heal\_info module to check the heal status of a gluster volume. What I’d like to do is gather the “no\_of\_entries” parameter, sum them up, and it if it is 0, move to the next step of stopping gluster …

---

## [Checkpoint Interface details](https://forum.ansible.com/t/checkpoint-interface-details/32271)

<div class="topic-metadata">

**Author:** [@Pushparaj\_Gothandam](https://forum.ansible.com/u/Pushparaj_Gothandam)\
**Replies:** 5\
**Last updated:** [March 3, 2020, 11:30am UTC](https://forum.ansible.com/t/checkpoint-interface-details/32271 "2020-03-03T11:30:37Z")

</div>

Hi , Has anybody generated interface report for checkpoint firewalls using Ansible? Thanks

---

## [Unable to read variable in a loop using include\_vars.](https://forum.ansible.com/t/unable-to-read-variable-in-a-loop-using-include-vars/32371)

<div class="topic-metadata">

**Author:** [@Shifa\_Shaikh](https://forum.ansible.com/u/Shifa_Shaikh)\
**Replies:** 6\
**Last updated:** [March 3, 2020, 10:11am UTC](https://forum.ansible.com/t/unable-to-read-variable-in-a-loop-using-include-vars/32371 "2020-03-03T10:11:18Z")

</div>

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: “{{ al…

---

## [ping windows - ssl: the specified credentials were rejected by the serve](https://forum.ansible.com/t/ping-windows-ssl-the-specified-credentials-were-rejected-by-the-serve/23564)

<div class="topic-metadata">

**Author:** [@John\_Norris](https://forum.ansible.com/u/John_Norris)\
**Replies:** 7\
**Last updated:** [March 3, 2020, 10:02am UTC](https://forum.ansible.com/t/ping-windows-ssl-the-specified-credentials-were-rejected-by-the-serve/23564 "2020-03-03T10:02:32Z")

</div>

Hi I am running ansible 2.1.2.0 on centos7. The windows machine is running windows 10 with powershell 5. I have installed pywinrm-0.2.2, included windows hostnames in the inventory file and also added group variables t…

[Previous page](https://forum.ansible.com/c/archives/ansible-project/30.md?page=137)

[Next page](https://forum.ansible.com/c/archives/ansible-project/30.md?page=139)
