Re: [ansible-project] Unable to fetch value from ansible_devices variable if special charcter in key

2014-06-24 Thread Roopendra Vishwakarma
Thanks for your help. Nice Trick. Its working for me. On Monday, 23 June 2014 17:41:21 UTC+5:30, Michael DeHaan wrote: > > That's not a valid variable name, so you'll have to attack it edgewise: > > {{ hostvars[inventory_hostname]["*ansible_devices"]["**cciss!c0d0"]["size"] > }}* > > *Usage of s

Re: [ansible-project] Ansible OS Abstraction

2014-06-24 Thread Nico K.
To see how far I could come I went with the second approach that I mentioned in my original post. With some tinkering I managed to abstract away most of the differences, it's way too chatty though but it works. However, I am stuck with the Handlers. As 'service' isn't supported on OSX I had the

Re: [ansible-project] Multi-cloud deployment, use site.yml or --extra-vars

2014-06-24 Thread Roman Valls
Thanks Michael for the ansible-vault insight, I knew of its existence but never used it ... yet. Anyhow, Paolo has a point there, we already use add_host handoff in our playbook, what I guess you meant is that we should call the actual "application payload" (in our case, docker containers): ht

Re: [ansible-project] multiple async actions (background tasks) question

2014-06-24 Thread Michael DeHaan
If you are polling on an async job, they will still be executed sequentially. I do not see where you are calling a shell script in your example, so I can't tell what you mean by the last part of your question. Can you elaborate or show that part? On Mon, Jun 23, 2014 at 3:39 PM, Dmitry Makovey

Re: [ansible-project] Moving a docker instance between 2 hosts

2014-06-24 Thread Michael DeHaan
"But there are so many shops that will never run in to this kind of scaling problem, and I think it is unproductive for them to swallow PaaS-scale solutions" And most of these shops don't need Docker. "But it would be nice if the current `docker` module received some priority with respect to bug

Re: [ansible-project] template requires write permission on parent directory?

2014-06-24 Thread Michael DeHaan
I find the concept of having to specify a parameter like nonatomic or overwrite a bit arcane for this, as it doesn't really describe what is being done. My gut feeling is the present behavior is acceptable, if the files were not there, ansible would need to create the file anyway, as is it's natur

Re: [ansible-project] Ansible OS Abstraction

2014-06-24 Thread Michael DeHaan
On Mon, Jun 23, 2014 at 3:25 PM, Nico K. wrote: > Sure, but that's exactly the thing I would like to deal with within a > role, within a role however you can't perform the 'include' you stated in > your post as "ansible_os_family" doesn't seem to evaluate. > This is not true. Task files in role

Re: [ansible-project] Ansible OS Abstraction

2014-06-24 Thread Michael DeHaan
It would be better to enhance the service module to understand launchd, but that's a different topic. On Tue, Jun 24, 2014 at 6:18 AM, Nico K. wrote: > To see how far I could come I went with the second approach that I > mentioned in my original post. > With some tinkering I managed to abstra

Re: [ansible-project] template requires write permission on parent directory?

2014-06-24 Thread Ben Hoyt
> if the files were not there, ansible would need to create the file anyway, > as is it's nature > That's a fair point. If ansible is being used for end-to-end server configuration (as is often the case) it will have to create the file anyway. However, one thing that could be improved here is the

Re: [ansible-project] Re: msg = unicode(msg).encode('utf8') LookupError

2014-06-24 Thread James Cammarata
The exception you're seeing is coming from inside a python-distributed package, so this would seem to be a python pathing problem. Do you have multiple versions of python installed, and/or did you install python from source? On Mon, Jun 23, 2014 at 3:52 PM, Nic Flores wrote: > I just did a git

Re: [ansible-project] template requires write permission on parent directory?

2014-06-24 Thread Michael DeHaan
Or perhaps improve the error message when it fails, yes. Agreed. On Tue, Jun 24, 2014 at 9:29 AM, Ben Hoyt wrote: > > >> if the files were not there, ansible would need to create the file >> anyway, as is it's nature >> > > That's a fair point. If ansible is being used for end-to-end server >

Re: [ansible-project] Ansible OS Abstraction

2014-06-24 Thread Christian Thiemann
It doesn't work for me (unless I create a file called roles/foobar/tasks/{{ansible_os_family}}.yml... ;-) ). I abstracted away package manager things using the ansible_pkg_mgr fact: - module: "{{ ansible_pkg_mgr }} name=foobar,baz,foo" To account for OS-specific package names, you can do someth

Re: [ansible-project] template requires write permission on parent directory?

