# Ansible Project

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

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

**Page:** 109

---

## [skip role if condition are not meet](https://forum.ansible.com/t/skip-role-if-condition-are-not-meet/33639)

<div class="topic-metadata">

**Author:** [@morten\_hoffmann](https://forum.ansible.com/u/morten_hoffmann)\
**Replies:** 1\
**Last updated:** [August 24, 2020, 6:11am UTC](https://forum.ansible.com/t/skip-role-if-condition-are-not-meet/33639 "2020-08-24T06:11:19Z")

</div>

hi I need to skip a role in my playbook if a server doesn’t exist inside hosts file hosts file: \[webserver\] server1.domain server2.domain \[machine01\] server1.domain \[machine02\] server2.domain play: name: Scal…

---

## [Issue with loop index number.](https://forum.ansible.com/t/issue-with-loop-index-number/33647)

<div class="topic-metadata">

**Author:** [@soumya\_dutta](https://forum.ansible.com/u/soumya_dutta)\
**Replies:** 4\
**Last updated:** [August 23, 2020, 3:41pm UTC](https://forum.ansible.com/t/issue-with-loop-index-number/33647 "2020-08-23T15:41:05Z")

</div>

Hi, I have a situation where I have few servers and there are different artifacts or rpms are installed. I am getting all data for all servers in a clubbed list and based on that I am creating files for each server and …

---

## [skipping: no hosts matched](https://forum.ansible.com/t/skipping-no-hosts-matched/33659)

<div class="topic-metadata">

**Author:** [@Andrew\_Morgan](https://forum.ansible.com/u/Andrew_Morgan)\
**Replies:** 0\
**Last updated:** [August 23, 2020, 3:46am UTC](https://forum.ansible.com/t/skipping-no-hosts-matched/33659 "2020-08-23T03:46:19Z")

</div>

hello all, my ansible.cfg is \[defaults\] host\_key\_checking = False #hostfile=ec2.py deprecation\_warnings=False interpreter\_python = auto\_silent Use the YAML callback plugin. stdout\_callback = yaml Use the stdout\_c…

---

## [Same playbook executed locally and remotely](https://forum.ansible.com/t/same-playbook-executed-locally-and-remotely/33658)

<div class="topic-metadata">

**Author:** [@mhalano](https://forum.ansible.com/u/mhalano)\
**Replies:** 0\
**Last updated:** [August 22, 2020, 5:44pm UTC](https://forum.ansible.com/t/same-playbook-executed-locally-and-remotely/33658 "2020-08-22T17:44:27Z")

</div>

Hi fellows! I’m trying to build a playbook for my infrastructure but I would like to be able to do something like this: ansible-playbook -i hosts site.yml This playbook is quite simple, just some lines like this: im…

---

## [Ansible for Windows Server DHCP feature (dhcpmgmt.msc)](https://forum.ansible.com/t/ansible-for-windows-server-dhcp-feature-dhcpmgmt-msc/32062)

<div class="topic-metadata">

**Author:** [@Yehuda\_Pinhas](https://forum.ansible.com/u/Yehuda_Pinhas)\
**Replies:** 1\
**Last updated:** [August 22, 2020, 2:52pm UTC](https://forum.ansible.com/t/ansible-for-windows-server-dhcp-feature-dhcpmgmt-msc/32062 "2020-08-22T14:52:17Z")

</div>

Hi, I want to create ansible automation for create IPv4 pools on Windows Server 2019 operating system. This is where I want to add the pool: From what I understand I have two options I could do that: Is to the fin…

---

## [question about mode=preserve with file module](https://forum.ansible.com/t/question-about-mode-preserve-with-file-module/33649)

<div class="topic-metadata">

**Author:** [@Martey\_Dodoo](https://forum.ansible.com/u/Martey_Dodoo)\
**Replies:** 6\
**Last updated:** [August 21, 2020, 9:14pm UTC](https://forum.ansible.com/t/question-about-mode-preserve-with-file-module/33649 "2020-08-21T21:14:37Z")

</div>

Hi everyone, I’m having some issues using the “mode” parameter on the file module to change ownership of an existing directory without modifying its permissions. For example: name: use preserve mode file: path=/t…

---

## [win\_shell Command Errors out;](https://forum.ansible.com/t/win-shell-command-errors-out/33655)

<div class="topic-metadata">

**Author:** [@David\_Foley](https://forum.ansible.com/u/David_Foley)\
**Replies:** 0\
**Last updated:** [August 21, 2020, 11:21am UTC](https://forum.ansible.com/t/win-shell-command-errors-out/33655 "2020-08-21T11:21:11Z")

</div>

Hi All, getting the Following Error when trying to Run a Win\_Shell Command: fatal: \[localhost\]: FAILED! =\> {“changed”: false, “module\_stderr”: “”, “module\_stdout”: “”, “msg”: “MODULE FAILURE\\nSee stdout/stderr for the …

---

## [Fetching directories](https://forum.ansible.com/t/fetching-directories/33652)

<div class="topic-metadata">

**Author:** [@Go\_Away](https://forum.ansible.com/u/Go_Away)\
**Replies:** 0\
**Last updated:** [August 21, 2020, 7:45am UTC](https://forum.ansible.com/t/fetching-directories/33652 "2020-08-21T07:45:02Z")

</div>

Usually Ansible is used for managing remote hosts but I thought I used it to “monitor” some hosts I have. In normal circumstances I’d just loop over a list of hosts and run a simple script over ssh but I have a quite ann…

---

## [ansible](https://forum.ansible.com/t/ansible/33651)

<div class="topic-metadata">

**Author:** [@P\_R\_Music\_video\_s](https://forum.ansible.com/u/P_R_Music_video_s)\
**Replies:** 0\
**Last updated:** [August 21, 2020, 6:11am UTC](https://forum.ansible.com/t/ansible/33651 "2020-08-21T06:11:39Z")

</div>

how can i connect to telnet server through ansible please replay as soon as possible thanks&regards prajwal h g

---

## [Openssh Issues in Ansible](https://forum.ansible.com/t/openssh-issues-in-ansible/33509)

<div class="topic-metadata">

**Author:** [@miqdad\_patwa](https://forum.ansible.com/u/miqdad_patwa)\
**Replies:** 4\
**Last updated:** [August 21, 2020, 4:35am UTC](https://forum.ansible.com/t/openssh-issues-in-ansible/33509 "2020-08-21T04:35:54Z")

</div>

can you please confirm what should we use for HP comware blade switches I used comware module but still it gives me Openssh error fatal: \[BC1-ESM-A\]: UNREACHABLE! =\> { “changed”: false, “msg”: “Failed to connect to t…

---

## [module 'platform' has no attribute 'dist' on Ubuntu 20.04](https://forum.ansible.com/t/module-platform-has-no-attribute-dist-on-ubuntu-20-04/33640)

<div class="topic-metadata">

**Author:** [@Jeff\_Dickens](https://forum.ansible.com/u/Jeff_Dickens)\
**Replies:** 2\
**Last updated:** [August 20, 2020, 4:38am UTC](https://forum.ansible.com/t/module-platform-has-no-attribute-dist-on-ubuntu-20-04/33640 "2020-08-20T04:38:34Z")

</div>

When I try to use the user module with a Ubuntu 20 host, I get a failure as follows: jeff@ansible:~$ ansible-playbook -l owl j\_ansible\_user.yaml PLAY \[create ansible user\] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*…

---

## [Ansible playbook to automatically create VMware snapshots](https://forum.ansible.com/t/ansible-playbook-to-automatically-create-vmware-snapshots/33638)

<div class="topic-metadata">

**Author:** [@Quad\_Zero](https://forum.ansible.com/u/Quad_Zero)\
**Replies:** 1\
**Last updated:** [August 20, 2020, 4:11am UTC](https://forum.ansible.com/t/ansible-playbook-to-automatically-create-vmware-snapshots/33638 "2020-08-20T04:11:33Z")

</div>

G’day, Could someone please point me in the direction of automated creation of vmware snapshots? Scenario: Plan to update a series virtual machine hosts through yum update Create snapshots for each vm Confirmation th…

---

## [iam\_role session duration](https://forum.ansible.com/t/iam-role-session-duration/33643)

<div class="topic-metadata">

**Author:** [@Alan\_Sparks](https://forum.ansible.com/u/Alan_Sparks)\
**Replies:** 0\
**Last updated:** [August 19, 2020, 8:01pm UTC](https://forum.ansible.com/t/iam-role-session-duration/33643 "2020-08-19T20:01:22Z")

</div>

I’ve been hoping for cloud module iam\_role to support setting max session duration each release through 2.9, but it seems to still not. Are there any patches or replacement modules that implement this? Anything slated t…

---

## [unset ansible fact](https://forum.ansible.com/t/unset-ansible-fact/33642)

<div class="topic-metadata">

**Author:** [@Vincent\_Illiano](https://forum.ansible.com/u/Vincent_Illiano)\
**Replies:** 0\
**Last updated:** [August 19, 2020, 5:50pm UTC](https://forum.ansible.com/t/unset-ansible-fact/33642 "2020-08-19T17:50:35Z")

</div>

Hi all, I understand that once an ansible variable is set, it cannot be unset. I did find the medium.com article below that explains a work around. Unfortunately, I do not understand some of the syntax. Specifically: “-…

---

## [Using ansible to hardening Linux Systems Remotely](https://forum.ansible.com/t/using-ansible-to-hardening-linux-systems-remotely/33631)

<div class="topic-metadata">

**Author:** [@giob](https://forum.ansible.com/u/giob)\
**Replies:** 7\
**Last updated:** [August 19, 2020, 12:52pm UTC](https://forum.ansible.com/t/using-ansible-to-hardening-linux-systems-remotely/33631 "2020-08-19T12:52:30Z")

</div>

I’m new of the Ansible World, and for the moment i used just to hardening some linux systems using every time the command locally: ansible path\_to\_my\_playbook.yml There is a way to run this commant to a remote comput…

---

## [How to get latest Ansible for Ubuntu 20.04](https://forum.ansible.com/t/how-to-get-latest-ansible-for-ubuntu-20-04/33636)

<div class="topic-metadata">

**Author:** [@sampsont](https://forum.ansible.com/u/sampsont)\
**Replies:** 0\
**Last updated:** [August 18, 2020, 3:38pm UTC](https://forum.ansible.com/t/how-to-get-latest-ansible-for-ubuntu-20-04/33636 "2020-08-18T15:38:30Z")

</div>

When will the Ansible PPA be available for Ubuntu 20.04? I get the following error using Ansible 2.9.6 running on Ubuntu 20.04: Malformed output discovered from systemd list-unit-files: accounts-daemon.service Googlin…

---

## [connection: local and delegate\_to not working together](https://forum.ansible.com/t/connection-local-and-delegate-to-not-working-together/33634)

<div class="topic-metadata">

**Author:** [@jegansignup](https://forum.ansible.com/u/jegansignup)\
**Replies:** 0\
**Last updated:** [August 18, 2020, 1:40pm UTC](https://forum.ansible.com/t/connection-local-and-delegate-to-not-working-together/33634 "2020-08-18T13:40:54Z")

</div>

Hello Team, I am facing issue while running below playbook from ansible server. Getting error like below. I gave small part of the playbook. The intention to use connection: local is I like to perform few tasks from ans…

---

## [Non-Administrator Accounts - WinRM](https://forum.ansible.com/t/non-administrator-accounts-winrm/33633)

<div class="topic-metadata">

**Author:** [@jesty\_sam](https://forum.ansible.com/u/jesty_sam)\
**Replies:** 0\
**Last updated:** [August 18, 2020, 1:07pm UTC](https://forum.ansible.com/t/non-administrator-accounts-winrm/33633 "2020-08-18T13:07:40Z")

</div>

Hello All We are trying to run certain playbooks against Windows servers and it works all fine. But every time we end up asking the DC team for the service account to be added to Local admin group which i think it is no…

---

## [Cross-domain auth using Kerberos](https://forum.ansible.com/t/cross-domain-auth-using-kerberos/33574)

<div class="topic-metadata">

**Author:** [@Michael\_Richter](https://forum.ansible.com/u/Michael_Richter)\
**Replies:** 1\
**Last updated:** [August 18, 2020, 10:47am UTC](https://forum.ansible.com/t/cross-domain-auth-using-kerberos/33574 "2020-08-18T10:47:19Z")

</div>

Hi, On a Linux server I want to access a Windows server from Windows domain sub.dnsdomain using an account from parent Windows domain dnsdomain. The account has admin permissions to that server and can login using RDP. …

---

## [2 levels nested loop with variables](https://forum.ansible.com/t/2-levels-nested-loop-with-variables/33598)

<div class="topic-metadata">

**Author:** [@Nic\_H](https://forum.ansible.com/u/Nic_H)\
**Replies:** 5\
**Last updated:** [August 17, 2020, 10:38pm UTC](https://forum.ansible.com/t/2-levels-nested-loop-with-variables/33598 "2020-08-17T22:38:57Z")

</div>

Hi, I have been looking into nested , subelements and other lookups with no luck to make this working , using ansible 2.8. Basically , I’d like to construct a loop than can itself iterate over other variables (list or d…

---

## [Ansible inventory duplicate hosts in different groups - Ansible picks the last one from the duplicates](https://forum.ansible.com/t/ansible-inventory-duplicate-hosts-in-different-groups-ansible-picks-the-last-one-from-the-duplicates/33629)

<div class="topic-metadata">

**Author:** [@Abhishek\_Sharma](https://forum.ansible.com/u/Abhishek_Sharma)\
**Replies:** 2\
**Last updated:** [August 17, 2020, 9:46pm UTC](https://forum.ansible.com/t/ansible-inventory-duplicate-hosts-in-different-groups-ansible-picks-the-last-one-from-the-duplicates/33629 "2020-08-17T21:46:09Z")

</div>

Hi I have an inventory defined as below: \[A\] host1.example.com lhost=1010 host2.example.com lhost=1110 \[B\] host1.example.com lhost=2010 now when i run below command on group A for host1.example.com ansible picks u…

---

## [Tags or Variables, not sure which way to go](https://forum.ansible.com/t/tags-or-variables-not-sure-which-way-to-go/33625)

<div class="topic-metadata">

**Author:** [@jcpetro](https://forum.ansible.com/u/jcpetro)\
**Replies:** 2\
**Last updated:** [August 17, 2020, 5:46pm UTC](https://forum.ansible.com/t/tags-or-variables-not-sure-which-way-to-go/33625 "2020-08-17T17:46:03Z")

</div>

So I am having an issue about not knowing what the best thing to do is. Here’s what I am trying to accomplish… I have the following sanitized tasks: name: Set authorized key ( prod) authorized\_key: user: ansible st…

---

## [Ansible Windows Deployment - 'Connection aborted.', error(104, 'Connection reset by peer')](https://forum.ansible.com/t/ansible-windows-deployment-connection-aborted-error-104-connection-reset-by-peer/28570)

<div class="topic-metadata">

**Author:** [@Kartik\_Jayaraman](https://forum.ansible.com/u/Kartik_Jayaraman)\
**Replies:** 5\
**Last updated:** [August 17, 2020, 1:41pm UTC](https://forum.ansible.com/t/ansible-windows-deployment-connection-aborted-error-104-connection-reset-by-peer/28570 "2020-08-17T13:41:40Z")

</div>

Hello, I am facing an issue with deployment on Windows 2008 server using Ansible. I have a jenkins pipeline which has an Ansible Deployment stage wherein I drop the files on to the target servers from inventory. I have …

---

## [Passing encrypted password to playbook using --ask-become-pass option](https://forum.ansible.com/t/passing-encrypted-password-to-playbook-using-ask-become-pass-option/33628)

<div class="topic-metadata">

**Author:** [@Kumaresh\_kulal](https://forum.ansible.com/u/Kumaresh_kulal)\
**Replies:** 0\
**Last updated:** [August 17, 2020, 11:34am UTC](https://forum.ansible.com/t/passing-encrypted-password-to-playbook-using-ask-become-pass-option/33628 "2020-08-17T11:34:46Z")

</div>

Hello, I am trying to pass the encrypted password to execute my playbook and while doing so I see below error. Error: FAILED! =\> {“msg”: “The field ‘become\_pass’ has an invalid value, which includes an undefined variab…

---

## [install ansible system wide](https://forum.ansible.com/t/install-ansible-system-wide/33627)

<div class="topic-metadata">

**Author:** [@Manuel\_Sopena\_Balles](https://forum.ansible.com/u/Manuel_Sopena_Balles)\
**Replies:** 1\
**Last updated:** [August 17, 2020, 8:37am UTC](https://forum.ansible.com/t/install-ansible-system-wide/33627 "2020-08-17T08:37:22Z")

</div>

hi, I just realised that ansible installs on user home folder $ whereis ansible-playbook ansible-playbook: /home/msopena/.local/bin/ansible-playbook how can I install ansible system-wide so I can install it once and …

---

## [How to add var file in task level and not playbook level](https://forum.ansible.com/t/how-to-add-var-file-in-task-level-and-not-playbook-level/33626)

<div class="topic-metadata">

**Author:** [@dudu.c](https://forum.ansible.com/u/dudu.c)\
**Replies:** 0\
**Last updated:** [August 17, 2020, 7:33am UTC](https://forum.ansible.com/t/how-to-add-var-file-in-task-level-and-not-playbook-level/33626 "2020-08-17T07:33:51Z")

</div>

This is not working Thanks - name: Update server etc/host vars\_files: /opt/defaults/defaults.yml lineinfile: path: /etc/hosts line: "{{ external\_address }} {{ service\_name }}" state: present …

---

## [How do i install an ansible galaxy role from a tar.gz file as non-root user ?](https://forum.ansible.com/t/how-do-i-install-an-ansible-galaxy-role-from-a-tar-gz-file-as-non-root-user/33621)

<div class="topic-metadata">

**Author:** [@Hans\_Lammerts](https://forum.ansible.com/u/Hans_Lammerts)\
**Replies:** 1\
**Last updated:** [August 17, 2020, 7:25am UTC](https://forum.ansible.com/t/how-do-i-install-an-ansible-galaxy-role-from-a-tar-gz-file-as-non-root-user/33621 "2020-08-17T07:25:11Z")

</div>

Hi, I have seen a number of sites that explain how to install a role from a tar.gz file using ansible-galaxy, and they all seem to say the same thing. In my case I have downloaded the following role file from ansible g…

---

## [Use of VARS and Register at the same time](https://forum.ansible.com/t/use-of-vars-and-register-at-the-same-time/33624)

<div class="topic-metadata">

**Author:** [@Poseidon\_Olympian](https://forum.ansible.com/u/Poseidon_Olympian)\
**Replies:** 0\
**Last updated:** [August 16, 2020, 6:38pm UTC](https://forum.ansible.com/t/use-of-vars-and-register-at-the-same-time/33624 "2020-08-16T18:38:22Z")

</div>

Hello, Appreciated of any Help… I’m looking for any approached or solution that a Variable (VARS) and Register would be able to use in one TASK Copy Module. here’s my Code as example… Basically, I need to copy all cf…

---

## [kerberos error when connecting to windows machine](https://forum.ansible.com/t/kerberos-error-when-connecting-to-windows-machine/33623)

<div class="topic-metadata">

**Author:** [@Tony\_Wong](https://forum.ansible.com/u/Tony_Wong)\
**Replies:** 0\
**Last updated:** [August 16, 2020, 6:03pm UTC](https://forum.ansible.com/t/kerberos-error-when-connecting-to-windows-machine/33623 "2020-08-16T18:03:45Z")

</div>

keep getting this error on a windows machine UNREACHABLE! =\> { “changed”: false, “msg”: “kerberos: (‘Connection aborted.’, error(104, ‘Connection reset by peer’))”, “unreachable”: true any idea? HTTPS is listenin…

---

## [Display file content in body of mail module](https://forum.ansible.com/t/display-file-content-in-body-of-mail-module/33620)

<div class="topic-metadata">

**Author:** [@Sivaraman\_P](https://forum.ansible.com/u/Sivaraman_P)\
**Replies:** 6\
**Last updated:** [August 15, 2020, 10:58am UTC](https://forum.ansible.com/t/display-file-content-in-body-of-mail-module/33620 "2020-08-15T10:58:21Z")

</div>

Hi All, How to display the file contents in the body of the mail module. mail: body: /tmp/file2.txt

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

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