Re: [ansible-project] ansible ovirt module

2014-08-14 Thread Peter Smallegange
Hello, Hope you had a good holiday :) My holiday starts this Friday luckily. These are the versions we use: Red Hat Enterprise Virtualization Manager Version: 3.4.1-0.31.el6ev ansible: 1.6.6 module: ovirt author: Vincent Van der Kussen short_description: oVirt/RHEV platform management descript

Re: [ansible-project] Role and playbook versioning

2014-08-14 Thread Will Thames
Also, what is the intended mechanism for pinning versions in dependencies in meta/main.yml? dependencies: - git+http://git.example.com/repos/role-abc,v1.0 There's probably some work to trim the .git off the role_name too (I just don't bother putting the .git in the repo url but maybe not all gi

[ansible-project] ssh_args per host/group

2014-08-14 Thread Steven Ringo
Hi, We have a requirement to pass for example, *-o "RemoteForward 8080 host.behind.the.firewall.com:80"* to some hosts so that the host can reverse tunnel to some private resources on our local network. For example we use a private git repo that is not publicly accessible, yet we need to use i

[ansible-project] set_fact vs register

2014-08-14 Thread Steven Ringo
Hi, Apart from the fact that *set_fact* is a task on its own and *register* captures the result of a task, is there any difference between the resulting variables' scope or lifecycle (or anything else) for example. Thanks, Steve -- You received this message because you are subscribed to the

Re: [ansible-project] Role and playbook versioning

2014-08-14 Thread Will Thames
I've solved the trimming the .git off the end and also the ability to specify role_version in meta/main.yml It doesn't work with an upgrade of a dependency because the check is currently for if the role exists, not if it's a particular version. I've added an integration test for all of this to

Re: [ansible-project] set_fact vs register

2014-08-14 Thread Michael DeHaan
Fundamentally they do the same thing, though "register" applies to task results. They enter into the same per-inventory-host scope. On Thu, Aug 14, 2014 at 5:55 AM, Steven Ringo wrote: > Hi, > > Apart from the fact that *set_fact* is a task on its own and *register* > captures the resul

Re: [ansible-project] Re: User management by ansible - any ideas ?

2014-08-14 Thread Michael DeHaan
Here's an easier way that avoids the messy Jinja2 in the playbook, which we as a community like to discourage (it's the reason Ansible templates don't evaluate into YAML, but are YAML... Jinja2 is intended to be just a quick way to get variables, unless you are in a template) In ansible, a host sp

Re: [ansible-project] Re: 127.0.0.1 and localhost in synchronize module

2014-08-14 Thread Michael DeHaan
Ansible views Vagrant as no different than any other computer. I believe it should set ansible_ssh_port in inventory. If you can paste what kind of errors you are seeing and your ansible version it might be more clear what you're talking about, but I don't understand "get hit by the special handl

Re: [ansible-project] deploying with ansible

2014-08-14 Thread Dan Vaida
Hello, Again, a very BIG thank you for your efforts on the deploy module. I would like to share my suggestion, perhaps as an idea to generate a future pull request: With capistrano, it is possible to run some of the tasks only on specific hosts. Any plans for such a feature? Problem is that in

Re: [ansible-project] Re: Idiomatic EC2 project structure

2014-08-14 Thread Michael DeHaan
"You are right about the intersection of groups - it's a shame you cannot declare hosts like (excuse any syntax issues - code looks funny on a phone):" Can you elaborate on what you think is missing? ":children" to define child groups is how that part works, so I'm missing the understanding of wh

Re: [ansible-project] Cron File Management

2014-08-14 Thread Michael DeHaan
"If I just change the template to {{item}} to output whatever is input, the play loops over each job in the variable and the end file only contains the last job." If you are writing to different cron.d files, the template that you have there in cron.j2 should be fine. Also take a look at the usin

Re: [ansible-project] centralizing groups of groups, strategy that works for both dynamic and static inventory

2014-08-14 Thread Michael DeHaan
Mixing groups between dynamic and static works in Ansible 1.7 and higher, so if you are not running that version, I'd upgrade. "To re-use this same method with static host inventories, the only way I can see is to put each inventory file in a separate directory along with a copy of rollup groups.

Re: [ansible-project] Weird set_fact boolean problem

2014-08-14 Thread Michael DeHaan
"Is this something that should be fixed or just documented as a difference?" Nope. It's fine, because the system has no hint to decide you asked for anything other than a string. On Wed, Aug 13, 2014 at 1:43 PM, Michael Peters wrote: > Also, isn't it weird the with the variable foo set to s

Re: [ansible-project] Weird set_fact boolean problem

