[ansible-project] Re: Ansible WinRM shows 401 Unauthorized when pywinrm works with no problem

2015-11-12 Thread kevin . e . kenny
Try changing: ansible_ssh_password=ansible to ansible_ssh_pass=ansible That tripped me up with 1.9.4. Same thing would apply to your windows.yml. Kev On Wednesday, October 21, 2015 at 5:48:13 PM UTC+1, Tianwei Liu wrote: > > Hi, > > I am having this weird problem that my ansible will

[ansible-project] Re: Connecting to existing ec2 instances

2015-11-12 Thread nathan chu
My existing instances are provisioned thusly: tasks: - name: Provision an instance ec2: > aws_access_key={{ec2_access_key}} aws_secret_key={{ec2_secret_key}} keypair={{mykeypair}} group_id={{security_group}} instance_type={{instance_type}}

[ansible-project] Connecting to existing ec2 instances

2015-11-12 Thread nathan chu
Hi, I recently inherited an Ansible deployment that manages some EC2 instances and I have a couple questions. I am unable to find a pem file/ssh key on the local file system, but somehow Ansible is able to connect to the instances it creates and run shell scripts. How is this possible? I'm

Re: [ansible-project] Build automation using ESXi, Ansible, Pysphere

2015-11-12 Thread Mark Phillips
Not a problem Mihai! *There is always a way*. There are choices here, as per usual - you could always use 'wait_for'[1] in an Ansible play, or you could use a 'phone home' type solution - i.e. the newly provisioned virtual machine boots and the first thing it does is 'look for' a centralised

Re: [ansible-project] Re: Connecting to existing ec2 instances

2015-11-12 Thread Brian Coca
run ansible with -v and you should see the full ssh command used, that should point at a key, if not you likely have an agent or the ssh user/password info in inventory. -- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible Project" group.

[ansible-project] Re: Connecting to existing ec2 instances

2015-11-12 Thread nathan chu
*typo: not --> now. there's a nice one-letter semantic change, lol. On Thursday, November 12, 2015 at 4:38:16 PM UTC-5, nathan chu wrote: > > Hi, > > I recently inherited an Ansible deployment that manages some EC2 instances > and I have a couple questions. I am unable to find a pem

Re: [ansible-project] Re: Troubleshooting Windows Host UNREACHABLE!

2015-11-12 Thread J Hawkesworth
Is this machine Server 2008 R2 by any chance? WMF 3.0 had an irritating bug where it would allocate a tiny memory quota for winrm so things would fail a lot. Hotfix for the fix as described in the blue box here: http://docs.ansible.com/ansible/intro_windows.html#windows-system-prep Just

[ansible-project] Variable name includes a variable

2015-11-12 Thread mtovey
This is something I have been struggling with for a while: a variable whose name includes a variable. For instance, Ansible facts for a server includes the following information on the network interfaces: "ansible_eth0": { "active": true, "device":

[ansible-project] How to ignore invalid tag name instead of throwing a error

2015-11-12 Thread yikaus
Hi , I got the requirement to ignore the invalid tag name when execute a playbook eg . ansible-playbook -t tag1 test.yml and I will get below error and fail the playbook ERROR: tag(s) not found in playbook: tag1. What I expect is doing nothing if tag name is not exist just like

[ansible-project] 2.0 host key check issues

2015-11-12 Thread Guy Knights
I've noticed since I upgraded to 2.0 that something is wrong with host key checks when running ansible-playbook. Previously, under 1.9, if ansible-playbook encountered an unknown host key during the setup phase, it was present the standard OpenSSH host key prompt and pause to wait for user

[ansible-project] Playbook name/path in callback plugin

2015-11-12 Thread tinyzais
Is it possible to get playbook name and/or path from within callback plugin? -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to

Re: [ansible-project] template with groups as a variable

2015-11-12 Thread Matt Martz
You can't nest jinja2 delimiters. You just use bare variable names inside such as: {% for host in groups[VAR] %} On Thursday, November 12, 2015, Edgardo Vega wrote: > I am trying to do the following where I index groups by a variable instead > of hardcoding it. Is that

Re: [ansible-project] loop over host group to create string

2015-11-12 Thread John Favorite
Great, glad it worked for you! On Wed, Nov 11, 2015, 1:27 PM Roy wrote: > Thanks following works for me. > > > zookeeper.connect={% for node in groups['eventstore-zookeeper-' ] %}{{ > node }}:2181{% if not loop.last %},{% endif %}{% endfor %} > > -- > You received this message

Re: [ansible-project] Build automation using ESXi, Ansible, Pysphere

2015-11-12 Thread Mihai Cristian Satmarean
Great Mark - *There is always a way* even if is the crazyest way :) I will investigate for now the wait for idea and ping the port or something. Thanks a lot! joi, 12 noiembrie 2015, 10:27:35 UTC+1, Mark Phillips a scris: > > Not a problem Mihai! *There is always a way*. > > There are choices

