Re: [ansible-project] possible to use boto and ec2.py to return instance IDs instead of IP addresses?

2014-11-05 Thread Wawrzek Niewodniczanski
On 3 November 2014 23:59, Paul Stivers wrote: [...] > Right now I'm using "-i inventories/ec2.py -l > 'tag_Environment_" to apply playbooks to servers in an > environment, by IP address. > > Now I have playbooks to stop and start all instances in an environment, but > haven't found a way to use ec

Re: [ansible-project] Roles, tasks and composability

2014-11-05 Thread Juho Viitasalo
I think Dennis's reasoning is good. I would also find this feature practical. Would it be possible to do a core module called 'role'? On Friday, October 4, 2013 5:13:25 PM UTC+3, Michael DeHaan wrote: > > "This does kinda solve the issue, however we want to treat the role as > readonly because c

[ansible-project] How does Ansible copy a module to a remote host?

2014-11-05 Thread Craig Wickesser
I know Ansible copies modules from the ansible host to remote hosts when running a play/playbook since Ansible isn't installed everywhere, where does Ansible get the module from to send to the remote host? For example, I'd like to test some changes to the docker module. On the ansible host I mo

Re: [ansible-project] Using sudosh instead of just sudo

2014-11-05 Thread Craig Wickesser
I have a similar requirement. Most operations are locked down to root, so I can SSH to a host as myself and then "sudo sudosh" to become root and do what I need. Is it possible to do this with Ansible? For example, as myself I can't check the status of docker (running "service docker status" re

Re: [ansible-project] copy fails for group ownership

2014-11-05 Thread Stein Inge Morisbak
Hi! It took some time before i could look into this. Anyway, I think it has to do with this issue: https://github.com/ansible/ansible/issues/7372 The template-module always does `chown`, and that will not work when running as a non-root user when the files are owned by root even if the group h

Re: [ansible-project] How does Ansible copy a module to a remote host?

2014-11-05 Thread James Cammarata
Hi Craig, If you're running the devel branch (which you should be if you're wanting to edit module code), the modules are stored in the modules/{core,extras} directories in the main source tree. The path to the docker module specifically is lib/ansible/modules/core/cloud/docker/docker.py. If you

Re: [ansible-project] Problem setting variable with bond0.11 IPv4 address from the gathered facts.

2014-11-05 Thread Michael DeHaan
>> "{{ hostvars[{{ ansible_host }}]['ansible_bond0.11']['ipv4']['address'] }}" You'll want to remove the template stuff inside the template stuff: "{{ hostvars[ansible_host]['ansible_bond0.11']['ipv4']['address'] }}" On Tue, Nov 4, 2014 at 5:25 PM, Joel Sdc wrote: > Hi Matt, > > Would this be

Re: [ansible-project] playbook conditional include another playbook not wokring

2014-11-05 Thread Michael DeHaan
Please upgrade to the recent 1.7.2 and see if you have any problems. We cannot support older versions on this list. On Tue, Nov 4, 2014 at 5:37 PM, jack wrote: > ansible 1.5.5 on Mac. > > > -- > You received this message because you are subscribed to the Google Groups > "Ansible Project" gro

Re: [ansible-project] copy module with hard link destination

2014-11-05 Thread Michael DeHaan
Can you please check and see if you have a problem on Ansible 1.7.2? We can't support older versions on this list. On Tue, Nov 4, 2014 at 5:04 PM, Sean McGowan wrote: > Background: I am using Ansible 1.5 on RedHat. Apparently > system-config-network creates a hard link to /etc/hosts and > /

Re: [ansible-project] Is there a reason for forcing verbose directory structure inside roles?

2014-11-05 Thread Michael DeHaan
Yes... This has been brought up 1-2 times before. At some point, roles will expand and need to include other files, things like include_vars, multiple templates, etc. This enforces a standard where everybody's roles follow a common convention. --Michael On Mon, Nov 3, 2014 at 4:37 PM, Teemu

Re: [ansible-project] EC2 provisionning and configuring with variables from inventory/ec2.py

2014-11-05 Thread Michael DeHaan
Typically the create playbook would include the configure playbook, using the "add_host" trick. This is covered a bit in EC2 examples, others here can also offer some good pointers to EC2 workflow. We're going to working on making the EC2 "best practices" type doc stuff a lot better in the coming

Re: [ansible-project] Roles, tasks and composability

2014-11-05 Thread Michael DeHaan
Not seeing post from Denis on this thread - can you provide a link? Roles to download roles are possible, via something that uses ansible-galaxy's CLI, though we need to refactor that a bit first (the ongoing v2/ tree code) to make that more easy to access. On Wed, Nov 5, 2014 at 1:00 AM, Juho Vi

