# Ansible Project

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

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

**Page:** 202

---

## [pick the inventory depends on my env variables ?](https://forum.ansible.com/t/pick-the-inventory-depends-on-my-env-variables/29884)

<div class="topic-metadata">

**Author:** [@Sampath\_Kumar](https://forum.ansible.com/u/Sampath_Kumar)\
**Replies:** 1\
**Last updated:** [March 14, 2019, 11:54am UTC](https://forum.ansible.com/t/pick-the-inventory-depends-on-my-env-variables/29884 "2019-03-14T11:54:50Z")

</div>

Hi All Can someone help me on how to execute the AWX template/playbook Template in such a way that it has to pick the inventory depends on my env variables ?

---

## [unable to delete line  file](https://forum.ansible.com/t/unable-to-delete-line-file/29867)

<div class="topic-metadata">

**Author:** [@Deepak\_Sharma](https://forum.ansible.com/u/Deepak_Sharma)\
**Replies:** 4\
**Last updated:** [March 14, 2019, 8:01am UTC](https://forum.ansible.com/t/unable-to-delete-line-file/29867 "2019-03-14T08:01:02Z")

</div>

this is my host file. cat /tmp/node/test.new \[masters\] 1234.abc.com \[nodes\] 453.abc.com openshift\_node\_labels,22,=“{‘region’: ‘us\_midwest’, ‘datacenter’: ‘ctc’, ‘zone’: ‘core’, ‘environment’: ‘nonprod’, ‘logging-infr…

---

## [ant to use my group\_vars variable with loops to assign variable value as argument which i want to run from playbook. for my workaround](https://forum.ansible.com/t/ant-to-use-my-group-vars-variable-with-loops-to-assign-variable-value-as-argument-which-i-want-to-run-from-playbook-for-my-workaround/29883)

<div class="topic-metadata">

**Author:** [@Atul\_Sharma](https://forum.ansible.com/u/Atul_Sharma)\
**Replies:** 0\
**Last updated:** [March 14, 2019, 7:38am UTC](https://forum.ansible.com/t/ant-to-use-my-group-vars-variable-with-loops-to-assign-variable-value-as-argument-which-i-want-to-run-from-playbook-for-my-workaround/29883 "2019-03-14T07:38:39Z")

</div>

I want to use my group\_vars variable with loops to assign variable value as argument which i want to run from playbook. for my workaround group\_vars : app.yml: clay: username\_ice: admin password\_ice: abc1234 nTurn…

---

## [help resolve warnings first role](https://forum.ansible.com/t/help-resolve-warnings-first-role/29879)

<div class="topic-metadata">

**Author:** [@Gaetano\_Giacalone](https://forum.ansible.com/u/Gaetano_Giacalone)\
**Replies:** 2\
**Last updated:** [March 14, 2019, 7:22am UTC](https://forum.ansible.com/t/help-resolve-warnings-first-role/29879 "2019-03-14T07:22:01Z")

</div>

I have this role dagman62.apache\_php it is installing apache/apr with php from source. I am registered variables and when: changed to determine if a tarball changed and needs to be UN-archived, configured, then built. I …

---

## [install.yml Fails](https://forum.ansible.com/t/install-yml-fails/29882)

<div class="topic-metadata">

**Author:** [@Sindhuja\_Koneru](https://forum.ansible.com/u/Sindhuja_Koneru)\
**Replies:** 0\
**Last updated:** [March 14, 2019, 4:21am UTC](https://forum.ansible.com/t/install-yml-fails/29882 "2019-03-14T04:21:11Z")

</div>

Hello, when i run install.yml script that is provided in the bundle, it fails saying awe-manage not found. I suppose awX-manage should be installed with the same script. How can I resolve this error? Any help/input is…

---

## [How to Restore DB from backup file](https://forum.ansible.com/t/how-to-restore-db-from-backup-file/29880)

<div class="topic-metadata">

**Author:** [@Sindhuja\_Koneru](https://forum.ansible.com/u/Sindhuja_Koneru)\
**Replies:** 2\
**Last updated:** [March 14, 2019, 3:15am UTC](https://forum.ansible.com/t/how-to-restore-db-from-backup-file/29880 "2019-03-14T03:15:32Z")

</div>

Hello, Can someone please help me here, not able to figure out why i am unable to run restore.yml that is provided in the bundle. STEP 1:- I have run backup.yml and it successfully created a tar file. STEP 2:- Then I …

---

## [How to format the inventory file for amazon ec2 hosts?](https://forum.ansible.com/t/how-to-format-the-inventory-file-for-amazon-ec2-hosts/29878)

<div class="topic-metadata">

**Author:** [@gigit1000](https://forum.ansible.com/u/gigit1000)\
**Replies:** 1\
**Last updated:** [March 13, 2019, 11:07pm UTC](https://forum.ansible.com/t/how-to-format-the-inventory-file-for-amazon-ec2-hosts/29878 "2019-03-13T23:07:04Z")

</div>

Hello, I am unable to run the example ad hoc command: ansible -m ping hosts --private-key=~/home/ec2-user/ -u ec2-user the error is: \[WARNING\]: Could not match supplied host pattern, ignoring: hosts The hostname is:…

---

## [How to install Ansible to run under Python3 on Amazon Linux?](https://forum.ansible.com/t/how-to-install-ansible-to-run-under-python3-on-amazon-linux/29870)

<div class="topic-metadata">

**Author:** [@gigit1000](https://forum.ansible.com/u/gigit1000)\
**Replies:** 4\
**Last updated:** [March 13, 2019, 8:43pm UTC](https://forum.ansible.com/t/how-to-install-ansible-to-run-under-python3-on-amazon-linux/29870 "2019-03-13T20:43:11Z")

</div>

There are directions here: https://docs.ansible.com/ansible/latest/reference\_appendices/python\_3\_support.html Which say: The easiest way to run /usr/bin/ansible under Python 3 is to install it with the Python3 version …

---

## [Ansible 2.7.8, role dependencies(github repo) in meta/main.yml are not downloaded automatically, why? still have to run ansible-galaxy install -r requirements.yml?](https://forum.ansible.com/t/ansible-2-7-8-role-dependencies-github-repo-in-meta-main-yml-are-not-downloaded-automatically-why-still-have-to-run-ansible-galaxy-install-r-requirements-yml/29872)

<div class="topic-metadata">

**Author:** [@rella.guo](https://forum.ansible.com/u/rella.guo)\
**Replies:** 1\
**Last updated:** [March 13, 2019, 7:03pm UTC](https://forum.ansible.com/t/ansible-2-7-8-role-dependencies-github-repo-in-meta-main-yml-are-not-downloaded-automatically-why-still-have-to-run-ansible-galaxy-install-r-requirements-yml/29872 "2019-03-13T19:03:50Z")

</div>

Ansible verison: 2.7.8 I define role B as Role A dependencies in meta/main.yml like this: dependencies: - { role: B, src: 'git+https://github.xxx/xxx/B.git', version: '1.0' } When I run playbook with Role A, I suppos…

---

## [I want to make a specific loop but don't know the way how to do it](https://forum.ansible.com/t/i-want-to-make-a-specific-loop-but-dont-know-the-way-how-to-do-it/28162)

<div class="topic-metadata">

**Author:** [@Julien](https://forum.ansible.com/u/Julien)\
**Replies:** 5\
**Last updated:** [March 13, 2019, 2:07pm UTC](https://forum.ansible.com/t/i-want-to-make-a-specific-loop-but-dont-know-the-way-how-to-do-it/28162 "2019-03-13T14:07:01Z")

</div>

Hi, Today i’m writting a play and i want to do a specific loop but i dont know to do it, here is the explanation: I’ve created a survey on Tower that is defining the {{ tma\_name }} var, this var should have one, or mul…

---

## [Strange error: Do you have azure\>=2.0.0 installed? Try \`pip install ansible\[azure\]\`- No module named containerservice](https://forum.ansible.com/t/strange-error-do-you-have-azure-2-0-0-installed-try-pip-install-ansible-azure-no-module-named-containerservice/29860)

<div class="topic-metadata">

**Author:** [@tselios.petros](https://forum.ansible.com/u/tselios.petros)\
**Replies:** 2\
**Last updated:** [March 13, 2019, 1:27pm UTC](https://forum.ansible.com/t/strange-error-do-you-have-azure-2-0-0-installed-try-pip-install-ansible-azure-no-module-named-containerservice/29860 "2019-03-13T13:27:20Z")

</div>

Hello, I am puzzled from the under subject error message. I have a very simple playbook that creates an Azure Resource Group. However, when I execute it it generates this error message. Of course, I have the latest pa…

---

## [Encrypted passwords not working, clear text does](https://forum.ansible.com/t/encrypted-passwords-not-working-clear-text-does/29869)

<div class="topic-metadata">

**Author:** [@John\_Harmon](https://forum.ansible.com/u/John_Harmon)\
**Replies:** 2\
**Last updated:** [March 12, 2019, 9:12pm UTC](https://forum.ansible.com/t/encrypted-passwords-not-working-clear-text-does/29869 "2019-03-12T21:12:11Z")

</div>

For my credssp (windows) to work, I need ansible\_user and ansible\_password set. I can set these in plain text in a variable, and everything works fine; however, when experimenting with vars\_prompt I attempt the same thin…

---

## [retrieving facter\_ec2\_metadata from hostvars - can't get element in macs](https://forum.ansible.com/t/retrieving-facter-ec2-metadata-from-hostvars-cant-get-element-in-macs/29828)

<div class="topic-metadata">

**Author:** [@Chris\_Jefferies](https://forum.ansible.com/u/Chris_Jefferies)\
**Replies:** 5\
**Last updated:** [March 12, 2019, 7:03pm UTC](https://forum.ansible.com/t/retrieving-facter-ec2-metadata-from-hostvars-cant-get-element-in-macs/29828 "2019-03-12T19:03:10Z")

</div>

I can drill down into hostvars like this: \` debug: msg: “looking at interface macs: {{ hostvars\[inventory\_hostname\].facter\_ec2\_metadata.network.interfaces.macs }}” \` And I get something like this: \` ok: \[db01.dev…

---

## [Inlinefile module keep adding a line when it does exists](https://forum.ansible.com/t/inlinefile-module-keep-adding-a-line-when-it-does-exists/29838)

<div class="topic-metadata">

**Author:** [@Jean\_Carlo](https://forum.ansible.com/u/Jean_Carlo)\
**Replies:** 2\
**Last updated:** [March 12, 2019, 1:03pm UTC](https://forum.ansible.com/t/inlinefile-module-keep-adding-a-line-when-it-does-exists/29838 "2019-03-12T13:03:00Z")

</div>

Hello I want to change the configuration of vim, in order to do set mouse=r. At the beginning this line is commented by default. Using inlinefile module, I check by regexp the line commented and I replace it with the n…

---

## [Export gathering facts to .csv file](https://forum.ansible.com/t/export-gathering-facts-to-csv-file/29832)

<div class="topic-metadata">

**Author:** [@michal.misiak](https://forum.ansible.com/u/michal.misiak)\
**Replies:** 3\
**Last updated:** [March 12, 2019, 10:32am UTC](https://forum.ansible.com/t/export-gathering-facts-to-csv-file/29832 "2019-03-12T10:32:34Z")

</div>

Hello, I’m new user in Ansible technology and I have a problem with export gathering facts about host to .csv file. I would like to generate report in .csv file from ansible-playbook results. Ansible playbook reads fac…

---

## [Apt Update exclude Packages (Blacklist)](https://forum.ansible.com/t/apt-update-exclude-packages-blacklist/29861)

<div class="topic-metadata">

**Author:** [@Face\_Gaming](https://forum.ansible.com/u/Face_Gaming)\
**Replies:** 4\
**Last updated:** [March 12, 2019, 8:50am UTC](https://forum.ansible.com/t/apt-update-exclude-packages-blacklist/29861 "2019-03-12T08:50:51Z")

</div>

Hey Guys I would like to know, if its possible to exclude packages from an apt update or a blacklist for packages, which shouldn’t be updated. Thanks for your help! Greetings

---

## [Can ios\_config handle responding to two prompts in a row?](https://forum.ansible.com/t/can-ios-config-handle-responding-to-two-prompts-in-a-row/29859)

<div class="topic-metadata">

**Author:** [@ibdg](https://forum.ansible.com/u/ibdg)\
**Replies:** 3\
**Last updated:** [March 11, 2019, 10:52pm UTC](https://forum.ansible.com/t/can-ios-config-handle-responding-to-two-prompts-in-a-row/29859 "2019-03-11T22:52:13Z")

</div>

Cross posted from stackoverflow I’m setting up a root CA on a Cisco IOS router and trying to use the ios\_command module to run the command crypto pki server my-ca start. On running it, the following happens: GW1(confi…

---

## [with\_items question](https://forum.ansible.com/t/with-items-question/29856)

<div class="topic-metadata">

**Author:** [@liverpudlian88](https://forum.ansible.com/u/liverpudlian88)\
**Replies:** 4\
**Last updated:** [March 11, 2019, 10:12pm UTC](https://forum.ansible.com/t/with-items-question/29856 "2019-03-11T22:12:25Z")

</div>

Hello, I am kinda new to Ansible, I would appreciate if you could assist me with a question, I am trying to do the following in a role in a playbook 1- Copy 3 zip files to a specific destination 2- Unzip only the firs…

---

## [conditionals](https://forum.ansible.com/t/conditionals/29862)

<div class="topic-metadata">

**Author:** [@Jeffrey\_Agnitsch](https://forum.ansible.com/u/Jeffrey_Agnitsch)\
**Replies:** 1\
**Last updated:** [March 11, 2019, 8:06pm UTC](https://forum.ansible.com/t/conditionals/29862 "2019-03-11T20:06:27Z")

</div>

Trying to do a conditional that when my inventory host name once converted to a string is greater than a number Inventory file server1 server2 server3 - … … … … … server205 this is the important parts of the r…

---

## [How can i run a block of playbook instructions only if they pass the specified condition?](https://forum.ansible.com/t/how-can-i-run-a-block-of-playbook-instructions-only-if-they-pass-the-specified-condition/29761)

<div class="topic-metadata">

**Author:** [@Ankit2](https://forum.ansible.com/u/Ankit2)\
**Replies:** 4\
**Last updated:** [March 11, 2019, 4:38pm UTC](https://forum.ansible.com/t/how-can-i-run-a-block-of-playbook-instructions-only-if-they-pass-the-specified-condition/29761 "2019-03-11T16:38:08Z")

</div>

I have got a playbook where i need to check if the host fact for reboot is set to true, i need to execute the rest of the instructions for that particular host in the inventory only if the reboot condition is true. Foll…

---

## [Access to variables defined in roles from python script](https://forum.ansible.com/t/access-to-variables-defined-in-roles-from-python-script/29837)

<div class="topic-metadata">

**Author:** [@wnelis294](https://forum.ansible.com/u/wnelis294)\
**Replies:** 2\
**Last updated:** [March 11, 2019, 11:43am UTC](https://forum.ansible.com/t/access-to-variables-defined-in-roles-from-python-script/29837 "2019-03-11T11:43:41Z")

</div>

I am an ansible newbie. My first non-trivial ansible project is to update / optimize the configuration of Juniper switches. The ansible modules are not run on the Juniper switch but locally on the ansible controller. The…

---

## [aws inventory: \`hostname\_variable = tag\_Name\` not working](https://forum.ansible.com/t/aws-inventory-hostname-variable-tag-name-not-working/29858)

<div class="topic-metadata">

**Author:** [@senorsmile](https://forum.ansible.com/u/senorsmile)\
**Replies:** 1\
**Last updated:** [March 10, 2019, 11:55pm UTC](https://forum.ansible.com/t/aws-inventory-hostname-variable-tag-name-not-working/29858 "2019-03-10T23:55:49Z")

</div>

I haven’t used Ansible with AWS for a while. I am using it on a new project. I see a newer option that didn’t used to be there: hostname\_variable = tag\_Name My understanding of this variable is that it will use the Na…

---

## [fetching the right output](https://forum.ansible.com/t/fetching-the-right-output/29480)

<div class="topic-metadata">

**Author:** [@Vino\_Thiyagu](https://forum.ansible.com/u/Vino_Thiyagu)\
**Replies:** 3\
**Last updated:** [March 9, 2019, 10:06pm UTC](https://forum.ansible.com/t/fetching-the-right-output/29480 "2019-03-09T22:06:00Z")

</div>

HI team, I have a output as below. but still I need to pick the right value fro this output. I need only the change no as in record field, it working fine for single run but it failing when in loop. can some one help me…

---

## [infini\_host module](https://forum.ansible.com/t/infini-host-module/29820)

<div class="topic-metadata">

**Author:** [@Bruno\_Cochofel](https://forum.ansible.com/u/Bruno_Cochofel)\
**Replies:** 6\
**Last updated:** [March 9, 2019, 3:23pm UTC](https://forum.ansible.com/t/infini-host-module/29820 "2019-03-09T15:23:00Z")

</div>

Hi, I have infinidat storage and I’m trying to use the ansible modules, but I’m stucked on the connection. I cannot figure out from the documentation how to connect to the storage. I have the following:

---

## [win\_update on domain controller using a "Domain User" account.](https://forum.ansible.com/t/win-update-on-domain-controller-using-a-domain-user-account/29846)

<div class="topic-metadata">

**Author:** [@Flavio\_Gobber](https://forum.ansible.com/u/Flavio_Gobber)\
**Replies:** 3\
**Last updated:** [March 8, 2019, 11:38pm UTC](https://forum.ansible.com/t/win-update-on-domain-controller-using-a-domain-user-account/29846 "2019-03-08T23:38:30Z")

</div>

Hello, I am using a “Domain User” to upgrade the windows server 2012 and 2016, on these server I have assigned to the this account to the local “Administrators” group. With this method the update works well. How can I…

---

## [rpm-python centos5 package package\_facts](https://forum.ansible.com/t/rpm-python-centos5-package-package-facts/29854)

<div class="topic-metadata">

**Author:** [@Adam\_E](https://forum.ansible.com/u/Adam_E)\
**Replies:** 5\
**Last updated:** [March 8, 2019, 11:32pm UTC](https://forum.ansible.com/t/rpm-python-centos5-package-package-facts/29854 "2019-03-08T23:32:29Z")

</div>

hey there, i’m trying to manage a bunch of centos5/rhel5 systems with ansible 2.7.5 On the target host I am able to install python 2.6 from epel which is all good and ansible runs just fine for most stuff. The issue is …

---

## [how can I use ansible openssl\_certificate module to gather facts about installed ssl certificates on application servers?](https://forum.ansible.com/t/how-can-i-use-ansible-openssl-certificate-module-to-gather-facts-about-installed-ssl-certificates-on-application-servers/29855)

<div class="topic-metadata">

**Author:** [@Jason\_Yu](https://forum.ansible.com/u/Jason_Yu)\
**Replies:** 0\
**Last updated:** [March 8, 2019, 10:41pm UTC](https://forum.ansible.com/t/how-can-i-use-ansible-openssl-certificate-module-to-gather-facts-about-installed-ssl-certificates-on-application-servers/29855 "2019-03-08T22:41:44Z")

</div>

Dear ansible friends here: I got a request to collect the facts like expiration date, issuer for each ssl certificates on linux servers. I plan to use openssl\_certificate module and use the return values to pop out the…

---

## [Ansible Playbook output to local file](https://forum.ansible.com/t/ansible-playbook-output-to-local-file/29850)

<div class="topic-metadata">

**Author:** [@Chris\_Bidwell](https://forum.ansible.com/u/Chris_Bidwell)\
**Replies:** 2\
**Last updated:** [March 8, 2019, 6:23pm UTC](https://forum.ansible.com/t/ansible-playbook-output-to-local-file/29850 "2019-03-08T18:23:08Z")

</div>

Hi all, So I’ve got this playbook that is getting information from all of my hosts in my inventory and outputting that data to a local file. However, it’s not outputting on EVERY inventory host. It’s going through the l…

---

## [remplace: "{{ mon\_groupe | replace('&', '\\&') }}"](https://forum.ansible.com/t/remplace-mon-groupe-replace/29847)

<div class="topic-metadata">

**Author:** [@ryad9200000](https://forum.ansible.com/u/ryad9200000)\
**Replies:** 6\
**Last updated:** [March 8, 2019, 6:05pm UTC](https://forum.ansible.com/t/remplace-mon-groupe-replace/29847 "2019-03-08T18:05:18Z")

</div>

hi all, I want replace all caracter " & " by " & " set\_fact: remplace: “{{ mon\_groupe | replace(‘&’, ‘&’) }}” but when i use this task it’s not work. It’s works only i skip " \\ " Someone have an idea please !! …

---

## [user creating using htpasswd](https://forum.ansible.com/t/user-creating-using-htpasswd/29851)

<div class="topic-metadata">

**Author:** [@Naveen\_kumar\_H\_M](https://forum.ansible.com/u/Naveen_kumar_H_M)\
**Replies:** 0\
**Last updated:** [March 8, 2019, 4:34pm UTC](https://forum.ansible.com/t/user-creating-using-htpasswd/29851 "2019-03-08T16:34:39Z")

</div>

I tried to creating user using Ansible playbook and i got this error FAILED! =\> {“changed”: false, “msg”: “This module requires the passlib Python library”} I have installe passlib ( version 1.7.1) on both local and ta…

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

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