# Latest

**URL:** https://forum.ansible.com/latest.md?page=657

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

**Page:** 658

---

## [\[WARNING\]: While constructing a mapping from /etc/ansible/playbooks/touch.yml, line 2, column 3, found a duplicate dict key (tasks). Using last defined value only.](https://forum.ansible.com/t/warning-while-constructing-a-mapping-from-etc-ansible-playbooks-touch-yml-line-2-column-3-found-a-duplicate-dict-key-tasks-using-last-defined-value-only/24524)

<div class="topic-metadata">

**Author:** [@Anfield](https://forum.ansible.com/u/Anfield)\
**Replies:** 4\
**Last updated:** [May 19, 2017, 3:05pm UTC](https://forum.ansible.com/t/warning-while-constructing-a-mapping-from-etc-ansible-playbooks-touch-yml-line-2-column-3-found-a-duplicate-dict-key-tasks-using-last-defined-value-only/24524 "2017-05-19T15:05:42Z")

</div>

I have the following playbook and I got the above error. This created the directory but not the file. Any ideas?

---

## [With\_items over the loops with "when", can we write multiple "when" in one task?](https://forum.ansible.com/t/with-items-over-the-loops-with-when-can-we-write-multiple-when-in-one-task/24485)

<div class="topic-metadata">

**Author:** [@Raj\_Martha](https://forum.ansible.com/u/Raj_Martha)\
**Replies:** 4\
**Last updated:** [May 19, 2017, 2:52pm UTC](https://forum.ansible.com/t/with-items-over-the-loops-with-when-can-we-write-multiple-when-in-one-task/24485 "2017-05-19T14:52:51Z")

</div>

Hi all, I want to write the code like this, is it possible? or is there any better way to write?

---

## [Problems using AWS Dynamic Inventory with STS Profiles](https://forum.ansible.com/t/problems-using-aws-dynamic-inventory-with-sts-profiles/24523)

<div class="topic-metadata">

**Author:** [@Ric](https://forum.ansible.com/u/Ric)\
**Replies:** 0\
**Last updated:** [May 19, 2017, 1:17pm UTC](https://forum.ansible.com/t/problems-using-aws-dynamic-inventory-with-sts-profiles/24523 "2017-05-19T13:17:48Z")

</div>

ANSIBLE VERSION ansible 2.3.0.0 config file = configured module search path = Default w/o overrides python version = 2.7.5 (default, Aug 2 2016, 04:20:16) \[GCC 4.8.5 20150623 (Red Hat 4.8.5-4)\]

---

## [Cannot execute a command on remote machine](https://forum.ansible.com/t/cannot-execute-a-command-on-remote-machine/24522)

<div class="topic-metadata">

**Author:** [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Replies:** 0\
**Last updated:** [May 19, 2017, 12:04pm UTC](https://forum.ansible.com/t/cannot-execute-a-command-on-remote-machine/24522 "2017-05-19T12:04:14Z")

</div>

It looks like your command depends on some environment vars. Can you try the shell module instead of command? That should handle it better. Dick

---

## [Adding new route to cisco router Jinja2 template](https://forum.ansible.com/t/adding-new-route-to-cisco-router-jinja2-template/24451)

<div class="topic-metadata">

**Author:** [@naeem\_dhby](https://forum.ansible.com/u/naeem_dhby)\
**Replies:** 3\
**Last updated:** [May 19, 2017, 3:42am UTC](https://forum.ansible.com/t/adding-new-route-to-cisco-router-jinja2-template/24451 "2017-05-19T03:42:09Z")

</div>

Hi, i have configured Cisco router and i want to setup automation to only add new route to router, and do not change any old configuration already exist in router is it possible to use Jinja2 template for this case, i’…

---

## [Plays taking way to long to run...](https://forum.ansible.com/t/plays-taking-way-to-long-to-run/24516)

<div class="topic-metadata">

**Author:** [@Will\_Dennis](https://forum.ansible.com/u/Will_Dennis)\
**Replies:** 1\
**Last updated:** [May 19, 2017, 1:56am UTC](https://forum.ansible.com/t/plays-taking-way-to-long-to-run/24516 "2017-05-19T01:56:46Z")

</div>

Seeing a weird problem with running playbooks from my Macbook, which is running OS X 10.10.5… The plays are taking a very long time to run: \` Wills-MacBook-Air:ist-ansible will$ ansible-playbook --version ansible-play…

---

## [Is there any better way to find if a list of packes installed](https://forum.ansible.com/t/is-there-any-better-way-to-find-if-a-list-of-packes-installed/24423)

<div class="topic-metadata">

**Author:** [@Kiran\_Kumar1](https://forum.ansible.com/u/Kiran_Kumar1)\
**Replies:** 4\
**Last updated:** [May 19, 2017, 12:45am UTC](https://forum.ansible.com/t/is-there-any-better-way-to-find-if-a-list-of-packes-installed/24423 "2017-05-19T00:45:50Z")

</div>

Hi Friends, Is there any better way to find if a list of packes is installed or not on a linux machine. It needs to return something may be a single variable to decide if all packages are installed or any one of them mi…

---

## [Getting paths right in Windows](https://forum.ansible.com/t/getting-paths-right-in-windows/24424)

<div class="topic-metadata">

**Author:** [@Trond\_Hindenes](https://forum.ansible.com/u/Trond_Hindenes)\
**Replies:** 5\
**Last updated:** [May 18, 2017, 10:33pm UTC](https://forum.ansible.com/t/getting-paths-right-in-windows/24424 "2017-05-18T22:33:02Z")

</div>

Hope someone can help me shed some light on this one: Since Ansible is python-based, us Windows dudes generally have to stick an extra backslash anywhere we’re manipulating Windows paths. However, in some cases this cau…

---

## [Ansible support for Windows Server 2016](https://forum.ansible.com/t/ansible-support-for-windows-server-2016/24501)

<div class="topic-metadata">

**Author:** [@Timothy\_Harris](https://forum.ansible.com/u/Timothy_Harris)\
**Replies:** 2\
**Last updated:** [May 18, 2017, 10:31pm UTC](https://forum.ansible.com/t/ansible-support-for-windows-server-2016/24501 "2017-05-18T22:31:49Z")

</div>

Hi, I am a bit of a newbie to Ansible. Not much of a windows user either to be honest :slight\_smile: But we may be looking at a project to spin up a windows server and deploy a .NET application on it. The wanted tools …

---

## [using eval in debugger](https://forum.ansible.com/t/using-eval-in-debugger/24517)

<div class="topic-metadata">

**Author:** [@horos22](https://forum.ansible.com/u/horos22)\
**Replies:** 0\
**Last updated:** [May 18, 2017, 9:55pm UTC](https://forum.ansible.com/t/using-eval-in-debugger/24517 "2017-05-18T21:55:18Z")

</div>

all, we are using the ansible debugger and running into some issues - basically, we are hitting a place where a string is being eval’ed to get another string, ie: var: “{{ another\_var | user\_filter | user\_filter2 }}” …

---

## [Using modules offline](https://forum.ansible.com/t/using-modules-offline/24492)

<div class="topic-metadata">

**Author:** [@Avishay\_Niv](https://forum.ansible.com/u/Avishay_Niv)\
**Replies:** 2\
**Last updated:** [May 18, 2017, 9:33pm UTC](https://forum.ansible.com/t/using-modules-offline/24492 "2017-05-18T21:33:17Z")

</div>

hello We installed ansible on a stand alone network that is not connected to the internet. the only way to insert data (files) to that network is offline. how can we use ansible modules in this case ? is there an optio…

---

## [Ansilbe Usage](https://forum.ansible.com/t/ansilbe-usage/24509)

<div class="topic-metadata">

**Author:** [@Jae\_Kim](https://forum.ansible.com/u/Jae_Kim)\
**Replies:** 1\
**Last updated:** [May 18, 2017, 8:11pm UTC](https://forum.ansible.com/t/ansilbe-usage/24509 "2017-05-18T20:11:01Z")

</div>

I tried running the following sample source code from http://stackoverflow.com/questions/39293527/ansible-uri-module-with-form

---

## [issue in counting no. of host in inventory ?](https://forum.ansible.com/t/issue-in-counting-no-of-host-in-inventory/24498)

<div class="topic-metadata">

**Author:** [@Gurminder\_Singh](https://forum.ansible.com/u/Gurminder_Singh)\
**Replies:** 4\
**Last updated:** [May 18, 2017, 8:08pm UTC](https://forum.ansible.com/t/issue-in-counting-no-of-host-in-inventory/24498 "2017-05-18T20:08:06Z")

</div>

I wrote a playbook to count number of host in inventory, can someone look or suggest better way of achieving this task, this play gives error in compling stage itself, however when I check the syntax in http://codebeauti…

---

## [single encrypted vault variable not working](https://forum.ansible.com/t/single-encrypted-vault-variable-not-working/24488)

<div class="topic-metadata">

**Author:** [@John\_Jolet](https://forum.ansible.com/u/John_Jolet)\
**Replies:** 1\
**Last updated:** [May 18, 2017, 5:31pm UTC](https://forum.ansible.com/t/single-encrypted-vault-variable-not-working/24488 "2017-05-18T17:31:23Z")

</div>

I’m running ansible 2.3.0.0,and attempting to use an inline encrypted variable per this documentation: http://docs.ansible.com/ansible/playbooks\_vault.html#running-a-playbook-with-vault this structure: mysecret: !vaul…

---

## [Ansible only completing first task in playbook](https://forum.ansible.com/t/ansible-only-completing-first-task-in-playbook/24515)

<div class="topic-metadata">

**Author:** [@JK1](https://forum.ansible.com/u/JK1)\
**Replies:** 0\
**Last updated:** [May 18, 2017, 3:25pm UTC](https://forum.ansible.com/t/ansible-only-completing-first-task-in-playbook/24515 "2017-05-18T15:25:29Z")

</div>

So Initially I thought that I had a rogue playbook but now I am finding that Ansible is only executing the first task in any playbook. For role below only first task is completed but no errors are given even with -v -vv …

---

## [Set backup date format for Ansible template module](https://forum.ansible.com/t/set-backup-date-format-for-ansible-template-module/24514)

<div class="topic-metadata">

**Author:** [@Ashok\_Chauhan](https://forum.ansible.com/u/Ashok_Chauhan)\
**Replies:** 0\
**Last updated:** [May 18, 2017, 2:38pm UTC](https://forum.ansible.com/t/set-backup-date-format-for-ansible-template-module/24514 "2017-05-18T14:38:41Z")

</div>

How do you change the date format for files that Ansible’s template module creates when you use the backup option? For example, the command: template: src=supervisord.conf.j2 dest=/etc/supervisor/supervisord.conf backu…

---

## [Looping from a list of definitions and values which is based on group var](https://forum.ansible.com/t/looping-from-a-list-of-definitions-and-values-which-is-based-on-group-var/24513)

<div class="topic-metadata">

**Author:** [@Ilan\_Harel](https://forum.ansible.com/u/Ilan_Harel)\
**Replies:** 0\
**Last updated:** [May 18, 2017, 2:31pm UTC](https://forum.ansible.com/t/looping-from-a-list-of-definitions-and-values-which-is-based-on-group-var/24513 "2017-05-18T14:31:13Z")

</div>

Might be a simple solution that I didn’t understand after reading http://docs.ansible.com/ansible/playbooks\_loops.html but here is my case: There is a command that should run different parameters for the same role based…

---

## [winrm certificate authentication](https://forum.ansible.com/t/winrm-certificate-authentication/24141)

<div class="topic-metadata">

**Author:** [@Hamdi\_Ben\_Zekri](https://forum.ansible.com/u/Hamdi_Ben_Zekri)\
**Replies:** 3\
**Last updated:** [May 18, 2017, 2:22pm UTC](https://forum.ansible.com/t/winrm-certificate-authentication/24141 "2017-05-18T14:22:37Z")

</div>

Hi, I have two VMs the first one is centos 7 VM with ansible 2.2.1 installed (ip: 192.168.26.2) the second one is a windows 10 VM (ip: 192.168.26.3) I have managed to connect to windows VM from centos VM using basic a…

---

## [Is posible add an EXTRAVARS with tower api?](https://forum.ansible.com/t/is-posible-add-an-extravars-with-tower-api/24508)

<div class="topic-metadata">

**Author:** [@Aitor\_Gomez](https://forum.ansible.com/u/Aitor_Gomez)\
**Replies:** 1\
**Last updated:** [May 18, 2017, 12:02pm UTC](https://forum.ansible.com/t/is-posible-add-an-extravars-with-tower-api/24508 "2017-05-18T12:02:08Z")

</div>

i need to add an extravars while ejecutin the job… i nedd start the job… get the extravars, and ADD it in the Job extravars to use it is posible add it with tower api?

---

## [win\_user is not repeatable](https://forum.ansible.com/t/win-user-is-not-repeatable/24511)

<div class="topic-metadata">

**Author:** [@gary\_mcwilliams](https://forum.ansible.com/u/gary_mcwilliams)\
**Replies:** 0\
**Last updated:** [May 18, 2017, 9:23am UTC](https://forum.ansible.com/t/win-user-is-not-repeatable/24511 "2017-05-18T09:23:51Z")

</div>

A minimal playbook --- # vim: set filetype=ansible ff=unix ts=2 sw=2 ai expandtab : # # Playbook to configure the environment - hosts: createuser tasks: - name: create user run\_once: true win\_user: …

---

## [win\_user is not repeatable](https://forum.ansible.com/t/win-user-is-not-repeatable/24510)

<div class="topic-metadata">

**Author:** [@gary\_mcwilliams](https://forum.ansible.com/u/gary_mcwilliams)\
**Replies:** 1\
**Last updated:** [May 18, 2017, 9:21am UTC](https://forum.ansible.com/t/win-user-is-not-repeatable/24510 "2017-05-18T09:21:13Z")

</div>

A minimal playbook --- # vim: set filetype=ansible ff=unix ts=2 sw=2 ai expandtab : # # Playbook to configure the environment - hosts: createuser tasks: - name: create user run\_once: true win\_user: …

---

## [import branch on ansible-galaxy](https://forum.ansible.com/t/import-branch-on-ansible-galaxy/24507)

<div class="topic-metadata">

**Author:** [@mtangaro](https://forum.ansible.com/u/mtangaro)\
**Replies:** 0\
**Last updated:** [May 18, 2017, 7:41am UTC](https://forum.ansible.com/t/import-branch-on-ansible-galaxy/24507 "2017-05-18T07:41:17Z")

</div>

Dear experts, I’m trying to import my ansible-role on github: https://github.com/mtangaro/ansible-galaxy-tools It is a fork and for this reason I don’t want modify the master branch, therefore I’ve added new branches. …

---

## [lineinfile - simply replace a string](https://forum.ansible.com/t/lineinfile-simply-replace-a-string/24490)

<div class="topic-metadata">

**Author:** [@AnsiNoob](https://forum.ansible.com/u/AnsiNoob)\
**Replies:** 10\
**Last updated:** [May 17, 2017, 8:02pm UTC](https://forum.ansible.com/t/lineinfile-simply-replace-a-string/24490 "2017-05-17T20:02:17Z")

</div>

Hi Two things that I miss in Ansible when compared to shell scripting is easy ‘grep’ and ‘sed’. That was easy to do in shell! My case is very simple. I have a file with lot of lines (sample below) and the line mentione…

---

## [Ansible for Microsoft update patching](https://forum.ansible.com/t/ansible-for-microsoft-update-patching/24506)

<div class="topic-metadata">

**Author:** [@Vinod\_Kashyap](https://forum.ansible.com/u/Vinod_Kashyap)\
**Replies:** 0\
**Last updated:** [May 17, 2017, 6:16pm UTC](https://forum.ansible.com/t/ansible-for-microsoft-update-patching/24506 "2017-05-17T18:16:41Z")

</div>

Hi, I am trying to understand if Ansible can be used for Microsoft update patching for windows servers in conjunction with WSUS? and if yes what are Pros and Cons of using this tool instead of using some GUI tool like B…

---

## [How to have a sequence of local tasks in a role](https://forum.ansible.com/t/how-to-have-a-sequence-of-local-tasks-in-a-role/24497)

<div class="topic-metadata">

**Author:** [@Gabriel\_Birke](https://forum.ansible.com/u/Gabriel_Birke)\
**Replies:** 1\
**Last updated:** [May 17, 2017, 6:03pm UTC](https://forum.ansible.com/t/how-to-have-a-sequence-of-local-tasks-in-a-role/24497 "2017-05-17T18:03:50Z")

</div>

I’m building a “deployment” role similar to what Ansistrano does: Check out code Run Project-specific build steps Create archive Extract archive on target machine Symlink new folder on target machine I’d like to write…

---

## [How to display the current java version and host name using loop in ansible.](https://forum.ansible.com/t/how-to-display-the-current-java-version-and-host-name-using-loop-in-ansible/24493)

<div class="topic-metadata">

**Author:** [@nishant\_bawane](https://forum.ansible.com/u/nishant_bawane)\
**Replies:** 3\
**Last updated:** [May 17, 2017, 5:48pm UTC](https://forum.ansible.com/t/how-to-display-the-current-java-version-and-host-name-using-loop-in-ansible/24493 "2017-05-17T17:48:44Z")

</div>

I need to show the current java version and the host name of the host server using Loop in my playbook. Currently i am able to fetch the hostname but not able o append the result which i got in my registered variable. Al…

---

## [Destination home not writable](https://forum.ansible.com/t/destination-home-not-writable/24505)

<div class="topic-metadata">

**Author:** [@devopsaws.santhosh](https://forum.ansible.com/u/devopsaws.santhosh)\
**Replies:** 0\
**Last updated:** [May 17, 2017, 5:46pm UTC](https://forum.ansible.com/t/destination-home-not-writable/24505 "2017-05-17T17:46:11Z")

</div>

I'm getting a file by using get\_url gave link and dest also normal sensible playbook run successfully when i run through Jenkins it's show the error while getting URL and placing to a created directory path. How can I r…

---

## [set\_fact across plays in playbook](https://forum.ansible.com/t/set-fact-across-plays-in-playbook/24499)

<div class="topic-metadata">

**Author:** [@madhan0618](https://forum.ansible.com/u/madhan0618)\
**Replies:** 1\
**Last updated:** [May 17, 2017, 5:28pm UTC](https://forum.ansible.com/t/set-fact-across-plays-in-playbook/24499 "2017-05-17T17:28:17Z")

</div>

Used to work and it stopped working. No idea why I have a playbook with multiple plays name: Configuring zookeeper hosts: zookeeperServers tasks: #- debug: msg=“{{ inventory\_hostname }}” #- debug: msg=“{{ play\_ho…

---

## [how to pass a file into AnsibleModule as argument](https://forum.ansible.com/t/how-to-pass-a-file-into-ansiblemodule-as-argument/24504)

<div class="topic-metadata">

**Author:** [@Bruce\_Lok](https://forum.ansible.com/u/Bruce_Lok)\
**Replies:** 0\
**Last updated:** [May 17, 2017, 9:07am UTC](https://forum.ansible.com/t/how-to-pass-a-file-into-ansiblemodule-as-argument/24504 "2017-05-17T09:07:46Z")

</div>

I know the basic to pass a some string to an Ansible Module as argument, but curious how to pass a file for example: I have a file containing some variable in yaml format (eg: /var/www/project/var.yaml) def main(): m…

---

## [ec2\_ami : FAILED! =\> {"changed": false, "failed": true, "msg": "unsupported parameter for module: root\_device\_name"}](https://forum.ansible.com/t/ec2-ami-failed-changed-false-failed-true-msg-unsupported-parameter-for-module-root-device-name/24503)

<div class="topic-metadata">

**Author:** [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Replies:** 0\
**Last updated:** [May 17, 2017, 7:23am UTC](https://forum.ansible.com/t/ec2-ami-failed-changed-false-failed-true-msg-unsupported-parameter-for-module-root-device-name/24503 "2017-05-17T07:23:19Z")

</div>

I've never used ec2\_ami myself but according to the docs on http://docs.ansible.com/ansible/ec2\_ami\_module.html root\_device\_name is available since ansible 2.3. I guess you're using an older version? Dick

[Previous page](https://forum.ansible.com/latest.md?page=656)

[Next page](https://forum.ansible.com/latest.md?page=658)