2014-08-14 Thread Michael DeHaan
"Also, isn't it weird the with the variable foo set to string "false" both "when: foo" and "when: not foo" evaluate to false?" This is a programming language concept. No, as the string 'false' in Python or any prograis not the same as False. there is a difference between these two: vars: x:

Re: [ansible-project] ansible yum module question

2014-08-14 Thread Michael DeHaan
Shelling out to the yum command could be used to do this, yes, though you will first need to make sure the RPMs are present on the remote machine. "ansbile reports a change, but when I check the system the packages are not installed." ansible will always report a change when a command runs, try r

Re: [ansible-project] 'lineinfile' module - possible bug?

2014-08-14 Thread Michael DeHaan
Can you let us know why the user module won't work for you in this case? It should not be needed to edit those files directly, and if there's a missing feature I'd like to see it exposed in the user module. Thanks! On Wed, Aug 13, 2014 at 5:28 PM, Willard Dennis wrote: > Sorry, other work took

Re: [ansible-project] Geting vars from a different playbook to use as the "hosts" value

2014-08-14 Thread Michael DeHaan
It's not possible to use inventory variables in the "host" spec ("- hosts:"). Also, don't use debug with register, instead, if you need to set a variable: - set_fact: foo: "tag_Name_{{ aws.ec2.Name }}" "- hosts: {{ hostvars.localhost.aws_host_target.msg" This is also an error because the

Re: [ansible-project] Re: Problem setting up the bash environment with playbook.

2014-08-14 Thread Michael DeHaan
Ansible doesn't use the host environment files like .bashrc because it's inconsistent if you have many hosts, it encourages centralized management. To set environment variables, see this feature: http://docs.ansible.com/playbooks_environment.html On Wed, Aug 13, 2014 at 8:22 PM, Darup tek wr

Re: [ansible-project] Git Module Repo Scheme Change?

2014-08-14 Thread Michael DeHaan
Can you ping "gh" from that host and is it available in DNS? On Thu, Aug 14, 2014 at 12:32 AM, James Gatannah wrote: > I'm updating a project (setting up a disposable dev environment) from > ansible 1.6.2 to 1.7. (Installed and upgraded using pip into a venv). > > I've been setting up a user

Re: [ansible-project] ssh_args per host/group

2014-08-14 Thread Michael DeHaan
For most configuration items, take a look in the docs about "host_vars/" and "group_vars/" directories. They are quite awesome for applying variables at host and group var level. You can't currently set this on a per host basis, but I'm open to making it possible. In the meantime, yes, local .ss

Re: [ansible-project] ssh_args per host/group

2014-08-14 Thread Michael DeHaan
Clarification: they are used for the "-c ssh" connection type. This is the default on all platforms except RHEL/CentOS 6 and earlier, which have an old SSH, and can't benefit from the (very useful) ControlPersist speedups. You could still manually pick this in your ansible.cfg, though I'd recomme

Re: [ansible-project] Role and playbook versioning

2014-08-14 Thread Michael DeHaan
Yeah I think the above syntax, and also in dependencies, would be fine. Dependency downloads are all in the ansible-galaxy CLI, so I think that would cover everything.We would just need the core change that would get the role name out correctly too. Thanks! On Thu, Aug 14, 2014 at 6:43 AM,

Re: [ansible-project] deploying with ansible

2014-08-14 Thread Michael DeHaan
"With capistrano, it is possible to run some of the tasks only on specific hosts. Any plans for such a feature?" This has been a feature in Ansible since day 1. - hosts: hostnames - hosts: otherhostnames Etc On Thu, Aug 14, 2014 at 7:42 AM, Dan Vaida wrote: > Hello, > > Again, a very BIG t

[ansible-project] Strange ansible hangs at the setup stage

2014-08-14 Thread fscomm
Hello. Please advise me in the next problem. Environment: Ansible host: CentOS 6.5 x86_64. Rpm package ansible 1.6.6. I created a task to disable ipv6 on target host. Let's name this host: myhost. I created task file: disable-ipv6.yml. Contents: ==

[ansible-project] Using json in docker environment variables

2014-08-14 Thread Dane Lipscombe
I use json to compact my docker environment variables, the problem is that the docker module parser splits on ',' character to signify a new key/value pair, meaning that more than one key doesn't work. eg docker: env='options={"foo":"bar"}' //ok docker: env='options={"foo":"bar","baz":"qux"}'

Re: [ansible-project] Role and playbook versioning

2014-08-14 Thread Ivaylo Bratoev
Hi guys, I am currently investigating different options for managing roles and looking forward to having this in Ansible itself. My requirements are similar - having roles shared (and versioned) in private git repos, referenced from playbooks in other repos. The solution you are discussing here

