[ansible-project] Execute task for specific host.

2015-02-06 Thread Alexey Lesovsky
Hello all! I have playbook with following parts: vars: servers: - { address: "192.168.122.12", role: "upstream" } - { address: "192.168.122.13", role: "downstream" } - { address: "192.168.122.14", role: "downstream" } task: - name: Task command: "/usr/sbin/somecommand" How I

Re: [ansible-project] Execute task for specific host.

2015-02-06 Thread Igor Homyakov
Hi Alexey, You do not need to quote a whole string here, could you try when: servers.role == "upstream" -- Best, Igor On Fri, Feb 6, 2015 at 2:27 PM, Alexey Lesovsky wrote: > Hello all! > I have playbook with following parts: > > vars: > servers: > - { address: "192.168.122.12", role: "u

Re: [ansible-project] Execute task for specific host.

2015-02-06 Thread Giovanni Tirloni
On Fri, 06 Feb 2015 03:27 -0800, Alexey Lesovsky wrote: > Hello all! > I have playbook with following parts: > > vars: > servers: > - { address: "192.168.122.12", role: "upstream" } > - { address: "192.168.122.13", role: "downstream" } > - { address: "192.168.122.14", role: "downstr

Re: [ansible-project] Execute task for specific host.

2015-02-06 Thread Alexey Lesovsky
Yes, I am tried use quotes, and this not working. пятница, 6 февраля 2015 г., 17:24:46 UTC+5 пользователь Igor Khomyakov написал: > > Hi Alexey, > > You do not need to quote a whole string here, could you try > > when: servers.role == "upstream" > > -- Best, Igor > > On Fri, Feb 6, 2015 at 2:

Re: [ansible-project] Execute task for specific host.

2015-02-06 Thread Alexey Lesovsky
Eventually I rewrote playbook using groups and include statements for tasks, and it works fine. But, in the current circumstances I'm not quite satisfied, I need to make a single file playbook. Yes, I know it's not quite right and not a best practice ))) пятница, 6 февраля 2015 г., 17:48:02 UTC

[ansible-project] Host-based files and templates

2015-02-06 Thread ProfHase
Is there a feature in Ansible for host-based files/templates directory? In my actual setup i am keeping track of it manually (on playbook level there is a files/ directory with one directory for {{ inventory_hostname }} . Nicer would be the same mechanism as host_vars / group_vars . Sometimes

[ansible-project] Where to put templates/files outside of a role

2015-02-06 Thread Kai Weber
Hi, I am writing a role for varnish. Because Varnish configuration language is a "real" language I can and will not restrict what configuration a user can provide. To make it as flexible as possible I planned to use a variable with an empty default. So a user of my role can provide a complete VCL

Re: [ansible-project] Nested looping with dict/sub-list

2015-02-06 Thread Duncan Hutty
That's an interesting strategy for getting the sources.list.d configured, but it relies on the fact that that line defining a deb repository can take multiple components 'deb http://mirrors.us.kernel.org/ubuntu/ precise main universe', so I'm no clearer on the real question about iterating ov

Re: [ansible-project] Execute task for specific host.

2015-02-06 Thread Serge van Ginderachter
​try this: ​ when: servers.role ==​ ​ ​ " ​​ ​upstream" -- 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

Re: [ansible-project] Host-based files and templates

2015-02-06 Thread Michael Peters
If your monitoring configuration differs too much between machines, I think you might be doing it wrong. I can definitely understand how it would be different per group/role (db vs web, etc) but how would it differ between machines of the same role? On Fri, Feb 6, 2015 at 8:46 AM, ProfHase wrote:

Re: [ansible-project] Where to put templates/files outside of a role

2015-02-06 Thread Brian Coca
Lookup plugins will search for relative paths by default in a role's files/ directory and then in a play's files/ directory. Also you probably want to just use the file lookup plugin unless you are inserting jinja statements inside the default.vcl file. -- Brian Coca -- You received this messa

Re: [ansible-project] Host-based files and templates

2015-02-06 Thread Brian Coca
Most users use variables to handle the per host differences vs full templates. -- 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 ansible-proje

[ansible-project] Re: Help understanding how the limit flag works with the ansible-playbook command

2015-02-06 Thread Daniel Richardson
Thanks so much Brian. That makes a lot of sense now. On Wednesday, February 4, 2015 at 7:17:06 PM UTC-5, Daniel Richardson wrote: > > I ran into what seemed to me like a strange problem today, but I might > just lack the understanding to know what was happening. > Let's say you have a YAML file

[ansible-project] Rolling upgrade of AWS instances of particular tag

2015-02-06 Thread Gary Malouf
For managing our web servers, I have two playbooks: webservers-provision and webservers-update. As one may guess, provision handles bootstrapping instances while update deals with in-place updates of our software. I have a desire to do a rolling upgrade of all of our servers from one EC2 insta

[ansible-project] Re: Thank you everyone!

2015-02-06 Thread Michael DeHaan
Wanted to say thanks for everyone that wrote in -- I think I replied directly to everybody on twitter/personal-email already. Your words really mean a lot and are much appreciated! On Sunday, February 1, 2015 at 9:30:19 PM UTC-5, Jun Zhang wrote: > > Thanks for creating such a great tool. Goo

[ansible-project] Problem with resource_tags

2015-02-06 Thread Rahul Mehrotra
Hi Everyone, I am trying to create a VPC using Ansible however I am having trouble in tagging resoruces - name: Create a VPC register: vpc ec2_vpc: state: present cidr_block: 10.0.0.0/16 #resource_tags: { Environmenti: Development } subnets: - c

Re: [ansible-project] multi stage and variables

2015-02-06 Thread Victor Volle
Hi Giovanni! Thanks for your reply. Even if I could rename the "ram" variable (the example is totally artificial): 1) I would need to add groups like: [web:children] prod-web dev-web [db:children] prod-db dev-db [prod:children] prod-web prod-db [dev:children] dev-web dev-db A