Re: [ansible-project] copy fails for group ownership

2014-11-05 Thread Michael DeHaan
Can you please share what version of Ansible you are using? (ansible --version) Thanks! On Wed, Nov 5, 2014 at 7:32 AM, Stein Inge Morisbak wrote: > Hi! > > It took some time before i could look into this. Anyway, I think it has to > do with this issue: https://github.com/ansible/ansible/iss

Re: [ansible-project] deploy artifacts - but download them only once, not for each host ?

2014-11-05 Thread Torsten Reinhard
Thanx, Brian, sounds like an easy solution - but what about encapsulation? I need to break down things than into - preparation steps (artifact to be downloaded) - roles that are executed - and depend on those artifacts Can I keep all "encapsulated" in one role ? Thx, Torsten Am Dienstag, 4. N

Re: [ansible-project] deploy artifacts - but download them only once, not for each host ?

2014-11-05 Thread Brian Coca
not sure why you need to encapsulate at role level, just put both plays in same file. you cannot do host selection at roles anyway, that is a play property On Wed, Nov 5, 2014 at 10:00 AM, Torsten Reinhard wrote: > Thanx, Brian, > > sounds like an easy solution - but what about encapsulation? I

Re: [ansible-project] ansible -m setup takes extra 2 min on Fedora 20

2014-11-05 Thread Toshio Kuratomi
I've been able to reproduce but not entirely consistently. If I have only one line in my /etc/hosts file: 127.0.0.1 localhost Running: time ansible all -i "localhost," -m setup -c local takes anywhere from 0.9 seconds to 15 seconds. Adding a second line to /etc/hosts: 127.0.0.1 roan.lan bri

[ansible-project] Interpolating concatenated variables

2014-11-05 Thread James Morgan
Hi, I'd like to be able to build a variable name programatically in a similar fashion to http://docs.ansible.com/faq.html#how-do-i-access-a-variable-name-programmatically Instead of accessing a dict I would like to build up the variable name. For example - hosts: localhost connection: local

[ansible-project] Re: Weird /tmp file issue

2014-11-05 Thread Paul Becker
Any thoughts at all why the /tmp folder on the PUT action is not always being defined? Thank you, Paul -- 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 ansib

Re: [ansible-project] copy fails for group ownership

2014-11-05 Thread Stein Inge Morisbak
2014-11-05 15:31 GMT+01:00 Michael DeHaan : > ansible --version ansible 1.7.2 -- - Stein Inge -- 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 ansible-pr

Re: [ansible-project] Interpolating concatenated variables

2014-11-05 Thread rektide
On Wed, Nov 05, 2014 at 08:06:41AM -0800, James Morgan wrote: > Hi, > > I'd like to be able to build a variable name programatically in a similar > fashion to > > http://docs.ansible.com/faq.html#how-do-i-access-a-variable-name-programmatically > > Instead of accessing a dict I would like to bu

Re: [ansible-project] copy fails for group ownership

2014-11-05 Thread Toshio Kuratomi
>From earlier on the thread 1.7.1 And yes, there have been some fixes to the devel branch related to owner and group since 1.7.1 that might be the cause of this. In addition to the two you've linked to, Stein, I believe there's a third where specifying the file name rather than the directory as t

[ansible-project] Hi - Installed ansible (not the first time) but on a new box - and although pip install worked fine if I use ping command I get 'FAILED => paramiko is not installed'

2014-11-05 Thread Shaun Barker
pip install paramiko PyYAML Jinja2 httplib2 --upgrade Requirement already up-to-date: paramiko in /usr/lib/python2.6/site-packages Requirement already up-to-date: PyYAML in /usr/lib64/python2.6/site-packages Requirement already up-to-date: Jinja2 in /usr/lib/python2.6/site-packages Requirement alre

Re: [ansible-project] Interpolating concatenated variables

2014-11-05 Thread James Morgan
Ok that doesn't work in my example as the variables aren't in the inventory TASK: [debug ] fatal: [localhost] => One or more undefined variables: 'dict' object has no attribute 'admin_port' Though If use include_vars which I woul

Re: [ansible-project] Hi - Installed ansible (not the first time) but on a new box - and although pip install worked fine if I use ping command I get 'FAILED => paramiko is not installed'

2014-11-05 Thread Brian Coca
check ansible shebang and make sure it is executing the same python On Wed, Nov 5, 2014 at 11:36 AM, Shaun Barker wrote: > pip install paramiko PyYAML Jinja2 httplib2 --upgrade > Requirement already up-to-date: paramiko in > /usr/lib/python2.6/site-packages > Requirement already up-to-date: PyYA