[ansible-project] Choosing from conflicting values in multiple roles

2014-08-14 Thread Joel Shprentz
The Zabbix installation manual recommends some settings in /etc/php5/apache2/php.ini: post_max_size = 16M max_execution_time = 300 max_input_time = 300 date.timezone = UTC Other PHP applications have different recommendations. Here are a few recommended values for post_max_size, for example: D

Re: [ansible-project] Strange ansible hangs at the setup stage

2014-08-14 Thread Michael DeHaan
Can you please upgrade to the latest version of Ansible and try from there? This is version 1.7. What remote OS are you managing? Can you run with "-c ssh -" and see if you get any particular messages from SSH debugging? On Thu, Aug 14, 2014 at 1:31 AM, fscomm wrote: > Hello. Please

Re: [ansible-project] Role and playbook versioning

2014-08-14 Thread Michael DeHaan
" would just add one more requirement - being able to overwrite the role-name and rely on the git repo name exclusively. Idea for syntax if you want to keep the *role_name/url, role_version* format:" While interesting, we don't want to do this because we already have ",version" used for describing

Re: [ansible-project] Using json in docker environment variables

2014-08-14 Thread Michael DeHaan
I think this is the problem in the module: env = dict(type='list'), If it were type='dict' we could do: docker: env: options: {"foo":"bar","baz":"qux"} other_arguments_here: 1234 And basically use full YAML, without any splitting magic. If someone would like to help test t

Re: [ansible-project] Choosing from conflicting values in multiple roles

2014-08-14 Thread Michael DeHaan
In your case, I recommend setting feature bits for things, or keying of the group in a template. {% if inventory_hostname in groups['webservers'] %} {% else %} {% endif %} etc {% if needs_more_power|defined %} {% endif %} etc On Wed, Aug 13, 2014 at 11:50 PM, Joel Shprentz wrote: > The

Re: [ansible-project] deploying with ansible

2014-08-14 Thread Dan Vaida
That's right. But I was referring to another thing. Basically, I'm trying to use their deployment role as a whole, to perform certain operations only on certain hosts, while leaving all the hosts/groups, listed in the the main 'hosts' directive. In my other roles, I've been using host_vars or e

Re: [ansible-project] Choosing from conflicting values in multiple roles

2014-08-14 Thread Tom Bamford
On 14 August 2014 05:50, Joel Shprentz wrote: > > Has anyone else encountered this problem? Have you found an approach for > tracking a maximum (or minimum, etc.) value across multiple roles and using > the maximum in a task? > > Instead of looking to Ansible to work around this shared global set

Re: [ansible-project] deploying with ansible

2014-08-14 Thread Michael DeHaan
" Basically, I'm trying to use their deployment role as a whole, to perform certain operations only on certain hosts, while leaving all the hosts/groups, listed in the the main 'hosts' directive." This is there too :) ansible-playbook foo.yml --limit groupname ansible-playbook foo.yml --limit hos

Re: [ansible-project] Weird set_fact boolean problem

2014-08-14 Thread Michael Peters
Yes, I realize the difference between a string and a boolean. But I've never seen a system where "foo" and "not foo" evaluate to the same thing. On Thu, Aug 14, 2014 at 7:47 AM, Michael DeHaan wrote: > "Also, isn't it weird the with the variable foo set to string "false" > both "when: foo" and "w

Re: [ansible-project] Weird set_fact boolean problem

2014-08-14 Thread Michael DeHaan
"both "when: foo" and "when: not foo" evaluate to false?" Don't recall it ever working that way. Can you share a playbook that reproduces this? On Thu, Aug 14, 2014 at 9:08 AM, Michael Peters wrote: > Yes, I realize the difference between a string and a boolean. But I've > never seen a syste

Re: [ansible-project] Weird set_fact boolean problem

2014-08-14 Thread Michael Peters
Sure: test.yml --- - hosts: 127.0.0.1 connection: local tasks: - set_fact: foo=false - command: ls / when: foo - command: ls / when: not foo Executed like "ansible-playbook -i '127.0.0.1,' test.yml" Results in both tasks being skipped: PLAY [127.0.0.1] **

Re: [ansible-project] Re: Idiomatic EC2 project structure

2014-08-14 Thread Lorin Hochstein
On Thu, Aug 14, 2014 at 7:42 AM, Michael DeHaan wrote: > "You are right about the intersection of groups - it's a shame you cannot > declare hosts like (excuse any syntax issues - code looks funny on a > phone):" > > Can you elaborate on what you think is missing? ":children" to define > child g

