# Ansible Project

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

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

**Page:** 203

---

## [Ansible gather facts](https://forum.ansible.com/t/ansible-gather-facts/29849)

<div class="topic-metadata">

**Author:** [@fahad.riaz1718](https://forum.ansible.com/u/fahad.riaz1718)\
**Replies:** 1\
**Last updated:** [March 8, 2019, 4:25pm UTC](https://forum.ansible.com/t/ansible-gather-facts/29849 "2019-03-08T16:25:44Z")

</div>

Hi All, I wrote the following playbook to gather facts about a particular datastore from vsphere. the playbook worked, however I had to add -vvv flag to see the facts. 2 questions 1- is there a file that gets the out…

---

## [I have a strange result](https://forum.ansible.com/t/i-have-a-strange-result/29848)

<div class="topic-metadata">

**Author:** [@ryad9200000](https://forum.ansible.com/u/ryad9200000)\
**Replies:** 1\
**Last updated:** [March 8, 2019, 4:22pm UTC](https://forum.ansible.com/t/i-have-a-strange-result/29848 "2019-03-08T16:22:05Z")

</div>

hi all, Why when i run this task : name: Find /var/log files equal or greater than 10 megabytes ending with .old or .log.gz find: paths: /{{ role\_path }}/files/groups/ patterns: ‘&.txt’ register: mes\_fichiers\_spe…

---

## [ansible role meta, templated role dependency.](https://forum.ansible.com/t/ansible-role-meta-templated-role-dependency/29831)

<div class="topic-metadata">

**Author:** [@Lionel\_H](https://forum.ansible.com/u/Lionel_H)\
**Replies:** 2\
**Last updated:** [March 8, 2019, 12:25pm UTC](https://forum.ansible.com/t/ansible-role-meta-templated-role-dependency/29831 "2019-03-08T12:25:16Z")

</div>

Hi all, I have a bunch of nested roles for a specific project. I’m trying to dynamically invoked roles based on variable I have in the inventory. For example, let’s say I have a foo variable that is defined for every …

---

## [Junos/Cisco | Compare outputs](https://forum.ansible.com/t/junos-cisco-compare-outputs/29841)

<div class="topic-metadata">

**Author:** [@intelysmark](https://forum.ansible.com/u/intelysmark)\
**Replies:** 2\
**Last updated:** [March 8, 2019, 7:57am UTC](https://forum.ansible.com/t/junos-cisco-compare-outputs/29841 "2019-03-08T07:57:10Z")

</div>

I would like to add some functionality to my Ansible playbooks that does the following; Before making any changes (at beginning of playbook) it runs a number of commands and stores the output of the commands in files. Th…

---

## [Dynamic Inventory on VMWare not working; but works when the script is run directly](https://forum.ansible.com/t/dynamic-inventory-on-vmware-not-working-but-works-when-the-script-is-run-directly/29843)

<div class="topic-metadata">

**Author:** [@computerprosupport](https://forum.ansible.com/u/computerprosupport)\
**Replies:** 0\
**Last updated:** [March 7, 2019, 5:52pm UTC](https://forum.ansible.com/t/dynamic-inventory-on-vmware-not-working-but-works-when-the-script-is-run-directly/29843 "2019-03-07T17:52:17Z")

</div>

I am trying to implement Dynamic Inventory for VMWare with the vmware\_inventory.py script From here : https://github.com/ansible/ansible/blob/devel/contrib/inventory/vmware\_inventory.py I have searched for docs on the…

---

## [This topic needs a title](https://forum.ansible.com/t/this-topic-needs-a-title/29842)

<div class="topic-metadata">

**Author:** [@intelysmark](https://forum.ansible.com/u/intelysmark)\
**Replies:** 0\
**Last updated:** [March 7, 2019, 5:43pm UTC](https://forum.ansible.com/t/this-topic-needs-a-title/29842 "2019-03-07T17:43:54Z")

</div>

---

## [Combining local\_action and delegate\_to](https://forum.ansible.com/t/combining-local-action-and-delegate-to/29840)

<div class="topic-metadata">

**Author:** [@Amir\_Al-Shourbaji](https://forum.ansible.com/u/Amir_Al-Shourbaji)\
**Replies:** 1\
**Last updated:** [March 7, 2019, 5:22pm UTC](https://forum.ansible.com/t/combining-local-action-and-delegate-to/29840 "2019-03-07T17:22:31Z")

</div>

I want this module to run locally on a host i delegate\_to name: Add Host to dhcp config local\_action: module: lineinfile dest: /etc/dhcp/dhcpd.conf line: “host {{ inventory\_hostname}} {hardware ethernet {{ macaddre…

---

## [Module for control routing table in Linux](https://forum.ansible.com/t/module-for-control-routing-table-in-linux/29827)

<div class="topic-metadata">

**Author:** [@Wawrzek\_Niewodniczan](https://forum.ansible.com/u/Wawrzek_Niewodniczan)\
**Replies:** 1\
**Last updated:** [March 7, 2019, 8:17am UTC](https://forum.ansible.com/t/module-for-control-routing-table-in-linux/29827 "2019-03-07T08:17:18Z")

</div>

Hi, I've failed to find a module responsible for controlling routing in Linux. Is there a 'route' module? Maybe I've missed something? Wawrzek

---

## [lineinfile path local and remote path](https://forum.ansible.com/t/lineinfile-path-local-and-remote-path/29823)

<div class="topic-metadata">

**Author:** [@Ryan1](https://forum.ansible.com/u/Ryan1)\
**Replies:** 2\
**Last updated:** [March 7, 2019, 8:09am UTC](https://forum.ansible.com/t/lineinfile-path-local-and-remote-path/29823 "2019-03-07T08:09:05Z")

</div>

I have a playbook that uses the following: set\_fact: logfile=/home/sandbox/playbooks/LOGS/{{ systemSN }} Lower in the playbook I have: lineinfile: line: “{{ item }}” path: “{{ logfile }}” create: yes with\_items: …

---

## [How to transfer a big size file to ansible server from a remote node?](https://forum.ansible.com/t/how-to-transfer-a-big-size-file-to-ansible-server-from-a-remote-node/23160)

<div class="topic-metadata">

**Author:** [@shaolongtan0886](https://forum.ansible.com/u/shaolongtan0886)\
**Replies:** 2\
**Last updated:** [March 6, 2019, 10:02pm UTC](https://forum.ansible.com/t/how-to-transfer-a-big-size-file-to-ansible-server-from-a-remote-node/23160 "2019-03-06T22:02:42Z")

</div>

Hi Everyboby, Currently, I have requirement to transfer file from remote node to ansible server. Ansible fetch module can do it but it can’t transfer big size file. Who could help how to resolve it with ansible module e…

---

## [Loop a play over several group sets](https://forum.ansible.com/t/loop-a-play-over-several-group-sets/29834)

<div class="topic-metadata">

**Author:** [@Doug\_OLeary](https://forum.ansible.com/u/Doug_OLeary)\
**Replies:** 3\
**Last updated:** [March 6, 2019, 7:08pm UTC](https://forum.ansible.com/t/loop-a-play-over-several-group-sets/29834 "2019-03-06T19:08:43Z")

</div>

Hi; I read through the docs on loops and am not seeing what I’m looking for. Basically, loops allow a task to run across a set. From the docs: - name: add several users user: name: "{{ item }}" state: present…

---

## [validation command privilege issue](https://forum.ansible.com/t/validation-command-privilege-issue/29826)

<div class="topic-metadata">

**Author:** [@Luca\_Cazzaniga](https://forum.ansible.com/u/Luca_Cazzaniga)\
**Replies:** 7\
**Last updated:** [March 6, 2019, 10:51am UTC](https://forum.ansible.com/t/validation-command-privilege-issue/29826 "2019-03-06T10:51:44Z")

</div>

Hi all, I’ve a very simple role to copy and validate a monit configuration file cat roles/monit\_install/tasks/main.yml name: copy configuration file template: mode: 0600 dest: /etc/monitrc src: monitrc.j2 validat…

---

## [How to include group\_vars when using python api to run ansible-playbook.](https://forum.ansible.com/t/how-to-include-group-vars-when-using-python-api-to-run-ansible-playbook/29830)

<div class="topic-metadata">

**Author:** [@Jace\_Liang](https://forum.ansible.com/u/Jace_Liang)\
**Replies:** 0\
**Last updated:** [March 6, 2019, 4:53am UTC](https://forum.ansible.com/t/how-to-include-group-vars-when-using-python-api-to-run-ansible-playbook/29830 "2019-03-06T04:53:44Z")

</div>

Hi all, I am trying to write a python script to run kuberspray’s ansible-playbook. Basically, when using kubespray, all I need to do is get into kubespray’s folder and type command. \` ansible-playbook -i inventory/my…

---

## [Determine virtual or physical machine from existing default Ansible facts](https://forum.ansible.com/t/determine-virtual-or-physical-machine-from-existing-default-ansible-facts/23672)

<div class="topic-metadata">

**Author:** [@Simon\_Wydooghe](https://forum.ansible.com/u/Simon_Wydooghe)\
**Replies:** 5\
**Last updated:** [March 5, 2019, 11:57pm UTC](https://forum.ansible.com/t/determine-virtual-or-physical-machine-from-existing-default-ansible-facts/23672 "2019-03-05T23:57:54Z")

</div>

Does anyone have a suggestion on how to detect whether a machine is a bare metal one or a virtual one using the existing Ansible facts? In Puppet there was a ‘physical’ boolean which could be used, but going through the …

---

## [How get some word in file](https://forum.ansible.com/t/how-get-some-word-in-file/29819)

<div class="topic-metadata">

**Author:** [@ryad9200000](https://forum.ansible.com/u/ryad9200000)\
**Replies:** 1\
**Last updated:** [March 5, 2019, 10:38am UTC](https://forum.ansible.com/t/how-get-some-word-in-file/29819 "2019-03-05T10:38:04Z")

</div>

Hy all, I’m sorry i ask a lot of question but it’s my last question. I have this file : 2,user2,hostname2,appli1 1,user1,hostname1,appli1,appli2,appli3, … 3,user3,hostname3,appli1 appli1 it’s one application for in…

---

## [Get indice in variable](https://forum.ansible.com/t/get-indice-in-variable/29825)

<div class="topic-metadata">

**Author:** [@ryad9200000](https://forum.ansible.com/u/ryad9200000)\
**Replies:** 1\
**Last updated:** [March 5, 2019, 10:37am UTC](https://forum.ansible.com/t/get-indice-in-variable/29825 "2019-03-05T10:37:46Z")

</div>

Hy all, I have this task : set\_fact: liste\_appli: “{{ item.split(‘,’)\[3:\] }}” with\_lines: cat /home/ansible/ssh\_manager/clef\_applicatives.csv when: (item.split(‘,’)\[1\] == ansible\_user) and (item.split(‘,’)\[2\] == in…

---

## [Get item with file](https://forum.ansible.com/t/get-item-with-file/29818)

<div class="topic-metadata">

**Author:** [@ryad9200000](https://forum.ansible.com/u/ryad9200000)\
**Replies:** 4\
**Last updated:** [March 5, 2019, 10:37am UTC](https://forum.ansible.com/t/get-item-with-file/29818 "2019-03-05T10:37:29Z")

</div>

Hy all, I have one file with this content: 1,user1,host1,appli1 2,user2,host2,appli2 3,user1,host1.appli3 This task works : - set\_fact: indice: “{{ item.split(‘,’)\[0\] }}” with\_lines: cat /home/ansible/ssh\_manager…

---

## [Defining complex data (cascaded arrays) in yaml has problems](https://forum.ansible.com/t/defining-complex-data-cascaded-arrays-in-yaml-has-problems/29817)

<div class="topic-metadata">

**Author:** [@Ralf\_Weber](https://forum.ansible.com/u/Ralf_Weber)\
**Replies:** 4\
**Last updated:** [March 5, 2019, 10:29am UTC](https://forum.ansible.com/t/defining-complex-data-cascaded-arrays-in-yaml-has-problems/29817 "2019-03-05T10:29:20Z")

</div>

Moin! For a recent project I needed to have a data structure with nested arrays, however I could not get it to work using yaml syntax. When using the following playbook: - hosts: all tasks: - name: Set some t…

---

## [Help on terminal and cliconf plugin](https://forum.ansible.com/t/help-on-terminal-and-cliconf-plugin/29824)

<div class="topic-metadata">

**Author:** [@rpachi](https://forum.ansible.com/u/rpachi)\
**Replies:** 1\
**Last updated:** [March 5, 2019, 8:53am UTC](https://forum.ansible.com/t/help-on-terminal-and-cliconf-plugin/29824 "2019-03-05T08:53:42Z")

</div>

Hi Experts, I am unable to create terminal and cliconf plugin for my company. Can some one help me in creating it. I can arrange a call. Thanks in advance. Thanks, Rajas

---

## [Windows ansible Kerberos user privileges.](https://forum.ansible.com/t/windows-ansible-kerberos-user-privileges/29816)

<div class="topic-metadata">

**Author:** [@Flavio\_Gobber](https://forum.ansible.com/u/Flavio_Gobber)\
**Replies:** 2\
**Last updated:** [March 5, 2019, 6:19am UTC](https://forum.ansible.com/t/windows-ansible-kerberos-user-privileges/29816 "2019-03-05T06:19:08Z")

</div>

Hello, I am starting to use the ansible to manage server Joined to a domain. I have started the test using a domain user account members of Domain Users but with the use member of local administrators on target. When …

---

## [Combine values from multiple lists](https://forum.ansible.com/t/combine-values-from-multiple-lists/29780)

<div class="topic-metadata">

**Author:** [@Ryan1](https://forum.ansible.com/u/Ryan1)\
**Replies:** 7\
**Last updated:** [March 5, 2019, 2:15am UTC](https://forum.ansible.com/t/combine-values-from-multiple-lists/29780 "2019-03-05T02:15:14Z")

</div>

How would I go about printing the values from three lists, so that each line contains elements from each list? For instance, I can print the values from the lists using: msg: “Memory: {{ memoryLocator.stdout\_lines }}…

---

## [using when something \> variable](https://forum.ansible.com/t/using-when-something-variable/29822)

<div class="topic-metadata">

**Author:** [@Spiro\_Mitsialis](https://forum.ansible.com/u/Spiro_Mitsialis)\
**Replies:** 2\
**Last updated:** [March 4, 2019, 8:14pm UTC](https://forum.ansible.com/t/using-when-something-variable/29822 "2019-03-04T20:14:58Z")

</div>

I have a playbook that performs a command on a router and then parses the output. So far no problem. I’m then trying to check if any of the variables back from the parser are \>= threshold. The threshold is defined as a …

---

## [Concatenate registered variable , variables in vara and strings](https://forum.ansible.com/t/concatenate-registered-variable-variables-in-vara-and-strings/29821)

<div class="topic-metadata">

**Author:** [@pnagaraj7656](https://forum.ansible.com/u/pnagaraj7656)\
**Replies:** 0\
**Last updated:** [March 4, 2019, 5:51pm UTC](https://forum.ansible.com/t/concatenate-registered-variable-variables-in-vara-and-strings/29821 "2019-03-04T17:51:16Z")

</div>

I'm trying to concatenate registered variable from a previous task , external variable with a string ( ex: -stringhere) in a task. I'm not getting the syntax to do it. I tried below and it didn't work. Command : echo …

---

## [How to use the different parameter for each host in playbook](https://forum.ansible.com/t/how-to-use-the-different-parameter-for-each-host-in-playbook/29805)

<div class="topic-metadata">

**Author:** [@Devesh\_singh](https://forum.ansible.com/u/Devesh_singh)\
**Replies:** 3\
**Last updated:** [March 4, 2019, 3:08pm UTC](https://forum.ansible.com/t/how-to-use-the-different-parameter-for-each-host-in-playbook/29805 "2019-03-04T15:08:49Z")

</div>

Hi, Could you please anyone help me to complete below request. We need to excute the one playbook on 10 hosts and each task in playbook should use the different-2 parameter on each host. Could you please how we can pe…

---

## [How to delete the same line in a file ?](https://forum.ansible.com/t/how-to-delete-the-same-line-in-a-file/29806)

<div class="topic-metadata">

**Author:** [@ryad9200000](https://forum.ansible.com/u/ryad9200000)\
**Replies:** 4\
**Last updated:** [March 4, 2019, 12:17pm UTC](https://forum.ansible.com/t/how-to-delete-the-same-line-in-a-file/29806 "2019-03-04T12:17:40Z")

</div>

Hy all, I have this file with this content : premiere line deuxieme line premiere line premiere line How to delete the same line in this file ? I want this file : premiere line deuxieme line Thank you guy !! …

---

## [When Condition check is not working in a list as expected.](https://forum.ansible.com/t/when-condition-check-is-not-working-in-a-list-as-expected/29798)

<div class="topic-metadata">

**Author:** [@Pandu\_jh](https://forum.ansible.com/u/Pandu_jh)\
**Replies:** 4\
**Last updated:** [March 4, 2019, 11:12am UTC](https://forum.ansible.com/t/when-condition-check-is-not-working-in-a-list-as-expected/29798 "2019-03-04T11:12:15Z")

</div>

When Condition check is not working in a list as expected. My requirement is Playbook should not fail If all the three mentioned variables have “no\_share” value. But it’s failing not sure what causing this issue. d…

---

## [How to save the O/P of ansible playbook into a file in windows enviroment](https://forum.ansible.com/t/how-to-save-the-o-p-of-ansible-playbook-into-a-file-in-windows-enviroment/29815)

<div class="topic-metadata">

**Author:** [@shyam.rpms](https://forum.ansible.com/u/shyam.rpms)\
**Replies:** 2\
**Last updated:** [March 4, 2019, 11:10am UTC](https://forum.ansible.com/t/how-to-save-the-o-p-of-ansible-playbook-into-a-file-in-windows-enviroment/29815 "2019-03-04T11:10:32Z")

</div>

Hi All, I have a playbook, using REST API getting the details of a process in JSON format. I want to save that JSON o/p to a file in windows environment. Can any one please help me. sample playbook:

---

## [vmware delete old snapshot](https://forum.ansible.com/t/vmware-delete-old-snapshot/29796)

<div class="topic-metadata">

**Author:** [@itforumsubs](https://forum.ansible.com/u/itforumsubs)\
**Replies:** 2\
**Last updated:** [March 4, 2019, 4:49am UTC](https://forum.ansible.com/t/vmware-delete-old-snapshot/29796 "2019-03-04T04:49:05Z")

</div>

Hi all, May I ask how do you handle deleting old snapshots in vmware? vmware\_guest\_snapshot module seems to be based on the name on the snapshot to manage. Im thinking of how to get the name of the snapshot based on th…

---

## [Except Module in Ansible](https://forum.ansible.com/t/except-module-in-ansible/29786)

<div class="topic-metadata">

**Author:** [@Deepak\_Sharma1](https://forum.ansible.com/u/Deepak_Sharma1)\
**Replies:** 5\
**Last updated:** [March 3, 2019, 10:40pm UTC](https://forum.ansible.com/t/except-module-in-ansible/29786 "2019-03-03T22:40:09Z")

</div>

Hi All, I am using except module to install one TIBCO products , name: Start Streambase installation expect: echo: yes chdir: /opt/tibco//{{ env }}/install command: ./TIB\_sb-cep\_{{ tib\_streambase\_version }}\_linux\_…

---

## [How to assign to an object with arbitrary characters in key](https://forum.ansible.com/t/how-to-assign-to-an-object-with-arbitrary-characters-in-key/29813)

<div class="topic-metadata">

**Author:** [@Oleg\_Semyonov](https://forum.ansible.com/u/Oleg_Semyonov)\
**Replies:** 1\
**Last updated:** [March 3, 2019, 1:48pm UTC](https://forum.ansible.com/t/how-to-assign-to-an-object-with-arbitrary-characters-in-key/29813 "2019-03-03T13:48:48Z")

</div>

I have a list of objects with names like this: ‘obj-0001’, ‘obj-0002’ and need to set\_stats with some data about these objects in the following structure: “data”: { “obj-0001”: { “a”: 1, “b”: 2 }, “obj-0002”: { “a”: 3…

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

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