Re: [ansible-project] Re: ansible >=1.7 fails unnecessarily by trying to open irrelevant vaults?

2014-11-05 Thread Colin Nichols
> > Is this being done because some team members might leave the team later > and no longer need access to something? We have 3 vaults -- one each for dev, staging, and production. They contain all the same variables, just with different values. We gave them all different passwords so that

Re: [ansible-project] Re: Weird /tmp file issue

2014-11-05 Thread Toshio Kuratomi
Shot in the dark: How are you setting remote_tmp? the default is $HOME/.ansible/tmp but your output is showing /tmp/ (in the places where it's being properly inserted). -Toshio On Wed, Nov 5, 2014 at 7:58 AM, Paul Becker wrote: > Any thoughts at all why the /tmp folder on the PUT action is not

Re: [ansible-project] Re: ansible >=1.7 fails unnecessarily by trying to open irrelevant vaults?

2014-11-05 Thread Michael Peters
Do you use the same inventory for all of your playbooks? I'm not familiar with the change that made this pattern not work, but does it only pull in group_vars for groups in your inventory? If you used separate inventories for each environment would this problem go away? On Wed, Nov 5, 2014 at 12:3

Re: [ansible-project] Re: Weird /tmp file issue

2014-11-05 Thread Paul Becker
remote_tmp = /tmp On Wednesday, November 5, 2014 12:32:53 PM UTC-6, tkuratomi wrote: > > Shot in the dark: How are you setting remote_tmp? the default is > $HOME/.ansible/tmp but your output is showing /tmp/ (in the places > where it's being properly inserted). > > -Toshio > > On Wed,

Re: [ansible-project] Re: Weird /tmp file issue

2014-11-05 Thread Toshio Kuratomi
And you're setting that by modifying /etc/ansible/ansible.cfg? On Wed, Nov 5, 2014 at 11:12 AM, Paul Becker wrote: > remote_tmp = /tmp > > > On Wednesday, November 5, 2014 12:32:53 PM UTC-6, tkuratomi wrote: >> >> Shot in the dark: How are you setting remote_tmp? the default is >> $HOME/.ans

Re: [ansible-project] Re: Weird /tmp file issue

2014-11-05 Thread Paul Becker
Yes, set by /etc/ansible/ansible.cfg -- 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 ansible-project+unsubscr...@googlegroups.com. To post to this group, send

Re: [ansible-project] Re: Weird /tmp file issue

2014-11-05 Thread Toshio Kuratomi
Looking through the code nothing's jumping out at me. The symptom you describe where this sometimes works and sometimes doesn't screams race condition but I'm not seeing where that's happening. I think we'll need a reproducer in order to diagnose from our side. Failing that, if you're comfortabl

Re: [ansible-project] Roles, tasks and composability

2014-11-05 Thread Juho Viitasalo
It is the current thread: Roles, tasks and composability https://groups.google.com/forum/#!topic/ansible-project/9bghHncUQCM 2014-11-05 16:30 GMT+02:00 Michael DeHaan : > Not seeing post from Denis on this thread - can you provide a link? > > Roles to download roles are possible, via something th

Re: [ansible-project] Re: Weird /tmp file issue

2014-11-05 Thread Paul Becker
Thank you, we'll look at it over here. Paul On Wednesday, November 5, 2014 1:49:21 PM UTC-6, tkuratomi wrote: > > Looking through the code nothing's jumping out at me. The symptom you > describe where this sometimes works and sometimes doesn't screams race > condition but I'm not seeing where t

[ansible-project] SSH uknown error issue

2014-11-05 Thread David Reagan
When I'm first setting up a vm, I need to set which user to use and the ssh and sudo passwords. So, my host file looks something like: [apache] > 192.168.77.2 ansible_ssh_user=vagrant ansible_ssh_pass=vagrant > ansible_sudo_pass=vagrant > [mysql] > 192.168.77.3 ansible_ssh_user=vagrant ansible

Re: [ansible-project] Interpolating concatenated variables

2014-11-05 Thread rektide
On Wed, Nov 05, 2014 at 08:56:59AM -0800, James Morgan wrote: > Ok that doesn't work in my example as the variables aren't in the inventory The other cache for facts: vars[test_app + '_port'] (PITA, this) -- You received this message because you are subscribed to the Google Groups "Ansible Pro

[ansible-project] Error while using variables

2014-11-05 Thread Erick Vitor de Barros
Hi ! Sorry for this newbie question...but...what is wrong with this? --- - name: Example of provisioning servers hosts: 127.0.0.1 connection: local tasks: - name: "Deploying new instances" local_action: module: ec2 aws_access_key: THIS IS A SECRET aws_secre

Re: [ansible-project] SSH uknown error issue

2014-11-05 Thread Matt Martz
If you have ansible_ssh_pass set, ansible explicitly sets "-o PubkeyAuthentication=no" which disables the use of SSH public key auth. On Wed, Nov 5, 2014 at 2:35 PM, David Reagan wrote: > When I'm first setting up a vm, I need to set which user to use and the > ssh and sudo passwords. > > So, my

Re: [ansible-project] Error while using variables

2014-11-05 Thread Matt Martz
You didn't actually tell us what error you are getting, however I will assume it is that you need to wrap your {{ }} tempting code in quotes. So instead of: exact_count: {{ item.count }} You need: exact_count: "{{ item.count }}" On Wed, Nov 5, 2014 at 3:06 PM, Erick Vitor de Barros wrote: >

Re: [ansible-project] SSH uknown error issue

2014-11-05 Thread David Reagan
Is that documented? I don't see it here: http://docs.ansible.com/intro_inventory.html#list-of-behavioral-inventory-parameters Any explanations on why? It seems counter intuitive to me. I would think we'd always want to use pubkey auth, and only use password auth if pubkey isn't available. --David

Re: [ansible-project] SSH uknown error issue

2014-11-05 Thread Matt Martz
It is not specifically documented other than the code itself: https://github.com/ansible/ansible/blob/d3c28fee8739c93821d4f639b2931f5a3592eb8e/lib/ansible/runner/connection_plugins/ssh.py#L90-L92 It was added in: https://github.com/ansible/ansible/commit/d703f920775e8877b1fb9e2ae750a23bcc7e9534

Re: [ansible-project] copy module with hard link destination

2014-11-05 Thread Sean McGowan
yes.. 1.7.2 is installed now and the result is the same. also, as an interesting aside, I apparently can no longer use bash FIFOs as an inventory file like i did in the previous example. On Wednesday, November 5, 2014 9:20:03 AM UTC-5, Michael DeHaan wrote: > > Can you please check and see if

Re: [ansible-project] Interpolating concatenated variables

2014-11-05 Thread James Morgan
Ah thanks for the info. On 5 November 2014 21:04, wrote: > On Wed, Nov 05, 2014 at 08:56:59AM -0800, James Morgan wrote: > > Ok that doesn't work in my example as the variables aren't in the > inventory > > The other cache for facts: vars[test_app + '_port'] > > (PITA, this) > > -- > You receive

Re: [ansible-project] Problem setting variable with bond0.11 IPv4 address from the gathered facts.

2014-11-05 Thread Joel Sdc
Hi Michael, Just tried, same problem... "{{ hostvars[ansible_host]['ansible_bond0.11']['ipv4']['address'] }}": fatal: [testserver1] => {'msg': "AnsibleUndefinedVariable: One or more undefined variables: 'ansible_host' is undefined", 'failed': True} fatal: [testserver1] => {'msg': "AnsibleUndef

Re: [ansible-project] Problem setting variable with bond0.11 IPv4 address from the gathered facts.

2014-11-05 Thread Matt Martz
According to that error, you have not defined a variable called 'ansible_host'. Where is that variable supposed to be coming from? The variable that ansible creates that references the current host is called inventory_hostname. Perhaps you were meaning ansible_hostname? In either case inventor

Re: [ansible-project] deploy artifacts - but download them only once, not for each host ?

2014-11-05 Thread Michael DeHaan
The get_url module can take a md5sum that can be used to avoid repeated downloads. There is also a "force" parameter which can avoid downloads if the file is already there. If using sudo, however, sometimes this force detection, due to permissions, can not engage. On Wed, Nov 5, 2014 at 10:32

Re: [ansible-project] ansible -m setup takes extra 2 min on Fedora 20

2014-11-05 Thread Michael DeHaan
If it's not something Fedora can resolve, we *MAY* have to remove this check on Fedora 20+ until they can, as we tend to get hammered for some issues in other things repeatedly at times. OTOH, 20 seconds is slow, but not insurmountable terrible. If we can pin it down to a python function (or bett

Re: [ansible-project] Re: ansible >=1.7 fails unnecessarily by trying to open irrelevant vaults?

2014-11-05 Thread Michael DeHaan
Keeping your inventory in different directories solves this for you. -i inventory/production/inventory.ini, group_vars, host_vars -i inventory/stage/inventory.ini, group_vars, host_vars Basically it would only see the group_vars, host_vars in that particular directory. Host_vars could even be sh

Re: [ansible-project] Roles, tasks and composability

2014-11-05 Thread Michael DeHaan
Ok yeah for now I'd just do a playbook that calls the ansible-galaxy install command using a requirements file. In 1.8 and later this can also suck down Ansible roles. Once the v2/ refactor is further along I can see a module doing this and roles being a bit more lazy loaded to allow runtime in t

[ansible-project] Ansible copy module takes lot of time on same machine

2014-11-05 Thread Ethan Collins
I am using Ansible to copy a file from Debian to XP running on the same machine on Virtualbox. Copying the file (437KB) using ssh as transport is taking 5 secs. I profiled the same copy operation using scp and that takes ~820ms. I am using ssh 5.5 on Debian squeeze and hence don't have ControlP

Re: [ansible-project] ansible -m setup takes extra 2 min on Fedora 20

2014-11-05 Thread Greg Andrews
Toshio Kuratomi wrote: > If I have > only one line in my /etc/hosts file: > > 127.0.0.1 localhost > > Running: time ansible all -i "localhost," -m setup -c local > > takes anywhere from 0.9 seconds to 15 seconds. > > Adding a second line to /etc/hosts: > 127.0.0.1 roan.lan > > brings runtime in

[ansible-project] Re: RHEL6.6 and ControlPersist

2014-11-05 Thread Pythagoras Watson
I ran into similar issues using the new ControlPersist option as well as the ProxyCommand option. A Red Hat bugzilla was created that has the details. I think the part in comment 1 s

[ansible-project] Re: EC2 - Delete on termination

2014-11-05 Thread Carlos V
I actually found that by specifying the volume as /dev/sda instead of /dev/sda1, it enables the "delete_on_termination" flag for the primary volume. On Monday, November 3, 2014 1:55:11 AM UTC-8, Carlos V wrote: > > Hello all, > I've been experimenting with the Ansible ec2 modules and I'm lookin

[ansible-project] Re: Nested loops with subelements

2014-11-05 Thread Ananda Debnath
Any recommendations? -- 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 ansible-project+unsubscr...@googlegroups.com. To post to this group, send email to ansibl

Re: [ansible-project] Re: setting up new control from source - getting 'FAILED => winrm is not installed' targeting existing Win clients

2014-11-05 Thread John Jelinek
I am still unable to execute the win_ping module: ``` $ ansible windows -i ansible_hosts -m win_ping - windows.example.com | FAILED => winrm is not installed ``` My group_vars is set to connect using a local Admin on the box. I ran the powershell scripts to make sure WinRM is all set up. Thi

Re: [ansible-project] Re: setting up new control from source - getting 'FAILED => winrm is not installed' targeting existing Win clients

2014-11-05 Thread John Jelinek
I upgraded to the dev branch of ansible and it works now. On Thursday, August 28, 2014 4:26:02 PM UTC-5, Damon Overboe wrote: > > Right in front of my face. I saw that line and assumed that was the full > installation for the Control machine, I just hurried through it this time. > > Thanks! > > O

Re: [ansible-project] Error while using variables

2014-11-05 Thread Erick Vitor de Barros
Hey Matt, you're perfectly right on both affirmations: 1) I've not informed the error 2) The proposed solution worked fine Thanks so much On Wed, Nov 5, 2014 at 7:11 PM, Matt Martz wrote: > You didn't actually tell us what error you are getting, however I will > assume it is that you need to

[ansible-project] Templates - Create, but do NOT update

2014-11-05 Thread Akos Vandra
Hello, This might be a wierd feature request at first, but would you accept a PR to add an option to the template module to create but do NOT update the generated file? I find myself needing this when generating secrets. I do want to generate my secret file if it does not exists (and it needs to

[ansible-project] Re: Templates - Create, but do NOT update

2014-11-05 Thread James Martin
You could stat the file using the stat module to see if it exists and register it's result, then run your template task conditionally, only if the file does not exist. On Wednesday, November 5, 2014 11:44:07 PM UTC-5, Akos Vandra wrote: > > Hello, > > This might be a wierd feature request at fir

Re: [ansible-project] Roles, tasks and composability

2014-11-05 Thread Juho Viitasalo
I'm not sure if we are talking about the same thing. Dennis didn't speak about lazy loading roles on demand, but running role as a task so you could do custom stuff between role execution. With core module called 'role' I meant (as Dennis suggested) this: - name: configure repo for patched mysql s