# Ansible Project

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

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

**Page:** 268

---

## [How to recover from expected connection loss?](https://forum.ansible.com/t/how-to-recover-from-expected-connection-loss/27249)

<div class="topic-metadata">

**Author:** [@Uwe\_Sauter](https://forum.ansible.com/u/Uwe_Sauter)\
**Replies:** 1\
**Last updated:** [April 14, 2018, 9:11am UTC](https://forum.ansible.com/t/how-to-recover-from-expected-connection-loss/27249 "2018-04-14T09:11:52Z")

</div>

Hi all, I'm trying to reduce the size of the locale archive on CentOS 7.4 as described in \[1\] and \[2\]. Ansible version is 2.4.2.0-2.el7 For this I have a script on the client, that calls the needed commands: ###### /r…

---

## [How do I loop a task with variables defined in another file?](https://forum.ansible.com/t/how-do-i-loop-a-task-with-variables-defined-in-another-file/27236)

<div class="topic-metadata">

**Author:** [@Olof\_Lundgren](https://forum.ansible.com/u/Olof_Lundgren)\
**Replies:** 2\
**Last updated:** [April 14, 2018, 9:01am UTC](https://forum.ansible.com/t/how-do-i-loop-a-task-with-variables-defined-in-another-file/27236 "2018-04-14T09:01:11Z")

</div>

I have built a .yml file with a set of users that I want to push to my routers with vyos\_user module. This is my users.yml \` users: full\_name: “Olof Lundgren” name: “olof” configured\_password: “abcd1234” level: …

---

## [ansible with elastic search with Jinja2 Template](https://forum.ansible.com/t/ansible-with-elastic-search-with-jinja2-template/27274)

<div class="topic-metadata">

**Author:** [@Bishwajit\_Samanta](https://forum.ansible.com/u/Bishwajit_Samanta)\
**Replies:** 3\
**Last updated:** [April 14, 2018, 5:10am UTC](https://forum.ansible.com/t/ansible-with-elastic-search-with-jinja2-template/27274 "2018-04-14T05:10:21Z")

</div>

Hi, my question is ::-------------------------------- My ansible script will be running for multiple systems. But in elasticsearch.jinja2 how can i change the value of node.name for different systems. Jinja 2 Code::-

---

## [How to sort ansible output](https://forum.ansible.com/t/how-to-sort-ansible-output/27263)

<div class="topic-metadata">

**Author:** [@The\_Wanderer](https://forum.ansible.com/u/The_Wanderer)\
**Replies:** 4\
**Last updated:** [April 14, 2018, 2:49am UTC](https://forum.ansible.com/t/how-to-sort-ansible-output/27263 "2018-04-14T02:49:39Z")

</div>

Hi all, I have a couple of servers that are managed via ansible. On all of them, I have got a script - free.sh - that when run, outputs just the free memory, like - 5GB. This is not the free system RAM, but a value that…

---

## [List of running processes form multiple linux hosts using with\_items](https://forum.ansible.com/t/list-of-running-processes-form-multiple-linux-hosts-using-with-items/27238)

<div class="topic-metadata">

**Author:** [@smitconsultant2017](https://forum.ansible.com/u/smitconsultant2017)\
**Replies:** 3\
**Last updated:** [April 13, 2018, 3:14pm UTC](https://forum.ansible.com/t/list-of-running-processes-form-multiple-linux-hosts-using-with-items/27238 "2018-04-13T15:14:13Z")

</div>

Hi I am trying to achieve all running processes on our linux machines via ansible and get output in a file along with each host name and processes. I have made below playbook but not getting to the point how to get list…

---

## [vsphere wait for vm powered off](https://forum.ansible.com/t/vsphere-wait-for-vm-powered-off/23007)

<div class="topic-metadata">

**Author:** [@Mathias\_Waack](https://forum.ansible.com/u/Mathias_Waack)\
**Replies:** 13\
**Last updated:** [April 13, 2018, 3:01pm UTC](https://forum.ansible.com/t/vsphere-wait-for-vm-powered-off/23007 "2018-04-13T15:01:32Z")

</div>

We use cloning to create new VMs in our vsphere cluster. The template is usually powered on (to receive regular updates), so we power it off before we create a clone: name: power off the template vsphere\_guest: vcen…

---

## [Cannot create user](https://forum.ansible.com/t/cannot-create-user/27272)

<div class="topic-metadata">

**Author:** [@Werner\_Flamme](https://forum.ansible.com/u/Werner_Flamme)\
**Replies:** 2\
**Last updated:** [April 13, 2018, 2:56pm UTC](https://forum.ansible.com/t/cannot-create-user/27272 "2018-04-13T14:56:21Z")

</div>

Hi, can someone please show me what's wrong? - name: create one single user user: user: "someguy" password: "something secret here" group: "users" state: "present" does not create a user, but in…

---

## [unable to fit the piece of code in ansible](https://forum.ansible.com/t/unable-to-fit-the-piece-of-code-in-ansible/27254)

<div class="topic-metadata">

**Author:** [@Bishwajit\_Samanta](https://forum.ansible.com/u/Bishwajit_Samanta)\
**Replies:** 5\
**Last updated:** [April 13, 2018, 2:52pm UTC](https://forum.ansible.com/t/unable-to-fit-the-piece-of-code-in-ansible/27254 "2018-04-13T14:52:14Z")

</div>

Hi all, I am a beginner in ansible. If anyone can help me in finding the answer. It would be great. My problem was finding a phrase in ansible which one of the person have helped me. But unfortunately i am not able to f…

---

## [Ternary filter vs conditional expressions](https://forum.ansible.com/t/ternary-filter-vs-conditional-expressions/27241)

<div class="topic-metadata">

**Author:** [@rbarlik](https://forum.ansible.com/u/rbarlik)\
**Replies:** 4\
**Last updated:** [April 13, 2018, 9:18am UTC](https://forum.ansible.com/t/ternary-filter-vs-conditional-expressions/27241 "2018-04-13T09:18:47Z")

</div>

I’ve been recently wondering about the ternary filter in Ansible. I’ve seen it used in a couple of places and it’s also mentioned in the documentation. As you probably know, it’s not a standard Jinja filter but one creat…

---

## [Trying to create a new user and password for server login . SSH permission denied error.](https://forum.ansible.com/t/trying-to-create-a-new-user-and-password-for-server-login-ssh-permission-denied-error/27264)

<div class="topic-metadata">

**Author:** [@poojavenkateshreddy](https://forum.ansible.com/u/poojavenkateshreddy)\
**Replies:** 1\
**Last updated:** [April 13, 2018, 6:23am UTC](https://forum.ansible.com/t/trying-to-create-a-new-user-and-password-for-server-login-ssh-permission-denied-error/27264 "2018-04-13T06:23:04Z")

</div>

Hi, I am trying to create a new user and password for the server login. The user is created in /etc/passwd and also I can see the password entry in /etc/shadow however when I try to ssh through the new user I cannot log…

---

## [Facts](https://forum.ansible.com/t/facts/27267)

<div class="topic-metadata">

**Author:** [@Juraj\_Papic1](https://forum.ansible.com/u/Juraj_Papic1)\
**Replies:** 0\
**Last updated:** [April 12, 2018, 10:30pm UTC](https://forum.ansible.com/t/facts/27267 "2018-04-12T22:30:53Z")

</div>

Hi all, I have the following playbook

---

## [I am trying to disable a user and give no login access to the user.](https://forum.ansible.com/t/i-am-trying-to-disable-a-user-and-give-no-login-access-to-the-user/27265)

<div class="topic-metadata">

**Author:** [@poojavenkateshreddy](https://forum.ansible.com/u/poojavenkateshreddy)\
**Replies:** 4\
**Last updated:** [April 12, 2018, 10:00pm UTC](https://forum.ansible.com/t/i-am-trying-to-disable-a-user-and-give-no-login-access-to-the-user/27265 "2018-04-12T22:00:10Z")

</div>

I am trying to disable a user and not remove it completely

---

## [Tacacs validation](https://forum.ansible.com/t/tacacs-validation/27259)

<div class="topic-metadata">

**Author:** [@Juraj\_Papic](https://forum.ansible.com/u/Juraj_Papic)\
**Replies:** 8\
**Last updated:** [April 12, 2018, 9:34pm UTC](https://forum.ansible.com/t/tacacs-validation/27259 "2018-04-12T21:34:08Z")

</div>

Hello, I would like to know if there’s any chance to configure ansible to validate user/pass via tacacs , instead of hard coding the user/pass. I dont want to use vault. Thanks.

---

## [Is it possible to pass 'vars\_prompt' variables from one playbook to another that would normally resemble passing arguments in functions?](https://forum.ansible.com/t/is-it-possible-to-pass-vars-prompt-variables-from-one-playbook-to-another-that-would-normally-resemble-passing-arguments-in-functions/27266)

<div class="topic-metadata">

**Author:** [@EspressoBeanies](https://forum.ansible.com/u/EspressoBeanies)\
**Replies:** 0\
**Last updated:** [April 12, 2018, 9:21pm UTC](https://forum.ansible.com/t/is-it-possible-to-pass-vars-prompt-variables-from-one-playbook-to-another-that-would-normally-resemble-passing-arguments-in-functions/27266 "2018-04-12T21:21:59Z")

</div>

I’m wondering whether or not its possible to pass variables defined by ‘vars\_prompt’ from one playbook to another when that other playbook is properly referenced in the first playbook. In other programming languages, thi…

---

## [Trying to create a new user and password for server login . SSH permission denied error.](https://forum.ansible.com/t/trying-to-create-a-new-user-and-password-for-server-login-ssh-permission-denied-error/27262)

<div class="topic-metadata">

**Author:** [@poojavenkateshreddy](https://forum.ansible.com/u/poojavenkateshreddy)\
**Replies:** 0\
**Last updated:** [April 12, 2018, 6:33pm UTC](https://forum.ansible.com/t/trying-to-create-a-new-user-and-password-for-server-login-ssh-permission-denied-error/27262 "2018-04-12T18:33:39Z")

</div>

Hi, I am trying to create a new user and password for the server login. The user is created in /etc/passwd and also I can see the password entry in /etc/shadow however when I try to ssh through the new user I cannot log…

---

## [This topic needs a title](https://forum.ansible.com/t/this-topic-needs-a-title/27256)

<div class="topic-metadata">

**Author:** [@ishita\_pandey](https://forum.ansible.com/u/ishita_pandey)\
**Replies:** 3\
**Last updated:** [April 12, 2018, 3:38pm UTC](https://forum.ansible.com/t/this-topic-needs-a-title/27256 "2018-04-12T15:38:07Z")

</div>

Hi team, I am trying to setup winrm connection to windows 12 but getting below error: \<10.47.11.89\> WINRM CONNECTION ERROR: the specified credentials were rejected by the server Traceback (most recent call last): File …

---

## [How to use the same dictionary to loop over two tasks? is it possible using block?](https://forum.ansible.com/t/how-to-use-the-same-dictionary-to-loop-over-two-tasks-is-it-possible-using-block/27253)

<div class="topic-metadata">

**Author:** [@Tchia04](https://forum.ansible.com/u/Tchia04)\
**Replies:** 1\
**Last updated:** [April 12, 2018, 2:55pm UTC](https://forum.ansible.com/t/how-to-use-the-same-dictionary-to-loop-over-two-tasks-is-it-possible-using-block/27253 "2018-04-12T14:55:50Z")

</div>

I.e. instead of doing this which does win\_iis\_website,win\_iis\_website,etc then win\_iis\_webbinding,win\_iis\_webbinding, etc name: Create IIS site win\_iis\_website: name: ‘{{ item.key }}’ state: started application\_po…

---

## [Create a Azure VM with static private IP](https://forum.ansible.com/t/create-a-azure-vm-with-static-private-ip/27258)

<div class="topic-metadata">

**Author:** [@Bubul\_Medhi](https://forum.ansible.com/u/Bubul_Medhi)\
**Replies:** 0\
**Last updated:** [April 12, 2018, 12:03pm UTC](https://forum.ansible.com/t/create-a-azure-vm-with-static-private-ip/27258 "2018-04-12T12:03:33Z")

</div>

Hi, using Ansible, I want to create a Ubuntu VM in Azure with static private IP, i.e a predefined IP. Pls help.

---

## [Ansible error : ERROR! The tasks/main.yml file for role 'xyz' must contain a list of tasks](https://forum.ansible.com/t/ansible-error-error-the-tasks-main-yml-file-for-role-xyz-must-contain-a-list-of-tasks/27252)

<div class="topic-metadata">

**Author:** [@Irfan\_Sayed](https://forum.ansible.com/u/Irfan_Sayed)\
**Replies:** 2\
**Last updated:** [April 12, 2018, 10:46am UTC](https://forum.ansible.com/t/ansible-error-error-the-tasks-main-yml-file-for-role-xyz-must-contain-a-list-of-tasks/27252 "2018-04-12T10:46:54Z")

</div>

Hello, i have following simple YAML play file --- tasks: - name: Execute the command in remote shell; stdout goes to the specified file on the remote. shell: echo hi but when running ansible-playbook command: g…

---

## [need help to install Visual studio code on linux machine through Ansible](https://forum.ansible.com/t/need-help-to-install-visual-studio-code-on-linux-machine-through-ansible/27244)

<div class="topic-metadata">

**Author:** [@Vishal\_Mane](https://forum.ansible.com/u/Vishal_Mane)\
**Replies:** 1\
**Last updated:** [April 12, 2018, 8:01am UTC](https://forum.ansible.com/t/need-help-to-install-visual-studio-code-on-linux-machine-through-ansible/27244 "2018-04-12T08:01:26Z")

</div>

I took a role to install vs code from github. now trying to run the role, it gets executes successfully, but vs code doesn’t gets installed on the target machine. my playbook is ----- hosts: become: true become\_m…

---

## [current run timestamp](https://forum.ansible.com/t/current-run-timestamp/27061)

<div class="topic-metadata">

**Author:** [@orderedchaosdev](https://forum.ansible.com/u/orderedchaosdev)\
**Replies:** 2\
**Last updated:** [April 12, 2018, 7:57am UTC](https://forum.ansible.com/t/current-run-timestamp/27061 "2018-04-12T07:57:37Z")

</div>

I want to set it up so there is a current ansible playbook run timestamp set at the start of every playbook run so I can use this var in various roles. The only way so far I have found is to set a pre\_task with set fact…

---

## [Hostnames with EC2 inventory plugin](https://forum.ansible.com/t/hostnames-with-ec2-inventory-plugin/27237)

<div class="topic-metadata">

**Author:** [@oscar](https://forum.ansible.com/u/oscar)\
**Replies:** 2\
**Last updated:** [April 12, 2018, 7:45am UTC](https://forum.ansible.com/t/hostnames-with-ec2-inventory-plugin/27237 "2018-04-12T07:45:41Z")

</div>

Hi, I’m testing the new Amazon EC2 dynamic inventory plugin. I need to set the host names to the “Name” tag, but I don’t understand the documentation. Reading this: http://docs.ansible.com/ansible/latest/plugins/invento…

---

## [Ansible 2.4 to 2.5 files - file module change](https://forum.ansible.com/t/ansible-2-4-to-2-5-files-file-module-change/27233)

<div class="topic-metadata">

**Author:** [@Mike\_Garris](https://forum.ansible.com/u/Mike_Garris)\
**Replies:** 2\
**Last updated:** [April 11, 2018, 6:39pm UTC](https://forum.ansible.com/t/ansible-2-4-to-2-5-files-file-module-change/27233 "2018-04-11T18:39:19Z")

</div>

Am I reading the docs correctly with regards to the file module being changed? “Sets attributes of files” - https://docs.ansible.com/ansible/2.4/list\_of\_files\_modules.html to “Read file contents” - https://docs.ansibl…

---

## [Where to put files and templates that don't belong to a role](https://forum.ansible.com/t/where-to-put-files-and-templates-that-dont-belong-to-a-role/27247)

<div class="topic-metadata">

**Author:** [@Clayton\_Louden](https://forum.ansible.com/u/Clayton_Louden)\
**Replies:** 3\
**Last updated:** [April 11, 2018, 5:47pm UTC](https://forum.ansible.com/t/where-to-put-files-and-templates-that-dont-belong-to-a-role/27247 "2018-04-11T17:47:52Z")

</div>

Hi everyone, Where do you usually put files or templates that are just used in a certain play but are not part of a role? Currently I do have them just alongside my playbooks organised by play someplay.yml files/ somep…

---

## [finding a phrase through ansible script](https://forum.ansible.com/t/finding-a-phrase-through-ansible-script/27250)

<div class="topic-metadata">

**Author:** [@Bishwajit\_Samanta](https://forum.ansible.com/u/Bishwajit_Samanta)\
**Replies:** 5\
**Last updated:** [April 11, 2018, 5:35pm UTC](https://forum.ansible.com/t/finding-a-phrase-through-ansible-script/27250 "2018-04-11T17:35:06Z")

</div>

i am having a problem in finding solution. I have a piece of file which contains data in below format (json type with quotes)::- hostinfo: 'host001': ip: x.x.x.x hostclass: 'puppet' 'host002': ip: y.y.y.…

---

## [create tepdir and copy file into it?](https://forum.ansible.com/t/create-tepdir-and-copy-file-into-it/27231)

<div class="topic-metadata">

**Author:** [@Michael\_Renner](https://forum.ansible.com/u/Michael_Renner)\
**Replies:** 2\
**Last updated:** [April 11, 2018, 1:34pm UTC](https://forum.ansible.com/t/create-tepdir-and-copy-file-into-it/27231 "2018-04-11T13:34:37Z")

</div>

Moin, I want to download a file using the maven\_artifact plugin into a temporary directory (an copy this to several other maschines). Now I wonder how to use a registerd variable for this … name: create temporary bui…

---

## [Proper handling of host specific credential files](https://forum.ansible.com/t/proper-handling-of-host-specific-credential-files/27242)

<div class="topic-metadata">

**Author:** [@Jean\_Helou](https://forum.ansible.com/u/Jean_Helou)\
**Replies:** 0\
**Last updated:** [April 11, 2018, 9:52am UTC](https://forum.ansible.com/t/proper-handling-of-host-specific-credential-files/27242 "2018-04-11T09:52:07Z")

</div>

Hi, I am using ansible 2.5, I have gone through the best practices but I fail to understand how I am supposed to properly handle host-specific files. My exact use case is handling vpn certificates for computers embedde…

---

## [Possible approaches to iteration](https://forum.ansible.com/t/possible-approaches-to-iteration/27227)

<div class="topic-metadata">

**Author:** [@tom.reynick](https://forum.ansible.com/u/tom.reynick)\
**Replies:** 1\
**Last updated:** [April 11, 2018, 3:00am UTC](https://forum.ansible.com/t/possible-approaches-to-iteration/27227 "2018-04-11T03:00:56Z")

</div>

I would like to understand semantics of with\_items in ansible and compare this approach to map for example. For example, let consider: {{ \["1","2", "3"\] | map('regex\_replace', '^(.\*)$', \\1'some tail') tail }} How to r…

---

## [Pip module reinstalls packages every time](https://forum.ansible.com/t/pip-module-reinstalls-packages-every-time/27234)

<div class="topic-metadata">

**Author:** [@Guy\_Knights](https://forum.ansible.com/u/Guy_Knights)\
**Replies:** 0\
**Last updated:** [April 11, 2018, 12:12am UTC](https://forum.ansible.com/t/pip-module-reinstalls-packages-every-time/27234 "2018-04-11T00:12:34Z")

</div>

A task I have uses the pip module in conjunction with ‘with\_items’ to install different ansible packages, like so: name: install ansible versions pip: name: ansible version: “{{ item }}” extra\_args: “–install-optio…

---

## [How to respond to prompts with pywinrm / Ansible when using win\_chocolatey?](https://forum.ansible.com/t/how-to-respond-to-prompts-with-pywinrm-ansible-when-using-win-chocolatey/27221)

<div class="topic-metadata">

**Author:** [@Johnson\_Johnson](https://forum.ansible.com/u/Johnson_Johnson)\
**Replies:** 3\
**Last updated:** [April 10, 2018, 1:56pm UTC](https://forum.ansible.com/t/how-to-respond-to-prompts-with-pywinrm-ansible-when-using-win-chocolatey/27221 "2018-04-10T13:56:54Z")

</div>

How to respond to prompts with pywinrm / Ansible when using win\_chocolatey? I am installing the android-sdk kit / module with chocolatey and get prompted to accept the license (y/n), but have no way to use the expect mod…

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

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