# Ansible Project

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

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

**Page:** 153

---

## [Want to send notification if no hosts match](https://forum.ansible.com/t/want-to-send-notification-if-no-hosts-match/31858)

<div class="topic-metadata">

**Author:** [@Bikram](https://forum.ansible.com/u/Bikram)\
**Replies:** 2\
**Last updated:** [December 23, 2019, 6:17am UTC](https://forum.ansible.com/t/want-to-send-notification-if-no-hosts-match/31858 "2019-12-23T06:17:22Z")

</div>

Hi, I have a use case where I am automating switch patching where engineers can select a switch name and playbook name from a web portal. I would to like to handle an exception if engineers select a wrong switch/playbo…

---

## [Ansible Linux Server - Unreachable](https://forum.ansible.com/t/ansible-linux-server-unreachable/31862)

<div class="topic-metadata">

**Author:** [@Parveen\_Datt](https://forum.ansible.com/u/Parveen_Datt)\
**Replies:** 3\
**Last updated:** [December 22, 2019, 7:56pm UTC](https://forum.ansible.com/t/ansible-linux-server-unreachable/31862 "2019-12-22T19:56:52Z")

</div>

Team, Can someone please help in solution for below requirement. I tried a lot but did not get through yet We want ansible playbook to test network reachability of a server followed by Power reset using IPMITOOL if Se…

---

## [Define global variables in ansible group\_vars/all file](https://forum.ansible.com/t/define-global-variables-in-ansible-group-vars-all-file/31780)

<div class="topic-metadata">

**Author:** [@Xinhuan\_Zheng](https://forum.ansible.com/u/Xinhuan_Zheng)\
**Replies:** 9\
**Last updated:** [December 20, 2019, 5:01pm UTC](https://forum.ansible.com/t/define-global-variables-in-ansible-group-vars-all-file/31780 "2019-12-20T17:01:22Z")

</div>

Hello, I followed Ansible best practice to create my ansible automation directory structure like following: group\_vars group\_vars/all host\_vars os.yml production roles roles/os-issue Since I’m using ansible user…

---

## [templating a variable name in ansible 2.9 is not working as before, did I miss something in the release notes ?](https://forum.ansible.com/t/templating-a-variable-name-in-ansible-2-9-is-not-working-as-before-did-i-miss-something-in-the-release-notes/31856)

<div class="topic-metadata">

**Author:** [@mahespth](https://forum.ansible.com/u/mahespth)\
**Replies:** 2\
**Last updated:** [December 20, 2019, 3:56pm UTC](https://forum.ansible.com/t/templating-a-variable-name-in-ansible-2-9-is-not-working-as-before-did-i-miss-something-in-the-release-notes/31856 "2019-12-20T15:56:36Z")

</div>

Hi, We have some plays that work ok in ansible \<2.9, they are used to generate various repositories based on facts and they do not appear to work any longer after ansible 2.9 update - I have rolled back just the ansible…

---

## [ios\_ntp](https://forum.ansible.com/t/ios-ntp/31854)

<div class="topic-metadata">

**Author:** [@Spiro\_Mitsialis](https://forum.ansible.com/u/Spiro_Mitsialis)\
**Replies:** 4\
**Last updated:** [December 20, 2019, 2:33pm UTC](https://forum.ansible.com/t/ios-ntp/31854 "2019-12-20T14:33:26Z")

</div>

Has anyone used ios\_ntp for Cisco IOS devices? Its new as of Ansible v2.8. It works fine for 1 NTP server but how do you add a 2nd server. I’ve tried the following and neither works. The 2nd method works for DNS with io…

---

## [QA TESTER//GLEN ALLEN VA//12 MONTHS//C2C](https://forum.ansible.com/t/qa-tester-glen-allen-va-12-months-c2c/31853)

<div class="topic-metadata">

**Author:** [@Farhad\_Mohammad](https://forum.ansible.com/u/Farhad_Mohammad)\
**Replies:** 0\
**Last updated:** [December 19, 2019, 3:32pm UTC](https://forum.ansible.com/t/qa-tester-glen-allen-va-12-months-c2c/31853 "2019-12-19T15:32:18Z")

</div>

Hi Greeting from Simba Staffing. We have an urgent requirement for one of our clients. please check and send me the suitable profiles ASAP Role : QA Tester Location : Glen Allen, VA Duration : 12 Months Contract : …

---

## [Ansible molecule and docker](https://forum.ansible.com/t/ansible-molecule-and-docker/31850)

<div class="topic-metadata">

**Author:** [@Bruno\_Cochofel](https://forum.ansible.com/u/Bruno_Cochofel)\
**Replies:** 0\
**Last updated:** [December 19, 2019, 10:56am UTC](https://forum.ansible.com/t/ansible-molecule-and-docker/31850 "2019-12-19T10:56:58Z")

</div>

Hi, I’m creating roles and because of some limitations running the tests under docker I was thinking of checking if it’s running on docker and adapt. How can I do this? Thanks, Bruno

---

## [How use with\_sequence and with\_dict together](https://forum.ansible.com/t/how-use-with-sequence-and-with-dict-together/31848)

<div class="topic-metadata">

**Author:** [@Rafael\_Tomelin](https://forum.ansible.com/u/Rafael_Tomelin)\
**Replies:** 2\
**Last updated:** [December 19, 2019, 8:33am UTC](https://forum.ansible.com/t/how-use-with-sequence-and-with-dict-together/31848 "2019-12-19T08:33:43Z")

</div>

Hi, I want to do loop in the dict variable appliance and in variable have var count. This count I should like loop count. appliances: fw01: count: 2 vmname: name image: redhat os\_type: Linux data\_disks: lun: 0 …

---

## [sending mail while using assert?](https://forum.ansible.com/t/sending-mail-while-using-assert/31831)

<div class="topic-metadata">

**Author:** [@evnflow](https://forum.ansible.com/u/evnflow)\
**Replies:** 5\
**Last updated:** [December 18, 2019, 8:21pm UTC](https://forum.ansible.com/t/sending-mail-while-using-assert/31831 "2019-12-18T20:21:18Z")

</div>

Is there a way you can send a mail with-in assert when any\_errors\_fatal: true ? I have tried to do it by using set\_fact still, but still not having success in sending the disk limit size via email. name: Assert that th…

---

## [Can custom plugins access extra\_vars?](https://forum.ansible.com/t/can-custom-plugins-access-extra-vars/31839)

<div class="topic-metadata">

**Author:** [@Andrew\_Garner](https://forum.ansible.com/u/Andrew_Garner)\
**Replies:** 1\
**Last updated:** [December 18, 2019, 6:11pm UTC](https://forum.ansible.com/t/can-custom-plugins-access-extra-vars/31839 "2019-12-18T18:11:10Z")

</div>

There is a comment on an Ansible GitHub issue suggesting that an inventory plugin can access extra vars from a custom plugin, but the issue was closed without any details being added. I have an inventory plugin and a lo…

---

## [get\_stats with callback json](https://forum.ansible.com/t/get-stats-with-callback-json/31847)

<div class="topic-metadata">

**Author:** [@Bruno\_Carvalho](https://forum.ansible.com/u/Bruno_Carvalho)\
**Replies:** 0\
**Last updated:** [December 18, 2019, 5:56pm UTC](https://forum.ansible.com/t/get-stats-with-callback-json/31847 "2019-12-18T17:56:26Z")

</div>

Hello everyone, my env: AWX 5.0 Ansible 2.8 Python 3.6 I´m try using get\_stats with callback json without sucess, someone ever using or can help about it? Tks Bruno

---

## [with\_dict in loop counter](https://forum.ansible.com/t/with-dict-in-loop-counter/31846)

<div class="topic-metadata">

**Author:** [@Rafael\_Tomelin](https://forum.ansible.com/u/Rafael_Tomelin)\
**Replies:** 1\
**Last updated:** [December 18, 2019, 2:53pm UTC](https://forum.ansible.com/t/with-dict-in-loop-counter/31846 "2019-12-18T14:53:33Z")

</div>

Hi, I have a task for creating the virtual machine at Azure with\_dict. I should like to create a variable count (number the VMS) and put it with\_dict. How can create loop count with with\_dict?

---

## [It would be nice if we can have  option to add description for computer object in win\_domain\_membership module.](https://forum.ansible.com/t/it-would-be-nice-if-we-can-have-option-to-add-description-for-computer-object-in-win-domain-membership-module/31843)

<div class="topic-metadata">

**Author:** [@vineesh\_ap](https://forum.ansible.com/u/vineesh_ap)\
**Replies:** 0\
**Last updated:** [December 18, 2019, 11:46am UTC](https://forum.ansible.com/t/it-would-be-nice-if-we-can-have-option-to-add-description-for-computer-object-in-win-domain-membership-module/31843 "2019-12-18T11:46:42Z")

</div>

Adding Description for computer object is a nice to have feature in win\_domain\_membership module. We do have a community module win\_domain\_computer which has this parameter. but we need AD management tools installed on t…

---

## [regexp is not working in window ansible](https://forum.ansible.com/t/regexp-is-not-working-in-window-ansible/31838)

<div class="topic-metadata">

**Author:** [@Uppara\_venkat](https://forum.ansible.com/u/Uppara_venkat)\
**Replies:** 4\
**Last updated:** [December 18, 2019, 8:15am UTC](https://forum.ansible.com/t/regexp-is-not-working-in-window-ansible/31838 "2019-12-18T08:15:31Z")

</div>

Hi all, I would like add a line in particular line, I have written a task as below;

---

## [Can you send mail within assert?](https://forum.ansible.com/t/can-you-send-mail-within-assert/31842)

<div class="topic-metadata">

**Author:** [@system](https://forum.ansible.com/u/system)\
**Replies:** 0\
**Last updated:** [December 17, 2019, 11:08pm UTC](https://forum.ansible.com/t/can-you-send-mail-within-assert/31842 "2019-12-17T23:08:21Z")

</div>

use a \`block\`, send mail in the \`rescue\` section and then use a \`fail\` task to 'continue the error'

---

## [Best practice for performing SQL query inside of Ansible playbook task?](https://forum.ansible.com/t/best-practice-for-performing-sql-query-inside-of-ansible-playbook-task/31841)

<div class="topic-metadata">

**Author:** [@Bruce\_W\_Mohler](https://forum.ansible.com/u/Bruce_W_Mohler)\
**Replies:** 0\
**Last updated:** [December 17, 2019, 10:38pm UTC](https://forum.ansible.com/t/best-practice-for-performing-sql-query-inside-of-ansible-playbook-task/31841 "2019-12-17T22:38:28Z")

</div>

What is the best practice for performing a SQL query inside of an Ansible playbook task? I know that Ansible provides some builtin MySQL modules but they only allow you to create databases, tables inside of databases, a…

---

## [deploy pod](https://forum.ansible.com/t/deploy-pod/31837)

<div class="topic-metadata">

**Author:** [@lelu\_nicu](https://forum.ansible.com/u/lelu_nicu)\
**Replies:** 0\
**Last updated:** [December 17, 2019, 3:35pm UTC](https://forum.ansible.com/t/deploy-pod/31837 "2019-12-17T15:35:00Z")

</div>

hi, give an example on how i write an ansible playbook to deploy a pod (1 container inside) to run nginx inside the container.in a kubernete environment. tnx

---

## [Ansible playbook, trying to execute ssh-copy-id to remote host for passwd less login,](https://forum.ansible.com/t/ansible-playbook-trying-to-execute-ssh-copy-id-to-remote-host-for-passwd-less-login/31834)

<div class="topic-metadata">

**Author:** [@Ganeshwari\_Sk](https://forum.ansible.com/u/Ganeshwari_Sk)\
**Replies:** 1\
**Last updated:** [December 17, 2019, 2:36pm UTC](https://forum.ansible.com/t/ansible-playbook-trying-to-execute-ssh-copy-id-to-remote-host-for-passwd-less-login/31834 "2019-12-17T14:36:46Z")

</div>

Hi, I am new for ansible. I wrote the following playbook to execute the ssh-copy-id to copy the id\_rsa.pub key to remote host, but I am getting permission denied error or hanging when passing password as argument, Play…

---

## [How to add key to elastic's kibana-keystore via ansible script?](https://forum.ansible.com/t/how-to-add-key-to-elastics-kibana-keystore-via-ansible-script/31833)

<div class="topic-metadata">

**Author:** [@Andreas\_Schampera](https://forum.ansible.com/u/Andreas_Schampera)\
**Replies:** 0\
**Last updated:** [December 17, 2019, 10:38am UTC](https://forum.ansible.com/t/how-to-add-key-to-elastics-kibana-keystore-via-ansible-script/31833 "2019-12-17T10:38:19Z")

</div>

Hi, I am new to ansible and try to automate the installation process of elastic stack. Currently I am stuck while trying to add a key to kibana’s keystore. Directly from bash (no ansible) the following works: bash-4.2…

---

## [Checking whether nested variable is defined in the when statement](https://forum.ansible.com/t/checking-whether-nested-variable-is-defined-in-the-when-statement/31826)

<div class="topic-metadata">

**Author:** [@Emmanuel\_Livingstone](https://forum.ansible.com/u/Emmanuel_Livingstone)\
**Replies:** 2\
**Last updated:** [December 17, 2019, 3:49am UTC](https://forum.ansible.com/t/checking-whether-nested-variable-is-defined-in-the-when-statement/31826 "2019-12-17T03:49:04Z")

</div>

Nested data structures can be accessed either by indexing using the key name or dot syntax with the key name - https://docs.ansible.com/ansible/latest/user\_guide/playbooks\_variables.html#accessing-complex-variable-data B…

---

## [docker\_prune not working with label](https://forum.ansible.com/t/docker-prune-not-working-with-label/31830)

<div class="topic-metadata">

**Author:** [@abin\_stephen](https://forum.ansible.com/u/abin_stephen)\
**Replies:** 8\
**Last updated:** [December 16, 2019, 11:03pm UTC](https://forum.ansible.com/t/docker-prune-not-working-with-label/31830 "2019-12-16T23:03:59Z")

</div>

How we can configure docker\_prune to delete docker images with specific name, I have tried something below and it didt worked can you please help us to fix this | | | | name: Remove unused images …

---

## [Large task Issue](https://forum.ansible.com/t/large-task-issue/31825)

<div class="topic-metadata">

**Author:** [@Aaa\_Bbb](https://forum.ansible.com/u/Aaa_Bbb)\
**Replies:** 5\
**Last updated:** [December 16, 2019, 9:19pm UTC](https://forum.ansible.com/t/large-task-issue/31825 "2019-12-16T21:19:27Z")

</div>

1 playbook, 20 tasks, 10 targets/hosts. On 9 host tasks runs similar time - a couple of minutes. On 1 server 15’th tasks takes 1,5h. After that time last 5 task runs quickly and end result report is produced for whole 10…

---

## [AnsibleAWX && WINRM returns "certificate: the specified credentials were rejected by the server"](https://forum.ansible.com/t/ansibleawx-winrm-returns-certificate-the-specified-credentials-were-rejected-by-the-server/31814)

<div class="topic-metadata">

**Author:** [@Robert\_Rozek](https://forum.ansible.com/u/Robert_Rozek)\
**Replies:** 4\
**Last updated:** [December 16, 2019, 8:43pm UTC](https://forum.ansible.com/t/ansibleawx-winrm-returns-certificate-the-specified-credentials-were-rejected-by-the-server/31814 "2019-12-16T20:43:45Z")

</div>

I have setup Windows remote management as per guidelines from below for the certificate: https://docs.ansible.com/ansible/latest/user\_guide/windows\_winrm.html#certificate So what I have done. Enabled WINRM using the …

---

## [Powershell Script execution](https://forum.ansible.com/t/powershell-script-execution/31823)

<div class="topic-metadata">

**Author:** [@Vikrant](https://forum.ansible.com/u/Vikrant)\
**Replies:** 3\
**Last updated:** [December 16, 2019, 8:38am UTC](https://forum.ansible.com/t/powershell-script-execution/31823 "2019-12-16T08:38:11Z")

</div>

Hi All, I’m curious if this is possible, At a very high level, for the connectivity testing on different servers, I’ve to follow below steps: Push two Powershell script to each server Run the two PowerShell scripts o…

---

## [fatal: \[localhost\]: FAILED! ansible-playbook](https://forum.ansible.com/t/fatal-localhost-failed-ansible-playbook/31822)

<div class="topic-metadata">

**Author:** [@Veny\_Cycilia](https://forum.ansible.com/u/Veny_Cycilia)\
**Replies:** 0\
**Last updated:** [December 15, 2019, 2:03pm UTC](https://forum.ansible.com/t/fatal-localhost-failed-ansible-playbook/31822 "2019-12-15T14:03:20Z")

</div>

Hi, I have followed the toturial, but an error when running the command ansible-playbook -i localhost, -c local analytics\_single.yml --extra-vars "INSIGHTS\_LMS\_BASE=mysite.org" anyone can help?? fatal: \[localhost\]: F…

---

## [Sql Alwayson Configuration with Ansible module](https://forum.ansible.com/t/sql-alwayson-configuration-with-ansible-module/31806)

<div class="topic-metadata">

**Author:** [@Raviteja\_Jinkala](https://forum.ansible.com/u/Raviteja_Jinkala)\
**Replies:** 4\
**Last updated:** [December 15, 2019, 12:59pm UTC](https://forum.ansible.com/t/sql-alwayson-configuration-with-ansible-module/31806 "2019-12-15T12:59:38Z")

</div>

Hi All, Please suggest if any Ansible module available to configure SQL Alwayson Configuration and Alwayson group creation. Thanks Raviteja

---

## [uri body call needs \[\] instead of {}](https://forum.ansible.com/t/uri-body-call-needs-instead-of/31819)

<div class="topic-metadata">

**Author:** [@Nicholas\_Britton](https://forum.ansible.com/u/Nicholas_Britton)\
**Replies:** 9\
**Last updated:** [December 15, 2019, 5:31am UTC](https://forum.ansible.com/t/uri-body-call-needs-instead-of/31819 "2019-12-15T05:31:58Z")

</div>

I am working on some uri calls with netbackup and with swagger shows that it only works with but the uri modual is using {}. Any thoughts or tricks to get that to format correctly? For example i am sending a body uri b…

---

## [aws\_ec2 and compose option](https://forum.ansible.com/t/aws-ec2-and-compose-option/31808)

<div class="topic-metadata">

**Author:** [@Guy\_Knights1](https://forum.ansible.com/u/Guy_Knights1)\
**Replies:** 1\
**Last updated:** [December 14, 2019, 12:21am UTC](https://forum.ansible.com/t/aws-ec2-and-compose-option/31808 "2019-12-14T00:21:19Z")

</div>

Hi, According to the documentation for the aws\_ec2 plugin, the compose option can be used to create vars when the plugin is executed. I’ve been trying to get this to work with a simple plugin config like so: plugin: a…

---

## [Accessing a dictionary item using a variable](https://forum.ansible.com/t/accessing-a-dictionary-item-using-a-variable/31818)

<div class="topic-metadata">

**Author:** [@Spiro\_Mitsialis](https://forum.ansible.com/u/Spiro_Mitsialis)\
**Replies:** 2\
**Last updated:** [December 13, 2019, 3:49pm UTC](https://forum.ansible.com/t/accessing-a-dictionary-item-using-a-variable/31818 "2019-12-13T15:49:21Z")

</div>

I would like to access data in a dictionary by referencing a variable. I have the following dict: \` “vlan\_list”: { “1”: { “id”: “1”, “name”: “Management”, “status”: “active” }, “2”: { “id”: “2”, “name”: “VLAN 2…

---

## [Zeros are truncated from strings. #10281](https://forum.ansible.com/t/zeros-are-truncated-from-strings-10281/31817)

<div class="topic-metadata">

**Author:** [@Dylan\_Humphreys](https://forum.ansible.com/u/Dylan_Humphreys)\
**Replies:** 3\
**Last updated:** [December 13, 2019, 2:33pm UTC](https://forum.ansible.com/t/zeros-are-truncated-from-strings-10281/31817 "2019-12-13T14:33:03Z")

</div>

Im getting that bug happen to me, but Im on 2.9.2 \` % dpkg -l ansible Desired=Unknown/Install/Remove/Purge/Hold

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

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