Re: [ansible-project] idempotent way to convert directory into a link?

2017-02-16 Thread Kai Stian Olstad
On 17.02.2017 01:51, sunnz wrote: can ansible force a path to be a link even when it is a directory with files? currently i am deleting the directory before making it a link and it is not idempotent. You can't force it, you need to delete and create link as you do now. on the first run it

Re: [ansible-project] Ansible and Vsphere

2017-02-16 Thread Nehal J Wani
Seems like there is an indentation problem. Try: vm_disk: disk1: size_gb: 1 type: thin datastore: Comoy-SAN vm_nic: nic1: type: vmxnet3 network: Example_Application_10.10.10.0_24_VLAN10 network_type: standard

[ansible-project] Using Win-regedit module to change ie hardening

2017-02-16 Thread challa . tek
currently i am using power shell Set-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\' -Name 'IEHarden' -Value '0' so , i am trying this: - win_regedit: path: 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\' na

[ansible-project] Win-regedit module

2017-02-16 Thread challa . tek
i wan to execute this job using win_regedit module Disabling IE hardening: Set-ItemProperty 'HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\policies\\system\\' -Name 'EnableLUA' -Value '0' -- You received this message because you are subscribed to the Google Groups "Ansible Project

[ansible-project] idempotent way to convert directory into a link?

2017-02-16 Thread sunnz
hi, can ansible force a path to be a link even when it is a directory with files? currently i am deleting the directory before making it a link and it is not idempotent. on the first run it deletes the directory. but it is also deleting and re-creating the link in every run after that. for ex

[ansible-project] Re: On Windows, how can we configure Ansible's modules to go through an HTTP Proxy?

2017-02-16 Thread JS
>From Github: SUMMARY Ansible modules executed on a Windows host are unable to access the internet via an HTTP Proxy. Ideally modules would function similarly to setting the environment on Linux hosts, i.e environment: http_proxy: http://gateway:port https_proxy: http://gateway:port Th

[ansible-project] On Windows, how can we configure Ansible's modules to go through an HTTP Proxy?

2017-02-16 Thread JS
As per this post on the Ansible Github , how can Ansible be configured to run through an HTTP proxy? Ultimately it is ideal to use the win_chocolatey module through the proxy, but I'm unable to just run a simple curl (i.e curl http://www.google.c

[ansible-project] Ansible and Vsphere

2017-02-16 Thread Robert Williams
All , i have searched many sites but i am able to get this playbook to work. I am trying to build a vm via ansible and i get the following error message below. I have also posted my playbook. Any help would be greatly appreciated. Thanks in advance, ___PLAYBOOK --- - hosts: 127.0.0.1 con

[ansible-project] Can't get gpg key accepted automatically for new repo on CentOS 7

2017-02-16 Thread luke
Here's the play I've tried: - hosts: eliza tags: - grafana roles: - role: service_restart tasks: - name: Add grafana repository yum_repository: name: grafana description: grafana baseurl: https://packagecloud.io/grafana/stable/el/6/$basearch

[ansible-project] ansible_connection ansible_user

2017-02-16 Thread trg . achilles
Hello, I'm new to ansible and struggle to find a way create a role that could install application both on Windows and Linux os. I'm having problem to allocate correct ansible_connection ansible_user. It seems like if I set in vars connection parameters for Windows that affects Linux access an

[ansible-project] `from_yaml` seems to strips newlines from values in yaml strings

2017-02-16 Thread james
Name: "{{item.name}}" Platform: "{{item.platform}}" Attributes: PlatformCredential: "{{platform_credential.stdout|regex_replace('\n', '\\n')}}" PlatformPrincipal: "{{platform_principal.stdout|regex_replace('\n', '\\n')}}" - debug: msg: "{{lookup('template', 'create-platform-applicatio

Re: [ansible-project] Re: How to use Ansible playbook loops to create multiple specific VMware guests on multiple free ESXi hosts using vsphere_guest module.

2017-02-16 Thread Alex Lien
Hi Kai, The playbook works perfectly now. Thanks again for all your help. Regards, Alex On Thu, Feb 16, 2017 at 7:26 AM, Kai Stian Olstad < ansible-project+l...@olstad.com> wrote: > On 15. feb. 2017 22:13, Alex Lien wrote: > >> Hi Kai, >> >> Thank You so much for your help. The loop works wit

[ansible-project] win_lineinfile does not create new file

