# Ansible Project

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

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

**Page:** 196

---

## [K8s module support for  --from-file=hooks](https://forum.ansible.com/t/k8s-module-support-for-from-file-hooks/30122)

<div class="topic-metadata">

**Author:** [@Alon\_Nisser](https://forum.ansible.com/u/Alon_Nisser)\
**Replies:** 0\
**Last updated:** [April 16, 2019, 11:00am UTC](https://forum.ansible.com/t/k8s-module-support-for-from-file-hooks/30122 "2019-04-16T11:00:52Z")

</div>

While I enjoy the new k8s module a lot I failed to find out how to do something like this with it kubectl create configmap service-per-pod-hooks -n metacontroller --from-file=hooks I’ll be glad for any pointers on how …

---

## [Separate Hard Disk guest](https://forum.ansible.com/t/separate-hard-disk-guest/30120)

<div class="topic-metadata">

**Author:** [@lander.hernandezmart](https://forum.ansible.com/u/lander.hernandezmart)\
**Replies:** 2\
**Last updated:** [April 16, 2019, 10:05am UTC](https://forum.ansible.com/t/separate-hard-disk-guest/30120 "2019-04-16T10:05:22Z")

</div>

I need separate hard disk information in number of hard disk and his information. For example, I have 2 disk and only need 1 disk information. My YAML is:

---

## [can't create a category tag](https://forum.ansible.com/t/cant-create-a-category-tag/30121)

<div class="topic-metadata">

**Author:** [@lander.hernandezmart](https://forum.ansible.com/u/lander.hernandezmart)\
**Replies:** 0\
**Last updated:** [April 16, 2019, 9:41am UTC](https://forum.ansible.com/t/cant-create-a-category-tag/30121 "2019-04-16T09:41:26Z")

</div>

I try to create a category in vsphere but have a giant error This is my YAML:

---

## [Ansible retrieve stdout with items loop](https://forum.ansible.com/t/ansible-retrieve-stdout-with-items-loop/30117)

<div class="topic-metadata">

**Author:** [@wanexa77](https://forum.ansible.com/u/wanexa77)\
**Replies:** 2\
**Last updated:** [April 16, 2019, 9:30am UTC](https://forum.ansible.com/t/ansible-retrieve-stdout-with-items-loop/30117 "2019-04-16T09:30:29Z")

</div>

Hi All I want to retrieve multiple output from a command with a with items loop the playbook is like this name: test command: openssl rand -base64 20 register: pwd delegate\_to: localhost with\_items: test1 test t…

---

## [how to modify output](https://forum.ansible.com/t/how-to-modify-output/30114)

<div class="topic-metadata">

**Author:** [@fmontaldo3](https://forum.ansible.com/u/fmontaldo3)\
**Replies:** 1\
**Last updated:** [April 16, 2019, 1:56am UTC](https://forum.ansible.com/t/how-to-modify-output/30114 "2019-04-16T01:56:12Z")

</div>

Hi folks: I got the following playbook

---

## [Pip install of Ansible on Ubuntu 16.04 results in broken ansible](https://forum.ansible.com/t/pip-install-of-ansible-on-ubuntu-16-04-results-in-broken-ansible/26321)

<div class="topic-metadata">

**Author:** [@Stephen\_Nesbitt](https://forum.ansible.com/u/Stephen_Nesbitt)\
**Replies:** 2\
**Last updated:** [April 16, 2019, 1:54am UTC](https://forum.ansible.com/t/pip-install-of-ansible-on-ubuntu-16-04-results-in-broken-ansible/26321 "2019-04-16T01:54:31Z")

</div>

All: After installing ansible using pip on an Ubuntu 16.04 system with python 3.5 results in the following error: ERROR! Unexpected Exception, this is probably a bug: (cryptography 1.2.3 (/usr/lib/python3/dist-packages)…

---

## [Change a dictionary within a loop](https://forum.ansible.com/t/change-a-dictionary-within-a-loop/30113)

<div class="topic-metadata">

**Author:** [@Spiro\_Mitsialis](https://forum.ansible.com/u/Spiro_Mitsialis)\
**Replies:** 0\
**Last updated:** [April 15, 2019, 6:28pm UTC](https://forum.ansible.com/t/change-a-dictionary-within-a-loop/30113 "2019-04-15T18:28:38Z")

</div>

I am trying to edit ansible\_facts created by network-engine inside a loop but cannot figure out the syntax. I have a bunch of VLANs as a dict.

---

## [Ansible regex\_replace and replace](https://forum.ansible.com/t/ansible-regex-replace-and-replace/30112)

<div class="topic-metadata">

**Author:** [@ryad9200000](https://forum.ansible.com/u/ryad9200000)\
**Replies:** 1\
**Last updated:** [April 15, 2019, 5:01pm UTC](https://forum.ansible.com/t/ansible-regex-replace-and-replace/30112 "2019-04-15T17:01:13Z")

</div>

Hi all, I have two task : name: “Utilisation du replace dans un fichier” set\_fact: mon\_fichier: “{{ lookup(‘file’, ‘/home/ansible/file.txt’) | replace(‘\\n’, ’ ') }}” and name: “Utilisation du regex\_replace dans u…

---

## [how to access hosts variable in ansible tasks](https://forum.ansible.com/t/how-to-access-hosts-variable-in-ansible-tasks/30111)

<div class="topic-metadata">

**Author:** [@Kunalsing\_Thakur](https://forum.ansible.com/u/Kunalsing_Thakur)\
**Replies:** 4\
**Last updated:** [April 14, 2019, 6:54pm UTC](https://forum.ansible.com/t/how-to-access-hosts-variable-in-ansible-tasks/30111 "2019-04-14T18:54:53Z")

</div>

hosts: test.example.com, test1.example.com gather\_facts: false tasks: name: checking uptime for {{ ansible\_hostname }} command: uptime when: ( “slave” in uriresult.content )

---

## [Loop problem](https://forum.ansible.com/t/loop-problem/30110)

<div class="topic-metadata">

**Author:** [@Sergio\_Fernandez](https://forum.ansible.com/u/Sergio_Fernandez)\
**Replies:** 5\
**Last updated:** [April 14, 2019, 1:10pm UTC](https://forum.ansible.com/t/loop-problem/30110 "2019-04-14T13:10:07Z")

</div>

Hi, I am using Ansible along with HashiCorp’s Vault to store sensible data. I will be weekly sending a Secret\_ID to each server, in order for them to get a token. With this token, they can access the contents of the Va…

---

## [Invoke roles with different variables](https://forum.ansible.com/t/invoke-roles-with-different-variables/30109)

<div class="topic-metadata">

**Author:** [@John\_Gateley](https://forum.ansible.com/u/John_Gateley)\
**Replies:** 0\
**Last updated:** [April 13, 2019, 4:41pm UTC](https://forum.ansible.com/t/invoke-roles-with-different-variables/30109 "2019-04-13T16:41:52Z")

</div>

Hello, I have a role “runit\_service” that creates a runit service based on variables (service\_name, script etc.) I have two roles that depend on runit\_service: role\_a and role\_b. The intent is to create two runit\_servi…

---

## [New User First Issue discrepancy between ansible & tower](https://forum.ansible.com/t/new-user-first-issue-discrepancy-between-ansible-tower/30107)

<div class="topic-metadata">

**Author:** [@joel.fisak](https://forum.ansible.com/u/joel.fisak)\
**Replies:** 2\
**Last updated:** [April 13, 2019, 1:46pm UTC](https://forum.ansible.com/t/new-user-first-issue-discrepancy-between-ansible-tower/30107 "2019-04-13T13:46:43Z")

</div>

Ansible works, a single playbook “helloworld.yml” works via cmd line. Yet in tower it doesn’t. My hosts file is very simple (just 1 IP). ansible\]$ cat hosts This is the default ansible ‘hosts’ file.

---

## [The non-existence of local facts means Ansible cannot check the existence of a local fact](https://forum.ansible.com/t/the-non-existence-of-local-facts-means-ansible-cannot-check-the-existence-of-a-local-fact/30078)

<div class="topic-metadata">

**Author:** [@Andy\_Wang](https://forum.ansible.com/u/Andy_Wang)\
**Replies:** 5\
**Last updated:** [April 13, 2019, 1:38pm UTC](https://forum.ansible.com/t/the-non-existence-of-local-facts-means-ansible-cannot-check-the-existence-of-a-local-fact/30078 "2019-04-13T13:38:23Z")

</div>

I have a playbook that checks the existence of a local fact, but not every hosts have this local fact. On servers where it does not exist my playbook fails with: “msg”: "The conditional check ‘ansible\_local\[‘my\_fact’\]\[…

---

## [Conditionally execute a task if directory exists?](https://forum.ansible.com/t/conditionally-execute-a-task-if-directory-exists/13057)

<div class="topic-metadata">

**Author:** [@Sebastiaan\_Pouyet](https://forum.ansible.com/u/Sebastiaan_Pouyet)\
**Replies:** 6\
**Last updated:** [April 12, 2019, 7:12pm UTC](https://forum.ansible.com/t/conditionally-execute-a-task-if-directory-exists/13057 "2019-04-12T19:12:39Z")

</div>

Hi all, I’ve searched the group and the ansible documentation, but haven’t been able to find a clear answer. I want to conditionally upload a monit config file in a nginx playbook, but only when the monnit conf directo…

---

## [regex\_replace](https://forum.ansible.com/t/regex-replace/30105)

<div class="topic-metadata">

**Author:** [@Luca\_Cazzaniga](https://forum.ansible.com/u/Luca_Cazzaniga)\
**Replies:** 2\
**Last updated:** [April 12, 2019, 3:29pm UTC](https://forum.ansible.com/t/regex-replace/30105 "2019-04-12T15:29:41Z")

</div>

hi all I don’t get why the following regexp replacement matches vars: monit\_pkgname: “prefixmonit-5.25.3-1” tasks: name: debug debug: msg: “{{ monit\_pkgname\_release }}” vars: monit\_pkgname\_release: “{{ (monit\_pk…

---

## [Best way to define variables based on facts for a role](https://forum.ansible.com/t/best-way-to-define-variables-based-on-facts-for-a-role/30103)

<div class="topic-metadata">

**Author:** [@Bruno\_Cochofel](https://forum.ansible.com/u/Bruno_Cochofel)\
**Replies:** 2\
**Last updated:** [April 12, 2019, 3:04pm UTC](https://forum.ansible.com/t/best-way-to-define-variables-based-on-facts-for-a-role/30103 "2019-04-12T15:04:18Z")

</div>

Hi, I’m trying to write a role that has different template file if the server is virtual os physical. What’s the best way to filter this? Thanks, Bruno

---

## [junos replace pattern](https://forum.ansible.com/t/junos-replace-pattern/30096)

<div class="topic-metadata">

**Author:** [@Michal\_Szczesniak](https://forum.ansible.com/u/Michal_Szczesniak)\
**Replies:** 1\
**Last updated:** [April 12, 2019, 8:40am UTC](https://forum.ansible.com/t/junos-replace-pattern/30096 "2019-04-12T08:40:28Z")

</div>

Hi, Is there any way using junos modules in ansible to send “replace pattern” command to Juniper device? I stucked on this. Any help would be greatly appreciated! Michal

---

## [Problem with linux debian Ansible](https://forum.ansible.com/t/problem-with-linux-debian-ansible/30095)

<div class="topic-metadata">

**Author:** [@ryad9200000](https://forum.ansible.com/u/ryad9200000)\
**Replies:** 6\
**Last updated:** [April 12, 2019, 7:24am UTC](https://forum.ansible.com/t/problem-with-linux-debian-ansible/30095 "2019-04-12T07:24:01Z")

</div>

Hi all, I have Debian linux 8.11 (jessie) with Ansible. My problem is that i have two repertory : repertoire repertoire? The repertory repertoire? it was created since windows so there is surely the character ^M wh…

---

## [How to cast stat.mtime (float) to readable date-time](https://forum.ansible.com/t/how-to-cast-stat-mtime-float-to-readable-date-time/30099)

<div class="topic-metadata">

**Author:** [@Jim\_Griffiths](https://forum.ansible.com/u/Jim_Griffiths)\
**Replies:** 2\
**Last updated:** [April 11, 2019, 7:30pm UTC](https://forum.ansible.com/t/how-to-cast-stat-mtime-float-to-readable-date-time/30099 "2019-04-11T19:30:54Z")

</div>

I need to display the date-time that a file was last updated. The value can be obtained with stat on the file: name: Get file stats stat: path=“{{ path\_of\_file }}” register: reg debug: msg: “Timestamp of {{path}}…

---

## [Ansible issue with Windows and Chocolatey 0.10.13](https://forum.ansible.com/t/ansible-issue-with-windows-and-chocolatey-0-10-13/29984)

<div class="topic-metadata">

**Author:** [@Guillaume\_Belrose](https://forum.ansible.com/u/Guillaume_Belrose)\
**Replies:** 5\
**Last updated:** [April 11, 2019, 9:10am UTC](https://forum.ansible.com/t/ansible-issue-with-windows-and-chocolatey-0-10-13/29984 "2019-04-11T09:10:13Z")

</div>

Hi all, I use Ansible to deploy Chocolatey packages on Windows Server 2016 machines (hosted on Amazon EC2). Yesterday, I re-created a brand new cluster for training purposes and I attempted to re-deploy my applications …

---

## [pip install docker-compose](https://forum.ansible.com/t/pip-install-docker-compose/30084)

<div class="topic-metadata">

**Author:** [@Andrew\_Meyer1](https://forum.ansible.com/u/Andrew_Meyer1)\
**Replies:** 13\
**Last updated:** [April 10, 2019, 8:29pm UTC](https://forum.ansible.com/t/pip-install-docker-compose/30084 "2019-04-10T20:29:38Z")

</div>

I seem to be having an issue when trying to run this playbook for building AWX. When I go to run the ansible playbook I get the following error: \` “ok: \[localhost\] =\> (item=environment.sh)”, “ok: \[localhost\] =\> (item…

---

## [Use Ansible template to pull out AWS AZ and subnet ID from a list of subnets.](https://forum.ansible.com/t/use-ansible-template-to-pull-out-aws-az-and-subnet-id-from-a-list-of-subnets/30089)

<div class="topic-metadata">

**Author:** [@Steve\_Button](https://forum.ansible.com/u/Steve_Button)\
**Replies:** 0\
**Last updated:** [April 10, 2019, 1:59pm UTC](https://forum.ansible.com/t/use-ansible-template-to-pull-out-aws-az-and-subnet-id-from-a-list-of-subnets/30089 "2019-04-10T13:59:36Z")

</div>

Been scratching my head with this one. Even digging into the jmespath docs, but really stuck. http://jmespath.org/specification.html#map I have a bunch of subnets, which I get back with :- name: Cluster create | Get…

---

## [Windows server luns path checks availability.](https://forum.ansible.com/t/windows-server-luns-path-checks-availability/30088)

<div class="topic-metadata">

**Author:** [@a.srini](https://forum.ansible.com/u/a.srini)\
**Replies:** 1\
**Last updated:** [April 10, 2019, 10:35am UTC](https://forum.ansible.com/t/windows-server-luns-path-checks-availability/30088 "2019-04-10T10:35:22Z")

</div>

Hi All, I am seeking for an help from the experts in this forum, if someone can help me and suggest on my task. I would like to create a play book for windows servers (2008 R2 standard/2012 Standard/ 2016 Standard) tha…

---

## [How to capture/filter stdout\_lines](https://forum.ansible.com/t/how-to-capture-filter-stdout-lines/30087)

<div class="topic-metadata">

**Author:** [@Sebastian\_Meyer](https://forum.ansible.com/u/Sebastian_Meyer)\
**Replies:** 0\
**Last updated:** [April 10, 2019, 5:46am UTC](https://forum.ansible.com/t/how-to-capture-filter-stdout-lines/30087 "2019-04-10T05:46:56Z")

</div>

Stdout\_lines that I get contains strings , json in different lines. I want to capture the last line and copy those contents to a a new Json file. How do I capture the last line from the registered variable. I tried t…

---

## [help me - error: Filespec must match the canonical format: \[\[namespace/\]pod:\]file/path](https://forum.ansible.com/t/help-me-error-filespec-must-match-the-canonical-format-namespace-pod-file-path/30081)

<div class="topic-metadata">

**Author:** [@Balaji1](https://forum.ansible.com/u/Balaji1)\
**Replies:** 1\
**Last updated:** [April 10, 2019, 5:31am UTC](https://forum.ansible.com/t/help-me-error-filespec-must-match-the-canonical-format-namespace-pod-file-path/30081 "2019-04-10T05:31:18Z")

</div>

Hello All, Need your help on below issue. I am trying to run kubernetes command on a remote host using ansible. This command works when directly run on a remote host. ======\> kubectl cp /etc/passwd bus-service/ssh-ju…

---

## [Set jinja2\_native at play level?](https://forum.ansible.com/t/set-jinja2-native-at-play-level/30000)

<div class="topic-metadata">

**Author:** [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Replies:** 4\
**Last updated:** [April 9, 2019, 9:45pm UTC](https://forum.ansible.com/t/set-jinja2-native-at-play-level/30000 "2019-04-09T21:45:53Z")

</div>

Hi I'm in a situation where I have a role that relies on ANSIBLE\_JINJA2\_NATIVE=True. However, setting this option in my ansible.cfg is causing breakage in many older playbooks. Is there a way to configure this behav…

---

## [man pages showing keywords?](https://forum.ansible.com/t/man-pages-showing-keywords/29985)

<div class="topic-metadata">

**Author:** [@Jason\_Amato](https://forum.ansible.com/u/Jason_Amato)\
**Replies:** 1\
**Last updated:** [April 9, 2019, 9:15pm UTC](https://forum.ansible.com/t/man-pages-showing-keywords/29985 "2019-04-09T21:15:04Z")

</div>

Is there a list of all keywords in the linux man pages somewhere ?

---

## [Ansible having an issue when we pass dictionary as extra variable or define in the variable file](https://forum.ansible.com/t/ansible-having-an-issue-when-we-pass-dictionary-as-extra-variable-or-define-in-the-variable-file/30085)

<div class="topic-metadata">

**Author:** [@Krishna\_G](https://forum.ansible.com/u/Krishna_G)\
**Replies:** 0\
**Last updated:** [April 9, 2019, 8:19pm UTC](https://forum.ansible.com/t/ansible-having-an-issue-when-we-pass-dictionary-as-extra-variable-or-define-in-the-variable-file/30085 "2019-04-09T20:19:21Z")

</div>

Local Machine: Ansible version: 2.4.1.0python version = 2.7.10 Remote Redhat Machine: Ansible version: 2.7.7 Python: 2.7.5 i have ansible running on my local machine(MAC), when i pass extra varibale as map it’s read…

---

## [Set ansible\_python\_interpreter at Task level?](https://forum.ansible.com/t/set-ansible-python-interpreter-at-task-level/29983)

<div class="topic-metadata">

**Author:** [@gigit1000](https://forum.ansible.com/u/gigit1000)\
**Replies:** 4\
**Last updated:** [April 9, 2019, 2:47pm UTC](https://forum.ansible.com/t/set-ansible-python-interpreter-at-task-level/29983 "2019-04-09T14:47:11Z")

</div>

Is there a way to do this? I have a playbook with two tasks. The first task uses Yum module (and python 2 interpreter). The next task uses aws\_s3 module (and python3 interpreter), but fails because the playbook is still …

---

## [Create custom facts in windows](https://forum.ansible.com/t/create-custom-facts-in-windows/30083)

<div class="topic-metadata">

**Author:** [@Rafael\_Tomelin](https://forum.ansible.com/u/Rafael_Tomelin)\
**Replies:** 0\
**Last updated:** [April 9, 2019, 2:04pm UTC](https://forum.ansible.com/t/create-custom-facts-in-windows/30083 "2019-04-09T14:04:38Z")

</div>

Hi, I need create custom facts in windows, but where directory create in windows for customs facts? How set path custom facts in windows in ansible?

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

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