Re: [ansible-project] Re: User management by ansible - any ideas ?

2014-08-14 Thread Alex Wheeler
I think I get where you are going with the idea of different plays, but they way I understand it, I would need a different play for every user that had different host/group requirements. So, with 100+ users, 70 might need the same access for a given set of hosts (1 play), but there could be 30 t

Re: [ansible-project] Role and playbook versioning

2014-08-14 Thread Ivaylo Bratoev
I can think a few cases where being able to control local role folder names would make things cleaner. For example: referencing repos with the same name in the end, too long or obscure repo names, etc. None of this is a blocker that would stop us from using this feature. I am looking forward to

Re: [ansible-project] Weird set_fact boolean problem

2014-08-14 Thread Michael DeHaan
The inconsistent booleanification is definitely not something I'd want to see here. Can you please file a bug on github for this one? On Thu, Aug 14, 2014 at 9:42 AM, Michael Peters wrote: > Sure: test.yml > > --- > - hosts: 127.0.0.1 > connection: local > tasks: > - set_fact: foo=fals

Re: [ansible-project] Re: Idiomatic EC2 project structure

2014-08-14 Thread Michael DeHaan
"I can create a new a group as a union of other groups (groups of groups), but AFAIK there's no way to create a new group as the intersection of other groups." Shouldn't be needed in the inventory file, as this is something you can address using the host spec: - hosts: alpha:&beta or also - hos

[ansible-project] Logical 'OR' in when statement?

2014-08-14 Thread John Oliver
Can I execute an action when variable1=x OR variable2=y? -- 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] Geting vars from a different playbook to use as the "hosts" value

2014-08-14 Thread Shih Oon Liong
Thanks! - that clarifies it for me. On Thursday, 14 August 2014 04:52:39 UTC-7, Michael DeHaan wrote: > > It's not possible to use inventory variables in the "host" spec ("- > hosts:"). > > Also, don't use debug with register, instead, if you need to set a > variable: > > - set_fact: >fo

Re: [ansible-project] Logical 'OR' in when statement?

2014-08-14 Thread Michael DeHaan
Yep! - shell: echo hi when: variable1 == x and variable2 == y On Thu, Aug 14, 2014 at 1:32 PM, John Oliver wrote: > Can I execute an action when variable1=x OR variable2=y? > > -- > You received this message because you are subscribed to the Google Groups > "Ansible Project" group.

Re: [ansible-project] Weird set_fact boolean problem

2014-08-14 Thread Michael Peters
Submitted bug: https://github.com/ansible/ansible/issues/8629 Thanks On Thu, Aug 14, 2014 at 1:24 PM, Michael DeHaan wrote: > The inconsistent booleanification is definitely not something I'd want to > see here. > > Can you please file a bug on github for this one? > > > > > On Thu, Aug 14, 2014

[ansible-project] Correct way of license file management in Ansible?

2014-08-14 Thread Vincent Hardion
Hi, I want to manage the license file (the license key of proprietary software) within Ansible for each host. There is few resource on the web on this subject or maybe I use the wrong vocabulary. So can someone tell me if there is a better ansible way to handle this case. Here is what is workin

[ansible-project] Ansible 1.7.1 Released

2014-08-14 Thread James Cammarata
Hi all! We have released 1.7.1, which addresses one security issue reported by Tomasz Kontusz, as well as some other bugs. - A security fix to disallow specifying 'args:' as a string, which could allow the insertion of extra module parameters through variables. - Performance enhancements

Re: [ansible-project] Re: Idiomatic EC2 project structure

2014-08-14 Thread Dominic Bou-Samra
Perhaps I am doing it wrongly (thus the idiomatic keyword), but I find that less declarative then being able to define intersections in groups. On Friday, August 15, 2014 3:25:35 AM UTC+10, Michael DeHaan wrote: > > "I can create a new a group as a union of other groups (groups of > groups), bu

[ansible-project] How can I loop over all hosts in a group in this playbook?

2014-08-14 Thread Abe Voelker
I have an inventory file like this: [webservers] 10.0.0.1 10.0.0.2 10.0.0.3 [postgresservers] 10.0.0.4 And I'm trying to run this playbook against my Postgres host: --- - name: Allow eth1 port 5432 access to Web servers ufw: rule=allow interface=eth1 direction=in port=5432 proto=tcp src={{ i

Re: [ansible-project] Re: Force gathering facts on all hosts when using --tags or --limit

2014-08-14 Thread Thijs Cadier
Any news or other workarounds for this? We've now converted our staging system to Ansible, but not sure how I can roll out to production. The problem is that we use the inventory set up hosts files and firewall rules, but we can't run Ansible on the entire production cluster for the migration.