2017-02-16 Thread cupcake
ansible core 2.1 When using win_lineinfile module and the `create: yes` option it seems it should create a new file. it fails the same as if create:yes is not specified. - hosts: all tasks: - name: win_lineinfile test win_lineinfile: dest: 'c:\temp\ansible-windows.log' cre

Re: [ansible-project] Ansible installation without internet

2017-02-16 Thread Kai Stian Olstad
On 15. feb. 2017 18:10, Abhinav Sanakkayala wrote: Hi All, I am trying to install Ansible on my Ubuntu16.04 version, the path that I can think of is to first install the Python Jinja2 package and then set the source for the Ansible installation file. I have googled it and didn't find any good us

Re: [ansible-project] Re: How to use Ansible playbook loops to create multiple specific VMware guests on multiple free ESXi hosts using vsphere_guest module.

2017-02-16 Thread Kai Stian Olstad
On 15. feb. 2017 22:13, Alex Lien wrote: Hi Kai, Thank You so much for your help. The loop works with your suggestions except it seems to run a duplicate task and create a duplicate guest. This is with a test of 2 ESX hosts. Is there a way to work around it? This is what I have in my invento

[ansible-project] Not able to use full URI in the playbook

2017-02-16 Thread shanmuga Mahalingam
I tried to specify full URI in the vurtual_network_name and ansible can't find the subnet within the virtual network. azure_rm_networkinterface: name: testnetworkinfrastructure resource_group: testsourcegroup1 virtual_network_name: */subscriptions/x/resourceGroups/tes

Re: [ansible-project] Arguments for/against using vault password files

2017-02-16 Thread Nehal J Wani
Another option, IMO is to use GPG https://github.com/ansible/ansible/pull/7174 On Thu, Feb 16, 2017 at 6:31 PM, Andrew Feller wrote: > Hi everyone, > > I would appreciate hearing peoples' various arguments for/against using > vault password files versus manually entering passwords. > > I've been

Re: [ansible-project] Replace multiple lines in a file at different locations

2017-02-16 Thread Nehal J Wani
Maybe http://docs.ansible.com/ansible/lineinfile_module.html will help? [wani@linux tmp ]$ cat /tmp/a [wani@linux tmp ]$ cat a.yaml - hosts: localhost tasks: - lineinfile: path: /tmp/a regexp: "^ " state: absent - lineinfile: path: /tmp/a r

[ansible-project] Arguments for/against using vault password files

2017-02-16 Thread Andrew Feller
Hi everyone, I would appreciate hearing peoples' various arguments for/against using vault password files versus manually entering passwords. I've been manually entering in vault passwords as I didn't want to leave keys on my laptop in case stolen / compromised. I've seen posts about configur

Re: [ansible-project] Telnet module for ansible

2017-02-16 Thread Nehal J Wani
Maybe, use the expect module? http://docs.ansible.com/ansible/expect_module. html#status - hosts: localhost tasks: - expect: command: telnet localhost 8000 responses: "Escape character is '\\^]'.": "GET / HTTP/1.1\rHost: localhost\r\n" "": "\x1d"

[ansible-project] Re: ansible winrm : the specified credentials were rejected by the server

2017-02-16 Thread Hmdi Bz
no I'm not using a domain login, just a normal user (not an admin) , the User Account Control is disabled. update: I've tried to win_ping to the admin account and it work, the thing is I need it to work with just a normal account On Wednesday, February 15, 2017 at 12:56:52 PM UTC+1, J Hawkeswor

[ansible-project] Re: ansible winrm : the specified credentials were rejected by the server

2017-02-16 Thread Hmdi Bz
Yes I'm using a domain login , do I have to create a normal user ?? Thank you for the reply On Wednesday, February 15, 2017 at 12:56:52 PM UTC+1, J Hawkesworth wrote: > > "the specified credentials were rejected by the server" can often mean the > password doesn't match what's expected for the

Re: [ansible-project] ansible winrm : the specified credentials were rejected by the server

2017-02-16 Thread Hmdi Bz
Yes the password is correct and no the user is a standard one not an admin is it necessary to be admin to just use win_ping?? On Thursday, February 16, 2017 at 7:14:21 AM UTC+1, Trond Hindenes wrote: > > Pretty sure thats not a password issue, I think the error text is > different. > > Is the use

Re: [ansible-project] Pass dynamic JSON/YAML inventory to ansible CLI

2017-02-16 Thread W Dec
Ok thanks. Indeed I've resorted to writing the inventory and host parameters to a tmp file, off a jinja2 template, and using the ansible -i option to read from it. Still it would be a nice enhancement for Ansible to support such "piped" inventories, as the Ansible API is way too cumbersome to u