Re: [ansible-project] synchronize / delegate_to / transferring files between hosts

2015-06-18 Thread Dan Swartz
Sorry, I'm not really following you. The pseudocode you posted is somewhat similar to what I'm doing, but the problems are: 1. My current delegate host (your build_systems) cannot resolve an IP address from my target machine's FQDN (your publication_system) 2. I don't really have the

[ansible-project] Re: 'dict' object has no attribute

2015-06-18 Thread Brad V
Anyone else stumbling upon this. db_master_ip: {{ hostvars['hostname.localdomain'].ansible_eth0.ipv4.address }} was the change that was needed. Thanks to piffey on the IRC channel for the assist. On Tuesday, June 16, 2015 at 10:47:42 AM UTC-5, Brad V wrote: I'm a bit stumped here. I

[ansible-project] Loop on Route53 with items

2015-06-18 Thread Louis Borsu
Hi, I would like to loop on items in an inventory group with the module Route53 I tried to methods but both failed, if you have any idea, it would be really appreciated :D *Method 1:* - route53: command: create overwrite: True zone: {{ slaves_dns_zone }} record: {{ item

[ansible-project] setting linux user password error with user command

2015-06-18 Thread Jan Duprez
I have a strange issue when setting passwords for a user with the user module, it seems to be mangling the password somehow. When i use a plain shell command to set the password it does work ... Code causing the error: - name: Add user someuser usingAnsible user module user:

Re: [ansible-project] Re: Using with_sequence with register

2015-06-18 Thread Alex Elent
Better late than never but I ran into this same thing and this is how I solved it with example code: - name: Launch instances ec2: user_data: {{ lookup('file', 'user_data.yml') }} keypair: {{ keypair }} group_id: {{ security_group }} instance_type: {{

[ansible-project] Connecting to new EC2 instance using .pem file

2015-06-18 Thread Lokesh Vastrad
Hi, I am new to Ansible. I have setup Ansible using source from GIT. I am able to provision a new EC2 instance. I want to connect to this instance using a .pem file and not ssh. I am able to manually connect to the new instance using the .pem file with the command ssh -i abc.pem

[ansible-project] Complex iteration problems

2015-06-18 Thread Ashley Penney
Hi, We've run into an issue (and a pattern really) using ansible that we've been unable to solve and I'm hoping the list can teach us the ansible way. The background is that we want to create a number of monitors automatically, based on certain information. The solution we have today is a

Re: [ansible-project] Re: Having troubles accessing hostvars for new host

2015-06-18 Thread Barry Kaplan
The flow is: provision.yml: -- - name: Provision rabbitmq cluster hosts: localhost connection: local gather_facts: yes tags: [provision, rabbitmq_cluster] tasks: - name: Create rabbitmq-server instance ec2: ... - include:

Re: [ansible-project] Re: Having troubles accessing hostvars for new host

2015-06-18 Thread Brian Coca
So the new hosts don't get added to the rabbitmq_server group? I assume this will happen automatically next time the inventory script runs (if tagged), but that won't happen until you run ansible again, normally you use add_hosts to temporarily add them for the 'current run'. -- Brian Coca --

[ansible-project] Re: How to choose between ansible_eth0 and ansible_eth1 depending on a parameter?

2015-06-18 Thread Anand Buddhdev
Hi Yassen, You have to use the hostvars dictionary, like this: {{ hostvars[inventory_hostname]['ansible_'+ext_if].ipv4.address }} -- 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

Re: [ansible-project] Re: Using with_sequence with register

2015-06-18 Thread Alex Elent
Sorry my reply was slightly incorrect. You don't need item.item|int -1. 0 would suffice and provide all items values. On Thursday, June 18, 2015 at 7:04:51 AM UTC-7, Alex Elent wrote: Better late than never but I ran into this same thing and this is how I solved it with example code: -

[ansible-project] Re: Ansible and IBM SoftLayer

2015-06-18 Thread kesten broughton
Is there anything available for testing? On Sunday, January 18, 2015 at 12:09:05 PM UTC-6, Peter Mooshammer wrote: I would be interested as well. thanks Peter On Sunday, January 18, 2015 at 8:47:38 AM UTC-8, Nate Dobbs wrote: I see as of the latest release of ansbile there exists an

Re: [ansible-project] Bug in top-level playbook: tags broken

2015-06-18 Thread Brian Coca
known issue https://github.com/ansible/ansible/issues/9862 -- Brian Coca -- 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] Re: Complex iteration problems

2015-06-18 Thread Brian Coca
this won't work with_nested: - with_subelements: - monitor_exchanges - demand_partners - monitors but this will: with_nested: - {{lookup('subelements', [monitor_exchanges, demand_partners]} - monitors I'm not sure that will get you what you want, but it should correctly combine

[ansible-project] Re: Complex iteration problems

2015-06-18 Thread Christian Thiemann
The fundamental problem is that Ansible doesn't allow nested loops -- even though Ansible looks like a procedural language (it's executing commands/modules in order and it can loop over things), it really isn't. The only simulation of a for/while loop is the with_foobar stuff, which calls a

[ansible-project] How to authorise an EC2 instance for S3 access

2015-06-18 Thread Andrew Burrow
I am unable to make use of IAM roles in my Ansible playbooks. Specifically, I have authorised an EC2 instance to get from an S3 bucket, but I cannot work out how to make use of this authorisation from within Ansible. *The question* How do I write Ansible task(s) that satisfies all the

Re: [ansible-project] ansible on Solaris instance

2015-06-18 Thread Stephane Nsakala
Instalation on Solaris 11.2 without OpenCSW http://blog.maduma.com/post/119357733698/install-ansible-on-solaris-11 -Stéphane On Thursday, February 12, 2015 at 5:37:48 AM UTC+1, vishakha soni wrote: Thanks a lot Brian.. Got specific document too for installation :

[ansible-project] Re: Connecting to new EC2 instance using .pem file

2015-06-18 Thread Andrew Burrow
Possibly start by running the trivial ping module in verbose mode: ansible all -m ping - On Friday, 19 June 2015 00:04:51 UTC+10, Lokesh Vastrad wrote: Hi, I am new to Ansible. I have setup Ansible using source from GIT. I am able to provision a new EC2 instance. I want to connect to

Re: [ansible-project] How to authorise an EC2 instance for S3 access

2015-06-18 Thread benno joy
Hi Andrew, instance profiles do work without any issues, from the error msg: Failed to connect to S3: 'module' object has no attribute 'connect_to_region' seems like boto is not installed properly, how did you install boto ? can you please try reinstalling boto and check. - Benno On Fri, Jun

[ansible-project] Re: Ansible authentication failure, despite successfull keybased ssh-login, mac

2015-06-18 Thread n_olding
Many thanks to ansible.com support for the help, this problem was fixed by updating software: I was running ansible 1.7.2 that 'brew ansible update' claimed was the latest version. 1. brew update (updates a number of definitions, new and deleted formulae) 2. brew upgrade ansible (upgrades to

Re: [ansible-project] Re: Complex iteration problems

2015-06-18 Thread Johnny Everson
Hi Brian, I am trying to implement your suggestion, I am getting: ERROR! an unexpected type error occurred. Error was sequence item 0: expected string, tuple found (I fixed the obvious typo in your code) Does this ring a bell? On Thursday, June 18, 2015 at 2:04:39 PM UTC-3, Brian Coca wrote:

[ansible-project] Support to AWS scheduled autoscale policy?

2015-06-18 Thread Sisso
Hello guys. I am unable to find if ansible aws module have support to define a scheduled scaling policy for Amazon Web Services. (http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/schedule_time.html). The obivous module (http://docs.ansible.com/ec2_scaling_policy_module.html) don't

Re: [ansible-project] Re: Complex iteration problems

2015-06-18 Thread Brian Coca
are you using current devel? On Thu, Jun 18, 2015 at 2:33 PM, Johnny Everson khron...@gmail.com wrote: Hi Brian, I am trying to implement your suggestion, I am getting: ERROR! an unexpected type error occurred. Error was sequence item 0: expected string, tuple found (I fixed the obvious

[ansible-project] Re: Run powershell command as administrator

2015-06-18 Thread alexey
Hi @all, I have almost identical issue. I am running powershell script on srv01: get-childitem \\srv01\share01 get-childitem \\srv02\share02 The first one is executing without issues, but on second one i am receiving Access Denied. It doesn't look like double hop trouble, but anyway just in

Re: [ansible-project] Re: Complex iteration problems

2015-06-18 Thread Johnny Everson
yes, on devel, last synced on Jun 16. On Thursday, June 18, 2015 at 4:12:33 PM UTC-3, Brian Coca wrote: are you using current devel? On Thu, Jun 18, 2015 at 2:33 PM, Johnny Everson khro...@gmail.com javascript: wrote: Hi Brian, I am trying to implement your suggestion, I am

[ansible-project] Re: Run powershell command as administrator

2015-06-18 Thread alexey
Event log is empty, and there is no difference between those 2 servers, firewall is disabled either. And anyway, the script is executed with domain admin rights. The weird thing is that i can execute the get-childitem \\srv02\share02 from any machine (including srv01), but not ansible.

[ansible-project] Re: How to choose between ansible_eth0 and ansible_eth1 depending on a parameter?

2015-06-18 Thread Yassen Damyanov
On Thursday, June 18, 2015 at 8:02:20 PM UTC+3, Anand Buddhdev wrote: Hi Yassen, You have to use the hostvars dictionary, like this: {{ hostvars[inventory_hostname]['ansible_'+ext_if].ipv4.address }} *Anand*: you nailed it, works great! Thank you! -Y. -- You received this message

Re: [ansible-project] Re: Complex iteration problems

2015-06-18 Thread Brian Coca
some of the lookups are not working correctly with devel, that woudl be the error messasge you get On Thu, Jun 18, 2015 at 3:14 PM, Johnny Everson khron...@gmail.com wrote: yes, on devel, last synced on Jun 16. On Thursday, June 18, 2015 at 4:12:33 PM UTC-3, Brian Coca wrote: are you using

[ansible-project] Re: Run powershell command as administrator

2015-06-18 Thread J Hawkesworth
If it is working on \\srv01\ but not on \\srv02 then there is a difference between the two machines. I suggest you check the event log on \\srv02, the configuration of the share02 sharing and the firewall on \\srv02 If you are not using Active Directory domain user, also check the same

Re: [ansible-project] Centos 7, Ansible 1.9.1 : module win_copy not found in configured module paths

2015-06-18 Thread rcncrrr
That worked for me, thank you! I like how straight forward it is to get automated tasks running. Looking forward to the release. On Thursday, June 18, 2015 at 2:19:30 AM UTC-6, Trond Hindenes wrote: Since you're stating that you're evaluating and quite new to Ansible: This should give you

[ansible-project] Error handling in do..until loops

2015-06-18 Thread Trond Hindenes
Hi all, I'm trying to write a play I'm going to use as part of a windows system reboot role. I plan to ping the Windows node's WinRM port using curl until it's responding. If the system is down, the curl command will result in an error (exit code 7). Here's my play: --- - name: Wait for

[ansible-project] Re: Run powershell command as administrator

2015-06-18 Thread Trond Hindenes
So just to sum up: Ansible--srv01: You can list stuff in \\srv01\ but not \\srv02 Are you connecting to srv01 from ansible using a domain account or a local account? If local it's pretty logical that you have this issue: The user doesn't have any permissions outside srv01, so that's the only

[ansible-project] Re: rollback of applications

2015-06-18 Thread Yassen Damyanov
On Monday, June 15, 2015 at 3:38:49 PM UTC+3, skg wrote: How would you get ansible to deal with the following use case: An application, X version 1, is installed with it's configuration variables for version 1. Subsequently X version 2 is released with a differnt config variable set. I

[ansible-project] Bug in top-level playbook: tags broken

2015-06-18 Thread jang
See the attachment. With ansible 1.7.2 this works as expected: % ansible-playbook --version ansible-playbook 1.7.2 % ansible-playbook -i hosts/localhost a.yml --tags b PLAY [localhost] ** GATHERING FACTS

Re: [ansible-project] Centos 7, Ansible 1.9.1 : module win_copy not found in configured module paths

2015-06-18 Thread Trond Hindenes
Since you're stating that you're evaluating and quite new to Ansible: This should give you win_copy: cd ~ mkdir repos cd repos git clone https://github.com/ansible/ansible-modules-core.git cd ansible-modules-core git checkout devel cd ~ export ANSIBLE_LIBRARY=~/repos/ansible-modules-core On

Re: [ansible-project] Centos 7, Ansible 1.9.1 : module win_copy not found in configured module paths

2015-06-18 Thread Trond Hindenes
Slam, win_copy is available in the devel branch of ansible-modules-core, so if you want to test it you can pull down that repo and point to it using the ANSIBLE_LIBRARY env variable. I guess tha'ts not an option for production usage tho. On Thursday, June 18, 2015 at 2:22:53 AM UTC+2, Slim

Re: [ansible-project] synchronize / delegate_to / transferring files between hosts

2015-06-18 Thread Philippe Eveque
Hi Dan I think you are on the right track with synchronize and delegate_to In my case I do this the following way (pseudo code) PLAY1: - hosts: build_systems # build_systems is a group in the inventory. Can have 1 or more systems remote_user: tester gather_facts: True - tasks:

[ansible-project] How to choose between ansible_eth0 and ansible_eth1 depending on a parameter?

2015-06-18 Thread Yassen Damyanov
My firewall-oriented roles need to use different network info when executed on different machines, depending on which interface is the external one and which is the internal one. Thus I need to be able to set e.g.: ext_if: eth0 int_if: eth1 and from here, ip network information to be taken

Re: [ansible-project] playbook to install software on windows clients from linux control machine

2015-06-18 Thread Trond Hindenes
win_copy is a bad idea. WinRM is simply not built for transferring binary files. The recommendation is to have the file accessible on a UNC path/url and then use win_package to get it onto the windows machine. On Thursday, June 18, 2015 at 4:55:52 AM UTC+2, benno joy wrote: Hi, Did yo try