[ansible-project] Re: template with groups as a variable

2015-11-12 Thread Edgardo Vega
I figured it out. You can just do the following and it will work. {% for host in groups[VAR] %} On Thursday, November 12, 2015 at 7:50:18 AM UTC-5, Edgardo Vega wrote: > > I am trying to do the following where I index groups by a variable instead > of hardcoding it. Is that possible somehow? >

Re: [ansible-project] Build automation using ESXi, Ansible, Pysphere

2015-11-12 Thread Jason Hiatt
We do something similar with our builds. The last thing we do in the post section of our Kickstart script is make a web service call. The web service moves the VM to the correct network. > On Nov 12, 2015, at 04:34, Mihai Cristian Satmarean > wrote: > > Great Mark

[ansible-project] template with groups as a variable

2015-11-12 Thread Edgardo Vega
I am trying to do the following where I index groups by a variable instead of hardcoding it. Is that possible somehow? {% for host in groups['{{VAR}}'] %} STUFF {% endfor %} Thanks in advance, Edgardo -- You received this message because you are subscribed to the Google Groups "Ansible

[ansible-project] msg: hostname module cannot be used on platform Linux (Centos linux)

2015-11-12 Thread Greg Swift
Fwiw, i built this role against centos7 and just ran it fresh against an updated box monday. I'm gonna check it again now that i saw this. -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving

[ansible-project] Re: Role do something after handler?

2015-11-12 Thread Ulrich Hochholdinger
Hi, xou can write a handler for every single Action, and notify all desired handlers when needed. Handlers are executed in the order inside the handlers list. theoretical example: tasks: - name: change config action: do something notify: - enable_handler -

Re: [ansible-project] Iterate over complex dicitonary structure in j2 tempalte

2015-11-12 Thread Alex Leonhardt
Hi, this may help: https://docs.ansible.com/ansible/playbooks_loops.html#looping-over-subelements https://docs.ansible.com/ansible/playbooks_loops.html#looping-over-hashes Alex On 13 November 2015 at 05:26, Hristo Stoyanov wrote: > Sorry if this has been documented

Re: [ansible-project] Solaris and pfexec, not working?

2015-11-12 Thread Brian Coca
1.9 had a skeleton for pfexec support but we never got to test it, it is now available in 2.0 which is current devel and close to release. If you really want to test with 1.9, you need to update the following in the ssh.py or paramiko_ssh.py connection plugin (whichever you are using).

Re: [ansible-project] lining up users when bootstrapping a system

2015-11-12 Thread Brian Coca
try: - hosts: boxens remote_user: root tasks: - yum: name={{ item }} state=present with_items: packages - command: "puppet agent --noop --server={{ puppetmaster }}" - command: "puppet cert sign {{ ansible_fqdn }}" delegate_to: "{{ puppetmaster }}" remote_user:

Re: [ansible-project] Variable name includes a variable

2015-11-12 Thread Brian Coca
mustaches don't stack, to do dynamic vars you need to use hostvars: - debug: msg="interface = {{item}}, address = {{ hostvars[inventory_hostname]['ansible_' + item].ipv4.address }} with_items: ansible_interfaces when: 'item != "lo"' -- Brian Coca -- You received this

Re: [ansible-project] msg: hostname module cannot be used on platform Linux (Centos linux)

2015-11-12 Thread Greg Swift
So I have no idea why the ostname module would be behaving like that. Looking at the module it has lots of distribution coverage. I just tested hostname on ansible 1.9.4 and "ansible_distribution": "CentOS", "ansible_distribution_major_version": "7", "ansible_distribution_release": "Core",

Re: [ansible-project] 2.0 host key check issues

2015-11-12 Thread Brian Coca
2.0 does not lock known_hosts for updating ssh keys, 1.9 does, it is a difficult issue as it needs to be locked to be consistent, but can end up serializing the plays. -- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To

[ansible-project] Iterate over complex dicitonary structure in j2 tempalte

2015-11-12 Thread Hristo Stoyanov
Sorry if this has been documented elsewhere (where?), but how can one iterate with jinja2 over a dictionary? http://stackoverflow.com/questions/33666820/ansible-jinja2-loops-over-complex-structures You can ask here or in stackoverflow. Thanks -- You received this message because you are

[ansible-project] Re: Role do something after handler?

