# Latest

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

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

**Page:** 807

---

## [Accessing host variables directly in python module](https://forum.ansible.com/t/accessing-host-variables-directly-in-python-module/20110)

<div class="topic-metadata">

**Author:** [@Miroslav\_Hudec](https://forum.ansible.com/u/Miroslav_Hudec)\
**Replies:** 0\
**Last updated:** [January 3, 2016, 6:24pm UTC](https://forum.ansible.com/t/accessing-host-variables-directly-in-python-module/20110 "2016-01-03T18:24:41Z")

</div>

Hi everyone, first of all, I am sorry if this is documented somewhere else. I am trying to write few modules which would be used for configuring MikroTik devices over API. My “problem” is, that in playbooks I always ha…

---

## [role dependencies question](https://forum.ansible.com/t/role-dependencies-question/20107)

<div class="topic-metadata">

**Author:** [@user46](https://forum.ansible.com/u/user46)\
**Replies:** 2\
**Last updated:** [January 2, 2016, 3:22pm UTC](https://forum.ansible.com/t/role-dependencies-question/20107 "2016-01-02T15:22:24Z")

</div>

hi, i have role1 which depend on role2. and i want role2 to know the path of role1 without being hardcoded, how can i achieve this? #role1/meta/main.yml dependencies: { role: role2, role\_dir: “{{role\_path}}” } → it …

---

## [Connect to host - SSH Tunnel](https://forum.ansible.com/t/connect-to-host-ssh-tunnel/20075)

<div class="topic-metadata">

**Author:** [@fabgcruz](https://forum.ansible.com/u/fabgcruz)\
**Replies:** 6\
**Last updated:** [January 2, 2016, 11:53am UTC](https://forum.ansible.com/t/connect-to-host-ssh-tunnel/20075 "2016-01-02T11:53:54Z")

</div>

Hello, I currently have a host that is accessed saw ssh tunnel, I need to manage that host with ansible. How can I do that? To connect to the host I use the command: ssh -N -R 10000: localhost: 22 user@hostX. I added …

---

## [bad characters in arguments\\r\\n](https://forum.ansible.com/t/bad-characters-in-arguments-r-n/20098)

<div class="topic-metadata">

**Author:** [@Aaron\_Lea](https://forum.ansible.com/u/Aaron_Lea)\
**Replies:** 1\
**Last updated:** [January 1, 2016, 7:18am UTC](https://forum.ansible.com/t/bad-characters-in-arguments-r-n/20098 "2016-01-01T07:18:53Z")

</div>

~ youmoo $ ansible --version ansible 2.1.0 (devel 2d11cfab92) last updated 2015/12/30 09:22:34 (GMT +800) lib/ansible/modules/core: (detached HEAD 002028748f) last updated 2015/12/30 09:22:49 (GMT +800) lib/ansible/mo…

---

## [inconsistent bug, how can i help report this?](https://forum.ansible.com/t/inconsistent-bug-how-can-i-help-report-this/19985)

<div class="topic-metadata">

**Author:** [@pixel\_fairy](https://forum.ansible.com/u/pixel_fairy)\
**Replies:** 2\
**Last updated:** [January 1, 2016, 7:14am UTC](https://forum.ansible.com/t/inconsistent-bug-how-can-i-help-report-this/19985 "2016-01-01T07:14:23Z")

</div>

using 2.0rc2 on osx 10.11, and getting this, sometimes. i can usually repeat the command (up arrow, enter) and it works fine. fatal: \[lxctest\]: FAILED! =\> {“failed”: true, “msg”: “ERROR! failed to resolve remote tempora…

---

## [Suggest : inventory variables should have more weight](https://forum.ansible.com/t/suggest-inventory-variables-should-have-more-weight/19879)

<div class="topic-metadata">

**Author:** [@Rainer\_Weinhold](https://forum.ansible.com/u/Rainer_Weinhold)\
**Replies:** 1\
**Last updated:** [January 1, 2016, 7:01am UTC](https://forum.ansible.com/t/suggest-inventory-variables-should-have-more-weight/19879 "2016-01-01T07:01:29Z")

</div>

Hello, i would like to propose a behavoiur change for variable overwrite order: When running a playbook, variables defined in the inventory ( or inventory groups) should have a higher weight then playbook group\_vars. T…

---

## [Adding link to source code of any extras module in documentation](https://forum.ansible.com/t/adding-link-to-source-code-of-any-extras-module-in-documentation/20079)

<div class="topic-metadata">

**Author:** [@srujan\_akumarthi](https://forum.ansible.com/u/srujan_akumarthi)\
**Replies:** 1\
**Last updated:** [January 1, 2016, 6:57am UTC](https://forum.ansible.com/t/adding-link-to-source-code-of-any-extras-module-in-documentation/20079 "2016-01-01T06:57:36Z")

</div>

For extras modules documentation, we ain’t adding sources of that module currently. How about adding it with a category: “Source Code: https://github.com/pgolm/ansible-playbook-monit.git” ? Using this, we can easily fin…

---

## [PlaybookExecutor example](https://forum.ansible.com/t/playbookexecutor-example/20076)

<div class="topic-metadata">

**Author:** [@Goran\_Mekic](https://forum.ansible.com/u/Goran_Mekic)\
**Replies:** 5\
**Last updated:** [January 1, 2016, 5:48am UTC](https://forum.ansible.com/t/playbookexecutor-example/20076 "2016-01-01T05:48:40Z")

</div>

Hello, I'm trying to figure out how to use PlaybookExecutor. In short, I'd like to run my playbook from the Python code using Ansible 2. I tried poking the code but I'm just not smart enough, so a code snippet would b…

---

## [How include argument in task if some variable is defined?](https://forum.ansible.com/t/how-include-argument-in-task-if-some-variable-is-defined/19987)

<div class="topic-metadata">

**Author:** [@viatoriche](https://forum.ansible.com/u/viatoriche)\
**Replies:** 2\
**Last updated:** [December 31, 2015, 10:37pm UTC](https://forum.ansible.com/t/how-include-argument-in-task-if-some-variable-is-defined/19987 "2015-12-31T22:37:09Z")

</div>

Example: name: Update databases postgresql\_db: name={{ name }} … login\_host={{ login\_host }} {% if login\_host is defined %} … → vars: login\_host: “localhost” postgresql\_db: name={{ name }} login\_host={{ lo…

---

## [assigning an array using set\_fact](https://forum.ansible.com/t/assigning-an-array-using-set-fact/20104)

<div class="topic-metadata">

**Author:** [@Cyril\_Scetbon](https://forum.ansible.com/u/Cyril_Scetbon)\
**Replies:** 0\
**Last updated:** [December 31, 2015, 3:29pm UTC](https://forum.ansible.com/t/assigning-an-array-using-set-fact/20104 "2015-12-31T15:29:54Z")

</div>

Hi, I’m trying to assign an array to a variable using set\_fact as proposed at http://stackoverflow.com/a/23522774. However, it doesn’t work as expected : TASK: \[set\_fact roles=“\[‘dddd’, ‘eeeew’, ‘pffff’, ‘sssss’\]”\] \*\*\*…

---

## [New module for Managed VPC NAT Gateway](https://forum.ansible.com/t/new-module-for-managed-vpc-nat-gateway/20101)

<div class="topic-metadata">

**Author:** [@jon2](https://forum.ansible.com/u/jon2)\
**Replies:** 0\
**Last updated:** [December 30, 2015, 12:13pm UTC](https://forum.ansible.com/t/new-module-for-managed-vpc-nat-gateway/20101 "2015-12-30T12:13:16Z")

</div>

Hi, AWS launched a Managed NAT Gateway service on 17th December (https://aws.amazon.com/blogs/aws/new-managed-nat-network-address-translation-gateway-for-aws/) which enables you to NAT from private subnets to an elastic…

---

## [Problem trying to use a specific string with templates](https://forum.ansible.com/t/problem-trying-to-use-a-specific-string-with-templates/20092)

<div class="topic-metadata">

**Author:** [@Guido](https://forum.ansible.com/u/Guido)\
**Replies:** 3\
**Last updated:** [December 30, 2015, 12:05pm UTC](https://forum.ansible.com/t/problem-trying-to-use-a-specific-string-with-templates/20092 "2015-12-30T12:05:46Z")

</div>

Hi everyone, I’m trying to put a string by replacing a macro in a template but the problem is that the string itself it’s being interpreted as a macro and I need to avoida that. Here are config vars and the template: v…

---

## [Best way to Include Roles in tasks](https://forum.ansible.com/t/best-way-to-include-roles-in-tasks/20085)

<div class="topic-metadata">

**Author:** [@Colin\_Byrne](https://forum.ansible.com/u/Colin_Byrne)\
**Replies:** 3\
**Last updated:** [December 30, 2015, 3:38am UTC](https://forum.ansible.com/t/best-way-to-include-roles-in-tasks/20085 "2015-12-30T03:38:25Z")

</div>

So I used to have one fairly long main.yml playbook that was used to perform a number of similar-tasks, one of which was to install rbenv, the ruby management tool.

---

## [Automated testing for Ansible roles with Molecule](https://forum.ansible.com/t/automated-testing-for-ansible-roles-with-molecule/20087)

<div class="topic-metadata">

**Author:** [@Borys\_Borysenko](https://forum.ansible.com/u/Borys_Borysenko)\
**Replies:** 1\
**Last updated:** [December 30, 2015, 3:09am UTC](https://forum.ansible.com/t/automated-testing-for-ansible-roles-with-molecule/20087 "2015-12-30T03:09:23Z")

</div>

Hello, A few weeks ago I have discovered an excellent tool named molecule that really simplify testing of Ansible roles. I guess it’s really worth to try! Molecule is designed to aid in the development and testing of …

---

## [Test Ansible roles and playbooks using Docker](https://forum.ansible.com/t/test-ansible-roles-and-playbooks-using-docker/20099)

<div class="topic-metadata">

**Author:** [@chrismeyersfsu](https://forum.ansible.com/u/chrismeyersfsu)\
**Replies:** 0\
**Last updated:** [December 30, 2015, 3:05am UTC](https://forum.ansible.com/t/test-ansible-roles-and-playbooks-using-docker/20099 "2015-12-30T03:05:59Z")

</div>

I’ve created a role, provision\_docker, to help test Ansible roles and playbooks. It’s simple and leverages Docker (not vms). Highlights: Best practice directory structure Test roles/playbooks using docker (spin up mul…

---

## [Use of fact\_path : in inventory (on group vars, on host vars) ? in configuration file (ansible.cfg)? in variable files ?](https://forum.ansible.com/t/use-of-fact-path-in-inventory-on-group-vars-on-host-vars-in-configuration-file-ansible-cfg-in-variable-files/20091)

<div class="topic-metadata">

**Author:** [@J\_Blomart](https://forum.ansible.com/u/J_Blomart)\
**Replies:** 1\
**Last updated:** [December 29, 2015, 10:57pm UTC](https://forum.ansible.com/t/use-of-fact-path-in-inventory-on-group-vars-on-host-vars-in-configuration-file-ansible-cfg-in-variable-files/20091 "2015-12-29T22:57:26Z")

</div>

Dears, I have just started checking out Ansible to handle automation on a set of dedicated servers. I have built a fact file to collect information about the application that we want to handle. For segregation purpose…

---

## [attempts key](https://forum.ansible.com/t/attempts-key/20094)

<div class="topic-metadata">

**Author:** [@jepper](https://forum.ansible.com/u/jepper)\
**Replies:** 2\
**Last updated:** [December 29, 2015, 5:23pm UTC](https://forum.ansible.com/t/attempts-key/20094 "2015-12-29T17:23:06Z")

</div>

Hi, please can someone explain to me how to use “attempts” with retries? E.g. here’s what I want to do: name: health check - wait for endpoints to become available action: shell curl “{{ item.endpoint }}/health” fail…

---

## [lookup module cannot return dict, and gives confusing error](https://forum.ansible.com/t/lookup-module-cannot-return-dict-and-gives-confusing-error/20090)

<div class="topic-metadata">

**Author:** [@Eric\_Feliksik](https://forum.ansible.com/u/Eric_Feliksik)\
**Replies:** 2\
**Last updated:** [December 29, 2015, 5:21pm UTC](https://forum.ansible.com/t/lookup-module-cannot-return-dict-and-gives-confusing-error/20090 "2015-12-29T17:21:09Z")

</div>

I am creating a Lookup module that should return a dict. This seems to be not possible: fatal: \[node-01-1\]: FAILED! =\> {“changed”: false, “failed”: true, “invocation”: {“module\_args”: {“dest”: “/tmp/testconfig.json”, “…

---

## [\--limit and groups variable inconsistency](https://forum.ansible.com/t/limit-and-groups-variable-inconsistency/20081)

<div class="topic-metadata">

**Author:** [@Anatoly\_Zozlinsky](https://forum.ansible.com/u/Anatoly_Zozlinsky)\
**Replies:** 5\
**Last updated:** [December 29, 2015, 4:15pm UTC](https://forum.ansible.com/t/limit-and-groups-variable-inconsistency/20081 "2015-12-29T16:15:11Z")

</div>

Hi, I use dynamic ec2 inventory. i tag hosts with tag ENV and call ansible with --limit tag\_ENV\_staging to get only hosts of staging At the same time, i have another ENV called production in my template i use loop on…

---

## [No module named ansible.errors; cannot sudo](https://forum.ansible.com/t/no-module-named-ansible-errors-cannot-sudo/20073)

<div class="topic-metadata">

**Author:** [@Charles\_Belov](https://forum.ansible.com/u/Charles_Belov)\
**Replies:** 3\
**Last updated:** [December 29, 2015, 3:59pm UTC](https://forum.ansible.com/t/no-module-named-ansible-errors-cannot-sudo/20073 "2015-12-29T15:59:26Z")

</div>

I’ve just added Ansible to my git codebase and am attempting to run a playbook. I’m getting the message “ImportError: No module named ansible.errors” I cannot do sudo on my host, but supposedly ansible can run without i…

---

## [Anisble , Jinja2  create list of hashes](https://forum.ansible.com/t/anisble-jinja2-create-list-of-hashes/20093)

<div class="topic-metadata">

**Author:** [@gerhardjadzkadzikise](https://forum.ansible.com/u/gerhardjadzkadzikise)\
**Replies:** 0\
**Last updated:** [December 29, 2015, 2:31pm UTC](https://forum.ansible.com/t/anisble-jinja2-create-list-of-hashes/20093 "2015-12-29T14:31:29Z")

</div>

Hello, I am using Ansible 2.0.0 devel version and i want to create list of hashes in my playbook. For example i have one variable jkl11 with structure: debug msg={{ jkl11 }}\] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* …

---

## [How to run the ansible-playbook command in background?](https://forum.ansible.com/t/how-to-run-the-ansible-playbook-command-in-background/20088)

<div class="topic-metadata">

**Author:** [@Honsen](https://forum.ansible.com/u/Honsen)\
**Replies:** 0\
**Last updated:** [December 29, 2015, 9:33am UTC](https://forum.ansible.com/t/how-to-run-the-ansible-playbook-command-in-background/20088 "2015-12-29T09:33:31Z")

</div>

saltstack has a “–async” parameter to run salt state.sls in background, does ansible-playbook has a similar parameter to run the command in background ?

---

## [file module - state=touch always finishes as changed](https://forum.ansible.com/t/file-module-state-touch-always-finishes-as-changed/20086)

<div class="topic-metadata">

**Author:** [@Koji\_Tanaka](https://forum.ansible.com/u/Koji_Tanaka)\
**Replies:** 2\
**Last updated:** [December 29, 2015, 3:48am UTC](https://forum.ansible.com/t/file-module-state-touch-always-finishes-as-changed/20086 "2015-12-29T03:48:48Z")

</div>

Hello Ansible Community, I'd like to create a task which ensures a file exists(if a file doesn't exist, it should create an empty file). Now I use file module's state=touch, but it always finishes as changed. Is there…

---

## [Autoscaling using "Ansible-pull" with AWS instances for Master and Slave configuration](https://forum.ansible.com/t/autoscaling-using-ansible-pull-with-aws-instances-for-master-and-slave-configuration/20084)

<div class="topic-metadata">

**Author:** [@Bhotu](https://forum.ansible.com/u/Bhotu)\
**Replies:** 0\
**Last updated:** [December 28, 2015, 10:35pm UTC](https://forum.ansible.com/t/autoscaling-using-ansible-pull-with-aws-instances-for-master-and-slave-configuration/20084 "2015-12-28T22:35:39Z")

</div>

I am working with AWS instances currently and want to transfer all the configuration that is currently running on AWS master node to the multiple AWS slave nodes with Ansible only. Slave nodes may be 2 or 3 or may be mor…

---

## [Want to test PR's but baffled by git submodules](https://forum.ansible.com/t/want-to-test-prs-but-baffled-by-git-submodules/20083)

<div class="topic-metadata">

**Author:** [@Jim\_Razmus\_II](https://forum.ansible.com/u/Jim_Razmus_II)\
**Replies:** 4\
**Last updated:** [December 28, 2015, 10:34pm UTC](https://forum.ansible.com/t/want-to-test-prs-but-baffled-by-git-submodules/20083 "2015-12-28T22:34:54Z")

</div>

I am attempting to test PR1401 on the ansible-modules-extras submodule. I’ve followed the directions at http://docs.ansible.com/ansible/developing\_test\_pr.html and https://help.github.com/articles/checking-out-pull-reque…

---

## [Add a query-language to ansible](https://forum.ansible.com/t/add-a-query-language-to-ansible/20082)

<div class="topic-metadata">

**Author:** [@Filipe\_Felisbino](https://forum.ansible.com/u/Filipe_Felisbino)\
**Replies:** 0\
**Last updated:** [December 28, 2015, 7:01pm UTC](https://forum.ansible.com/t/add-a-query-language-to-ansible/20082 "2015-12-28T19:01:10Z")

</div>

Hello I’ve just created a pull request that adds a lookup plugin to enable generic data querying on ansible by using a json-path based query language. It is pretty straightforward but it has a dependency with dq so I wo…

---

## [failed\_when to fail after retries have been used](https://forum.ansible.com/t/failed-when-to-fail-after-retries-have-been-used/20047)

<div class="topic-metadata">

**Author:** [@jepper](https://forum.ansible.com/u/jepper)\
**Replies:** 2\
**Last updated:** [December 28, 2015, 10:17am UTC](https://forum.ansible.com/t/failed-when-to-fail-after-retries-have-been-used/20047 "2015-12-28T10:17:04Z")

</div>

I am looking for a way for below to cause a failure, if the health check fails to see an “UP” message after 10 attempts. name: health check - wait for endpoints to become available action: shell curl http://endpoint/h…

---

## [In Ansible, how to get a variable from another variable and then fetch it's value](https://forum.ansible.com/t/in-ansible-how-to-get-a-variable-from-another-variable-and-then-fetch-its-value/20077)

<div class="topic-metadata">

**Author:** [@system](https://forum.ansible.com/u/system)\
**Replies:** 2\
**Last updated:** [December 28, 2015, 9:23am UTC](https://forum.ansible.com/t/in-ansible-how-to-get-a-variable-from-another-variable-and-then-fetch-its-value/20077 "2015-12-28T09:23:10Z")

</div>

Here is my problem I need to use one variable ‘RDS\_SG\_NAME’ and then append ‘\_id’ to it’s value to get another variable name which value I want/need. My simple playbook look like this: --- - hosts: localhost connectio…

---

## [Ansible modules core release](https://forum.ansible.com/t/ansible-modules-core-release/19642)

<div class="topic-metadata">

**Author:** [@james4](https://forum.ansible.com/u/james4)\
**Replies:** 3\
**Last updated:** [December 27, 2015, 10:34pm UTC](https://forum.ansible.com/t/ansible-modules-core-release/19642 "2015-12-27T22:34:13Z")

</div>

How do we determine what version of the module core is released with the main ansible project? How do we determine when the devel branch has been merged into the latest release e.g. stable-1.9? Basically want to know i…

---

## [How to use external variable inside an ansible inventory file.](https://forum.ansible.com/t/how-to-use-external-variable-inside-an-ansible-inventory-file/20017)

<div class="topic-metadata">

**Author:** [@anoop.kolari](https://forum.ansible.com/u/anoop.kolari)\
**Replies:** 2\
**Last updated:** [December 27, 2015, 12:43am UTC](https://forum.ansible.com/t/how-to-use-external-variable-inside-an-ansible-inventory-file/20017 "2015-12-27T00:43:57Z")

</div>

Hi, I have an inventory file ‘inventory/localhost’ and contains; \[localhost\] “{{MYSITE\_NAME}}-local.com” ansible\_ssh\_port=2222 Lets say ‘MYSITE\_NAME’ is a variable defined in some file. I need to access this inside m…

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

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