[ansible-project] ansible_host + proxy + windows servers (WinRM) not working

2017-08-10 Thread Mike Klebolt
Hello, We're using ansible on some windows servers. The ansible_host is configured with a proxy and is preventing us from connecting to the windows hosts. My current workaround involves manually exporting no_proxy with the windows server IPs. While this gets us connected, I still feel like

Re: [ansible-project] ansible_host + proxy + windows servers (WinRM) not working

2017-08-14 Thread Mike Klebolt
I was able to resolve this issue by modifying one of the lines in transport.py for pywinrm. session.trust_env = True changed to: session.trust_env = False > -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To

[ansible-project] Re: How to call roles & specify tags for those roles

2017-08-17 Thread Mike Klebolt
I use tags at the role level when I have a play that contains multiple roles. If all you're wanting to do is run the config apache task, remove the config_apache tag from the role and leave it on the task. Hopefully I'm understanding your question correctly. --- - hosts: 10.10.0.5 become:

[ansible-project] Re: delegate_to localhost tries to connect to WinRM

2017-08-18 Thread Mike Klebolt
I could be wrong here but I believe this is related to variable precedence. Ansible thinks that it has to use winrm to connect to the localhost since extra vars always wins. Try moving all of the connection details to either host_vars/10.x.x.x or group_vars/windows.yml.

[ansible-project] Re: Cannot connect to WindowsServer from Centos7 ProxyError

2017-08-18 Thread Mike Klebolt
Hi Aleksander, Try adding no_proxy= to your ~/.bashrc and reload it. If you will be working with many windows servers in the future, a more permanent solution that worked for me is the following... 1. Locate transport.py that comes with pywinrm 2. modify the following line session.trust_env

[ansible-project] Re: Playbook for windows updates.

2017-09-25 Thread Mike Klebolt
The win_updates module will give a reboot_required: True return value when one is required. With that information you can register the task and then have a follow up win_reboot task when reboot_required: True. See below for how to accomplish this. - name: Install Windows Updates

[ansible-project] Re: Cannot connect to WindowsServer from Centos7 ProxyError

2017-08-21 Thread Mike Klebolt
t;> >> Thanks a lot Mike!! >> Your suggestion works, >> the .bashrc shortcut didn't work, but then I changed session.trust_env = >> True to False in transport.py and ansible made the connection. >> >> >> W dniu piątek, 18 sierpnia 2017 16:20:27 UTC+2 użytkownik

[ansible-project] Re: disable unnecessary output on ansible server console

2017-08-21 Thread Mike Klebolt
ot@hackerdev 6.2]# > > > On Friday, August 18, 2017 at 1:26:39 AM UTC+5:30, Mike Klebolt wrote: >> >> What do you have in your ansible.cfg for stdout_callback? >> >> On Thursday, August 17, 2017 at 9:13:25 AM UTC-5, Sameer Modak wrote: >>> >>>

[ansible-project] Re: with_items loops saying item undefined even if its present in parameter

