# Latest

**URL:** https://forum.ansible.com/latest.md?page=508

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

**Page:** 509

---

## [Ansible + jinja2 macro](https://forum.ansible.com/t/ansible-jinja2-macro/28905)

<div class="topic-metadata">

**Author:** [@profhase85](https://forum.ansible.com/u/profhase85)\
**Replies:** 3\
**Last updated:** [November 6, 2018, 12:37pm UTC](https://forum.ansible.com/t/ansible-jinja2-macro/28905 "2018-11-06T12:37:37Z")

</div>

Hi @all, I am trying to use a macro in an ansible template: {% macro logging(ltype) %}\` \`\` {% if ltype == 'fluentd' %} logging: driver: 'fluentd' options: tag: "{{ app\_name }}.{{ '{{' }}.Name{{ '}}' }}" …

---

## [Regexp failure:  Unmatched group](https://forum.ansible.com/t/regexp-failure-unmatched-group/28947)

<div class="topic-metadata">

**Author:** [@John\_Harmon](https://forum.ansible.com/u/John_Harmon)\
**Replies:** 5\
**Last updated:** [November 6, 2018, 12:19pm UTC](https://forum.ansible.com/t/regexp-failure-unmatched-group/28947 "2018-11-06T12:19:24Z")

</div>

I am getting a failure with the latter half of my task. I replaced the working stuff with … According to a regexp tester, every group does have something, and I don’t have empty groups. https://regex101.com/r/MNkwaD/1 …

---

## [docker\_container to mongo auth](https://forum.ansible.com/t/docker-container-to-mongo-auth/28955)

<div class="topic-metadata">

**Author:** [@15911133389](https://forum.ansible.com/u/15911133389)\
**Replies:** 0\
**Last updated:** [November 6, 2018, 11:18am UTC](https://forum.ansible.com/t/docker-container-to-mongo-auth/28955 "2018-11-06T11:18:59Z")

</div>

Why can I only add admin tables? I try to change to other or nonexistent tables. mongodb\_user: database: admin update is error name: pangu password: sdvxcdlskadlk1231c state: present roles: db: aitc\_matrix role…

---

## [Question on using Ansible to upgrade Linux with config file overwrites](https://forum.ansible.com/t/question-on-using-ansible-to-upgrade-linux-with-config-file-overwrites/28945)

<div class="topic-metadata">

**Author:** [@EspressoBeanies](https://forum.ansible.com/u/EspressoBeanies)\
**Replies:** 2\
**Last updated:** [November 6, 2018, 10:12am UTC](https://forum.ansible.com/t/question-on-using-ansible-to-upgrade-linux-with-config-file-overwrites/28945 "2018-11-06T10:12:05Z")

</div>

What’s the best way to use Ansible to manage software updates where installer config files have the potential to overwrite the config settings you currently have in place? I’m trying to see if there’s a way for Ansible t…

---

## [Add Host to Group dynamically (or better: design question regarding a hacky solution)](https://forum.ansible.com/t/add-host-to-group-dynamically-or-better-design-question-regarding-a-hacky-solution/28951)

<div class="topic-metadata">

**Author:** [@Daniel1](https://forum.ansible.com/u/Daniel1)\
**Replies:** 0\
**Last updated:** [November 6, 2018, 9:32am UTC](https://forum.ansible.com/t/add-host-to-group-dynamically-or-better-design-question-regarding-a-hacky-solution/28951 "2018-11-06T09:32:53Z")

</div>

Hi everyone, I have a playbook that installs a web application on multiple hosts (one host per customer). The following variable hierarchy would be perfect for my environment: common.yml $environment $environm…

---

## [Ftp - ansible](https://forum.ansible.com/t/ftp-ansible/28943)

<div class="topic-metadata">

**Author:** [@nadim\_mansour](https://forum.ansible.com/u/nadim_mansour)\
**Replies:** 1\
**Last updated:** [November 6, 2018, 4:05am UTC](https://forum.ansible.com/t/ftp-ansible/28943 "2018-11-06T04:05:42Z")

</div>

I have files that I need to transfer from my mac (machine) to windows server and linux server before running several tasks files are binary files and .exe can the files be sent through ftp ? can someone help please

---

## [Restart kestrelservice](https://forum.ansible.com/t/restart-kestrelservice/28924)

<div class="topic-metadata">

**Author:** [@Narmada\_Karthika](https://forum.ansible.com/u/Narmada_Karthika)\
**Replies:** 9\
**Last updated:** [November 5, 2018, 10:35pm UTC](https://forum.ansible.com/t/restart-kestrelservice/28924 "2018-11-05T22:35:41Z")

</div>

Hello All, can we have have a play book to restart kestrel service.

---

## [gcp\_compute plugin showing auth failure](https://forum.ansible.com/t/gcp-compute-plugin-showing-auth-failure/28950)

<div class="topic-metadata">

**Author:** [@Murali\_Krishna](https://forum.ansible.com/u/Murali_Krishna)\
**Replies:** 0\
**Last updated:** [November 5, 2018, 10:34pm UTC](https://forum.ansible.com/t/gcp-compute-plugin-showing-auth-failure/28950 "2018-11-05T22:34:24Z")

</div>

SUMMARY I am using gcp\_compute plugin as a inventory source. While on local machine it is working fine but when I try to use this same inventory on GCP VM it is showing ansible-inventory -i ./inventory/gcompute.gcp.yam…

---

## [Lookup Plugin XML encoded Output](https://forum.ansible.com/t/lookup-plugin-xml-encoded-output/28948)

<div class="topic-metadata">

**Author:** [@ken\_partridge](https://forum.ansible.com/u/ken_partridge)\
**Replies:** 0\
**Last updated:** [November 5, 2018, 9:41pm UTC](https://forum.ansible.com/t/lookup-plugin-xml-encoded-output/28948 "2018-11-05T21:41:20Z")

</div>

Hello, We have a lookup plugin we are developing. It uses open\_url() to grab an XML file and display it. Pretty simple, The problem is that the output comes back with the text encoded (i.e. " and \\r and \\n and %29 etc et…

---

## [windows - ansible.. create user and run remaining tasks with the user created](https://forum.ansible.com/t/windows-ansible-create-user-and-run-remaining-tasks-with-the-user-created/28942)

<div class="topic-metadata">

**Author:** [@nadim\_mansour](https://forum.ansible.com/u/nadim_mansour)\
**Replies:** 2\
**Last updated:** [November 5, 2018, 9:12pm UTC](https://forum.ansible.com/t/windows-ansible-create-user-and-run-remaining-tasks-with-the-user-created/28942 "2018-11-05T21:12:31Z")

</div>

In the first task I am creating a user called cbsadmin. In the second task I am copying a file from templates to tmp and then installing oracle is it possible to run the second and third task using the user I created in…

---

## [GitHub bugs not being resolved](https://forum.ansible.com/t/github-bugs-not-being-resolved/28946)

<div class="topic-metadata">

**Author:** [@EspressoBeanies](https://forum.ansible.com/u/EspressoBeanies)\
**Replies:** 1\
**Last updated:** [November 5, 2018, 6:47pm UTC](https://forum.ansible.com/t/github-bugs-not-being-resolved/28946 "2018-11-05T18:47:43Z")

</div>

I posted an Ansible bug on GitHub a year ago and still have not seen anyone provide a resolution aside from acknowledging an issue exists. Since Ansible seems to be releasing new updates every so often, how can I request…

---

## [Manipulating part of a custom variable](https://forum.ansible.com/t/manipulating-part-of-a-custom-variable/28932)

<div class="topic-metadata">

**Author:** [@John\_Harmon](https://forum.ansible.com/u/John_Harmon)\
**Replies:** 7\
**Last updated:** [November 5, 2018, 6:00pm UTC](https://forum.ansible.com/t/manipulating-part-of-a-custom-variable/28932 "2018-11-05T18:00:40Z")

</div>

I have a variable called ‘oldid’ set to a value of ‘0004fb0000060000b824b442d236a8b7’ I wish to manipulate it so that I do the following: strip off the last 12 characters (slicing?) Re-add 12 more characters that are …

---

## [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- …

---

## [Bitbicket -\> Ansible Tower, script the tower-cli connection, help please](https://forum.ansible.com/t/bitbicket-ansible-tower-script-the-tower-cli-connection-help-please/28902)

<div class="topic-metadata">

**Author:** [@Ian\_Williamson](https://forum.ansible.com/u/Ian_Williamson)\
**Replies:** 1\
**Last updated:** [November 4, 2018, 9:01pm UTC](https://forum.ansible.com/t/bitbicket-ansible-tower-script-the-tower-cli-connection-help-please/28902 "2018-11-04T21:01:17Z")

</div>

Hello AWX community I am trying to CI/CD from JIRA → Bitbicket → Ansible Tower. I think the documentation on how to pipeline from Bitbicket is out of date now tower-cli uses Oauth2. Can anyone please guide me on how t…

---

## [How set 2 environment (PATH and proxy\_env ) in ansible-playbook?](https://forum.ansible.com/t/how-set-2-environment-path-and-proxy-env-in-ansible-playbook/28938)

<div class="topic-metadata">

**Author:** [@user91](https://forum.ansible.com/u/user91)\
**Replies:** 0\
**Last updated:** [November 4, 2018, 1:18pm UTC](https://forum.ansible.com/t/how-set-2-environment-path-and-proxy-env-in-ansible-playbook/28938 "2018-11-04T13:18:17Z")

</div>

Hello! Trying to install run ansible-playbook (kubespray) through a proxy. Here specify the proxy server: https://github.com/kubernetes-incubator/kubespray/blob/master/inventory/sample/group\_vars/all/all.yml#L52 Added…

---

## [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…

---

## [Fact caching and shared dynamic inventory](https://forum.ansible.com/t/fact-caching-and-shared-dynamic-inventory/28934)

<div class="topic-metadata">

**Author:** [@iamroddo](https://forum.ansible.com/u/iamroddo)\
**Replies:** 1\
**Last updated:** [November 3, 2018, 2:09pm UTC](https://forum.ansible.com/t/fact-caching-and-shared-dynamic-inventory/28934 "2018-11-03T14:09:07Z")

</div>

If I understand correctly host facts are shared and cached between job runs on AWX. Would the cached facts from a dynamic inventory that is shared between jobs be available to both, or do both need to have their own cach…

---

## [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…

---

## [using "with\_items:" in my custom module](https://forum.ansible.com/t/using-with-items-in-my-custom-module/28927)

<div class="topic-metadata">

**Author:** [@Shin\_Fukuda](https://forum.ansible.com/u/Shin_Fukuda)\
**Replies:** 2\
**Last updated:** [November 2, 2018, 10:54am UTC](https://forum.ansible.com/t/using-with-items-in-my-custom-module/28927 "2018-11-02T10:54:09Z")

</div>

Hi Ansible Developers. I want to know how to use “with\_items:” loop in my own custom module ? e.g. \` tasks: name: “Something custom action” my\_first\_mod: name: “{{ item }}” with\_items: ‘andres’ ‘lukas’ \` Any h…

---

## [Option "Overwrite Variables" in Inventory sources does not seem to work](https://forum.ansible.com/t/option-overwrite-variables-in-inventory-sources-does-not-seem-to-work/28911)

<div class="topic-metadata">

**Author:** [@BOTTE\_QUU](https://forum.ansible.com/u/BOTTE_QUU)\
**Replies:** 3\
**Last updated:** [November 2, 2018, 8:47am UTC](https://forum.ansible.com/t/option-overwrite-variables-in-inventory-sources-does-not-seem-to-work/28911 "2018-11-02T08:47:52Z")

</div>

Hi, I’m using AWX 2.0.1. I created an inventory with a source from Red Hat Satellite 6. It works. All the hosts are correctly created with a lot of variables. My problem is that when I manually add variables in a host…

[Previous page](https://forum.ansible.com/latest.md?page=507)

[Next page](https://forum.ansible.com/latest.md?page=509)
