# Latest

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

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

**Page:** 1021

---

## [including host\_vars in with\_items using roles](https://forum.ansible.com/t/including-host-vars-in-with-items-using-roles/13613)

<div class="topic-metadata">

**Author:** [@michael.ibarra](https://forum.ansible.com/u/michael.ibarra)\
**Replies:** 3\
**Last updated:** [October 4, 2013, 11:36pm UTC](https://forum.ansible.com/t/including-host-vars-in-with-items-using-roles/13613 "2013-10-04T23:36:16Z")

</div>

Hi all, I’m trying to use one role for two different hosts, each one using different playbooks. The behaviour I’m expecting is if I have n-deploy-web hosts they should get trackX.war copied in /var/lib/tomcat6/webapps,…

---

## [Variable depends on other variable](https://forum.ansible.com/t/variable-depends-on-other-variable/13555)

<div class="topic-metadata">

**Author:** [@Edgars](https://forum.ansible.com/u/Edgars)\
**Replies:** 5\
**Last updated:** [October 4, 2013, 11:34pm UTC](https://forum.ansible.com/t/variable-depends-on-other-variable/13555 "2013-10-04T23:34:11Z")

</div>

Hi I am wondering is it possible to set variable’s value which depends on other variable’s value? Something like this: dbname = prod: if dbid == 1 dbname = dev: if dbid == 2 Or maybe there is another way how to ach…

---

## [Conditional task using when\_changed](https://forum.ansible.com/t/conditional-task-using-when-changed/13611)

<div class="topic-metadata">

**Author:** [@Jon\_Chappell](https://forum.ansible.com/u/Jon_Chappell)\
**Replies:** 5\
**Last updated:** [October 4, 2013, 6:43pm UTC](https://forum.ansible.com/t/conditional-task-using-when-changed/13611 "2013-10-04T18:43:27Z")

</div>

Greetings, I’m running into unexpected behavior when trying to use a when\_changed statement to trigger an immediate service reload if a change is made. We wanted to do this instead of doing a flush\_handlers to avoid imp…

---

## [set\_facts does not work on Mac OSX??](https://forum.ansible.com/t/set-facts-does-not-work-on-mac-osx/13610)

<div class="topic-metadata">

**Author:** [@Edgars](https://forum.ansible.com/u/Edgars)\
**Replies:** 2\
**Last updated:** [October 4, 2013, 2:36pm UTC](https://forum.ansible.com/t/set-facts-does-not-work-on-mac-osx/13610 "2013-10-04T14:36:21Z")

</div>

Here is what I do on Linux: name: set fact set\_fact: dbname=‘prod’ shell: echo {{ dbname }} Output: changed: \[localhost\] =\> {“changed”: true, “cmd”: "echo prod ", “delta”: “0:00:00.004590”, “end”: “2013-10-04 …

---

## [Fetch multiple files?](https://forum.ansible.com/t/fetch-multiple-files/13600)

<div class="topic-metadata">

**Author:** [@Yaniv\_Kaul](https://forum.ansible.com/u/Yaniv_Kaul)\
**Replies:** 6\
**Last updated:** [October 4, 2013, 2:34pm UTC](https://forum.ansible.com/t/fetch-multiple-files/13600 "2013-10-04T14:34:29Z")

</div>

Is there an existing feature request that fetch will be able to fetch multiple files (via a regular file pattern) ? Something like fetch src=/tmp/results\* dest=/results/ flat=true ansible-1.2.3-2.el6.noarch on CentOS …

---

## [Using data return from tasks for subsequent tasks](https://forum.ansible.com/t/using-data-return-from-tasks-for-subsequent-tasks/13601)

<div class="topic-metadata">

**Author:** [@saurabh\_verma](https://forum.ansible.com/u/saurabh_verma)\
**Replies:** 2\
**Last updated:** [October 4, 2013, 2:19pm UTC](https://forum.ansible.com/t/using-data-return-from-tasks-for-subsequent-tasks/13601 "2013-10-04T14:19:23Z")

</div>

Hi, I am a bit confused here, Basically I want to use ec2-vol modules ( somehow i want to dynamically generate the instance ID inside the playbook or use it from vars ) , get the device name attached, use this data for…

---

## [Occasional apt-get update problems with EC2 using Ansible](https://forum.ansible.com/t/occasional-apt-get-update-problems-with-ec2-using-ansible/13605)

<div class="topic-metadata">

**Author:** [@Cyrus\_Durgin](https://forum.ansible.com/u/Cyrus_Durgin)\
**Replies:** 2\
**Last updated:** [October 4, 2013, 1:38pm UTC](https://forum.ansible.com/t/occasional-apt-get-update-problems-with-ec2-using-ansible/13605 "2013-10-04T13:38:50Z")

</div>

Hi folks, I’m not certain (in fact I’m entirely uncertain) that this is directly an Ansible issue, but I’ve only come across it with instances launched using the “ec2” module. Occasionally (maybe 1 in 5 or fewer) the fi…

---

## [Ansible for deployment and one-off tasks](https://forum.ansible.com/t/ansible-for-deployment-and-one-off-tasks/13607)

<div class="topic-metadata">

**Author:** [@John\_Jarvis](https://forum.ansible.com/u/John_Jarvis)\
**Replies:** 8\
**Last updated:** [October 4, 2013, 1:16pm UTC](https://forum.ansible.com/t/ansible-for-deployment-and-one-off-tasks/13607 "2013-10-04T13:16:24Z")

</div>

Sometimes (not often) we need to do some one-off maintenance (like manually deleting some files, force removing a package) before a single deploy. Using ansible seems like it would be a great tool to do this. for examp…

---

## [add\_host module doesn't modify hostvars or groups magic variables](https://forum.ansible.com/t/add-host-module-doesnt-modify-hostvars-or-groups-magic-variables/13606)

<div class="topic-metadata">

**Author:** [@Matt\_Ferrante](https://forum.ansible.com/u/Matt_Ferrante)\
**Replies:** 5\
**Last updated:** [October 3, 2013, 11:05pm UTC](https://forum.ansible.com/t/add-host-module-doesnt-modify-hostvars-or-groups-magic-variables/13606 "2013-10-03T23:05:24Z")

</div>

I am writing a playbook that adds hosts to the inventory and then writes a host inventory file based on the hosts defined. The host added with add\_host isn’t reflected in the hostvars or groups variable. I would have exp…

---

## [Ansible python error related to unicode?](https://forum.ansible.com/t/ansible-python-error-related-to-unicode/13608)

<div class="topic-metadata">

**Author:** [@David\_Reagan](https://forum.ansible.com/u/David_Reagan)\
**Replies:** 4\
**Last updated:** [October 3, 2013, 8:55pm UTC](https://forum.ansible.com/t/ansible-python-error-related-to-unicode/13608 "2013-10-03T20:55:44Z")

</div>

I keep getting an odd error when trying to configure my php.ini template. It ends with: UnicodeEncodeError: ‘ascii’ codec can’t encode character u’\\xa0’ in position 68552: ordinal not in range(128) I’ve posted the c…

---

## [Playbook interdependencies](https://forum.ansible.com/t/playbook-interdependencies/13602)

<div class="topic-metadata">

**Author:** [@Jim\_Van\_Fleet](https://forum.ansible.com/u/Jim_Van_Fleet)\
**Replies:** 1\
**Last updated:** [October 3, 2013, 7:54pm UTC](https://forum.ansible.com/t/playbook-interdependencies/13602 "2013-10-03T19:54:43Z")

</div>

I am preparing a playbook to configure my use of papertrailapp.com. In turn, producing a file like https://github.com/papertrail/remote\_syslog/blob/master/examples/log\_files.yml.example is desired. For my use case, I c…

---

## [Related to vars\_files](https://forum.ansible.com/t/related-to-vars-files/13604)

<div class="topic-metadata">

**Author:** [@michael.ibarra](https://forum.ansible.com/u/michael.ibarra)\
**Replies:** 2\
**Last updated:** [October 3, 2013, 3:42pm UTC](https://forum.ansible.com/t/related-to-vars-files/13604 "2013-10-03T15:42:20Z")

</div>

Hi all, I’m stuck using vars\_file correctly. I have the following playbook (livetrack.yml) that it processes roles “lt” and “network”. The LT role copies a vhost.conf file to the httpd conf.d directory with a variable d…

---

## [command line option to display the evaluated variables per play](https://forum.ansible.com/t/command-line-option-to-display-the-evaluated-variables-per-play/13296)

<div class="topic-metadata">

**Author:** [@Ali-Akber\_Saifee](https://forum.ansible.com/u/Ali-Akber_Saifee)\
**Replies:** 5\
**Last updated:** [October 3, 2013, 12:23pm UTC](https://forum.ansible.com/t/command-line-option-to-display-the-evaluated-variables-per-play/13296 "2013-10-03T12:23:54Z")

</div>

With reference to the pull request here : https://github.com/ansible/ansible/pull/3840 The reason I wanted this was to be able to quickly see the effect of variable changes I made and verify that the precedence was as I…

---

## [Multiple actions in playbook?](https://forum.ansible.com/t/multiple-actions-in-playbook/13599)

<div class="topic-metadata">

**Author:** [@Yaniv\_Kaul](https://forum.ansible.com/u/Yaniv_Kaul)\
**Replies:** 4\
**Last updated:** [October 3, 2013, 12:17pm UTC](https://forum.ansible.com/t/multiple-actions-in-playbook/13599 "2013-10-03T12:17:07Z")

</div>

I’d like to perform the following: Ensure 3 results file do not exist on targets Run a script that produces them on targets Copy the 3 resulting files back. Delete the 3 resulting file from targets. Seems like I can’t…

---

## [Multiple patterns for hosts?](https://forum.ansible.com/t/multiple-patterns-for-hosts/13597)

<div class="topic-metadata">

**Author:** [@Yaniv\_Kaul](https://forum.ansible.com/u/Yaniv_Kaul)\
**Replies:** 2\
**Last updated:** [October 3, 2013, 7:35am UTC](https://forum.ansible.com/t/multiple-patterns-for-hosts/13597 "2013-10-03T07:35:04Z")

</div>

I’m trying to monitor clusters of hosts, all of which have 2 nodes. Their hostnames are host200-n1 for 1st node and host200-n2 for the 2nd node and so on. For this I wanted to use the following pattern in my hosts file…

---

## [Variables can't contain '-' char?](https://forum.ansible.com/t/variables-cant-contain-char/13598)

<div class="topic-metadata">

**Author:** [@Yaniv\_Kaul](https://forum.ansible.com/u/Yaniv_Kaul)\
**Replies:** 1\
**Last updated:** [October 3, 2013, 7:32am UTC](https://forum.ansible.com/t/variables-cant-contain-char/13598 "2013-10-03T07:32:19Z")

</div>

Variable named ‘res\_file’ works. Variable named ‘res-file’ fails miserably: fatal: \[cluster267-n1.example.com\] =\> Traceback (most recent call last): File “/usr/lib/python2.6/site-packages/ansible/runner/init.py”, line…

---

## [vagrant and ansible not working on osx mountain lion](https://forum.ansible.com/t/vagrant-and-ansible-not-working-on-osx-mountain-lion/13528)

<div class="topic-metadata">

**Author:** [@Derek\_Brockway](https://forum.ansible.com/u/Derek_Brockway)\
**Replies:** 4\
**Last updated:** [October 2, 2013, 11:59pm UTC](https://forum.ansible.com/t/vagrant-and-ansible-not-working-on-osx-mountain-lion/13528 "2013-10-02T23:59:27Z")

</div>

I’ve installed virtual box, vagrant and ansible from http://www.pyrosoft.co.uk/blog/2012/06/26/installing-ansible-on-osx-lion/ But I can’t get anything to work. I can start vagrant and ssh in but I can’t get to any urls…

---

## [A rough idea on specifying resources based on ansible\_\* vars](https://forum.ansible.com/t/a-rough-idea-on-specifying-resources-based-on-ansible-vars/13593)

<div class="topic-metadata">

**Author:** [@Mark\_Casey](https://forum.ansible.com/u/Mark_Casey)\
**Replies:** 2\
**Last updated:** [October 2, 2013, 7:56pm UTC](https://forum.ansible.com/t/a-rough-idea-on-specifying-resources-based-on-ansible-vars/13593 "2013-10-02T19:56:38Z")

</div>

Hello, I had an idea with regards to a common syntax (or a filter, if you will) that would have ansible auto-select items in playbooks based on existing vars like ansible\_os\_family. I was wondering if (as I’m still pret…

---

## [Anisble Version Check](https://forum.ansible.com/t/anisble-version-check/13592)

<div class="topic-metadata">

**Author:** [@Aaron\_Robinson](https://forum.ansible.com/u/Aaron_Robinson)\
**Replies:** 14\
**Last updated:** [October 2, 2013, 5:43pm UTC](https://forum.ansible.com/t/anisble-version-check/13592 "2013-10-02T17:43:44Z")

</div>

Is there an easy way to enforce that when a playbook is run that the ansible running it is the correct version? Ansible is extremely powerful, so I understand the solution can be achieved by creating a local playbook th…

---

## [lineinfile - append at end of line ?](https://forum.ansible.com/t/lineinfile-append-at-end-of-line/13579)

<div class="topic-metadata">

**Author:** [@Alex\_Rodenberg](https://forum.ansible.com/u/Alex_Rodenberg)\
**Replies:** 10\
**Last updated:** [October 2, 2013, 2:29pm UTC](https://forum.ansible.com/t/lineinfile-append-at-end-of-line/13579 "2013-10-02T14:29:00Z")

</div>

can lineinfile append at the end of a line ? I have a kernel line in my grub.conf i would like to append “pcie\_aspm=off” to if it’s not there. To my understanding backrefs would possibly be able to do that ? I don’t w…

---

## [Conditional expression must evaluate to True or False](https://forum.ansible.com/t/conditional-expression-must-evaluate-to-true-or-false/13587)

<div class="topic-metadata">

**Author:** [@Michal\_Till](https://forum.ansible.com/u/Michal_Till)\
**Replies:** 3\
**Last updated:** [October 2, 2013, 11:43am UTC](https://forum.ansible.com/t/conditional-expression-must-evaluate-to-true-or-false/13587 "2013-10-02T11:43:28Z")

</div>

Hello, in a play file I have a test for current node.js version: name: Node.js | Checking installed version of node.js action: shell /usr/bin/test “$(node -v 2\> /dev/null)” = v${node\_version} register: wanted\_versio…

---

## [Reminder: quick messaging survey (no, it's not the community survey) -- your help greatly appreciated!](https://forum.ansible.com/t/reminder-quick-messaging-survey-no-its-not-the-community-survey-your-help-greatly-appreciated/13577)

<div class="topic-metadata">

**Author:** [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Replies:** 2\
**Last updated:** [October 1, 2013, 10:15pm UTC](https://forum.ansible.com/t/reminder-quick-messaging-survey-no-its-not-the-community-survey-your-help-greatly-appreciated/13577 "2013-10-01T22:15:00Z")

</div>

Hi all, This is a really short survey (not like the long community one – I need to recap results to that a bit later) to help us understand some things about who our users are, and more importantly, how we should talk t…

---

## [Hadoop Example](https://forum.ansible.com/t/hadoop-example/11518)

<div class="topic-metadata">

**Author:** [@John\_Kleint](https://forum.ansible.com/u/John_Kleint)\
**Replies:** 6\
**Last updated:** [October 1, 2013, 9:31pm UTC](https://forum.ansible.com/t/hadoop-example/11518 "2013-10-01T21:31:01Z")

</div>

I've put together some Ansible playbooks and templates that I've successfully used to install and manage Hadoop (CDH4) on a cluster. I'd really appreciate feedback, especially from anyone who wants to try it. https:/…

---

## [ERROR: 'module' is not a legal parameter in an Ansible Playbook](https://forum.ansible.com/t/error-module-is-not-a-legal-parameter-in-an-ansible-playbook/13590)

<div class="topic-metadata">

**Author:** [@michael.ibarra](https://forum.ansible.com/u/michael.ibarra)\
**Replies:** 5\
**Last updated:** [October 1, 2013, 7:41pm UTC](https://forum.ansible.com/t/error-module-is-not-a-legal-parameter-in-an-ansible-playbook/13590 "2013-10-01T19:41:33Z")

</div>

Hi all, I’m trying to run a module that I’ve written but I’m getting: ERROR: ‘module’ is not a legal parameter in an Ansible Playbook’. Where ‘module’ is located at /usr/share/ansible/mymodules/module as its specified…

---

## [One PC can connect when running ansible but not when running ansible-playbook](https://forum.ansible.com/t/one-pc-can-connect-when-running-ansible-but-not-when-running-ansible-playbook/13589)

<div class="topic-metadata">

**Author:** [@Jurgen\_Haas2](https://forum.ansible.com/u/Jurgen_Haas2)\
**Replies:** 5\
**Last updated:** [October 1, 2013, 5:31pm UTC](https://forum.ansible.com/t/one-pc-can-connect-when-running-ansible-but-not-when-running-ansible-playbook/13589 "2013-10-01T17:31:27Z")

</div>

Here is a problem that’s driving me crazy for the last 10 hours and I can’t sort it. Let’s call it PC1 and I use this: ansible -s -K -i hosts -m setup host1 -u username -vvvv This is running just fine and delivers all…

---

## [with\_items: two YAML lists](https://forum.ansible.com/t/with-items-two-yaml-lists/13586)

<div class="topic-metadata">

**Author:** [@Edgars](https://forum.ansible.com/u/Edgars)\
**Replies:** 9\
**Last updated:** [October 1, 2013, 4:22pm UTC](https://forum.ansible.com/t/with-items-two-yaml-lists/13586 "2013-10-01T16:22:16Z")

</div>

Hi As per documentation, with\_items supports yaml or vars list: with\_items: somelist What is syntax if I want to include two lists for with\_items? Thanks Edgars

---

## [My frist Playbooks - Please Comment](https://forum.ansible.com/t/my-frist-playbooks-please-comment/13588)

<div class="topic-metadata">

**Author:** [@Marcelo\_Costa](https://forum.ansible.com/u/Marcelo_Costa)\
**Replies:** 1\
**Last updated:** [October 1, 2013, 2:26pm UTC](https://forum.ansible.com/t/my-frist-playbooks-please-comment/13588 "2013-10-01T14:26:09Z")

</div>

Hi, folks I create my first playbook and I’d like, if possible, comments. https://github.com/marcelojscosta/ansible-example-playbooks/blob/master/bootnode.yml I had doubts in the use of rsync and when I change the own…

---

## [How to manage ssh known hosts](https://forum.ansible.com/t/how-to-manage-ssh-known-hosts/13316)

<div class="topic-metadata">

**Author:** [@David\_Reagan](https://forum.ansible.com/u/David_Reagan)\
**Replies:** 9\
**Last updated:** [October 1, 2013, 2:13pm UTC](https://forum.ansible.com/t/how-to-manage-ssh-known-hosts/13316 "2013-10-01T14:13:27Z")

</div>

When I ssh into a server for the first time, ssh always asks me if the ECDSA key fingerprint is correct. When I say yes, it adds that to my ~/.ssh/known\_hosts file. I’d like to use ansible to create a known\_hosts file t…

---

## [limit="host\_name" breaks](https://forum.ansible.com/t/limit-host-name-breaks/13585)

<div class="topic-metadata">

**Author:** [@Marc\_Trudel](https://forum.ansible.com/u/Marc_Trudel)\
**Replies:** 3\
**Last updated:** [October 1, 2013, 1:37pm UTC](https://forum.ansible.com/t/limit-host-name-breaks/13585 "2013-10-01T13:37:22Z")

</div>

Given that group\_name is provided, if I have the following template: {% for host in groups\[group\_name\] %} {{ host }} {{ hostvars\[host\] }} {% endfor %} And I run ansible-playbook on only a single machine of group g…

---

## [Docs restructuring -- seeking suggestions/thoughts](https://forum.ansible.com/t/docs-restructuring-seeking-suggestions-thoughts/13557)

<div class="topic-metadata">

**Author:** [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Replies:** 32\
**Last updated:** [October 1, 2013, 12:21am UTC](https://forum.ansible.com/t/docs-restructuring-seeking-suggestions-thoughts/13557 "2013-10-01T00:21:22Z")

</div>

Hi all, From the community survey results so far (BTW, please take it if you have not already) - ttps://www.surveymonkey.com/s/9PCHKDK - it becomes clear that many of you would like some documentation restructuring. We …

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

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