2017-08-21 Thread Mike Klebolt
It looks like your spacing is off. Add another space to your hashes under with_items. with_items: - { href: " http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm;, repo: "/etc/yum.repos.d/epel.repo" } - { href: "

[ansible-project] Re: how to retain stdout formatting when using adhoc commands (shell module)

2017-08-17 Thread Mike Klebolt
Not sure what exactly you mean. Is stdout_lines what you're looking for? On Thursday, August 17, 2017 at 1:32:20 PM UTC-5, je...@redhat.com wrote: > > Hey -- when running adhoc commands (using shell module), the stdout > returned from target systems is stripped of formatting. Is there a >

[ansible-project] Re: disable unnecessary output on ansible server console

2017-08-17 Thread Mike Klebolt
What do you have in your ansible.cfg for stdout_callback? On Thursday, August 17, 2017 at 9:13:25 AM UTC-5, Sameer Modak wrote: > > Hello Team, > When i run following command i get log of output on screen. I just want if > it success or failed. > > ansible web -m yum -a "name=MySQL-python

[ansible-project] Re: How to call roles & specify tags for those roles

2017-08-17 Thread Mike Klebolt
If you are adding a tag to a role, there is no need to use the same tag on any of the tasks within the role. So running your playbook with -t config_apache will include both tasks. Running it with -t apache_install will only run the Install apache task.

[ansible-project] Re: How to make variant DNS config on windows following hosts group

2018-01-04 Thread Mike Klebolt
Something like this? group_vars/host_group1.yml --- DNS: - 192.168.10.10 - 192.168.10.11 - 192.168.10.12 group_vars/host_group2.yml --- DNS: - 192.168.10.11 - 192.168.10.12 - 192.168.10.10 group_vars/host_group3.yml --- DNS: - 192.168.10.12 - 192.168.10.10 - 192.168.10.11

[ansible-project] Re: how to see only cifs mount on all server using ansible

2018-01-04 Thread Mike Klebolt
- shell: df -ht cifs On Sunday, December 24, 2017 at 6:23:27 AM UTC-6, Sameer Modak wrote: > > how can we see all cifs mount on each server using ansible > -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group

[ansible-project] Re: Create variables based on hostname

2018-01-04 Thread Mike Klebolt
You can create your own filter. I've created this one that you should easily be able to modify to suit your needs. import math import collections from ansible import errors def uppercase_all(arg): return arg.upper() def extract_siteid(arg): if len(arg) < 10: return FALSE

[ansible-project] include_tasks with tags, regression of feature?

2018-01-19 Thread Mike Klebolt
I'm trying to dynamically include tasks along with using tags. The issue I'm running into is that yes, its including the tasks file, but its not executing any of the tasks within that file. After reading the Creating Reusable Playbooks guide, it appears this is by design for include_tasks.

[ansible-project] Re: include_tasks with tags, regression of feature?

2018-01-19 Thread Mike Klebolt
I've also tried wrapping all the tasks in the dynamically included file in a block and adding a tag to the block. This achieves what I'm trying to accomplish but doesn't feel like the proper approach. On Friday, January 19, 2018 at 9:58:05 AM UTC-6, Mike Klebolt wrote: > > I'm

Re: [ansible-project] Re: include_tasks with tags, regression of feature?

2018-01-19 Thread Mike Klebolt
I won't be able to use 2.5 since import_tasks with a dynamically assigned variable with fail. Is there a way around this? --- - name: Test hosts: localhost gather_facts: False connection: local tasks: - set_fact: dynamic_variable: dynamic - import_tasks: "{{ dynamic_variable

Re: [ansible-project] Re: include_tasks with tags, regression of feature?

2018-01-22 Thread Mike Klebolt
Thanks Matt. I was able to get everything functioning using the `block` method. Do you know if this will be revisited in a future release because I grew to like the include functionality prior to ebf971f? > -- You received this message because you are subscribed to the Google Groups

[ansible-project] Re: running a command & remotely

2018-03-20 Thread Mike Klebolt
Sounds like you may want to use async “fire and forget” by specifying a poll value of 0. http://docs.ansible.com/ansible/latest/playbooks_async.html -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop

[ansible-project] Re: Win_service name option contains non permitted characters and doesn't allow escaping

2018-03-19 Thread Mike Klebolt
Have you tried using the service name rather than the Display Name? On Monday, March 19, 2018 at 9:43:20 AM UTC-5, b...@wspring.co.uk wrote: > > Hi All > > I am trying to use thw win_service module to start a service. > > My issue is the service name contains non-valid characters and I dont seem

[ansible-project] Re: ansible-sudo-issue

2018-10-30 Thread Mike Klebolt
You may want to check out these two config options: https://docs.ansible.com/ansible/latest/reference_appendices/config.html?highlight=ansible_become_exe#default-become-exe https://docs.ansible.com/ansible/latest/reference_appendices/config.html?highlight=ansible_become_exe#default-become-flags

[ansible-project] Re: Ansible-Protecting-Paswords

2018-10-30 Thread Mike Klebolt
This should do the trick. https://docs.ansible.com/ansible/latest/user_guide/playbooks_vault.html#single-encrypted-variable On Monday, October 29, 2018 at 9:40:49 AM UTC-5, Bairava Surya wrote: > > Hi All, > > --- > > - name: Weblogic Server control > hosts: "servername" > > > tasks: > -

[ansible-project] Re: Export debug msg to a file

2019-02-18 Thread Mike Klebolt
The stat module does not have a return key of stdout_lines. For a list of data that is returned from the stat module please reference this page here . On Monday, February 18, 2019 at 2:58:11 AM UTC-6, Adelmo Silva