2015-11-12 Thread Ulrich Hochholdinger
Hi, xou can write a handler for every single Action, and notify all desired handlers when needed. Handlers are executed in the order inside the handlers list. theoretical example: tasks: - name: change config action: do something notify: - enable_handler -

Re: [ansible-project] 2.0 host key check issues

2015-11-12 Thread Alex Leonhardt
I'd try running 1.9 against the very same host and see what happens, also, adding - may give some idea what's happening too .. it may just be a new config setting somewhere ... this may be relevant too tho : https://github.com/ansible/ansible/issues/3694#issuecomment-22530734 Alex On 13

[ansible-project] Re: Troubleshooting Windows Host UNREACHABLE!

2015-11-12 Thread Matt Calhoun
I have verified that PSRemoting seems to be working fine on this host. From another windows box... PS C:\> Invoke-Command -ComputerName myhost -port 5985 -Authentication Kerberos -ScriptBlock { Get-Content c:\windows\system32\drivers\etc\hosts } -credential myaccount # Copyright (c)

[ansible-project] CloudFront Module for Ansible

2015-11-12 Thread K Cheng
Hi Mohammad, I've submitted pull request https://github.com/ansible/ansible-modules-extras/pull/1223 if you are still after an Ansible cloudfront module. Regards Ķaren C -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe

[ansible-project] Re: How to SUBSTRING a string from a variable like hostname_01.com:28569 ... get only the hostname part or the port ?

