# Ansible Project

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

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

**Page:** 226

---

## [Why doesn't Ansible like my regexp?](https://forum.ansible.com/t/why-doesnt-ansible-like-my-regexp/28944)

<div class="topic-metadata">

**Author:** [@John\_Harmon](https://forum.ansible.com/u/John_Harmon)\
**Replies:** 2\
**Last updated:** [November 5, 2018, 5:38pm UTC](https://forum.ansible.com/t/why-doesnt-ansible-like-my-regexp/28944 "2018-11-05T17:38:26Z")

</div>

\` As far as I can tell I have all of my quotes… it just doesn’t seem to like my escaping… Adding verbosity didn’t give me any useful information. \` \` name: Sanitize vm.cfg step 2 of lineinfile: path: “{{ file }}” …

---

## [Is there any way to select a single host when using a pattern?](https://forum.ansible.com/t/is-there-any-way-to-select-a-single-host-when-using-a-pattern/28939)

<div class="topic-metadata">

**Author:** [@Barry\_Kaplan](https://forum.ansible.com/u/Barry_Kaplan)\
**Replies:** 2\
**Last updated:** [November 5, 2018, 4:51pm UTC](https://forum.ansible.com/t/is-there-any-way-to-select-a-single-host-when-using-a-pattern/28939 "2018-11-05T16:51:21Z")

</div>

hosts: group\_a\[0\] works, but this does not hosts: group\_a:&group\_b\[0\] is there any way to achieve the second without having to put run\_once on every task?

---

## [Copy multiple files to different locations on remote server](https://forum.ansible.com/t/copy-multiple-files-to-different-locations-on-remote-server/28892)

<div class="topic-metadata">

**Author:** [@anushakeshipeddy4](https://forum.ansible.com/u/anushakeshipeddy4)\
**Replies:** 14\
**Last updated:** [November 5, 2018, 11:40am UTC](https://forum.ansible.com/t/copy-multiple-files-to-different-locations-on-remote-server/28892 "2018-11-05T11:40:52Z")

</div>

Hi, I am trying to copy multiple files to different locations using with\_items. Could someone please help me with this vars: main.yml wars: file1.war file2.war file3.war file4.war dest\_path: /tmp/{wars} tasks- …

---

## [Reinstall package if config dir is missing or different?](https://forum.ansible.com/t/reinstall-package-if-config-dir-is-missing-or-different/28820)

<div class="topic-metadata">

**Author:** [@Mauricio\_Tavares](https://forum.ansible.com/u/Mauricio_Tavares)\
**Replies:** 4\
**Last updated:** [November 3, 2018, 10:44pm UTC](https://forum.ansible.com/t/reinstall-package-if-config-dir-is-missing-or-different/28820 "2018-11-03T22:44:04Z")

</div>

As you know some packages install their config files/dir during the normal package installation (the first examples that popped in my mind are postfix, bind, and apache). I understand that if the configuration file I …

---

## [hostvars\[some\_ip\] does not contain \`ansible\_hostname\`](https://forum.ansible.com/t/hostvars-some-ip-does-not-contain-ansible-hostname/28936)

<div class="topic-metadata">

**Author:** [@Barry\_Kaplan](https://forum.ansible.com/u/Barry_Kaplan)\
**Replies:** 1\
**Last updated:** [November 3, 2018, 8:20pm UTC](https://forum.ansible.com/t/hostvars-some-ip-does-not-contain-ansible-hostname/28936 "2018-11-03T20:20:11Z")

</div>

Why would this be? It has lots and lots of ansible\_\* variables, but some others like ansible\_hostname or ansible\_mounts. This is not the case for hosts though, just some.

---

## [Undefined variable when using lookup('dict', hostvars) or map('extract', hostvars)](https://forum.ansible.com/t/undefined-variable-when-using-lookup-dict-hostvars-or-map-extract-hostvars/28935)

<div class="topic-metadata">

**Author:** [@Barry\_Kaplan](https://forum.ansible.com/u/Barry_Kaplan)\
**Replies:** 1\
**Last updated:** [November 3, 2018, 7:09pm UTC](https://forum.ansible.com/t/undefined-variable-when-using-lookup-dict-hostvars-or-map-extract-hostvars/28935 "2018-11-03T19:09:13Z")

</div>

I’m trying to extract a few values from hostvars for subset of hosts, eg: \` debug: msg: “just a string” # a constant just to show the problem is not here loop: “{{ lookup(‘dict’, hostvars) }}” when: “item.key in gr…

---

## [regexp help?  Replace part of string](https://forum.ansible.com/t/regexp-help-replace-part-of-string/28923)

<div class="topic-metadata">

**Author:** [@John\_Harmon](https://forum.ansible.com/u/John_Harmon)\
**Replies:** 5\
**Last updated:** [November 2, 2018, 8:53pm UTC](https://forum.ansible.com/t/regexp-help-replace-part-of-string/28923 "2018-11-02T20:53:08Z")

</div>

I have been thinking about doing this with lineinfile with backrefs, or with the replace module, but I am at a loss as to where to start (I am horrible with regexp…) Consider the following: vif = \['mac=00:21:f6:A1:B7:4…

---

## [Looping thru a dictionary of dictionaries, then looping thru a list which is a value of a key in each item](https://forum.ansible.com/t/looping-thru-a-dictionary-of-dictionaries-then-looping-thru-a-list-which-is-a-value-of-a-key-in-each-item/28929)

<div class="topic-metadata">

**Author:** [@Will\_Dennis](https://forum.ansible.com/u/Will_Dennis)\
**Replies:** 6\
**Last updated:** [November 2, 2018, 7:15pm UTC](https://forum.ansible.com/t/looping-thru-a-dictionary-of-dictionaries-then-looping-thru-a-list-which-is-a-value-of-a-key-in-each-item/28929 "2018-11-02T19:15:57Z")

</div>

So I have a var, which is a dict of dicts, with one of the values (“patchset\_url\_list”) being a list (possibly empty): \` TASK \[print out ‘cuda\_versions’ var\] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*…

---

## [Event Driven with ansible](https://forum.ansible.com/t/event-driven-with-ansible/28928)

<div class="topic-metadata">

**Author:** [@Sathya\_Narayanan](https://forum.ansible.com/u/Sathya_Narayanan)\
**Replies:** 5\
**Last updated:** [November 2, 2018, 6:41pm UTC](https://forum.ansible.com/t/event-driven-with-ansible/28928 "2018-11-02T18:41:43Z")

</div>

Hello All, just thought of checking, is ansible capable of doing EDI ( event-driven )? I search some article on the internet and I found some saying its possible and some saying it’s not, kind of confusing :(. If poss…

---

## [Deploying GitLab with ansible. Creating users, and repos.](https://forum.ansible.com/t/deploying-gitlab-with-ansible-creating-users-and-repos/28931)

<div class="topic-metadata">

**Author:** [@Tatar\_Kutyafeju](https://forum.ansible.com/u/Tatar_Kutyafeju)\
**Replies:** 0\
**Last updated:** [November 2, 2018, 6:06pm UTC](https://forum.ansible.com/t/deploying-gitlab-with-ansible-creating-users-and-repos/28931 "2018-11-02T18:06:35Z")

</div>

Hi there! For context: I’m a university student, we’re trying to develop a program, that will deploy a whole virtual environment (different virtual machines, a gitlab server, alfresco, nginx etc) and using the built up …

---

## [Ansible include files](https://forum.ansible.com/t/ansible-include-files/28930)

<div class="topic-metadata">

**Author:** [@rjbotham](https://forum.ansible.com/u/rjbotham)\
**Replies:** 1\
**Last updated:** [November 2, 2018, 5:43pm UTC](https://forum.ansible.com/t/ansible-include-files/28930 "2018-11-02T17:43:30Z")

</div>

Hi All, Would appreciate any help on this one I have 3 files in the /include directory and i’d like to be able to call/use these from any role. However, hard as i try can’t get the path to find the include files If i…

---

## [Trade offs regarding installing control machine via rpm versus pip](https://forum.ansible.com/t/trade-offs-regarding-installing-control-machine-via-rpm-versus-pip/28919)

<div class="topic-metadata">

**Author:** [@afeller](https://forum.ansible.com/u/afeller)\
**Replies:** 6\
**Last updated:** [November 2, 2018, 3:16pm UTC](https://forum.ansible.com/t/trade-offs-regarding-installing-control-machine-via-rpm-versus-pip/28919 "2018-11-02T15:16:20Z")

</div>

I appreciate the plethora of options for installing ansible control machine, however I’d appreciate insight into why someone might prefer installing it via rpm versus pip even more. My offhand thoughts: pip would allo…

---

## [var loaded from yaml file, and working with resulting data structure](https://forum.ansible.com/t/var-loaded-from-yaml-file-and-working-with-resulting-data-structure/28925)

<div class="topic-metadata">

**Author:** [@Will\_Dennis](https://forum.ansible.com/u/Will_Dennis)\
**Replies:** 2\
**Last updated:** [November 2, 2018, 3:01pm UTC](https://forum.ansible.com/t/var-loaded-from-yaml-file-and-working-with-resulting-data-structure/28925 "2018-11-02T15:01:03Z")

</div>

Hi all, I am working on an idea for an Ansible role that installs CUDA, where I want to have a var consisting of a list of items with multiple key/value pairs (some values being lists of items.) So I came up with this Y…

---

## [File with variables (template)](https://forum.ansible.com/t/file-with-variables-template/28926)

<div class="topic-metadata">

**Author:** [@nadim\_mansour](https://forum.ansible.com/u/nadim_mansour)\
**Replies:** 1\
**Last updated:** [November 2, 2018, 7:54am UTC](https://forum.ansible.com/t/file-with-variables-template/28926 "2018-11-02T07:54:22Z")

</div>

If I have a file and the user wants to pass variables for this file (example: http.conf) should I convert the file to http.conf.j2 ? when copied to the server it will be read as http.conf or http.conf.j2 ? where should…

---

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

<div class="topic-metadata">

**Author:** [@Michael\_M1](https://forum.ansible.com/u/Michael_M1)\
**Replies:** 2\
**Last updated:** [November 1, 2018, 10:40pm UTC](https://forum.ansible.com/t/delete-all-files-under-a-specific-directory/28915 "2018-11-01T22:40:22Z")

</div>

Per the documentation (in bold red below), the file module is working as designed: If directory, all intermediate subdirectories will be created if they do not exist. Since Ansible 1.7 they will be created with the supp…

---

## [Passing variables to a template / jinja2 ??](https://forum.ansible.com/t/passing-variables-to-a-template-jinja2/28907)

<div class="topic-metadata">

**Author:** [@nadim\_mansour](https://forum.ansible.com/u/nadim_mansour)\
**Replies:** 2\
**Last updated:** [November 1, 2018, 9:30pm UTC](https://forum.ansible.com/t/passing-variables-to-a-template-jinja2/28907 "2018-11-01T21:30:51Z")

</div>

I have an http.conf where some values will be variables passed by the user where should I put the variables and how the file should look can someone advice ?

---

## [unable to setup windows host for ansible](https://forum.ansible.com/t/unable-to-setup-windows-host-for-ansible/28872)

<div class="topic-metadata">

**Author:** [@Narmada\_Karthika](https://forum.ansible.com/u/Narmada_Karthika)\
**Replies:** 14\
**Last updated:** [November 1, 2018, 7:58pm UTC](https://forum.ansible.com/t/unable-to-setup-windows-host-for-ansible/28872 "2018-11-01T19:58:17Z")

</div>

I am trying to run ping command on my windows host from linux controller i created inventory.txt file \[win\] servername \[win:vars\] ansible\_user=myusername ansible\_password=password ansible\_connection=winrm ansible…

---

## [WinRM - running ansible on widnows returning error](https://forum.ansible.com/t/winrm-running-ansible-on-widnows-returning-error/28918)

<div class="topic-metadata">

**Author:** [@nadim\_mansour](https://forum.ansible.com/u/nadim_mansour)\
**Replies:** 9\
**Last updated:** [November 1, 2018, 7:29pm UTC](https://forum.ansible.com/t/winrm-running-ansible-on-widnows-returning-error/28918 "2018-11-01T19:29:14Z")

</div>

How can I let ansible run on windows node(windows server 2012 machine) ?? I ran the belwo commands on power shell before running the ansible script : netsh advfirewall firewall add rule name=“Allow WinRM (Http)” dir=in…

---

## [Create a list from a file ?  -- wanting to use win\_updates module and import a list of patches to the whitelist option](https://forum.ansible.com/t/create-a-list-from-a-file-wanting-to-use-win-updates-module-and-import-a-list-of-patches-to-the-whitelist-option/28920)

<div class="topic-metadata">

**Author:** [@Tuyen\_Nguyen](https://forum.ansible.com/u/Tuyen_Nguyen)\
**Replies:** 0\
**Last updated:** [November 1, 2018, 12:46pm UTC](https://forum.ansible.com/t/create-a-list-from-a-file-wanting-to-use-win-updates-module-and-import-a-list-of-patches-to-the-whitelist-option/28920 "2018-11-01T12:46:56Z")

</div>

Hi In the ansible playlist, can we define a file for the playlist to import the values of the option? Instead of having to put each value in the playbook itself? In my example, I am using the win\_updates module which h…

---

## [tower\_credential module is failing](https://forum.ansible.com/t/tower-credential-module-is-failing/28916)

<div class="topic-metadata">

**Author:** [@Vinod\_Patil](https://forum.ansible.com/u/Vinod_Patil)\
**Replies:** 3\
**Last updated:** [November 1, 2018, 11:11am UTC](https://forum.ansible.com/t/tower-credential-module-is-failing/28916 "2018-11-01T11:11:55Z")

</div>

Hi , I am using tower\_credential module to create a credential on ansible tower. Ansible tower version 3.3.0 ansible tower CLI verison 3.3.0 ansible module used - tower\_credential However I am getting the error - f…

---

## [windows command from ansible / returning error](https://forum.ansible.com/t/windows-command-from-ansible-returning-error/28906)

<div class="topic-metadata">

**Author:** [@nadim\_mansour](https://forum.ansible.com/u/nadim_mansour)\
**Replies:** 4\
**Last updated:** [November 1, 2018, 10:11am UTC](https://forum.ansible.com/t/windows-command-from-ansible-returning-error/28906 "2018-11-01T10:11:10Z")

</div>

I am trying to install oracle client in silent mode by runing the following task from ansible and its returning an error: - name: Install Oracle client 12.1.0.2.1 win\_command: C:\\tmp\\ODAC121021\_x64\\setup.exe -silent -r…

---

## [Ansible 2.5.11 and 2.6.7 are available](https://forum.ansible.com/t/ansible-2-5-11-and-2-6-7-are-available/28913)

<div class="topic-metadata">

**Author:** [@system](https://forum.ansible.com/u/system)\
**Replies:** 3\
**Last updated:** [November 1, 2018, 7:24am UTC](https://forum.ansible.com/t/ansible-2-5-11-and-2-6-7-are-available/28913 "2018-11-01T07:24:19Z")

</div>

Hi all, Ansible 2.5.11 and 2.6.7 were released today. These releases only fix reported security vulnerability CVE-2018-16837 (https://nvd.nist.gov/vuln/detail/CVE-2018-16837). The fix protects the user module from pote…

---

## [ansible-sudo-issue](https://forum.ansible.com/t/ansible-sudo-issue/28899)

<div class="topic-metadata">

**Author:** [@Bairava\_Surya](https://forum.ansible.com/u/Bairava_Surya)\
**Replies:** 2\
**Last updated:** [November 1, 2018, 5:05am UTC](https://forum.ansible.com/t/ansible-sudo-issue/28899 "2018-11-01T05:05:43Z")

</div>

Hi Team, we need to sudo to solaris box using ansible. Below steps are done manually to login as sudo via putty SSH into solaris box by entering username and password sudo to server by entering username and password …

---

## [ansible vault with ad hoc command line](https://forum.ansible.com/t/ansible-vault-with-ad-hoc-command-line/28889)

<div class="topic-metadata">

**Author:** [@rajendra.rawat17](https://forum.ansible.com/u/rajendra.rawat17)\
**Replies:** 9\
**Last updated:** [November 1, 2018, 4:49am UTC](https://forum.ansible.com/t/ansible-vault-with-ad-hoc-command-line/28889 "2018-11-01T04:49:20Z")

</div>

Hi All, Is it possible to use ansible-vault with ad-hoc commands. Use case: I have not setup ssh key and I want to use ping module on target machine. normal way if we have setup sshkey or pass the text password 1: an…

---

## [looks like sudo error, may be](https://forum.ansible.com/t/looks-like-sudo-error-may-be/28912)

<div class="topic-metadata">

**Author:** [@Kallu\_Srikanth](https://forum.ansible.com/u/Kallu_Srikanth)\
**Replies:** 2\
**Last updated:** [November 1, 2018, 2:26am UTC](https://forum.ansible.com/t/looks-like-sudo-error-may-be/28912 "2018-11-01T02:26:35Z")

</div>

Playbook:

---

## [Running servers in parallel and not sequential  ??](https://forum.ansible.com/t/running-servers-in-parallel-and-not-sequential/28908)

<div class="topic-metadata">

**Author:** [@nadim\_mansour](https://forum.ansible.com/u/nadim_mansour)\
**Replies:** 1\
**Last updated:** [October 31, 2018, 3:16pm UTC](https://forum.ansible.com/t/running-servers-in-parallel-and-not-sequential/28908 "2018-10-31T15:16:58Z")

</div>

My ansible project runs by the below order -prepare web-server (on linux) -prepare proxy-server (on linux) -prepare database-server (on windows ) Note: web server and proxy server share some roles (common , apache …e…

---

## [cant run a IBM Installation manager install file using ansible.](https://forum.ansible.com/t/cant-run-a-ibm-installation-manager-install-file-using-ansible/28909)

<div class="topic-metadata">

**Author:** [@Vivek1](https://forum.ansible.com/u/Vivek1)\
**Replies:** 3\
**Last updated:** [October 31, 2018, 1:12pm UTC](https://forum.ansible.com/t/cant-run-a-ibm-installation-manager-install-file-using-ansible/28909 "2018-10-31T13:12:25Z")

</div>

Hi Experts, Am very beginner on Ansible and need your kind advise here. I want to execute one installer file of IBM installation manger for its silent installation and my play book is throwing error here. Could you ple…

---

## [How to add a particular module to Ansible than merely doing an Ansible upgrade totally](https://forum.ansible.com/t/how-to-add-a-particular-module-to-ansible-than-merely-doing-an-ansible-upgrade-totally/28904)

<div class="topic-metadata">

**Author:** [@rangapv08](https://forum.ansible.com/u/rangapv08)\
**Replies:** 1\
**Last updated:** [October 31, 2018, 8:28am UTC](https://forum.ansible.com/t/how-to-add-a-particular-module-to-ansible-than-merely-doing-an-ansible-upgrade-totally/28904 "2018-10-31T08:28:09Z")

</div>

Hi, My current version of Ansible is 2.4.3.0 I need the module “gcp\_compute\_instance” which is introduced in Ansible 2.6 as per documents. Is there a way I can just only add this package to my current Ansible version …

---

## [how to configure switch with ansible](https://forum.ansible.com/t/how-to-configure-switch-with-ansible/28903)

<div class="topic-metadata">

**Author:** [@Ho\_Yeung\_Lee](https://forum.ansible.com/u/Ho_Yeung_Lee)\
**Replies:** 0\
**Last updated:** [October 31, 2018, 3:26am UTC](https://forum.ansible.com/t/how-to-configure-switch-with-ansible/28903 "2018-10-31T03:26:34Z")

</div>

i use following script can not redirect debug to a file and also can not change password or add user

---

## [Is it possible to create a project and VPC in Google cloud through Ansible?](https://forum.ansible.com/t/is-it-possible-to-create-a-project-and-vpc-in-google-cloud-through-ansible/28897)

<div class="topic-metadata">

**Author:** [@somali.batra](https://forum.ansible.com/u/somali.batra)\
**Replies:** 7\
**Last updated:** [October 31, 2018, 2:50am UTC](https://forum.ansible.com/t/is-it-possible-to-create-a-project-and-vpc-in-google-cloud-through-ansible/28897 "2018-10-31T02:50:51Z")

</div>

I am new to Ansible. I have come across various articles showing how to provision resources like GCE in the Google cloud. But I want to automate the entire end to end flow and thus would start with automating the creatio…

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

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