Re: [ansible-project] Re: Idiomatic EC2 project structure

2014-08-14 Thread Michael DeHaan
It's not an issue of declarative vs imperative here, but saying "talk to these groups". The children are not technically unions either, they are child relationships. On Thu, Aug 14, 2014 at 5:54 PM, Dominic Bou-Samra wrote: > Perhaps I am doing it wrongly (thus the idiomatic keyword), but I

Re: [ansible-project] Re: Force gathering facts on all hosts when using --tags or --limit

2014-08-14 Thread Michael DeHaan
Yes. Apologies for the weird archive link instead of the forum, but this is what Google juice turned up when I was looking for my post. https://www.mail-archive.com/ansible-project@googlegroups.com/msg07964.html On Thu, Aug 14, 2014 at 12:26 PM, Thijs Cadier wrote: > Any news or other worka

Re: [ansible-project] How can I loop over all hosts in a group in this playbook?

2014-08-14 Thread Matt Martz
I think what you want is the following: --- - name: Allow eth1 port 5432 access to Web servers ufw: rule=allow interface=eth1 direction=in port=5432 proto=tcp src="{{ hostvars[item]['ansible_eth1']['ipv4']['address'] }}" with_items: groups['webservers'] That will loop over groups['webservers

Re: [ansible-project] Re: Get rid of "previous known host file not found"

2014-08-14 Thread Steffen Prince
Sorry for bumping this old thread, but I encountered "previous known host file not found" myself and identified my problem. I was using ansible on a host where my login name did not match the name I wanted to run ansible under, so I set $USER to the desired name. This is a bad idea generally, b

Re: [ansible-project] Role and playbook versioning

2014-08-14 Thread Will Thames
Perhaps we could make role name an optional third field - so if you do want role_name but not role_version, just leave role_version blank i.e. git+http://git.server/bad-role-name,,nice-role-name The reason for making it the third field is that I don't want to break existing roles files and I do

Re: [ansible-project] Git Module Repo Scheme Change?

2014-08-14 Thread James Gatannah
Sorry, I wasn't as clear as I thought/wanted. ~/.ssh/config has a host entry that sets up an alias from gh to github.com. After the playbook has run, I can go through the repositories that were cloned as ssh://g...@github.com/me/{{item}} and run "git remote set-url ssh://gh/me/{{item}}" in each cl

Re: [ansible-project] Re: Get rid of "previous known host file not found"

2014-08-14 Thread Ilya Ivanov
I always set ansible user in the inventory file. I actually narrowed down the issue. It happens whenever a new host is added in a screen session. So, when working with already known hosts or when screen isn't used, I don't see it. On Fri, Aug 15, 2014 at 6:17 AM, Steffen Prince wrote: > Sorry

Re: [ansible-project] Re: Idiomatic EC2 project structure

2014-08-14 Thread Lorin Hochstein
I would also find it useful to be able to define a group as an intersection of two groups. It's something I've wanted for a while but just haven't gotten around to submitting a feature request for. If I use the "hosts: dbservers:&production:&northeast" syntax in N playbooks, then I have N opportun

[ansible-project] pip module installing xmlrunner for python3 fails but shell install always succeeds?

2014-08-14 Thread zperry
I would like to install xmlrunner via the pip module to a KVM guest running CentOS 6.5 with python34u installed from IUS Community repo. The following task include file always fails --- # Specifically, the xmlrunner for python3 is installed. - name: Install xmlrunner pip: name=xmlrunner execu

Re: [ansible-project] How can I loop over all hosts in a group in this playbook?

2014-08-14 Thread Abe Voelker
Matt, thanks so much, I do believe that did the trick! On Thursday, August 14, 2014 6:05:16 PM UTC-5, Matt Martz wrote: > > I think what you want is the following: > > --- > - name: Allow eth1 port 5432 access to Web servers > ufw: rule=allow interface=eth1 direction=in port=5432 proto=tcp src="

[ansible-project] Ansible Workflow with Roles as Git Submodules

2014-08-14 Thread Steffen Prince
What are people's experiences with using git submodules to incorporate reusable roles into Ansible repos? We've just started trying this out because we are incorporating roles from affiliated public role repos as submodules, and we need to manage integration of public roles into private "master

[ansible-project] Re: Ansible Workflow with Roles as Git Submodules

2014-08-14 Thread Will Thames
I think the solutions discussed in https://groups.google.com/forum/#!topic/ansible-project/TawjChwaV08 start to look like managed vendoring ala golang. Not to say it's the only solution and git submodules might work, but the above approach is where I'm thinking of going with managing versionin