2015-11-12 Thread Eric Franckx
Is there a advance substr( var, ':', 0) ---> to get from the begin of the string the substring ? On Thursday, 12 November 2015 14:13:16 UTC+1, Eric Franckx wrote: > > Hi, > > if I have a string/var with hostname_01.com:28569, how can I use the > hostname part (hostname_01 and don"t use the

[ansible-project] How to SUBSTRING a string from a variable like hostname_01.com:28569 ... get only the hostname part or the port ?

2015-11-12 Thread Eric Franckx
Hi, if I have a string/var with hostname_01.com:28569, how can I use the hostname part (hostname_01 and don"t use the :28569) to be use in an action ? Regards, -- -- This email is sent on behalf of Northgate Information Solutions Limited and its associated

[ansible-project] Re: Sentinel - Redis : fatal: [pyxrrsap02.pyx.erp]: FAILED! => {"failed": true, "msg": "ERROR! 'list object' has no attribute 'cmd'"}

2015-11-12 Thread Eric Franckx
SOLVED: Simple by using : [0][0] and [0][1] to get the correct value/parameters. On Wednesday, 11 November 2015 16:48:09 UTC+1, Eric Franckx wrote: > > Hi, > I try to connect to a list of Sentinel host to get the master redis host > and port. > >- name: "CONNECT SENTINEL" command:

Re: [ansible-project] template with groups as a variable

2015-11-12 Thread Edgardo Vega
Thanks Matt! is there way to do this in a playbook. The first one works the second one doesn't. - debug: msg="hey {{ item }}" with_items: groups['tag_env_prod'] - debug: msg="hey {{ item }}" with_items: groups['{{group_name}}'] On Thursday, November 12, 2015 at 7:59:20 AM UTC-5,

[ansible-project] Re: Problem with Conditional Imports

2015-11-12 Thread Thomas Willert
I havent managed to understand my problem but I have been able to use this workaround using the "include_vars" module instead: --- - hosts: server1:server2 tasks: - include_vars: "{{ item }}" with_first_found: - "vars/{{ ansible_os_family }}{{ ansible_distribution_version }}.yml"

[ansible-project] vmware vm migrate between datastores using ansible?

2015-11-12 Thread AnilD
Hi guys, Looks like state=reconfigured in vsphere_guest module cannot be used for datastore migration for a vm. Is there is away to migrate a virtual machine to a different datastore in the vcenter using ansible? -- You received this message because you are subscribed to the Google Groups

[ansible-project] "unsupported parameter for module: validate_cert",

2015-11-12 Thread Dee Young
I am trying to get around the "Unable to validate server's certificate against available CA certs" error. I've tried using uri: url=site url validate_cert=no and I'm still getting the same error. Then I tried using get_url: url=site url validate_cert=no, and now I'm getting "unsupported

[ansible-project] Recovering stdout and stderr from sudo commands in async mode

2015-11-12 Thread Jose Ángel De Bustos Pérez
Hi, I have to run sudo commands in async mode and recover the stdout/stderr. I have written a module to run sudo commands but I am not able to recover the stdout and stderr. All of this is done from a python script and in the json which is returned the file indicated in results_file is empty.

[ansible-project] Recovering sdout/stderr from sudo commands in async mode

2015-11-12 Thread Jose Ángel De Bustos Pérez
Hi, I have to execute sudo commands in async mode and I need to recover stdout and stderr. I have written a module to do that but I am not able to recover the stdout and stderr. All of this is done using a python script and the file indicate in results_file is empty. I am new with ansible

[ansible-project] Re: How to SUBSTRING a string from a variable like hostname_01.com:28569 ... get only the hostname part or the port ?

2015-11-12 Thread Eric Franckx
Super, you are the man Thank you very much On Thursday, 12 November 2015 14:13:16 UTC+1, Eric Franckx wrote: > > Hi, > > if I have a string/var with hostname_01.com:28569, how can I use the > hostname part (hostname_01 and don"t use the :28569) to be use in an > action ? > > Regards, >

[ansible-project] Re: How to SUBSTRING a string from a variable like hostname_01.com:28569 ... get only the hostname part or the port ?

2015-11-12 Thread Eric Franckx
OK ... found the issue: var=production.clients.default.hosts[0].split(':') Works. thanks again to Matt Martz for the tip some_var.split(':')[0] On Thursday, 12 November 2015 14:13:16 UTC+1, Eric Franckx wrote: > > Hi, > > if I have a string/var with hostname_01.com:28569, how can I use the >

Re: [ansible-project] How to SUBSTRING a string from a variable like hostname_01.com:28569 ... get only the hostname part or the port ?

2015-11-12 Thread Matt Martz
There a few ways. One way is to use .split() Such as: some_var.split(':')[0] On Thursday, November 12, 2015, Eric Franckx wrote: > Is there a advance substr( var, ':', 0) ---> to get from the begin of the > string the substring ? > > On Thursday, 12 November 2015

[ansible-project] Solaris and pfexec, not working?

2015-11-12 Thread Thomas Willert
Hi, I am not able to get the "ping" modules working when using privilege escalation on Solaris 11. I am using Ansible 1.9.4 from a CentOS 7.1 control machine: $ ansible --version ansible 1.9.4 configured module search path = None $ cat /etc/redhat-release CentOS Linux release 7.1.1503 (Core)

[ansible-project] Re: How to SUBSTRING a string from a variable like hostname_01.com:28569 ... get only the hostname part or the port ?

2015-11-12 Thread Eric Franckx
Still an issue .. sorry I start with Ansible: I have a config file with following entries: production: clients: default: database: db1 hosts: - host1.com:29017 and so if I try on it : debug: msg={{ production.clients.default.hosts.split(':')[0]}} I have the

Re: [ansible-project] Restart clustered service node by node?

2015-11-12 Thread Brian Coca
you can have more than 1 play in a playbook - name: play1 hosts: ... tasks: - do most of the work - na On Thu, Nov 12, 2015 at 2:38 AM, Rafał Radecki wrote: > Thanks for the tip. Overall serial looks good but it is usable only at the > 'play' level. In my case

[ansible-project] lining up users when bootstrapping a system

2015-11-12 Thread Greg Swift
I've been bashing at this since yesterday and have read around a lot and tried lots of things. I figured it was time to try the list. Basically I'm trying to create a playbook that will be used when bootstrapping a fresh host. The root user is needed for the initial bootstrap. After the on

[ansible-project] Re: Troubleshooting Windows Host UNREACHABLE!

2015-11-12 Thread J Hawkesworth
try hitting it again with ansible and check the event logs for any evidence of a login attempt. if its not getting that far... is there a proxy between controller and windows host (guessing a bit here, not much experience with proxies)? possibly firewall rules kicking in? bear in mind

Re: [ansible-project] template with groups as a variable

2015-11-12 Thread Brian Coca
- debug: msg="hey {{ item }}" with_items: "{{groups[group_name]}}" On Thu, Nov 12, 2015 at 5:44 AM, Edgardo Vega wrote: > Thanks Matt! is there way to do this in a playbook. The first one works the > second one doesn't. > > - debug: msg="hey {{ item }}" >

[ansible-project] Re: gce instance start and stop existing instances (not create and destroy)

2015-11-12 Thread Richard Corfield
I have been trying to determine this myself and I have not successfully started a terminated instance with the Ansible gce module. The titles of the Ansible module pages do seem to imply that the EC2 has a higher level of functionality than the GCE module: ec2 - create, terminate, start or

Re: [ansible-project] Re: Troubleshooting Windows Host UNREACHABLE!

2015-11-12 Thread Calhoun, Matt
I see a sucessful connection listed in the event logs, and in my original post demonstrated that I could telnet in on the WinRM port, so no firewall blocking. There is also no proxy or anything in between. I can connect to over 100 different servers, many on the same subnet as myhost, but this is