# Ansible Project

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

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

**Page:** 93

---

## [delete all files under a directory](https://forum.ansible.com/t/delete-all-files-under-a-directory/34377)

<div class="topic-metadata">

**Author:** [@Reneesh\_K](https://forum.ansible.com/u/Reneesh_K)\
**Replies:** 6\
**Last updated:** [December 30, 2020, 7:49pm UTC](https://forum.ansible.com/t/delete-all-files-under-a-directory/34377 "2020-12-30T19:49:01Z")

</div>

How do I delete all files under a directory?

---

## [Selecting attributes from a registered variable](https://forum.ansible.com/t/selecting-attributes-from-a-registered-variable/34374)

<div class="topic-metadata">

**Author:** [@harry\_devine](https://forum.ansible.com/u/harry_devine)\
**Replies:** 11\
**Last updated:** [December 29, 2020, 7:42pm UTC](https://forum.ansible.com/t/selecting-attributes-from-a-registered-variable/34374 "2020-12-29T19:42:32Z")

</div>

I’m trying to use “gluster\_heal\_info” to retrieve the “no\_of\_entries” attribute. When I print out the values that gluster\_heal\_info returns, I see that this attribute exists: storage1 | SUCCESS =\> { “msg”: { “brick”: …

---

## [Can anyone help me in java upgradation and Apache2 in rhel 7 with Ansible roles](https://forum.ansible.com/t/can-anyone-help-me-in-java-upgradation-and-apache2-in-rhel-7-with-ansible-roles/34379)

<div class="topic-metadata">

**Author:** [@prathyusha](https://forum.ansible.com/u/prathyusha)\
**Replies:** 1\
**Last updated:** [December 29, 2020, 11:46am UTC](https://forum.ansible.com/t/can-anyone-help-me-in-java-upgradation-and-apache2-in-rhel-7-with-ansible-roles/34379 "2020-12-29T11:46:36Z")

</div>

Hi everyone, I want your support to work with Ansible. I have written some scripts for java upgradation. Its working but it is not showing in the nodes. Please if anyone help it will be grateful. Thanks & Regards Pra…

---

## [Experts help need for imc\_rest module](https://forum.ansible.com/t/experts-help-need-for-imc-rest-module/34362)

<div class="topic-metadata">

**Author:** [@Ramesh\_AR](https://forum.ansible.com/u/Ramesh_AR)\
**Replies:** 10\
**Last updated:** [December 28, 2020, 11:21pm UTC](https://forum.ansible.com/t/experts-help-need-for-imc-rest-module/34362 "2020-12-28T23:21:03Z")

</div>

Hi Folks, Does anyone had an experience to use imc\_rest module ? I’m trying to get information or output about hardware inventory . Say for example, I have equipmentPsu to check PSU status. however, the output is not sh…

---

## [exclude\_path not working on archive module](https://forum.ansible.com/t/exclude-path-not-working-on-archive-module/28736)

<div class="topic-metadata">

**Author:** [@JS11](https://forum.ansible.com/u/JS11)\
**Replies:** 6\
**Last updated:** [December 28, 2020, 6:17pm UTC](https://forum.ansible.com/t/exclude-path-not-working-on-archive-module/28736 "2020-12-28T18:17:39Z")

</div>

Hello! I would like to exclude a folder from being archived into a tar.gz file. However, I’ve tried multiple options but I haven’t had any luck. Any time I run the archive module, the images directory keeps on getting b…

---

## [Copy a file from one node to another node](https://forum.ansible.com/t/copy-a-file-from-one-node-to-another-node/34373)

<div class="topic-metadata">

**Author:** [@harry\_devine](https://forum.ansible.com/u/harry_devine)\
**Replies:** 3\
**Last updated:** [December 28, 2020, 4:37pm UTC](https://forum.ansible.com/t/copy-a-file-from-one-node-to-another-node/34373 "2020-12-28T16:37:46Z")

</div>

Let me start this out by saying that this playbook I’m referencing is running on a 3-node Ansible Tower installation. Before anyone says "contact Red Hat’, this question is a base Ansible question, and something that wou…

---

## [Automation on C language application](https://forum.ansible.com/t/automation-on-c-language-application/34372)

<div class="topic-metadata">

**Author:** [@Rachna\_Dodia](https://forum.ansible.com/u/Rachna_Dodia)\
**Replies:** 2\
**Last updated:** [December 28, 2020, 7:57am UTC](https://forum.ansible.com/t/automation-on-c-language-application/34372 "2020-12-28T07:57:41Z")

</div>

Hi Team I wanted some immediate help to find out any references of ansible automation for applications based on C language . It could be around compiling the application or deploying it. I want some reference as a exam…

---

## [Windows Host Issue: Consider changing the remote tmp path in ansible.cfg to a path rooted in](https://forum.ansible.com/t/windows-host-issue-consider-changing-the-remote-tmp-path-in-ansible-cfg-to-a-path-rooted-in/34371)

<div class="topic-metadata">

**Author:** [@Mohammed\_Alnajdi](https://forum.ansible.com/u/Mohammed_Alnajdi)\
**Replies:** 5\
**Last updated:** [December 26, 2020, 9:27am UTC](https://forum.ansible.com/t/windows-host-issue-consider-changing-the-remote-tmp-path-in-ansible-cfg-to-a-path-rooted-in/34371 "2020-12-26T09:27:51Z")

</div>

Greeting Guys, I am using Ansible 2.9.6 from a Debian machine and i am trying to run the ping\_win module on a windows target host but i am presented with this error. “”" “msg”: “Authentication or permission failure. …

---

## [setting up windows host on a production environment](https://forum.ansible.com/t/setting-up-windows-host-on-a-production-environment/34294)

<div class="topic-metadata">

**Author:** [@Deepak\_Gowda](https://forum.ansible.com/u/Deepak_Gowda)\
**Replies:** 6\
**Last updated:** [December 24, 2020, 6:44am UTC](https://forum.ansible.com/t/setting-up-windows-host-on-a-production-environment/34294 "2020-12-24T06:44:25Z")

</div>

Hi All, How can i setup windows host to communicate with Ansible control node on a production environment securely.Can i run the below script with \[switch\]$DisableBasicAuth = $true https://github.com/ansible/ansible/b…

---

## [How to store server password](https://forum.ansible.com/t/how-to-store-server-password/34370)

<div class="topic-metadata">

**Author:** [@Abdulrazzaq\_shaik](https://forum.ansible.com/u/Abdulrazzaq_shaik)\
**Replies:** 0\
**Last updated:** [December 24, 2020, 4:42am UTC](https://forum.ansible.com/t/how-to-store-server-password/34370 "2020-12-24T04:42:01Z")

</div>

Hi All, Please help me with information on how to store the server password in vault and call while connecting ping bwt the nodes. Kindly share the process to do

---

## [Inventory file creation](https://forum.ansible.com/t/inventory-file-creation/34369)

<div class="topic-metadata">

**Author:** [@Abdulrazzaq\_shaik](https://forum.ansible.com/u/Abdulrazzaq_shaik)\
**Replies:** 0\
**Last updated:** [December 24, 2020, 4:39am UTC](https://forum.ansible.com/t/inventory-file-creation/34369 "2020-12-24T04:39:52Z")

</div>

Please help on how to build hostfile for kafka and zookeeper cluster, Kindly help on this…

---

## [Ansible facts in a Jinja template](https://forum.ansible.com/t/ansible-facts-in-a-jinja-template/34366)

<div class="topic-metadata">

**Author:** [@harry\_devine](https://forum.ansible.com/u/harry_devine)\
**Replies:** 2\
**Last updated:** [December 23, 2020, 12:57pm UTC](https://forum.ansible.com/t/ansible-facts-in-a-jinja-template/34366 "2020-12-23T12:57:08Z")

</div>

I have a playbook that has “gather\_facts: yes”, and with that I’m trying to look through all of the hosts in the playbook and print out the OS version information. The Jinja2 template I’m using is below. The issue I’m ha…

---

## [not able to use variables in plugins.](https://forum.ansible.com/t/not-able-to-use-variables-in-plugins/34365)

<div class="topic-metadata">

**Author:** [@Pravin\_V](https://forum.ansible.com/u/Pravin_V)\
**Replies:** 0\
**Last updated:** [December 22, 2020, 3:45pm UTC](https://forum.ansible.com/t/not-able-to-use-variables-in-plugins/34365 "2020-12-22T15:45:52Z")

</div>

Hello All, I’m testing netbox inventory plugin locally. Below is the yml file. If I specify the api\_endpoint and token directly like- api\_endpoint: https://1.1.1.1 token: 2323123123 This way it is working properly. B…

---

## [Ansible 2.10.4 authorized\_key - Syntax error](https://forum.ansible.com/t/ansible-2-10-4-authorized-key-syntax-error/34359)

<div class="topic-metadata">

**Author:** [@Lucas\_Possamai](https://forum.ansible.com/u/Lucas_Possamai)\
**Replies:** 3\
**Last updated:** [December 21, 2020, 9:13pm UTC](https://forum.ansible.com/t/ansible-2-10-4-authorized-key-syntax-error/34359 "2020-12-21T21:13:33Z")

</div>

Hi all, I’m trying to set up ansible.posix.authorized\_key on my playbook, which look like this: name: Set authorized key for Carol ansible.posix.authorized\_key: user: carol state: present key: “{{ lookup(‘file’, ‘…

---

## [with\_items stat too verbose](https://forum.ansible.com/t/with-items-stat-too-verbose/29546)

<div class="topic-metadata">

**Author:** [@rjwagner.dba](https://forum.ansible.com/u/rjwagner.dba)\
**Replies:** 11\
**Last updated:** [December 21, 2020, 2:46am UTC](https://forum.ansible.com/t/with-items-stat-too-verbose/29546 "2020-12-21T02:46:01Z")

</div>

Hey all- I’m using stat and with\_items to check proper ownership of various files. Is there any way to reduce the volume of output (i.e., eliminate everything in red, below)? rowagn@localhost:~/data-platform/oracle/ans…

---

## [Handlers not found](https://forum.ansible.com/t/handlers-not-found/34358)

<div class="topic-metadata">

**Author:** [@rubod\_singh](https://forum.ansible.com/u/rubod_singh)\
**Replies:** 0\
**Last updated:** [December 20, 2020, 9:04pm UTC](https://forum.ansible.com/t/handlers-not-found/34358 "2020-12-20T21:04:45Z")

</div>

Hi All, i wrote simple windows app pool playbook , to test handlers but everything works fine except that part of handlers being notified. can someone please point me where am i going wrong or what am i missing ?

---

## ["when" attribute in a play](https://forum.ansible.com/t/when-attribute-in-a-play/34357)

<div class="topic-metadata">

**Author:** [@Alan\_Evangelista](https://forum.ansible.com/u/Alan_Evangelista)\
**Replies:** 3\
**Last updated:** [December 18, 2020, 11:32pm UTC](https://forum.ansible.com/t/when-attribute-in-a-play/34357 "2020-12-18T23:32:47Z")

</div>

Today I needed to add a condition to a play in my playbook. If it is true, the tasks are executed. I’d expect this intuitive code to work: hosts:all become:yes when: tasks: … Unfortunately, “when” is not a v…

---

## [Stdout error](https://forum.ansible.com/t/stdout-error/34354)

<div class="topic-metadata">

**Author:** [@Thuan1](https://forum.ansible.com/u/Thuan1)\
**Replies:** 8\
**Last updated:** [December 18, 2020, 6:31pm UTC](https://forum.ansible.com/t/stdout-error/34354 "2020-12-18T18:31:08Z")

</div>

Hi, I’m getting the below error. I’ve tried: service\_status.stdout == ‘enabled’, and service.status.stdout.find(‘enabled’) != -1 but no luck. TASK \[set\_fact\] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*…

---

## [Trouble with win\_chocolatey and OpenSSH](https://forum.ansible.com/t/trouble-with-win-chocolatey-and-openssh/34350)

<div class="topic-metadata">

**Author:** [@Mike\_Alberghini](https://forum.ansible.com/u/Mike_Alberghini)\
**Replies:** 5\
**Last updated:** [December 18, 2020, 5:53pm UTC](https://forum.ansible.com/t/trouble-with-win-chocolatey-and-openssh/34350 "2020-12-18T17:53:25Z")

</div>

I’m using OpenSSH to connect to Windows boxes to avoid having to deal with WinRM. So far it is working pretty good, but I have found an issue and i’m hoping someone has an idea. This is what my tasks looks like: name…

---

## [nxos spanning tree vlan priority](https://forum.ansible.com/t/nxos-spanning-tree-vlan-priority/34355)

<div class="topic-metadata">

**Author:** [@Richard\_Lucht](https://forum.ansible.com/u/Richard_Lucht)\
**Replies:** 1\
**Last updated:** [December 18, 2020, 4:32pm UTC](https://forum.ansible.com/t/nxos-spanning-tree-vlan-priority/34355 "2020-12-18T16:32:54Z")

</div>

I am having some issues in a playbook I am working on. When I create a vlan on a nxos I want to set the spanning-tree vlan “{{ vlan }}” root primary. what I have when it runs errors on me. This is the last bit I need for…

---

## [encrypted password hash question](https://forum.ansible.com/t/encrypted-password-hash-question/34343)

<div class="topic-metadata">

**Author:** [@Rene\_Paquin](https://forum.ansible.com/u/Rene_Paquin)\
**Replies:** 9\
**Last updated:** [December 18, 2020, 2:33pm UTC](https://forum.ansible.com/t/encrypted-password-hash-question/34343 "2020-12-18T14:33:19Z")

</div>

Hi. New ansible user here so just starting out. My first experiment is to create a user with sudo privileges on an Oracle Linux 8 server in my test environment. Here are the contents of the files in the /home/”user”/ansi…

---

## [Ansible 2.8.2 - yum list of local packages](https://forum.ansible.com/t/ansible-2-8-2-yum-list-of-local-packages/34352)

<div class="topic-metadata">

**Author:** [@Ty\_Smith](https://forum.ansible.com/u/Ty_Smith)\
**Replies:** 0\
**Last updated:** [December 18, 2020, 3:40am UTC](https://forum.ansible.com/t/ansible-2-8-2-yum-list-of-local-packages/34352 "2020-12-18T03:40:32Z")

</div>

I get a deprecation warning when running the below task when using yum module with local install. The variable “packages” comes from vars/centos\_6.yml \*\*\*\* This Works but provides deprecated warning \*\*\*\* name: Includ…

---

## [CentOS 7 is end-of-life when using Ansible?](https://forum.ansible.com/t/centos-7-is-end-of-life-when-using-ansible/34345)

<div class="topic-metadata">

**Author:** [@Onno](https://forum.ansible.com/u/Onno)\
**Replies:** 5\
**Last updated:** [December 17, 2020, 8:38pm UTC](https://forum.ansible.com/t/centos-7-is-end-of-life-when-using-ansible/34345 "2020-12-17T20:38:58Z")

</div>

Hi all, I stumbled onto the problem If you require Python 3 support use the dnf Ansible module instead." This message baffles me. It has for some time and I do not understand what it implies or means. My conclusion a…

---

## [Need help with Loop and Stat playbook](https://forum.ansible.com/t/need-help-with-loop-and-stat-playbook/34344)

<div class="topic-metadata">

**Author:** [@Thuan1](https://forum.ansible.com/u/Thuan1)\
**Replies:** 4\
**Last updated:** [December 17, 2020, 8:30pm UTC](https://forum.ansible.com/t/need-help-with-loop-and-stat-playbook/34344 "2020-12-17T20:30:27Z")

</div>

Hi all, I’m try to use the Loop and Stat modules instead Shell command with Ansible playbook. Whenever I run the playbook with --check, I always get the ‘Pass’ message. The error was: error while evaluating conditiona…

---

## [gather facts fails when inventory contains vault variable](https://forum.ansible.com/t/gather-facts-fails-when-inventory-contains-vault-variable/34342)

<div class="topic-metadata">

**Author:** [@Umesha\_A](https://forum.ansible.com/u/Umesha_A)\
**Replies:** 2\
**Last updated:** [December 17, 2020, 7:28pm UTC](https://forum.ansible.com/t/gather-facts-fails-when-inventory-contains-vault-variable/34342 "2020-12-17T19:28:21Z")

</div>

Hi All, With the following inventory file, gather facts gives error. The inventory file has root\_password which is defined in vault and I am passing vault-id in command line. Any ideas ? I am able to access the root\_pas…

---

## [Multiple values for ansible connection properties](https://forum.ansible.com/t/multiple-values-for-ansible-connection-properties/34347)

<div class="topic-metadata">

**Author:** [@Ivan\_Labrovic](https://forum.ansible.com/u/Ivan_Labrovic)\
**Replies:** 4\
**Last updated:** [December 17, 2020, 1:23pm UTC](https://forum.ansible.com/t/multiple-values-for-ansible-connection-properties/34347 "2020-12-17T13:23:13Z")

</div>

Has anyone heard of providing a second --user/–privatekey to ansible-playbook command, just in case the first user/privkey authentication fails? Seem to remember something about this in an Ansible session on the RHEl su…

---

## [Need to enter chroot on remote host](https://forum.ansible.com/t/need-to-enter-chroot-on-remote-host/34335)

<div class="topic-metadata">

**Author:** [@Mathias\_Jung](https://forum.ansible.com/u/Mathias_Jung)\
**Replies:** 3\
**Last updated:** [December 17, 2020, 8:35am UTC](https://forum.ansible.com/t/need-to-enter-chroot-on-remote-host/34335 "2020-12-17T08:35:46Z")

</div>

Hello, some servers i like to manage have a chroot. There I have to run: chroot /home/system/chroot to switch in. There i have to install packages with APT, store configurations, etc. Is there a chance to do that wit…

---

## [Setting a variable in one playbook and using that in another](https://forum.ansible.com/t/setting-a-variable-in-one-playbook-and-using-that-in-another/34339)

<div class="topic-metadata">

**Author:** [@Akshay\_Kumar](https://forum.ansible.com/u/Akshay_Kumar)\
**Replies:** 2\
**Last updated:** [December 16, 2020, 1:31pm UTC](https://forum.ansible.com/t/setting-a-variable-in-one-playbook-and-using-that-in-another/34339 "2020-12-16T13:31:33Z")

</div>

Hi Everyone, Hope all are well . I have a small query where in i want to know if i can set a variable in one playbook and use that in another playbook. For eg Playbook1 : setting a var with output of shell set\_fact: …

---

## [Mapping from hosts to services](https://forum.ansible.com/t/mapping-from-hosts-to-services/34336)

<div class="topic-metadata">

**Author:** [@Axel\_Rau](https://forum.ansible.com/u/Axel_Rau)\
**Replies:** 3\
**Last updated:** [December 16, 2020, 11:57am UTC](https://forum.ansible.com/t/mapping-from-hosts-to-services/34336 "2020-12-16T11:57:07Z")

</div>

Hi all, I’m still in the learning phase. I try to complete a strong normalized approach with all variables and dependencies declared in the inventory with the goal to manage the configuration of a server infrastructure…

---

## [saving login details in remote device](https://forum.ansible.com/t/saving-login-details-in-remote-device/34341)

<div class="topic-metadata">

**Author:** [@anup\_nepal](https://forum.ansible.com/u/anup_nepal)\
**Replies:** 0\
**Last updated:** [December 16, 2020, 11:34am UTC](https://forum.ansible.com/t/saving-login-details-in-remote-device/34341 "2020-12-16T11:34:21Z")

</div>

how can i write the ansible playbook for finding the last login details and saving those details in my remote device and updating in every details when user login with same ip address

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

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