Re: [ansible-project] Problem with SSH Forwarding using Ansible and Vagrant

2014-10-24 Thread Navid Paya
Yes, I could do that. It's just that my SSH key has full access to everything and didn't want to even take a chance leaving it in the box once it's generated and I want to share it with others but I guess you are right. Not that hard to get around it using synced folders or something of that kind.

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

2014-10-24 Thread Michael DeHaan
I've filed a github for now to include (in 1.8) a check to auto-disable pipelining on RHEL 6.6+ (but not EL7), which should resolve most of the confusion. We also may make it print a warning if it was on. But yeah, bugzilla seems appropriate. Bugzilla from someone with a nice friendly Red Hat TA

Re: [ansible-project] tags and role dependencies

2014-10-24 Thread Daniel Wendler
So i think i have to "redesign" my monitoring role to add the tags to the dependency (in meta.yml) or to split the role in multiple roles. Thanks for your help. Am Samstag, 25. Oktober 2014 02:02:13 UTC+2 schrieb Michael DeHaan: > > "since tags applied directly to tasks (like your include statem

Re: [ansible-project] tags and role dependencies

2014-10-24 Thread Michael DeHaan
Ok, communication issue on my end. "doit" does get applied to everything, and we are good there (no bugs!) It isn't true that adding a tag to the "include" statement you have manually inside the role would affect the deps. That would only affect the included tasks in that file. Sorry for confus

Re: [ansible-project] when condition based on list

2014-10-24 Thread Jacob Weber
Not exactly...I want each condition to be a regex on the output of the original command (which also contains a lot of other text). That's why I was trying to use a "search" filter. > On Oct 24, 2014, at 5:04 PM, Michael DeHaan wrote: > > sounds like you mean do something like: > > when: a in

Re: [ansible-project] How to copy to remote servers

2014-10-24 Thread Michael DeHaan
Do you have a specific question about the above playbook? If configuration of different hosts is *VERY* different, like one is a database server and one is not, this is where you would write two plays, each applying different tasks/roles to each. Otherwise, it's a case of setting inventory variab

Re: [ansible-project] Re: Merging dictionaries for "environment" parameter

2014-10-24 Thread Michael DeHaan
I think your filter plugin could be more easily written: hash_a.update(hash_b) perhaps? If you send in a pull request, this seems reasonable to have as a core filter. I'd probably call it 'update' if I'm correct on the above, which I think I am. If not, perhaps "merge". On Fri, Oct 24, 20

Re: [ansible-project] include when and variables and Friday and I don't even

2014-10-24 Thread Michael DeHaan
I think the key is here: - include: prepare.yml, tags: ['prepare'] Where in your copy and paste you have it starting with a "{", this is not the same as in your error message, so I think the actual in the file might not match what you typed. On Fri, Oct 24, 2014 at 4:54 PM, wrote: > I have a

Re: [ansible-project] when condition based on list

2014-10-24 Thread Michael DeHaan
sounds like you mean do something like: when: a in ['x','y','z'] or when: x.foo in alist ?? On Fri, Oct 24, 2014 at 3:50 PM, Jacob Weber wrote: > Is it possible to write something like "when: a and b and c", but get the > list [a,b,c] from a variable? > > I have one command that outputs s

Re: [ansible-project] include: myplaybook.yml tags=mytag, how to make it work ?

2014-10-24 Thread Michael DeHaan
"The only was to do that ( restrict by tag ) is only on the command line with -t option right ?" yep! On Fri, Oct 24, 2014 at 2:18 PM, Alainkr wrote: > Okay, I did miss the semantic here. I'd thought it was include "only" the > task associated with the tags given. Which incidentally was exact

Re: [ansible-project] Variable Definition Question

2014-10-24 Thread Michael DeHaan
You should probably define all the variables for the properties file instead, and maybe consider ansible templating the properties file as an ansible template to avoid dual entry. On Fri, Oct 24, 2014 at 1:59 PM, Jamal B wrote: > All, I'm new to Ansible so forgive me if this is already answere

Re: [ansible-project] tags and role dependencies

