# Ansible Project

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

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

**Page:** 277

---

## [Error while using Yum install packages on existing rhel template on VMware](https://forum.ansible.com/t/error-while-using-yum-install-packages-on-existing-rhel-template-on-vmware/26917)

<div class="topic-metadata">

**Author:** [@Shiva\_Gonela](https://forum.ansible.com/u/Shiva_Gonela)\
**Replies:** 0\
**Last updated:** [March 7, 2018, 8:03am UTC](https://forum.ansible.com/t/error-while-using-yum-install-packages-on-existing-rhel-template-on-vmware/26917 "2018-03-07T08:03:36Z")

</div>

Hi team, we are facing issues provisioning the rhel VM in Vmware environment using the existing template. here are list of tasks we are performing – provisioning the rhel Vm using existing template used vmware\_guest mo…

---

## [pick the hostname dynamically from facts and match with inventory hostname and if matched then run the command](https://forum.ansible.com/t/pick-the-hostname-dynamically-from-facts-and-match-with-inventory-hostname-and-if-matched-then-run-the-command/26915)

<div class="topic-metadata">

**Author:** [@rraka1002](https://forum.ansible.com/u/rraka1002)\
**Replies:** 2\
**Last updated:** [March 7, 2018, 8:00am UTC](https://forum.ansible.com/t/pick-the-hostname-dynamically-from-facts-and-match-with-inventory-hostname-and-if-matched-then-run-the-command/26915 "2018-03-07T08:00:11Z")

</div>

I’m looking for an idea to spill the hostname infromation geting from facts and run the command if the matches the hostname provided in inventory. Saying that “myhostname” value should be picked & matched from inventory…

---

## [When condition ignored during the includes and loops](https://forum.ansible.com/t/when-condition-ignored-during-the-includes-and-loops/26916)

<div class="topic-metadata">

**Author:** [@Raj5](https://forum.ansible.com/u/Raj5)\
**Replies:** 0\
**Last updated:** [March 7, 2018, 7:50am UTC](https://forum.ansible.com/t/when-condition-ignored-during-the-includes-and-loops/26916 "2018-03-07T07:50:42Z")

</div>

Hello, Can some one help me on below issue, When condition got ignored if I use Includes and loops. main.yml \`

---

## [Reading each line in CSV file and use the items and execute the SQL statement against a remote Database.](https://forum.ansible.com/t/reading-each-line-in-csv-file-and-use-the-items-and-execute-the-sql-statement-against-a-remote-database/26846)

<div class="topic-metadata">

**Author:** [@Raj5](https://forum.ansible.com/u/Raj5)\
**Replies:** 8\
**Last updated:** [March 7, 2018, 12:02am UTC](https://forum.ansible.com/t/reading-each-line-in-csv-file-and-use-the-items-and-execute-the-sql-statement-against-a-remote-database/26846 "2018-03-07T00:02:57Z")

</div>

Hello Ansible Gurus, I have a CSV file as below. “DB\_SCHEMA”,“SYSTEM\_USER”,“SYSTEM\_PASSWORD”,“TNS\_NAME”,“TNS\_DESCRIPTION” “Client\_Schema1”,“user”,“password”,“TNSNAME”,“(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=SANDBOX…

---

## [Newbie: Error running ansible playbook](https://forum.ansible.com/t/newbie-error-running-ansible-playbook/26904)

<div class="topic-metadata">

**Author:** [@Vishlesh\_Patel](https://forum.ansible.com/u/Vishlesh_Patel)\
**Replies:** 4\
**Last updated:** [March 6, 2018, 10:30pm UTC](https://forum.ansible.com/t/newbie-error-running-ansible-playbook/26904 "2018-03-06T22:30:01Z")

</div>

hosts: CSRs gather\_facts: false connection: local tasks: name: test show run ios\_config: authorize: yes lines: do show run I have the above simple show\_run.yaml ansible playbook. While i run this playbook I am …

---

## [Having trouble copying registered result to local file.](https://forum.ansible.com/t/having-trouble-copying-registered-result-to-local-file/26906)

<div class="topic-metadata">

**Author:** [@MarcG](https://forum.ansible.com/u/MarcG)\
**Replies:** 2\
**Last updated:** [March 6, 2018, 9:43pm UTC](https://forum.ansible.com/t/having-trouble-copying-registered-result-to-local-file/26906 "2018-03-06T21:43:19Z")

</div>

Hi, I am trying to save some results that I have registered to a file on my local machine ( that is running ansible ) The error I am getting is very generic and of no use. Below is the playbook and the resulting error \`…

---

## [get the value of Json vars ansible](https://forum.ansible.com/t/get-the-value-of-json-vars-ansible/26910)

<div class="topic-metadata">

**Author:** [@Brunet\_Julien](https://forum.ansible.com/u/Brunet_Julien)\
**Replies:** 1\
**Last updated:** [March 6, 2018, 7:06pm UTC](https://forum.ansible.com/t/get-the-value-of-json-vars-ansible/26910 "2018-03-06T19:06:36Z")

</div>

Hello I faced a issue with items , i would like to get the value of Json vars. But i can’t access/get the value. I write this ansible script : \`

---

## [trouble iterating through stdout\_lines](https://forum.ansible.com/t/trouble-iterating-through-stdout-lines/26908)

<div class="topic-metadata">

**Author:** [@MarcG](https://forum.ansible.com/u/MarcG)\
**Replies:** 1\
**Last updated:** [March 6, 2018, 6:35pm UTC](https://forum.ansible.com/t/trouble-iterating-through-stdout-lines/26908 "2018-03-06T18:35:57Z")

</div>

Hi, I am trying to work out how to iterate through some results from a command I am running on a network device. the idea is when I find the line that matches what I am looking for based on a regexp I want to store it. …

---

## [Variables in lookup statement for vault](https://forum.ansible.com/t/variables-in-lookup-statement-for-vault/26902)

<div class="topic-metadata">

**Author:** [@K\_S-Dean](https://forum.ansible.com/u/K_S-Dean)\
**Replies:** 1\
**Last updated:** [March 6, 2018, 6:19pm UTC](https://forum.ansible.com/t/variables-in-lookup-statement-for-vault/26902 "2018-03-06T18:19:22Z")

</div>

"{{ lookup('vault', 'pki/issue/webserver common\_name=\\"test.example.com\\" ip\_sans=\\"{{ IP\_ADDR }}, {{ var=hostvars\[inventory\_hostname\].ansible\_ssh\_host }}\\" format=\\"pem\\" key\_bits=4096').certificate }}" Hi im trying to…

---

## [HP Procurve switch](https://forum.ansible.com/t/hp-procurve-switch/26839)

<div class="topic-metadata">

**Author:** [@DOkuwa](https://forum.ansible.com/u/DOkuwa)\
**Replies:** 2\
**Last updated:** [March 6, 2018, 10:08am UTC](https://forum.ansible.com/t/hp-procurve-switch/26839 "2018-03-06T10:08:56Z")

</div>

Does any one knows how to backup the config of HP Procurve using Ansible. Has anyone done this backup I can’t see any information on the networking module

---

## [Issue in 2.5.0rc1 with digital\_ocean module: "Server was unable to give you a response"](https://forum.ansible.com/t/issue-in-2-5-0rc1-with-digital-ocean-module-server-was-unable-to-give-you-a-response/26907)

<div class="topic-metadata">

**Author:** [@Denise\_Draper](https://forum.ansible.com/u/Denise_Draper)\
**Replies:** 0\
**Last updated:** [March 6, 2018, 7:58am UTC](https://forum.ansible.com/t/issue-in-2-5-0rc1-with-digital-ocean-module-server-was-unable-to-give-you-a-response/26907 "2018-03-06T07:58:47Z")

</div>

Hi — Previously working command isn’t working as of tonight. I’m pretty sure it did previously work after I upgraded to ansible 2.5.0rc1, but I could be wrong about that. The specific and the response are below. I think…

---

## [debug module does not escape double quotes](https://forum.ansible.com/t/debug-module-does-not-escape-double-quotes/26900)

<div class="topic-metadata">

**Author:** [@rasha\_hajlaoui](https://forum.ansible.com/u/rasha_hajlaoui)\
**Replies:** 2\
**Last updated:** [March 6, 2018, 7:40am UTC](https://forum.ansible.com/t/debug-module-does-not-escape-double-quotes/26900 "2018-03-06T07:40:10Z")

</div>

Hello guys, I’ve got a problem with ansible playbook. In fact, I use debug module to display a file content. the content of myfile is : my playbook.yml is as follow: name: Display file content shell: cat myfile …

---

## [How do I access the cpu %usage in this example? I'm getting an error no matter what I try.](https://forum.ansible.com/t/how-do-i-access-the-cpu-usage-in-this-example-im-getting-an-error-no-matter-what-i-try/26896)

<div class="topic-metadata">

**Author:** [@MarcG](https://forum.ansible.com/u/MarcG)\
**Replies:** 4\
**Last updated:** [March 6, 2018, 4:11am UTC](https://forum.ansible.com/t/how-do-i-access-the-cpu-usage-in-this-example-im-getting-an-error-no-matter-what-i-try/26896 "2018-03-06T04:11:24Z")

</div>

Hi, I am using the Napalm module with Ansible and using its get\_facts module to obtain some basic information from the device. The relevant output is below, \` “ansible\_facts”: { “napalm\_environment”: { “cpu”: { “0”…

---

## [how to specify log-opt of docker run in ansible to limit the log size of a container?](https://forum.ansible.com/t/how-to-specify-log-opt-of-docker-run-in-ansible-to-limit-the-log-size-of-a-container/26905)

<div class="topic-metadata">

**Author:** [@Tang\_Ye](https://forum.ansible.com/u/Tang_Ye)\
**Replies:** 0\
**Last updated:** [March 6, 2018, 12:53am UTC](https://forum.ansible.com/t/how-to-specify-log-opt-of-docker-run-in-ansible-to-limit-the-log-size-of-a-container/26905 "2018-03-06T00:53:13Z")

</div>

I am using ansible playbook to deploy my app with docker in Jenkins, Recently I want to limit the log size of the app container, with “docker run” has “–log-opt max-size=xxxm” option, but How can I add the same function …

---

## ["absolute" (root) include\_tasks path](https://forum.ansible.com/t/absolute-root-include-tasks-path/26903)

<div class="topic-metadata">

**Author:** [@Josef\_Fortier](https://forum.ansible.com/u/Josef_Fortier)\
**Replies:** 3\
**Last updated:** [March 6, 2018, 12:08am UTC](https://forum.ansible.com/t/absolute-root-include-tasks-path/26903 "2018-03-06T00:08:44Z")

</div>

Just looking for possible better approaches for specifying a semi absolute path to include\_tasks. I’ve come up with this: vars: pwd: ‘{{ lookup(“env”, “PWD”) }}’ And then constructing the include path with this varia…

---

## [assert and fail. When to use what?](https://forum.ansible.com/t/assert-and-fail-when-to-use-what/26621)

<div class="topic-metadata">

**Author:** [@Varun\_Chopra](https://forum.ansible.com/u/Varun_Chopra)\
**Replies:** 1\
**Last updated:** [March 5, 2018, 5:00pm UTC](https://forum.ansible.com/t/assert-and-fail-when-to-use-what/26621 "2018-03-05T17:00:57Z")

</div>

Hi, I’ve been working on a playbook that asserts prerequisites required for a mssql installation and I’m not entirely confident with what I’ve come up with. https://gist.githubusercontent.com/chopraaa/1b74480a7b286ee91…

---

## [Dynamic Inventory using Google Cloud Platform](https://forum.ansible.com/t/dynamic-inventory-using-google-cloud-platform/26801)

<div class="topic-metadata">

**Author:** [@Chrisy](https://forum.ansible.com/u/Chrisy)\
**Replies:** 6\
**Last updated:** [March 5, 2018, 1:47pm UTC](https://forum.ansible.com/t/dynamic-inventory-using-google-cloud-platform/26801 "2018-03-05T13:47:38Z")

</div>

We are trying to configure Google compute engine resources using dynamic inventory in ANSIBLE We are getting the below error when we run the command: $ ./gce.py --list File “./gce.py”, line 508, in GceInventory() Fi…

---

## [Error: 'import\_playbook' has extra params](https://forum.ansible.com/t/error-import-playbook-has-extra-params/26898)

<div class="topic-metadata">

**Author:** [@kavya\_KULSHRESHTHA](https://forum.ansible.com/u/kavya_KULSHRESHTHA)\
**Replies:** 1\
**Last updated:** [March 5, 2018, 11:40am UTC](https://forum.ansible.com/t/error-import-playbook-has-extra-params/26898 "2018-03-05T11:40:14Z")

</div>

Hi, I am using ansible 2.4.4 I have a role, where in main.yml I am importing two playbooks: main.yml: \`

---

## [Ansible and VMware vCloud Automation Center](https://forum.ansible.com/t/ansible-and-vmware-vcloud-automation-center/26899)

<div class="topic-metadata">

**Author:** [@mehdi\_mrhari](https://forum.ansible.com/u/mehdi_mrhari)\
**Replies:** 0\
**Last updated:** [March 5, 2018, 10:12am UTC](https://forum.ansible.com/t/ansible-and-vmware-vcloud-automation-center/26899 "2018-03-05T10:12:32Z")

</div>

Hi community, I would like to know is there is a module, or a way to automate the launch of a blueprint or catalog VCAC from Ansible. Thank you.

---

## [How to read the local variables in a role](https://forum.ansible.com/t/how-to-read-the-local-variables-in-a-role/26885)

<div class="topic-metadata">

**Author:** [@Guillermo\_Colmena](https://forum.ansible.com/u/Guillermo_Colmena)\
**Replies:** 1\
**Last updated:** [March 5, 2018, 9:19am UTC](https://forum.ansible.com/t/how-to-read-the-local-variables-in-a-role/26885 "2018-03-05T09:19:12Z")

</div>

Hi community, I was forwarded from github website to this group ; ) I am trying to use local variables on the roles I have created, but once the var file is created. I don’t know how and from where call those. At the m…

---

## [Trying to capture value from with\_lines loop](https://forum.ansible.com/t/trying-to-capture-value-from-with-lines-loop/26895)

<div class="topic-metadata">

**Author:** [@Evan](https://forum.ansible.com/u/Evan)\
**Replies:** 2\
**Last updated:** [March 5, 2018, 6:27am UTC](https://forum.ansible.com/t/trying-to-capture-value-from-with-lines-loop/26895 "2018-03-05T06:27:57Z")

</div>

I’m trying to loop through a list (file) of powervc regions, delegating a command to them, and if that command (find a vm) is successful (ie: the vm is on that region) I want to record the region name. I’m using delegate…

---

## [\[become: yes\] doesn't work. Failed to run playbook on AWS EC2 Ubuntu instance](https://forum.ansible.com/t/become-yes-doesnt-work-failed-to-run-playbook-on-aws-ec2-ubuntu-instance/26892)

<div class="topic-metadata">

**Author:** [@Viktor\_Chernov](https://forum.ansible.com/u/Viktor_Chernov)\
**Replies:** 1\
**Last updated:** [March 4, 2018, 9:25am UTC](https://forum.ansible.com/t/become-yes-doesnt-work-failed-to-run-playbook-on-aws-ec2-ubuntu-instance/26892 "2018-03-04T09:25:51Z")

</div>

dexter@dexter-X55A /opt/SSH $ ansible --version ansible 2.4.3.0 config file = /etc/ansible/ansible.cfg configured module search path = \[u'/home/dexter/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules'\] ans…

---

## [How to use wilde card to remove packages (dnf)](https://forum.ansible.com/t/how-to-use-wilde-card-to-remove-packages-dnf/26886)

<div class="topic-metadata">

**Author:** [@\_rabin](https://forum.ansible.com/u/_rabin)\
**Replies:** 6\
**Last updated:** [March 4, 2018, 12:19am UTC](https://forum.ansible.com/t/how-to-use-wilde-card-to-remove-packages-dnf/26886 "2018-03-04T00:19:56Z")

</div>

Hello all, I like to use Ansible to remove few packages, but it seem not to support the wildecard option for package name matching. name: Remove Packages package: name: “{{ item }}” state: absent tags: packages\_re…

---

## [Error: Argument must be an int,or have a file() method](https://forum.ansible.com/t/error-argument-must-be-an-int-or-have-a-file-method/26890)

<div class="topic-metadata">

**Author:** [@ramesh1](https://forum.ansible.com/u/ramesh1)\
**Replies:** 0\
**Last updated:** [March 3, 2018, 7:11am UTC](https://forum.ansible.com/t/error-argument-must-be-an-int-or-have-a-file-method/26890 "2018-03-03T07:11:21Z")

</div>

Hi Team, I am new to ansible please help on this here I am getting error like this : 178.128.22.23 | UNREACHABLE! =\> { “changed”: false, “msg”: “Failed to connect to the host via ssh.”, “unreachable”: true } My …

---

## [Modify uid/gid if exists, but don't create if absent](https://forum.ansible.com/t/modify-uid-gid-if-exists-but-dont-create-if-absent/26889)

<div class="topic-metadata">

**Author:** [@John\_Harmon](https://forum.ansible.com/u/John_Harmon)\
**Replies:** 3\
**Last updated:** [March 2, 2018, 8:56pm UTC](https://forum.ansible.com/t/modify-uid-gid-if-exists-but-dont-create-if-absent/26889 "2018-03-02T20:56:04Z")

</div>

I don’t see a way to do this with ansible, but perhaps I am missing something. I have a need to change the uid/gid of users/groups on a bunch of servers; however, I don’t wish to create the user/group if it is missing, I…

---

## [How to run "sudo command" as ssh user without switching to become\_user?](https://forum.ansible.com/t/how-to-run-sudo-command-as-ssh-user-without-switching-to-become-user/26881)

<div class="topic-metadata">

**Author:** [@Kevin1](https://forum.ansible.com/u/Kevin1)\
**Replies:** 4\
**Last updated:** [March 2, 2018, 4:50pm UTC](https://forum.ansible.com/t/how-to-run-sudo-command-as-ssh-user-without-switching-to-become-user/26881 "2018-03-02T16:50:05Z")

</div>

Hi, I’m connecting to my host as “user1” and my become user name is “user2”. The only account that has sudo privs to run the “do-something” command is user1. Attempt 1: I’m trying to run the following task, but it do…

---

## [/tmp/.ansible/tmp not write-able by all users](https://forum.ansible.com/t/tmp-ansible-tmp-not-write-able-by-all-users/26887)

<div class="topic-metadata">

**Author:** [@Mike\_Cavedon](https://forum.ansible.com/u/Mike_Cavedon)\
**Replies:** 3\
**Last updated:** [March 2, 2018, 3:49pm UTC](https://forum.ansible.com/t/tmp-ansible-tmp-not-write-able-by-all-users/26887 "2018-03-02T15:49:57Z")

</div>

I changed remote\_tmp to /tmp/.ansible/tmp for performance reasons. The directory is created as follows: \[tmp\]$ ls -ld .ansible drwx------ 3 ec2-user ec2-user 4096 Mar 2 09:47 .ansible When a different user attempts to…

---

## [Cannot use sed inside it](https://forum.ansible.com/t/cannot-use-sed-inside-it/26888)

<div class="topic-metadata">

**Author:** [@Alexandre\_MARRE](https://forum.ansible.com/u/Alexandre_MARRE)\
**Replies:** 0\
**Last updated:** [March 2, 2018, 3:48pm UTC](https://forum.ansible.com/t/cannot-use-sed-inside-it/26888 "2018-03-02T15:48:35Z")

</div>

Hello, I have a little bug with ansible parser I can’t execute this code in ansible: This code works on shell \` echo “INSERT INTO scripts VALUES (‘1’, ‘install-debian’, ‘$(cat startupscripts/install-debian.sh | sed "s…

---

## [Ansible 2.4.4 RC1 is ready for testing](https://forum.ansible.com/t/ansible-2-4-4-rc1-is-ready-for-testing/26883)

<div class="topic-metadata">

**Author:** [@tkuratom](https://forum.ansible.com/u/tkuratom)\
**Replies:** 0\
**Last updated:** [March 2, 2018, 2:44am UTC](https://forum.ansible.com/t/ansible-2-4-4-rc1-is-ready-for-testing/26883 "2018-03-02T02:44:36Z")

</div>

Hi all, we're happy to announce that RC1 for 2.4.4 is now available for testing. How do you get it?

---

## [when: search stdout\_lines](https://forum.ansible.com/t/when-search-stdout-lines/26882)

<div class="topic-metadata">

**Author:** [@John\_Harmon](https://forum.ansible.com/u/John_Harmon)\
**Replies:** 1\
**Last updated:** [March 1, 2018, 11:03pm UTC](https://forum.ansible.com/t/when-search-stdout-lines/26882 "2018-03-01T23:03:07Z")

</div>

I can’t seem to find the proper syntax to search the stdout\_lines for a string. Consider the following. \` tasks: name: List home dirs shell: “ls /home” register: home changed\_when: false name: List scripts dir…

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

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