2014-06-24 Thread Ben Hoyt
Ah yes -- good point. For me the error message was the first point of contact, and I was confused by it. It said: Destination /etc/nginx/conf.d not writable And my thought (till I looked at the Ansible source) was "why does the directory need to be writable when I'm just copying the existing file

Re: [ansible-project] template requires write permission on parent directory?

2014-06-24 Thread Jacob Weber
I'd actually like to see some general information in the documentation about this topic of user permissions. I would think that a lot of people get the idea to create users with limited sudo rights, and use them with Ansible. But there are cases like this where Ansible doesn't allow that. It wou

Re: [ansible-project] template requires write permission on parent directory?

2014-06-24 Thread Ben Hoyt
Good point. We are in fact running our scripts as a user with limited sudo rights, so it's good to know that's not recommended practice. On Tue, Jun 24, 2014 at 10:42 AM, Jacob Weber wrote: > I'd actually like to see some general information in the documentation > about this topic of user permi

[ansible-project] Using a variable inside a jinja loop

2014-06-24 Thread Claus Strommer
Hi there, I have a play with a role that creates a load balancer template. I've successfully tested it in my dev environment, using {% for host in groups['dev-web'] %} server {{ host }} {{ host }}:80 {% endfor %} the 'dev-web' group is defined in my inventory, as well as 'stage-web', 'pro

Re: [ansible-project] Using a variable inside a jinja loop

2014-06-24 Thread Michael Peters
When inside the {% %} part you are inside of jinja and don't need special syntax to tell it that your using jinja variables. Something like this should work: {% for host in groups[deploy_env + '-web'] %} server {{ host }} {{ host }}:80 {% endfor %} On Tue, Jun 24, 2014 at 10:48 AM, Claus Stro

Re: [ansible-project] Moving a docker instance between 2 hosts

2014-06-24 Thread Drew Northup
On Tue, Jun 24, 2014 at 9:22 AM, Michael DeHaan wrote: > "But it would be nice if the current `docker` module received some priority > with respect to bug fixes and tracked Docker releases closely" > > We do apply fixes on the docker modules pretty quickly, but they are also > not so good about m

Re: [ansible-project] Using a variable inside a jinja loop

2014-06-24 Thread 'Petros Moisiadis' via Ansible Project
On 06/24/14 17:48, Claus Strommer wrote: > Hi there, > > I have a play with a role that creates a load balancer template. I've > successfully tested it in my dev environment, using > > > {% for host in groups['dev-web'] %} > server {{ host }} {{ host }}:80 > {% endfor %} > > > the 'dev-web' gr

Re: [ansible-project] Using a variable inside a jinja loop

2014-06-24 Thread Claus Strommer
d'oh! I should have known that. Thanks a bunch! On Tue, Jun 24, 2014 at 11:05 AM, Michael Peters wrote: > When inside the {% %} part you are inside of jinja and don't need > special syntax to tell it that your using jinja variables. Something > like this should work: > > {% for host in groups

[ansible-project] Re: Having problems with --exclude, --include with synchronize module using rsync_opts

2014-06-24 Thread Heath Henjum
I read the description from pull 7820, and it makes sense. For my situation, I'm pretty sure with_fileglob would work, but I haven't tested it. Thanks Tim for finding the issue. On Tuesday, June 17, 2014 10:53:29 AM UTC-5, Heath Henjum wrote: > > Hi, > > I was trying to do something using

Re: [ansible-project] Ansible OS Abstraction

2014-06-24 Thread Michael DeHaan
"It doesn't work for me (unless I create a file called roles/foobar/tasks/{{ansible_os_family}}.yml... ;-) )." So in other words, it works :) Also, public service announcement - Don't use ansible_pkg_mgr like that - it won't join mulitple package installs using with_items into single transactions

Re: [ansible-project] template requires write permission on parent directory?

2014-06-24 Thread Michael DeHaan
That's actually in the docs in the "note" section under http://docs.ansible.com/intro_adhoc.html#id8 where sudo is first introduced. On Tue, Jun 24, 2014 at 10:42 AM, Jacob Weber wrote: > I'd actually like to see some general information in the documentation > about this topic of user permissio

Re: [ansible-project] template requires write permission on parent directory?

2014-06-24 Thread Michael DeHaan
Then it sounds like the existing error message does indicate the directory needs to be writeable which may be good enough, I'm not sure whether most people would know or should need to know what "atomic move" was. On Tue, Jun 24, 2014 at 10:38 AM, Ben Hoyt wrote: > Ah yes -- good point. For m

Re: [ansible-project] Using a variable inside a jinja loop