2014-10-24 Thread Michael DeHaan
"since tags applied directly to tasks (like your include statements in tasks/main.yml) are not applied to dependent roles (nor would we expect them to be)" I may have been confused with the discussion. I do expect tags like this: - hosts: webservers roles: - { role: doit, tags: doit }

Re: [ansible-project] How to use ec2 modules user_data field?

2014-10-24 Thread Michael DeHaan
I don't believe YAML takes Python-like docstrings. So you would need to start with a single or double quote and escape any internal quotes as need be. The "file" lookup plugin may also be helpful. On Fri, Oct 24, 2014 at 12:06 PM, Erick Barros wrote: > I got the following error: > > ERROR: Syn

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

2014-10-24 Thread Todd Zullinger
Jacob Weber wrote: Just to clarify -- I was seeing the same results as Kevin, not Todd. Removing "pipelining = True" from my config fixed the problem. I've since updated to 1.7.2 from epel-testing and I see the same results as you and Kevin. I've disabled pipelining as well for now, but it'

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

2014-10-24 Thread Jacob Weber
Just to clarify -- I was seeing the same results as Kevin, not Todd. Removing "pipelining = True" from my config fixed the problem. Since that's the default, I don't know if you really need to change Ansible -- it never worked on RHEL6 before, so nothing's changed in that regard. But I hope the

Re: [ansible-project] block statements?

2014-10-24 Thread Brian Coca
you can already do some of this, with variables and tags, with include and role directives. But currently there is only one true block of tasks and that is a play. there is some work in ansible to create the block concept/object for tasks but it is in early stages. On Fri, Oct 24, 2014 at 2:46 PM

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

2014-10-24 Thread Michael DeHaan
"with pipeline disabled:" Hm, curious. Worst case we could detect RHEL 6 and auto-disable pipelining on that platform, what say ye? On Wed, Oct 15, 2014 at 9:44 PM, Kevin Fenzi wrote: > On Wed, 15 Oct 2014 21:01:55 -0400 > Todd Zullinger wrote: > > > With pipelining = True commented out

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

2014-10-24 Thread Jacob Weber
Same results here. I have ansible 1.7.2-2 and openssh-5.3p1-104 (installed from the CentOS Continuous Releases Repository), on CentOS 6.5. On Wednesday, October 15, 2014 6:45:03 PM UTC-7, Kevin Fenzi wrote: > > ansible-1.7.2-1.el6.noarch > openssh-5.3p1-104.el6.x86_64 > > with pipeline disable

[ansible-project] How to copy to remote servers

2014-10-24 Thread vinay . bhasker
I am new to ansible and need suggestion as I how to perform different task in different hosts. I need to setup jdk & wls in one host and move the binaries(jdk/wls) from same server to other servers. I was able to setup on one server(01) but want to move to other hosts(02/03) instead of setting

[ansible-project] include when and variables and Friday and I don't even

