# Archives

**URL:** https://forum.ansible.com/c/archives/31.md?page=491

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

**Page:** 492

---

## [get value from command line in playbook](https://forum.ansible.com/t/get-value-from-command-line-in-playbook/24373)

<div class="topic-metadata">

**Author:** [@Anand\_Dasari](https://forum.ansible.com/u/Anand_Dasari)\
**Replies:** 2\
**Last updated:** [May 2, 2017, 8:57pm UTC](https://forum.ansible.com/t/get-value-from-command-line-in-playbook/24373 "2017-05-02T20:57:51Z")

</div>

Hi is there anyway i can get value from command line arguments for eg., my command line is ansible-playbook -i inv/sit1 playbooks/sit1/test.yml in test.yml i want to capture the value from inv/sit1 as sit1,

---

## [Python Annoying error when connecting to target machines](https://forum.ansible.com/t/python-annoying-error-when-connecting-to-target-machines/24382)

<div class="topic-metadata">

**Author:** [@Anthony\_Youssef](https://forum.ansible.com/u/Anthony_Youssef)\
**Replies:** 0\
**Last updated:** [May 2, 2017, 5:31pm UTC](https://forum.ansible.com/t/python-annoying-error-when-connecting-to-target-machines/24382 "2017-05-02T17:31:04Z")

</div>

Hi, i am facing an error that is blocking my work on ansible. i am trying to connect from my control machine to a big number of hosts to execute remote commands (around 1000 hosts). some of these target hosts didn’t ha…

---

## [yaml syntax is extremely annoying](https://forum.ansible.com/t/yaml-syntax-is-extremely-annoying/24380)

<div class="topic-metadata">

**Author:** [@madhan0618](https://forum.ansible.com/u/madhan0618)\
**Replies:** 5\
**Last updated:** [May 2, 2017, 5:23pm UTC](https://forum.ansible.com/t/yaml-syntax-is-extremely-annoying/24380 "2017-05-02T17:23:32Z")

</div>

i had a play like this name: Install jdk become: yes become\_method: sudo become\_user: root command: rpm -ivf /tmp/kafka-src/{{ jdkInstaller }} when: “‘oraclejdk’ not in is\_jdkInstalled.stdout” i wanted to add dir…

---

## [win\_chocolatey fails to install software](https://forum.ansible.com/t/win-chocolatey-fails-to-install-software/24379)

<div class="topic-metadata">

**Author:** [@Thorin\_Oakenshield](https://forum.ansible.com/u/Thorin_Oakenshield)\
**Replies:** 0\
**Last updated:** [May 2, 2017, 3:47pm UTC](https://forum.ansible.com/t/win-chocolatey-fails-to-install-software/24379 "2017-05-02T15:47:24Z")

</div>

Hello, i’m very new to ansible. I have been trying to install software with chocolatey and am having no luck. The very basic task I have is just win\_chocolatey: name: git name: git and throws this error fatal…

---

## [Why does vmware\_guest\_facts require a datacenter parameter?](https://forum.ansible.com/t/why-does-vmware-guest-facts-require-a-datacenter-parameter/24374)

<div class="topic-metadata">

**Author:** [@MKPhil](https://forum.ansible.com/u/MKPhil)\
**Replies:** 0\
**Last updated:** [May 2, 2017, 12:47pm UTC](https://forum.ansible.com/t/why-does-vmware-guest-facts-require-a-datacenter-parameter/24374 "2017-05-02T12:47:59Z")

</div>

As per http://docs.ansible.com/ansible/vmware\_guest\_facts\_module.html (and my own testing) the vmware\_guest\_facts module requires a “datacenter” parameter, however, the example given on that page does not include it. To …

---

## [include\_role variables scoping issue](https://forum.ansible.com/t/include-role-variables-scoping-issue/24370)

<div class="topic-metadata">

**Author:** [@Enrico\_Stahn](https://forum.ansible.com/u/Enrico_Stahn)\
**Replies:** 0\
**Last updated:** [May 2, 2017, 7:23am UTC](https://forum.ansible.com/t/include-role-variables-scoping-issue/24370 "2017-05-02T07:23:39Z")

</div>

Hi there, It appears the variables that are passed to a role from a play can’t be overridden in include\_role. Does anyone have this issue? Example: --- - name: test hosts: localhost connection: local gather\_fact…

---

## [New to Ansible - need to pull hostname and ip from facts for template.](https://forum.ansible.com/t/new-to-ansible-need-to-pull-hostname-and-ip-from-facts-for-template/24369)

<div class="topic-metadata">

**Author:** [@Owen\_Corcoran](https://forum.ansible.com/u/Owen_Corcoran)\
**Replies:** 1\
**Last updated:** [May 2, 2017, 7:21am UTC](https://forum.ansible.com/t/new-to-ansible-need-to-pull-hostname-and-ip-from-facts-for-template/24369 "2017-05-02T07:21:15Z")

</div>

Hey all, Im trying to pull the hostname and ip of the hosts in a specific host group from the facts gathered when the ansibe playbook runs to gather it facts. Im trying to use the hostname and ip for both my two target…

---

## [Ansible Dyn inventory speed issue](https://forum.ansible.com/t/ansible-dyn-inventory-speed-issue/24366)

<div class="topic-metadata">

**Author:** [@chris4](https://forum.ansible.com/u/chris4)\
**Replies:** 5\
**Last updated:** [May 1, 2017, 9:35pm UTC](https://forum.ansible.com/t/ansible-dyn-inventory-speed-issue/24366 "2017-05-01T21:35:20Z")

</div>

Hi, I’m having issues with a dynamic inventory script I created for Solar Winds. It’s here, https://github.com/cbabs/solarwinds-ansible-inv. The script seems to work as expected. When I copy to hosts and run with --list…

---

## [Include\_vars with predefined variables?](https://forum.ansible.com/t/include-vars-with-predefined-variables/24368)

<div class="topic-metadata">

**Author:** [@burns498](https://forum.ansible.com/u/burns498)\
**Replies:** 0\
**Last updated:** [May 1, 2017, 8:16pm UTC](https://forum.ansible.com/t/include-vars-with-predefined-variables/24368 "2017-05-01T20:16:16Z")

</div>

Hello - Can include\_vars also include predefined variables? I have a variable {{ WMS\_HOME }} which debug resoles properly but include\_vars doesn’t carry it through. role/vars/SDN500.yml backup\_files: src\_path: “{{ W…

---

## [Issue with become\_user](https://forum.ansible.com/t/issue-with-become-user/24359)

<div class="topic-metadata">

**Author:** [@Ryan\_Oakes](https://forum.ansible.com/u/Ryan_Oakes)\
**Replies:** 1\
**Last updated:** [May 1, 2017, 6:28pm UTC](https://forum.ansible.com/t/issue-with-become-user/24359 "2017-05-01T18:28:08Z")

</div>

Hey all. I’m attempting to write a small playbook that installs oh-my-zsh on a remote host. The final step of the playbook is to run the ohmyzsh install tool script. name: Apply zsh sript shell: sh -c “$(curl -fsSL ht…

---

## [Problems becoming root on Multi-Tech mlinux](https://forum.ansible.com/t/problems-becoming-root-on-multi-tech-mlinux/24356)

<div class="topic-metadata">

**Author:** [@Jeffrey\_Honig](https://forum.ansible.com/u/Jeffrey_Honig)\
**Replies:** 1\
**Last updated:** [May 1, 2017, 6:27pm UTC](https://forum.ansible.com/t/problems-becoming-root-on-multi-tech-mlinux/24356 "2017-05-01T18:27:14Z")

</div>

I’m using Ansible to CM Multi-Tech Conduits running mLinux. It’s a Yocto Project based Linux and /bin/sh points to /bin/bash. It has su, but does not have sudo. Ansible can ping the box if ansible\_user is a normal user. …

---

## [Simple Server Checks](https://forum.ansible.com/t/simple-server-checks/24355)

<div class="topic-metadata">

**Author:** [@Gary\_Wright](https://forum.ansible.com/u/Gary_Wright)\
**Replies:** 1\
**Last updated:** [May 1, 2017, 6:25pm UTC](https://forum.ansible.com/t/simple-server-checks/24355 "2017-05-01T18:25:50Z")

</div>

Hi Guru’s, I am currently evaluating Ansible and a quick win would be be to be able to use Ansible for checking pre-built servers against set criteria. Some of this can be obtained from facts, but but how do I access t…

---

## [if failed](https://forum.ansible.com/t/if-failed/24364)

<div class="topic-metadata">

**Author:** [@groupfiles14](https://forum.ansible.com/u/groupfiles14)\
**Replies:** 6\
**Last updated:** [May 1, 2017, 6:24pm UTC](https://forum.ansible.com/t/if-failed/24364 "2017-05-01T18:24:26Z")

</div>

is there a way i can run a task if a task fails? how can i mention that

---

## [zcat failing in ansible](https://forum.ansible.com/t/zcat-failing-in-ansible/24363)

<div class="topic-metadata">

**Author:** [@Swathi\_Cutie](https://forum.ansible.com/u/Swathi_Cutie)\
**Replies:** 1\
**Last updated:** [May 1, 2017, 3:28pm UTC](https://forum.ansible.com/t/zcat-failing-in-ansible/24363 "2017-05-01T15:28:37Z")

</div>

I am trying to import the schema it is failing , please suggest me to solve this error

---

## [Ansible: i need to start a server from one node if the server in another node starts.](https://forum.ansible.com/t/ansible-i-need-to-start-a-server-from-one-node-if-the-server-in-another-node-starts/24319)

<div class="topic-metadata">

**Author:** [@Raj\_Martha](https://forum.ansible.com/u/Raj_Martha)\
**Replies:** 2\
**Last updated:** [May 1, 2017, 3:07pm UTC](https://forum.ansible.com/t/ansible-i-need-to-start-a-server-from-one-node-if-the-server-in-another-node-starts/24319 "2017-05-01T15:07:44Z")

</div>

ANSIBLE VERSION ansible 2.2.1.0 Hi All, I need Help for starting and Stopping the servers in WebSphere, I have a 9 nodes in websphere, Node1 have 3 servers(Message, CW, CP), Node2 Have 3 servers((Message, CW, CP), Node…

---

## [Is there a Ansible filter to convert humain size to bytes? Example convert 1.0 MB, 976.6 KiB… =\> bytes integer value?](https://forum.ansible.com/t/is-there-a-ansible-filter-to-convert-humain-size-to-bytes-example-convert-1-0-mb-976-6-kib-bytes-integer-value/24362)

<div class="topic-metadata">

**Author:** [@Stephane\_Klein1](https://forum.ansible.com/u/Stephane_Klein1)\
**Replies:** 2\
**Last updated:** [May 1, 2017, 1:07pm UTC](https://forum.ansible.com/t/is-there-a-ansible-filter-to-convert-humain-size-to-bytes-example-convert-1-0-mb-976-6-kib-bytes-integer-value/24362 "2017-05-01T13:07:27Z")

</div>

Hi, is there a Ansible filter to convert humain size to bytes? Example convert 1.0 MB, 976.6 KiB… in bytes integer value? Best regards, Stéphane

---

## [Preserve virtual env for python when calling third party modules](https://forum.ansible.com/t/preserve-virtual-env-for-python-when-calling-third-party-modules/24358)

<div class="topic-metadata">

**Author:** [@Eric\_Salome](https://forum.ansible.com/u/Eric_Salome)\
**Replies:** 8\
**Last updated:** [May 1, 2017, 10:35am UTC](https://forum.ansible.com/t/preserve-virtual-env-for-python-when-calling-third-party-modules/24358 "2017-05-01T10:35:12Z")

</div>

Hi, I am writing third party modules in Python using the tag “#\<\<INCLUDE\_ANSIBLE\_MODULE\_COMMON\>\>” so that I get parameters for my modules in a nice ANSIBLE\_MODULE\_ARG= {… } json list, read by a call to AnsibleModule()…

---

## [Executing commands from Lookup Plugin in development](https://forum.ansible.com/t/executing-commands-from-lookup-plugin-in-development/24360)

<div class="topic-metadata">

**Author:** [@jparrill](https://forum.ansible.com/u/jparrill)\
**Replies:** 2\
**Last updated:** [April 30, 2017, 2:44pm UTC](https://forum.ansible.com/t/executing-commands-from-lookup-plugin-in-development/24360 "2017-04-30T14:44:46Z")

</div>

Hi there pals, I am developing a Lookup plugin and I’m trying to figure out which is the best way to execute a system command using the built-ins from Ansible utils. I am trying to use those libraries to call to a syst…

---

## [jinja2 using host facts to create playbook for haproxy back end configuration question](https://forum.ansible.com/t/jinja2-using-host-facts-to-create-playbook-for-haproxy-back-end-configuration-question/24357)

<div class="topic-metadata">

**Author:** [@Owen\_Corcoran](https://forum.ansible.com/u/Owen_Corcoran)\
**Replies:** 0\
**Last updated:** [April 29, 2017, 6:59pm UTC](https://forum.ansible.com/t/jinja2-using-host-facts-to-create-playbook-for-haproxy-back-end-configuration-question/24357 "2017-04-29T18:59:26Z")

</div>

Hi guys, I’m putting together a playbook for a project and i cant seem to find a way to do the following: I was to create a ha proxy config file specifying the backends from the system facts gathered namely from the ho…

---

## [vmware\_guest: How to create a VM with a NIC, without specifying a MAC address on creation](https://forum.ansible.com/t/vmware-guest-how-to-create-a-vm-with-a-nic-without-specifying-a-mac-address-on-creation/24316)

<div class="topic-metadata">

**Author:** [@Lemar](https://forum.ansible.com/u/Lemar)\
**Replies:** 3\
**Last updated:** [April 29, 2017, 12:56am UTC](https://forum.ansible.com/t/vmware-guest-how-to-create-a-vm-with-a-nic-without-specifying-a-mac-address-on-creation/24316 "2017-04-29T00:56:02Z")

</div>

Hi All! I’m running Ansible v2.3, and want to know if it’s possible to create virtual machines with NIC’s, without specifying a MAC address. While it’s listed as optional in the docs (http://docs.ansible.com/ansible/vm…

---

## [Struggling with complex lists and dictionaries](https://forum.ansible.com/t/struggling-with-complex-lists-and-dictionaries/24354)

<div class="topic-metadata">

**Author:** [@burns498](https://forum.ansible.com/u/burns498)\
**Replies:** 0\
**Last updated:** [April 28, 2017, 9:47pm UTC](https://forum.ansible.com/t/struggling-with-complex-lists-and-dictionaries/24354 "2017-04-28T21:47:54Z")

</div>

Hello Ansible Project - Assistance requested. I’m attempting to create a new playbook that heavily uses loop iterations over lists and dictionaries.This is my first time using loops of any significance within Ansible, a…

---

## [any\_errors\_fatal as a global config?](https://forum.ansible.com/t/any-errors-fatal-as-a-global-config/21400)

<div class="topic-metadata">

**Author:** [@Bharathwaj\_Sankara](https://forum.ansible.com/u/Bharathwaj_Sankara)\
**Replies:** 2\
**Last updated:** [April 28, 2017, 9:42pm UTC](https://forum.ansible.com/t/any-errors-fatal-as-a-global-config/21400 "2017-04-28T21:42:33Z")

</div>

Hello- I want to stop the playbook on hitting the first error and not proceed anything further, I understand any\_errors\_fatal: True will take care of that at a playbook level. However I have a deployment/upgrade proc…

---

## [with\_items skip 'None/null/undefined' items during iterations=](https://forum.ansible.com/t/with-items-skip-none-null-undefined-items-during-iterations/24345)

<div class="topic-metadata">

**Author:** [@james3](https://forum.ansible.com/u/james3)\
**Replies:** 3\
**Last updated:** [April 28, 2017, 7:57pm UTC](https://forum.ansible.com/t/with-items-skip-none-null-undefined-items-during-iterations/24345 "2017-04-28T19:57:14Z")

</div>

Any good way to have with\_items skip None or ‘Null’ items with out using objects or having a when != ‘None’ name: skip none items command: echo {{item}} with\_items: 1 2 “{{3 if false else None}}” 4 would echo 1, 2, …

---

## [A question about a new OpenStack module](https://forum.ansible.com/t/a-question-about-a-new-openstack-module/24353)

<div class="topic-metadata">

**Author:** [@Tal\_Shafir](https://forum.ansible.com/u/Tal_Shafir)\
**Replies:** 6\
**Last updated:** [April 28, 2017, 6:55pm UTC](https://forum.ansible.com/t/a-question-about-a-new-openstack-module/24353 "2017-04-28T18:55:30Z")

</div>

Hi, I’m currently developing modules to automate the process of testing OpenStack with Tempest. In one of the modules, that configs Tempest, I’m using Tempest to interact with the target OpenStack. I’ve recently saw t…

---

## [How to filter dictionary entries using Jinja](https://forum.ansible.com/t/how-to-filter-dictionary-entries-using-jinja/24325)

<div class="topic-metadata">

**Author:** [@Frank\_Thommen](https://forum.ansible.com/u/Frank_Thommen)\
**Replies:** 4\
**Last updated:** [April 28, 2017, 6:11pm UTC](https://forum.ansible.com/t/how-to-filter-dictionary-entries-using-jinja/24325 "2017-04-28T18:11:15Z")

</div>

Dear all, I'm at a loss as to how to filter entries fom a dictionry based von specific host variables. In the concrete case we have a long list of possible NFS mounts which should be applied according to the hosts' cla…

---

## [how to add custom jinja filters](https://forum.ansible.com/t/how-to-add-custom-jinja-filters/16897)

<div class="topic-metadata">

**Author:** [@Ilin](https://forum.ansible.com/u/Ilin)\
**Replies:** 4\
**Last updated:** [April 28, 2017, 4:10pm UTC](https://forum.ansible.com/t/how-to-add-custom-jinja-filters/16897 "2017-04-28T16:10:30Z")

</div>

Hi, Is there a good example how to extend ansible with custom jinja filters? I have added this, but my filter is not found http://docs.ansible.com/intro\_configuration.html#filter-plugins Adding the function to core.p…

---

## [lineinfile ansible module skips a line](https://forum.ansible.com/t/lineinfile-ansible-module-skips-a-line/24352)

<div class="topic-metadata">

**Author:** [@madhan0618](https://forum.ansible.com/u/madhan0618)\
**Replies:** 0\
**Last updated:** [April 28, 2017, 3:45pm UTC](https://forum.ansible.com/t/lineinfile-ansible-module-skips-a-line/24352 "2017-04-28T15:45:56Z")

</div>

I just posted my question on stackoverflow. Figured I will post here as well in hopes someone here can help. http://stackoverflow.com/questions/43683862/lineinfile-ansible-module-skips-a-line content: I have a need to…

---

## [Setup up SSH key in Ansible tower](https://forum.ansible.com/t/setup-up-ssh-key-in-ansible-tower/24351)

<div class="topic-metadata">

**Author:** [@ishan\_jain](https://forum.ansible.com/u/ishan_jain)\
**Replies:** 1\
**Last updated:** [April 28, 2017, 1:41pm UTC](https://forum.ansible.com/t/setup-up-ssh-key-in-ansible-tower/24351 "2017-04-28T13:41:45Z")

</div>

Hi all, I am checking out Ansible tower and since i have a trial license, not sure if this is the right place to ask. Maybe we have a lot of tower users here. So the thing is i got into my admin account and trying to s…

---

## [Automating Apache Karaf](https://forum.ansible.com/t/automating-apache-karaf/13675)

<div class="topic-metadata">

**Author:** [@Richard\_Clayton](https://forum.ansible.com/u/Richard_Clayton)\
**Replies:** 5\
**Last updated:** [April 28, 2017, 1:22pm UTC](https://forum.ansible.com/t/automating-apache-karaf/13675 "2017-04-28T13:22:26Z")

</div>

Hello everyone. I’m working on a set of modules for controlling an Apache Karaf OSGi node; particularly fetching, installing, and removing OSGi bundles. Karaf has a built in SSH2 server, but it does not have a “BASH” im…

---

## [getting value from command line](https://forum.ansible.com/t/getting-value-from-command-line/24349)

<div class="topic-metadata">

**Author:** [@Anand\_Dasari](https://forum.ansible.com/u/Anand_Dasari)\
**Replies:** 0\
**Last updated:** [April 28, 2017, 8:40am UTC](https://forum.ansible.com/t/getting-value-from-command-line/24349 "2017-04-28T08:40:40Z")

</div>

Hi is there anyway i can get value from command line arguments for eg., my commadn line is ansible-playbook -i inv/sit1 playbooks/sit1/test.yml in test.yml i want to capture the value from inv/sit1 as sit1,

[Previous page](https://forum.ansible.com/c/archives/31.md?page=490)

[Next page](https://forum.ansible.com/c/archives/31.md?page=492)