2014-06-24 Thread Michael DeHaan
" - hosts: [ '{{ deploy_env }}-bal' ] " This is gross and I would recommend not doing this. Instead consider seperating your different environments into different inventory files (-i production), and having the host group just named "bal" in this case. You can still put nodes in different groups

Re: [ansible-project] Ansible OS Abstraction

2014-06-24 Thread Christian Thiemann
On Tuesday, June 24, 2014 6:04:54 PM UTC+2, Michael DeHaan wrote: > > "It doesn't work for me (unless I create a file called > roles/foobar/tasks/{{ansible_os_family}}.yml... ;-) )." > > So in other words, it works :) > No, sorry, I meant literally "{{ansible_os_family}}.yml" -- it doesn't seem

[ansible-project] Error when running ec2_tag action

2014-06-24 Thread Douglas Lopes Pereira
I've being trying to get the tag "Name" I've created for my ec2 instance using the ec2_tag module with this task file: $cat getTagTask.yml - name: Testing action: ec2_facts tags: [metric-alarms] - name: list resource tags local_action: ec2_tag resource=ansible_ec2_instance-id region=us-eas

Re: [ansible-project] template requires write permission on parent directory?

2014-06-24 Thread Ben Hoyt
Re note in docs -- thanks! Then it sounds like the existing error message does indicate the directory > needs to be writeable which may be good enough, I'm not sure whether most > people would know or should need to know what "atomic move" was. > > Well, as is it was confusing to me why it'd need

Re: [ansible-project] Recursively chown'ing a directory

2014-06-24 Thread Ben Hoyt
Yeah, I'm seeing this same thing -- trying to change the owner of a large (existing) directory recursively is taking 10-20 times as long using the "file" module vs just using chown -R, so I've opted to use the latter in our playbooks. On Wednesday, September 19, 2012 12:57:17 PM UTC-4, Aleksej

Re: [ansible-project] Ansible OS Abstraction

2014-06-24 Thread Michael DeHaan
On Tue, Jun 24, 2014 at 12:36 PM, Christian Thiemann wrote: > > > On Tuesday, June 24, 2014 6:04:54 PM UTC+2, Michael DeHaan wrote: >> >> "It doesn't work for me (unless I create a file called >> roles/foobar/tasks/{{ansible_os_family}}.yml... ;-) )." >> >> So in other words, it works :) >> > > N

Re: [ansible-project] Recursively chown'ing a directory

2014-06-24 Thread Michael DeHaan
FYI: you are replying to a mailing list post from last October. On Tue, Jun 24, 2014 at 2:38 PM, Ben Hoyt wrote: > Yeah, I'm seeing this same thing -- trying to change the owner of a large > (existing) directory recursively is taking 10-20 times as long using the > "file" module vs just usi

Re: [ansible-project] Recursively chown'ing a directory

2014-06-24 Thread Ben Hoyt
Understood -- the intention was to bump this up as it's still an issue with Ansible 1.5.5. -Ben On Tue, Jun 24, 2014 at 3:17 PM, Michael DeHaan wrote: > FYI: you are replying to a mailing list post from last October. > > > > > > On Tue, Jun 24, 2014 at 2:38 PM, Ben Hoyt wrote: > >> Yeah, I'

[ansible-project] Service module and RC files (FreeBSD)

2014-06-24 Thread Dominik Kołowski
Hello, I'm using Ansible since the very begining to manage my farm of FreeBSD based servers. Some time ago I have spotted a problem, I can't actually understand, related to service module of Ansible. According to the source code of service module it can use three system files as rcfiles in this

[ansible-project] Feedback on a mult-platform CM & deploy use-case please?

2014-06-24 Thread Boy Baukema
Hi! Could anyone give me feedback in the way I'm setting up our DevOps? I really couldn't find much that actually dealt with multiple platforms so I had to piece together what I could and came up with the following (hopefully it will also help for anyone that comes after). We, OpenConext.org

[ansible-project] vars_files not importing existing file

2014-06-24 Thread micafer
Hi, I create an issue in the ansible github and Michael DeHaan recomend me to ask here for help. All the information is in this issue: https://github.com/ansible/ansible/issues/7901 The summary is: In Ubuntu 12.04. versions 1.5.4, 1.5.5, 1.6.0 and 1.6.1, a "vars_files" section defined like th

[ansible-project] Ansible Windows 404 error

2014-06-24 Thread Ollie Lawson
Hi, I'm trying to do a proof of concept install of the new windows functionality of anisble. I have tried Windows Server 2012 and 2008 r2 but I get the following errors back: WIN-3Q6QUQU2T6P.cs29cloud.internal | FAILED => Traceback (most recent call last): File "/usr/lib/python2.6/site-pac

