# Ansible Project

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

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

**Page:** 204

---

## [Ansible CloudFormation module parameters file](https://forum.ansible.com/t/ansible-cloudformation-module-parameters-file/29811)

<div class="topic-metadata">

**Author:** [@Raveendran\_Kumaravel](https://forum.ansible.com/u/Raveendran_Kumaravel)\
**Replies:** 0\
**Last updated:** [March 2, 2019, 4:15am UTC](https://forum.ansible.com/t/ansible-cloudformation-module-parameters-file/29811 "2019-03-02T04:15:44Z")

</div>

Hi, I tested invoking Ansible CloudFormation module from a playbook. by passing required cloudformation parameters. Just wondering is it possible to pass parameter file to a cloudformation module inside playbook Similar …

---

## [How to reference previous play's hostname and host\_vars in a jinja2 template](https://forum.ansible.com/t/how-to-reference-previous-plays-hostname-and-host-vars-in-a-jinja2-template/29810)

<div class="topic-metadata">

**Author:** [@Bharath\_Kumar2](https://forum.ansible.com/u/Bharath_Kumar2)\
**Replies:** 0\
**Last updated:** [March 2, 2019, 3:38am UTC](https://forum.ansible.com/t/how-to-reference-previous-plays-hostname-and-host-vars-in-a-jinja2-template/29810 "2019-03-02T03:38:51Z")

</div>

Hello Ansible experts, I am having a ‘hostgroup’ with a ‘host\_var’ associated with each host of the ‘hostgroup’. Play 1 which targets the ‘hostgroup’, will create files on the target servers using the associated ‘host\_va…

---

## [how could I use python 3 for ansible command](https://forum.ansible.com/t/how-could-i-use-python-3-for-ansible-command/29809)

<div class="topic-metadata">

**Author:** [@Jason\_Yu](https://forum.ansible.com/u/Jason_Yu)\
**Replies:** 0\
**Last updated:** [March 2, 2019, 1:36am UTC](https://forum.ansible.com/t/how-could-i-use-python-3-for-ansible-command/29809 "2019-03-02T01:36:45Z")

</div>

I have two versions of python installed. If I don’t run the scl command, I will use python 2.7, but when I use scl command, it swith to use python 3. What is the difference between these two methods? When I try to see w…

---

## [Get indice in file if caracter present](https://forum.ansible.com/t/get-indice-in-file-if-caracter-present/29792)

<div class="topic-metadata">

**Author:** [@ryad9200000](https://forum.ansible.com/u/ryad9200000)\
**Replies:** 2\
**Last updated:** [March 1, 2019, 11:02pm UTC](https://forum.ansible.com/t/get-indice-in-file-if-caracter-present/29792 "2019-03-01T23:02:22Z")

</div>

Hy all, I have one file with this content: 1,user1,host1,appli1 2,user2,host2,appli2 My problem is that i want an task who look if {{ ansible\_user}},{{inventory\_hostname}} == “user1,host1” He must return ID of this …

---

## [expect with duplicated responses](https://forum.ansible.com/t/expect-with-duplicated-responses/29808)

<div class="topic-metadata">

**Author:** [@John\_Harmon](https://forum.ansible.com/u/John_Harmon)\
**Replies:** 5\
**Last updated:** [March 1, 2019, 10:08pm UTC](https://forum.ansible.com/t/expect-with-duplicated-responses/29808 "2019-03-01T22:08:56Z")

</div>

When using the following (first time using expect) I have many responses with the same prompt. I took care of the first 20 of them as you can see below, however, the same prompt comes up again later during the install. I…

---

## [Hostvars to pull specific variables](https://forum.ansible.com/t/hostvars-to-pull-specific-variables/29795)

<div class="topic-metadata">

**Author:** [@Jeffrey\_Agnitsch](https://forum.ansible.com/u/Jeffrey_Agnitsch)\
**Replies:** 5\
**Last updated:** [March 1, 2019, 2:45pm UTC](https://forum.ansible.com/t/hostvars-to-pull-specific-variables/29795 "2019-03-01T14:45:23Z")

</div>

Hello, I am trying to use hostvars to get an inventory hostname and a specific variable. The goal of this is to get from the app group, get each unique servers client\_name. The below command works for just the first lin…

---

## [Ansible Ad-hoc Command](https://forum.ansible.com/t/ansible-ad-hoc-command/29804)

<div class="topic-metadata">

**Author:** [@Bipin\_Guragain](https://forum.ansible.com/u/Bipin_Guragain)\
**Replies:** 2\
**Last updated:** [March 1, 2019, 2:34pm UTC](https://forum.ansible.com/t/ansible-ad-hoc-command/29804 "2019-03-01T14:34:32Z")

</div>

Hi All I am new to Ansible and started using it for a while. I have one question on Ansible Ad-hoc command using a shell module with a passed args ‘chdir’. I am having a problem using the argument ‘chdir’ in Ansible CLI…

---

## [How to store ansible running log separately without touching log\_path and ANSIBLE\_LOG\_PATH](https://forum.ansible.com/t/how-to-store-ansible-running-log-separately-without-touching-log-path-and-ansible-log-path/29803)

<div class="topic-metadata">

**Author:** [@Qin\_Peter](https://forum.ansible.com/u/Qin_Peter)\
**Replies:** 0\
**Last updated:** [March 1, 2019, 7:17am UTC](https://forum.ansible.com/t/how-to-store-ansible-running-log-separately-without-touching-log-path-and-ansible-log-path/29803 "2019-03-01T07:17:58Z")

</div>

Hi All, I am new to Ansible and I have requirement about ansible running log. Could anyone help? Thanks. I am talking about running log, not the playbook log. eg: 2019-02-28 01:39:59,819 p=23627 u=peterqi | PLAY \[cre…

---

## [Defning cloudwatch metric alarm which uses metric math using ansible ec2\_metric\_alarm](https://forum.ansible.com/t/defning-cloudwatch-metric-alarm-which-uses-metric-math-using-ansible-ec2-metric-alarm/29800)

<div class="topic-metadata">

**Author:** [@Sachin\_Doiphode](https://forum.ansible.com/u/Sachin_Doiphode)\
**Replies:** 1\
**Last updated:** [March 1, 2019, 6:34am UTC](https://forum.ansible.com/t/defning-cloudwatch-metric-alarm-which-uses-metric-math-using-ansible-ec2-metric-alarm/29800 "2019-03-01T06:34:04Z")

</div>

I’m using ansible’s ec2\_metric\_alarm for creating CloudWatch metrics alarms. now, I have some metrics defined which uses metric math, I’m trying to define alarms for those using ec2\_metric\_alarm but I cannot find a way. …

---

## [creating a vm using ovf and vmdk files](https://forum.ansible.com/t/creating-a-vm-using-ovf-and-vmdk-files/29801)

<div class="topic-metadata">

**Author:** [@Sahar](https://forum.ansible.com/u/Sahar)\
**Replies:** 0\
**Last updated:** [February 28, 2019, 10:06pm UTC](https://forum.ansible.com/t/creating-a-vm-using-ovf-and-vmdk-files/29801 "2019-02-28T22:06:09Z")

</div>

\*\*I'm trying to create VM using the following ansible module. To create it, I see "ovf" as attributes that I can use the path to the ovf files, but I don't see any attribute to let me use my vmdk files.\*\* \*\*Do you know …

---

## [Guidelines for writing cross platform roles](https://forum.ansible.com/t/guidelines-for-writing-cross-platform-roles/29797)

<div class="topic-metadata">

**Author:** [@Elan](https://forum.ansible.com/u/Elan)\
**Replies:** 2\
**Last updated:** [February 28, 2019, 8:05pm UTC](https://forum.ansible.com/t/guidelines-for-writing-cross-platform-roles/29797 "2019-02-28T20:05:21Z")

</div>

Recently I have been watching some ansible conference recordings and reading about best practices and I have a question. How do you write your playbooks/roles to for cross platform use and be able to not to turn your sp…

---

## [Vault encrypting password over the network or just locally](https://forum.ansible.com/t/vault-encrypting-password-over-the-network-or-just-locally/29763)

<div class="topic-metadata">

**Author:** [@mboncalo](https://forum.ansible.com/u/mboncalo)\
**Replies:** 3\
**Last updated:** [February 28, 2019, 1:29pm UTC](https://forum.ansible.com/t/vault-encrypting-password-over-the-network-or-just-locally/29763 "2019-02-28T13:29:20Z")

</div>

Hi, I'm trying to secure my ansible playbook and one of the steps is securing the password. I know that I can store the password encrypted inside ansible vault and than use directly from the vault and send it over th…

---

## [Skip import playbook using when condition.](https://forum.ansible.com/t/skip-import-playbook-using-when-condition/29793)

<div class="topic-metadata">

**Author:** [@Pandu\_jh](https://forum.ansible.com/u/Pandu_jh)\
**Replies:** 2\
**Last updated:** [February 28, 2019, 12:45pm UTC](https://forum.ansible.com/t/skip-import-playbook-using-when-condition/29793 "2019-02-28T12:45:00Z")

</div>

If there are no hosts added to add host, subsequent plays should be skipped. Please let me know how to provide when condition for this - name: hosts: rchadm01 vars\_files: - var.yml tasks: - name: …

---

## [Can network\_cli or expect run tasks via SSH on simple embedded devices?](https://forum.ansible.com/t/can-network-cli-or-expect-run-tasks-via-ssh-on-simple-embedded-devices/29767)

<div class="topic-metadata">

**Author:** [@CodeWaffle](https://forum.ansible.com/u/CodeWaffle)\
**Replies:** 3\
**Last updated:** [February 28, 2019, 6:29am UTC](https://forum.ansible.com/t/can-network-cli-or-expect-run-tasks-via-ssh-on-simple-embedded-devices/29767 "2019-02-28T06:29:28Z")

</div>

Hi all: Not sure if I’m going about this the right way since I’m pretty new to Ansible. Bu, can something like “network\_cli” be used to drive simple to simple embedded devices over SSH in an expect-like manner? I’ve g…

---

## [blockinfile & lineinfile both are not working in RHEL 7.6](https://forum.ansible.com/t/blockinfile-lineinfile-both-are-not-working-in-rhel-7-6/29777)

<div class="topic-metadata">

**Author:** [@Deepan\_M](https://forum.ansible.com/u/Deepan_M)\
**Replies:** 19\
**Last updated:** [February 28, 2019, 12:48am UTC](https://forum.ansible.com/t/blockinfile-lineinfile-both-are-not-working-in-rhel-7-6/29777 "2019-02-28T00:48:09Z")

</div>

Hello Guys, Can someone please help me to resolve this issue. below playbook i have created to remove dns entries from resolv.conf and its working perfect on rhel 6 but not in rhel 7.6, is there any bug or i need to ad…

---

## [skip\_unreachable ?](https://forum.ansible.com/t/skip-unreachable/29446)

<div class="topic-metadata">

**Author:** [@Adam\_E](https://forum.ansible.com/u/Adam_E)\
**Replies:** 4\
**Last updated:** [February 28, 2019, 12:26am UTC](https://forum.ansible.com/t/skip-unreachable/29446 "2019-02-28T00:26:56Z")

</div>

Hi there. My scenario is that I have a hundreds of locations on various different networks that I want to run some plays against. In almost all circumstances I will have 2-3% of these sites that I cannot connect to due …

---

## [Us congress hearing of maan alsaan Money laundry قضية الكونغجرس لغسيل الأموال للمليادير معن الصانع](https://forum.ansible.com/t/us-congress-hearing-of-maan-alsaan-money-laundry/29794)

<div class="topic-metadata">

**Author:** [@Kasem\_A](https://forum.ansible.com/u/Kasem_A)\
**Replies:** 0\
**Last updated:** [February 27, 2019, 8:54pm UTC](https://forum.ansible.com/t/us-congress-hearing-of-maan-alsaan-money-laundry/29794 "2019-02-27T20:54:38Z")

</div>

YouTube videos of U.S. Congress money laundering hearing of Saudi Billionaire " Maan Al sanea" with bank of America and The owner of Saad Hospital and Schools in the Eastern Province in Saudi Arabia and the Chairm…

---

## [lineinfile creating line when regexp not found](https://forum.ansible.com/t/lineinfile-creating-line-when-regexp-not-found/29779)

<div class="topic-metadata">

**Author:** [@John\_Harmon](https://forum.ansible.com/u/John_Harmon)\
**Replies:** 3\
**Last updated:** [February 27, 2019, 4:11pm UTC](https://forum.ansible.com/t/lineinfile-creating-line-when-regexp-not-found/29779 "2019-02-27T16:11:06Z")

</div>

Consider the following: \` name: Change sshd\_config settings lineinfile: path: /etc/ssh/sshd\_config regexp: “{{ item.regexp }}” line: “{{ item.line }}” with\_items: {regexp: “^#.ClientAliveInterval.$”, line: “Clien…

---

## [Ansible unable to winrm to Windows Server 2012](https://forum.ansible.com/t/ansible-unable-to-winrm-to-windows-server-2012/29782)

<div class="topic-metadata">

**Author:** [@Eric\_Tan](https://forum.ansible.com/u/Eric_Tan)\
**Replies:** 7\
**Last updated:** [February 27, 2019, 6:02am UTC](https://forum.ansible.com/t/ansible-unable-to-winrm-to-windows-server-2012/29782 "2019-02-27T06:02:10Z")

</div>

SUMMARY Using Python 2.7 in RHEL7 Executed powershell script in windows machine ConfigureRemotingForAnsible.ps1 Configured yml file to the below: name: hit windows test instance hosts: “tag\_class\_windows\_{{ env }}\_{…

---

## [Memory  Usage for past 10 days](https://forum.ansible.com/t/memory-usage-for-past-10-days/29730)

<div class="topic-metadata">

**Author:** [@Vinu\_Vajravel](https://forum.ansible.com/u/Vinu_Vajravel)\
**Replies:** 6\
**Last updated:** [February 27, 2019, 5:49am UTC](https://forum.ansible.com/t/memory-usage-for-past-10-days/29730 "2019-02-27T05:49:37Z")

</div>

Hello all , does any one using Ansible task which gives us a memory usage information about past 10 days ? Thanks

---

## [Copy template as non root user fails](https://forum.ansible.com/t/copy-template-as-non-root-user-fails/29784)

<div class="topic-metadata">

**Author:** [@Govind\_C](https://forum.ansible.com/u/Govind_C)\
**Replies:** 0\
**Last updated:** [February 27, 2019, 4:28am UTC](https://forum.ansible.com/t/copy-template-as-non-root-user-fails/29784 "2019-02-27T04:28:56Z")

</div>

A regular user(gov1) wants to install an application (app1) owned by the app1:app1 under the directory where app1 has permission. The /app\_mnt and its folders are all owned by app1:app1. (gov2) is part of app1 group as …

---

## [Ansible Dynamic Inventory for Azure does not work on Ubuntu 16.04 Agent](https://forum.ansible.com/t/ansible-dynamic-inventory-for-azure-does-not-work-on-ubuntu-16-04-agent/29783)

<div class="topic-metadata">

**Author:** [@Ameya\_Agashe](https://forum.ansible.com/u/Ameya_Agashe)\
**Replies:** 0\
**Last updated:** [February 27, 2019, 2:49am UTC](https://forum.ansible.com/t/ansible-dynamic-inventory-for-azure-does-not-work-on-ubuntu-16-04-agent/29783 "2019-02-27T02:49:21Z")

</div>

Hi Guys, I’m getting the below error when I try to run Ansible Dynamic inventory on Ubuntu 16.04, the source of python script is here: wget https://raw.githubusercontent.com/ansible/ansible/devel/contrib/inventory/azur…

---

## [Post Request using uri module to update the parameter flags/values](https://forum.ansible.com/t/post-request-using-uri-module-to-update-the-parameter-flags-values/29781)

<div class="topic-metadata">

**Author:** [@abhijith.devaraju](https://forum.ansible.com/u/abhijith.devaraju)\
**Replies:** 1\
**Last updated:** [February 27, 2019, 2:26am UTC](https://forum.ansible.com/t/post-request-using-uri-module-to-update-the-parameter-flags-values/29781 "2019-02-27T02:26:25Z")

</div>

Hello There, I have the below GET response for a feature API request. I would like to update the values for the corresponding parameters as follows in the json object: “paramValue”: 15 “configState”: “ENABLE” GET Res…

---

## [setting variable in a playbook from a jinjia2 snippet](https://forum.ansible.com/t/setting-variable-in-a-playbook-from-a-jinjia2-snippet/29742)

<div class="topic-metadata">

**Author:** [@Luca\_Cazzaniga](https://forum.ansible.com/u/Luca_Cazzaniga)\
**Replies:** 4\
**Last updated:** [February 26, 2019, 3:46pm UTC](https://forum.ansible.com/t/setting-variable-in-a-playbook-from-a-jinjia2-snippet/29742 "2019-02-26T15:46:35Z")

</div>

Hi all is it possible assign variable built from jingia2 fragment to other variable in the playbook: name: “list files in an archive” unarchive: src: /root/mybundle.zip dest: /opt list\_files: yes remote\_src: yes …

---

## [supply dict as parameter to role](https://forum.ansible.com/t/supply-dict-as-parameter-to-role/29776)

<div class="topic-metadata">

**Author:** [@andybourges](https://forum.ansible.com/u/andybourges)\
**Replies:** 0\
**Last updated:** [February 26, 2019, 2:08pm UTC](https://forum.ansible.com/t/supply-dict-as-parameter-to-role/29776 "2019-02-26T14:08:54Z")

</div>

Hi, …I#m having a problem supplying a dictionary as parameter to a role. Seems it’s converted to Unicode and don’t know how to proceed. The basic idea is to have a task separated in a role and call it with different inp…

---

## [The customization\_spec feature of the vmware\_guest module appears to be ignored](https://forum.ansible.com/t/the-customization-spec-feature-of-the-vmware-guest-module-appears-to-be-ignored/28476)

<div class="topic-metadata">

**Author:** [@Matt\_Smith](https://forum.ansible.com/u/Matt_Smith)\
**Replies:** 1\
**Last updated:** [February 26, 2019, 1:02pm UTC](https://forum.ansible.com/t/the-customization-spec-feature-of-the-vmware-guest-module-appears-to-be-ignored/28476 "2019-02-26T13:02:40Z")

</div>

Hi all, I’m trying to set up a playbook that creates VMs on a vSphere server based on a template. I’ve created a playbook that uses the vmware\_guest module, I’ve created a template in vSphere, and I’ve also created an O…

---

## [How to delete a duplicate in file ?](https://forum.ansible.com/t/how-to-delete-a-duplicate-in-file/29774)

<div class="topic-metadata">

**Author:** [@ryad9200000](https://forum.ansible.com/u/ryad9200000)\
**Replies:** 0\
**Last updated:** [February 26, 2019, 12:23pm UTC](https://forum.ansible.com/t/how-to-delete-a-duplicate-in-file/29774 "2019-02-26T12:23:16Z")

</div>

Hy all, how to delete a duplicate in a file? Exemple, in my file1 there is : user1 user2 user3 user1 user1 user1 I want that my task delete all duplicate for get this file : user1 user2 user3 Thanks Regards …

---

## [how to skip a line in a file](https://forum.ansible.com/t/how-to-skip-a-line-in-a-file/29773)

<div class="topic-metadata">

**Author:** [@ryad9200000](https://forum.ansible.com/u/ryad9200000)\
**Replies:** 2\
**Last updated:** [February 26, 2019, 12:03pm UTC](https://forum.ansible.com/t/how-to-skip-a-line-in-a-file/29773 "2019-02-26T12:03:56Z")

</div>

Hy all, I have a file called “file1.csv”, the contents of this file is: word1 word2 word3 word4 I want him to jump in line with every word, i want this result : word1 word2 word3 word4 I use this task for test bu…

---

## [write multiple user in a column in file](https://forum.ansible.com/t/write-multiple-user-in-a-column-in-file/29772)

<div class="topic-metadata">

**Author:** [@ryad9200000](https://forum.ansible.com/u/ryad9200000)\
**Replies:** 0\
**Last updated:** [February 26, 2019, 9:41am UTC](https://forum.ansible.com/t/write-multiple-user-in-a-column-in-file/29772 "2019-02-26T09:41:08Z")

</div>

Hy all, I have a file called “file1.csv” I want this file to have two columns (user; hostname) And that ansible fill is two columns from other files. We will obtain in this file: user ; hostname user1 ; hostname1 …

---

## [How to detect AWS instance type](https://forum.ansible.com/t/how-to-detect-aws-instance-type/29770)

<div class="topic-metadata">

**Author:** [@Frank\_Dias](https://forum.ansible.com/u/Frank_Dias)\
**Replies:** 1\
**Last updated:** [February 26, 2019, 9:40am UTC](https://forum.ansible.com/t/how-to-detect-aws-instance-type/29770 "2019-02-26T09:40:34Z")

</div>

I have an old playbook that will add an addition volume and it works fine on t2 instances. With the move to t3 instances we also now have nvme based ebs. The play book uses lvm to setup the second volume we add the volu…

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

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