2014-10-24 Thread brian
I have a playbook. It's got includes, and tags, and it works. But when I introduce a when it fails. And I'm too slow this long Friday to get what's wrong. https://gist.github.com/bdunbar/82f55ed4f1de76cd3d6e Perhaps I'm going about this the wrong way. I have an existing role (call it 'sftp'

Re: [ansible-project] Re: Merging dictionaries for "environment" parameter

2014-10-24 Thread Evgeny Goldin
Not really. Python doesn't allow to merge two hashes using "{{ env1 + env2 }}". Here's what worked for me: playbooks/filter_plugins/filters.py: def merge( hash_a, hash_b ): return dict(hash_a.items() + hash_b.items()); class FilterModule( objec

[ansible-project] block statements?

2014-10-24 Thread Ian Denhardt
Hey Does ansible have a way of grouping multiple tasks into one (akin to a block statement in many programming languages)? I've several tasks that I want to (a) apply some common options to, such as sudo: yes, and (b) do in a loop (with_items). I could put these in a separate role, but that seems

Re: [ansible-project] Ansible quoting

2014-10-24 Thread Michael Perzel
I tried taking your changes but it failed with: http://schemas.microsoft.com/powershell/2004/04";>C:\Users\ansible\AppData\Local\Temp\ansible-tmp-1414187414.25-97343749557638\de_x000D__x000A_ployLauncher.ps1 : A positional parameter cannot be found that accepts _x000D__x000A_argument 'False'._x00

Re: [ansible-project] Ansible quoting

2014-10-24 Thread Michael Perzel
Your idea with jinja filter is what I originally tried to get working. I never managed it but I think its the ideal solution (converting yaml hash to a powershell one). If I follow your patch you added a parameter that controls whether or not arguments get quoted (and set it to false for power

[ansible-project] when condition based on list

2014-10-24 Thread Jacob Weber
Is it possible to write something like "when: a and b and c", but get the list [a,b,c] from a variable? I have one command that outputs some data, which I register in a variable x. Then I want to see if all items from variable y are included in that output. If I were doing it manually, it might

Re: [ansible-project] include: myplaybook.yml tags=mytag, how to make it work ?

2014-10-24 Thread Alainkr
Okay, I did miss the semantic here. I'd thought it was include "only" the task associated with the tags given. Which incidentally was exactly what I was looking for. The only was to do that ( restrict by tag ) is only on the command line with -t option right ? Thanks Le lundi 20 octobre 2

[ansible-project] Using Ansible with remote nodes running Windows 7

2014-10-24 Thread skinnedknuckles
Has anyone succeeded at running ansible with a remote node running Windows 7? I'm having problems getting win-ping to work in this configuration. I've tried Fedora 20 and CentOs7 with Ansible 1.8. My inventory and windows.yml files are good and I've run pip install http://github.com/diyan/p

[ansible-project] Variable Definition Question

2014-10-24 Thread Jamal B
All, I'm new to Ansible so forgive me if this is already answered as I was unable to find a solution with my research. I have an application which uses a Java properties file (/usr/local/app/app.properties) which contains key/value pairs like so: THRESHOLD=75 NUM_THREADS=3 REAPER_COUNT=1 The a

[ansible-project] Module aliases, and the module docs formatter showing In core vs extras, etc

2014-10-24 Thread Michael DeHaan
As requested by Monty and Eric, among others, I'm proposing the following on the development branch: - the module docs formatter shows "core" vs "extras" modules in the index in different columns. - the plugin loader learns about "aliases", so renamed modules can be found even though the module

Re: [ansible-project] Is aptitude really needed?

2014-10-24 Thread Michael DeHaan
I came from running Debian a long time ago, and have been an apt-get user for a long time. Aptitude support came in with a patch for upgrade modes, as is noted below. If these can be done without aptitude cleanly, I am quite open to it, unless other longtime Ubuntu/Debian folks have suggestions a

Re: [ansible-project] Is aptitude really needed?

2014-10-24 Thread Serge van Ginderachter
On 24 October 2014 16:29, Goran Jurić wrote: > I am running multiple services on lean (minimal) containers on Debian and > aptitude package needs to be installed on the target system if you want to > run: > > "apt: upgrade=full" command > > Is there a command that does the same but uses apt-g

Re: [ansible-project] tags and role dependencies

2014-10-24 Thread James Cammarata
Hi Daniel, Michael and I ran through this and we agree this is operating as expected, since tags applied directly to tasks (like your include statements in tasks/main.yml) are not applied to dependent roles (nor would we expect them to be). So, as I suggested in my reply, you just need to add what

[ansible-project] Re: Using yum module to install latest or defined version of a package

2014-10-24 Thread Gaston Acosta
Hi all, I resolve this using something like this: yum: pkg=httpd-{{ httpd_version | default('*') }} state=latest as the documentation says : "Package name, or package specifier with version, like name-1.0. When using state=latest, this can be '*' which means run: yum -y update. You can also pa

Re: [ansible-project] How to use ec2 modules user_data field?

2014-10-24 Thread Erick Barros
I got the following error: ERROR: Syntax Error while loading YAML script, /etc/ansible/playbooks/search /roles/aws/tasks/main.yml Note: The error may actually appear before this position: line 13, column 17 state: running user_data: """#!/bin/bash ^ This one looks easy to f

[ansible-project] Is aptitude really needed?

2014-10-24 Thread Goran Jurić
I am running multiple services on lean (minimal) containers on Debian and aptitude package needs to be installed on the target system if you want to run: "apt: upgrade=full" command Is there a command that does the same but uses apt-get instead? Installing aptitude pulls in a bunch of depe

Re: [ansible-project] fetch module - hostname instead of ip in the filesystem tree?

2014-10-24 Thread Michael Warkentin
Hey Michael, thanks for the reply. I've opened ansible#9415 to track this. On Friday, October 24, 2014 9:42:51 AM UTC-4, Michael DeHaan wrote: > > "if there's any way to use the hostname of a server rather than it's IP > to generate the file syste

Re: [ansible-project] tags and role dependencies

2014-10-24 Thread Daniel Wendler
The version is ansible 1.7.2 (1.7.2+dfsg-2~bpo70+1 - installed from distri repo debian wheezy) Yes, i narrowed the scope of my tag because i want to run only an subset of tasks of the role. But as this are tasks in the monitoring role, i was expecting the dependency is triggered an the monitori

Re: [ansible-project] fetch module - hostname instead of ip in the filesystem tree?

2014-10-24 Thread Michael DeHaan
"if there's any way to use the hostname of a server rather than it's IP to generate the file system tree when using the fetch module?" Yeah, It should use the inventory name anyway. I'd file a bug on this one at github.com/ansible/ansible -- it's a small bug, and the workaround above will do, but

Re: [ansible-project] Problem with SSH Forwarding using Ansible and Vagrant

2014-10-24 Thread Michael DeHaan
"I'm trying to use SSH forwarding to clone some private repos from github using Ansible on a Vagrant instance but it fails" Would it be possible to put your private key on the development machine, since it's local to you anyway? You could then use the key_file parameter and save yourself the trou

Re: [ansible-project] Continu running tasks after a failure without ignoring?

2014-10-24 Thread Michael DeHaan
Ansible internally fails on errors as a key design feature. Any tasks you want to ignore would need the "ignore_errors: True" flag on those specific tasks. I'm sorry if you don't like how that was flagged in the stats, but we can't change that. On Thu, Oct 23, 2014 at 7:14 PM, Matt Madrid wro

Re: [ansible-project] Re: how to handle repeated module parameters?

2014-10-24 Thread Michael DeHaan
Michael, You can't make up syntax and just have it automatically passed to the modules, the original poster is asking about passing parameters repeatedly to OpenStack. Thomas, To at least clean up your playbook, define a variable: vars: auth_url: "{{ lookup('env', 'OS_AUTH_URL') }}" Etc.

Re: [ansible-project] Re: Ansible and make all command

2014-10-24 Thread Michael DeHaan
This failed because you have a command returning "rc":2. It did not time out. "There seems to be an environment difference from when Ansible does SSH to execute the command versus what you are doing locally" Ansible does not load the remote environment intentionally. See http://docs.ansible.com/

Re: [ansible-project] Re: ec2_snapshot question: how to run only when needed?

2014-10-24 Thread Michael DeHaan
Hi Ted, We'd be happy to consider a pull request to ansible/ansible-modules-core (We would like to avoid cluttering up the tracker with feature requests as usually folks are unlikely to scratch itches of others) ansible-devel list is the right forum to discuss what form this maybe should take.

Re: [ansible-project] Error running ec2.py script

2014-10-24 Thread Michael DeHaan
No closing quotation has little to do with AWS parameter usage, but error handling is greatly improved in numerous cases in the 1.7.X series. On Thu, Oct 23, 2014 at 2:48 PM, Christian Laguerre wrote: > Bruce, > > You may want to run a more recent version Ansible. There a a lot of > parameters

Re: [ansible-project] Retrieving Organization name in playbook - Ansible Tower

2014-10-24 Thread Michael DeHaan
(For completeness that support address is supp...@ansible.com) On Thu, Oct 23, 2014 at 12:49 PM, James Cammarata wrote: > This was forwarded to the Ansible Support address. The ansible-project > group is for core/module questions only. > > Thanks! > > On Tue, Oct 21, 2014 at 2:12 PM, Martin He

Re: [ansible-project] Usage of 'npm install' on centos 6.3 , getting error

2014-10-24 Thread Michael DeHaan
"If you're running from the source installation of Ansible, make sure that you've run "git submodule update --init", as we have moved the modules into their own repositories." Ansible will report if it detects it can't find modules, so if this does fix this for you, and you did not get an appropri

Re: [ansible-project] Issue creating Cloudwatch alarms

2014-10-24 Thread Michael DeHaan
Also, a traceback is always a bug, please file a ticket on this in the ansible/ansible-modules-core repo so we can catch it. On Thu, Oct 23, 2014 at 11:07 AM, James Cammarata wrote: > Hi Stephen, > > That's a very odd error, since the boto docs ( > http://boto.readthedocs.org/en/latest/ref/clo

Re: [ansible-project] How are debug: var=vars / var=hostvars supposed to work?

2014-10-24 Thread Michael DeHaan
"but wouldn't we want debug: var=hostvars to not come from the cache and be the latest truth of what is contained in hostvars" Serge mispoke a bit above. The problem is not that hostvars is a cache, but rather that hostvars is an object that provides access to individual variables. We aren't rea

Re: [ansible-project] Re: extra_vars don't override inventory variables in templates (continuing #9242)

2014-10-24 Thread Michael DeHaan
Trying to sort through the email storm here :) Yes, vars_files and such will evaluate all the variables it can *So that they may be used* if possible early, as that is often the case. While it doesn't help your question, I would try to not complicate your infrastructure so much, it's hard to say

Re: [ansible-project] fetch module - hostname instead of ip in the filesystem tree?

2014-10-24 Thread Michael Warkentin
Thanks James, I'll give that a try! Sorry about the double-post as well - I didn't realize that the forum was moderated, so I thought there was a glitch when I submitted my first message. On Thursday, October 23, 2014 11:52:13 AM UTC-4, James Cammarata wrote: > > Hi Michael, > > One way you can

Re: [ansible-project] npm is not a legal parameter at this level in an Ansible playbook

2014-10-24 Thread Michael DeHaan
Hi Michael, That should not be a problem because Ansible will self-report and give a helpful error when it can't find modules this way. ansi, How did you install Ansible? On Wed, Oct 22, 2014 at 4:20 PM, Michael Peters wrote: > Sounds like you're running ansible from a git checkout. If th

Re: [ansible-project] tags and role dependencies

2014-10-24 Thread Michael DeHaan
I'm not sure that's intuitive. By tagging all things with "monitoring", everything should get a "monitoring". additionally, the included tasks add a "monitoring:crc" I would expect tags should be additive, and "narrowing the scope of your tags" is not a thing that should be a language concept IM

Re: [ansible-project] tags and role dependencies

2014-10-24 Thread James Cammarata
This is happening because you have narrowed the scope of your tags, and the dependent role is only inheriting the "monitoring" tag from its parent role. If you still need to have your deps run when other tags are specified, you can add them to the list of tags on the dependency: - dependencies:

Re: [ansible-project] tags and role dependencies

2014-10-24 Thread Michael DeHaan
For starters, ansible --version output? On Fri, Oct 24, 2014 at 5:29 AM, Daniel Wendler < daniel.wendler@gmail.com> wrote: > Hello @all, > > i have an strage behavior with role dependencies and tags. > I have an playbook like this: > > --- > - name: install and configure a basic set of tools

[ansible-project] tags and role dependencies

2014-10-24 Thread Daniel Wendler
Hello @all, i have an strage behavior with role dependencies and tags. I have an playbook like this: --- - name: install and configure a basic set of tools gather_facts: true hosts: - is roles: - { role: monitoring, tags: monitoring } - { role: other, tags: other } In the "mo

[ansible-project] Problem with SSH Forwarding using Ansible and Vagrant

2014-10-24 Thread Navid Paya
Hi all I'm trying to use SSH forwarding to clone some private repos from github using Ansible on a Vagrant instance but it fails. Here are the involved artifacts. I've read pretty much all the related Google searches but can't figure out what's wrong after a couple of days. Vagrantfile

Re: [ansible-project] A module to get Ansible facts from SNMP devices - Feedback requested

2014-10-24 Thread Patrick Ogenstad
Hi Michael, Thank you for your comments! I'll do some changes to the code. Great about the require_together feature! I'll change the OID numbers to constants instead, for some of these basic values there are (or should be) some preloaded MIBs with pysnmp. However this could add another dependen