Re: [ansible-project] Recursively chown'ing a directory

2014-06-24 Thread Michael DeHaan
See if there's a ticket filed and file one would be better, we really don't bump old threads on this list. I also don't consider this an issue so much more as a feature request / enhancement idea, where a pull request that makes it happen would probably be ideal. You can also keep using the chown

Re: [ansible-project] vars_files not importing existing file

2014-06-24 Thread Michael DeHaan
" - - {{ ansible_distribution }}.yml - os_defaults.yml" This looks like a formatting error to me. vars_files: - [ "{{ ansible_os_distribution }}.yml", "os_defaults.yml" ] OR: vars_files: - - "{{ ansible_os_distribution }}.yml" - "os_defaults.yml" On Tue, Jun 2

Re: [ansible-project] Ansible Windows 404 error

2014-06-24 Thread Michael DeHaan
What steps did you take to set up powershell remoting on the remote system? On Tue, Jun 24, 2014 at 7:08 AM, Ollie Lawson wrote: > Hi, > > I'm trying to do a proof of concept install of the new windows > functionality of anisble. > > I have tried Windows Server 2012 and 2008 r2 but I get the

[ansible-project] Deprecating pararmeters

2014-06-24 Thread Stephen Gargan
Hi, I've been making changes to the ec2_elb_lb module to allow security group names as well as security group ids. While doing this I had added a new module parameter 'security_groups' with the intention of marking the id specific one as deprecated. I was wondering how this kind of deprecation

[ansible-project] Register being set even though task is skipped

2014-06-24 Thread PePe Amengual
Hi there I'm running into an issue that I don't know if it is a expected behaviour or a bug I have a play with two task both of them have the conditional "when" and both of them use the same variable name as a register like so : - name: Forcing Termination of instances hosts: localhos

Re: [ansible-project] Ansible Windows 404 error

2014-06-24 Thread Paul Durivage
Hi Ollie, Have you seen the Windows guide? Be sure to set the Windows machines to allow powershell remoting and make sure to open up the firewall. See the below link for the guide. http://docs.ansible.com/intro_windows.html#windows-system-prep On Tue, Jun 24, 2014 at 6:08 AM, Ollie Lawson wr

[ansible-project] frequent ssh drops due to "Connection timed out during banner exchange"

2014-06-24 Thread Nick Evgeniev
Hi, For some reason if I'm connecting to the host using ansible connection is been dropped frequently with "Connection timed out during banner exchange" message.. Any hints? pls check output below.. again if I just 'ssh lb0014' everything is fine GATHERING FACTS *

Re: [ansible-project] Register being set even though task is skipped

2014-06-24 Thread James Cammarata
Yes this is expected. Register always stores the state of the task, but you can just check the .skipped value in your when: statement. On Jun 24, 2014 3:12 PM, "PePe Amengual" wrote: > Hi there > > I'm running into an issue that I don't know if it is a expected behaviour > or a bug > I hav

Re: [ansible-project] Deprecating pararmeters

2014-06-24 Thread Michael DeHaan
Sounds like a good topic for ansible-devel BTW. Anyway, we generally try to avoid deprecating *any* parameters, I'd be interested in references to specifics you've found as I don't recall them offhand. I think the first question should be do we need to deprecate this at all, with the default of t

Re: [ansible-project] frequent ssh drops due to "Connection timed out during banner exchange"

2014-06-24 Thread Michael DeHaan
Anything particularly interesting about the setup, OSes involved (managed or managing), or network? On Tue, Jun 24, 2014 at 6:23 PM, Nick Evgeniev wrote: > Hi, > > For some reason if I'm connecting to the host using ansible connection is > been dropped frequently with "Connection timed out

Re: [ansible-project] Service module and RC files (FreeBSD)

2014-06-24 Thread Brian Coca
As written the code will make the last file it finds in that sequence the 'rcconf_file; it will use, not the first as it does not end the for loop on assignment. I believe this is done to use the most 'local' file.​ -- You received this message because you are subscribed to the Google Groups "A

[ansible-project] AWS EC2 instance create via Ansible IAM Roles instance_profile_name UnauthorizedOperation: Error

2014-06-24 Thread Faisal Ali Rabbani
I am trying to create EC2 instance via ansible using IAM roles but I while launching new instance I get error failed: [localhost] => (item= IAMRole-1) => {"failed": true, "item": " IAMRole-1"} msg: Instance creation failed => UnauthorizedOperation: You are not authorized to perform this oper