[ansible-project] Re: Bug with composer module on OSX

2014-07-09 Thread Andrew Udvare
What is composer_dir? I have a feeling you are pointing to the wrong file (as in not the real phar file). The real phar looks like it's on your system at /usr/local/Cellar/composer/1.0.0-alpha8/libexec/composer.phar On Tuesday, 8 July 2014 19:48:44 UTC-7, Cameron Junge wrote: Hi All, I

[ansible-project] Re: Stop service before copying config file?

2014-07-09 Thread Andrew Udvare
Not sure what you mean. You are saying a service call to stop can change a configuration file that is not really related. This is what I think you mean. someservice can sometimes change /etc/sometimesrc # Capture the MD5 or something similar in one task before stopping the service (Linux, OS X

[ansible-project] Re: Windows Support Stage 2: Engage Battlestations!

2014-07-09 Thread Andrew Udvare
I would find this interesting (even though I only have a few boxes for real Windows) but due to how different things are between Windows and basically everything else, I think it pretty much requires a new project. The other issue is reliability handling errors and pre-provisioning (which maybe

[ansible-project] Re: setting PATH in user crontab

2014-07-09 Thread Andrew Udvare
Depends on what cron implementation you are using. If vixie-cron, you can literally put PATH in the crontab line (not that I really recommend this). If cronie you can put environment variables at the top of crontab files but they apply to all commands there. This also works with vixie-cron. If

[ansible-project] Issue filtering by hosts group if host in both static and dynamic inventory

2014-07-09 Thread Pedro Romano
I am having trouble filtering hosts (using the --limit switch) in the command line by specifying the static inventory hosts group that the hosts are part if said hosts are also returned by the Google Compute Engine dynamic inventory script. I have to specify the individual hosts instead as a

[ansible-project] Parameterize the HostName HostKey in the hosts file

2014-07-09 Thread Suresh Katta
Hi, I'm a newbie in Ansible and trying for a solution to this issue. We have a jenkins server on one machine which is connected to all the Dev, Test Prod instances. So now on Jenkins Server, by using the Jenkins UI we will be able to deploy / configure the instances using playbooks created

[ansible-project] How to keep the content returned by uri from being printed in the console?

2014-07-09 Thread Behrang Saeedzadeh
Hi all, Is there a way to stop Ansible from printing the content returned from a uri in the console and have return_content=true? Thanks in advance, Behrang -- You received this message because you are subscribed to the Google Groups Ansible Project group. To unsubscribe from this group and

Re: [ansible-project] --skip-tags equivalent inside playbooks

2014-07-09 Thread C. Morgan Hamill
Excerpts from Dmitry Makovey's message of 2014-07-08 18:49:22 -0400: Hi everybody, http://docs.ansible.com/playbooks_tags.html mentions several ways to use tags, one of which is: - { role: A, tags: [t1, t2] } This doesn't do what you think it does. It applies tags 't1' and 't2' to all

Re: [ansible-project] problem with ansible bastion hosts /playbook connectivity

2014-07-09 Thread Henry Finucane
On Jul 9, 2014 6:48 AM, Simon Tyler simon.systems.supp...@gmail.com wrote: ok i havent used Ansible before. Are you saying I don't have to pass any switch to use SSH; it uses Paramiko and if it doesn't find a hostname, it tries ssh config? it just keeps giving me the errorNo hosts matched,

Re: [ansible-project] Using register with exact_count when launching an instance on EC2

2014-07-09 Thread Michael Peters
Try using debug on ec2_info to see what it contains. It seems that instances is coming back with a list of strings and not a list of objects like you thought. On Wed, Jul 9, 2014 at 4:50 AM, Ofer Herman ofe...@gmail.com wrote: Hi, I'm using exact_count when creating an instance on EC2, when

Re: [ansible-project] problem with ansible bastion hosts /playbook connectivity

2014-07-09 Thread Henry Finucane
Ansible only wants to talk to hosts in its inventory. If you want your inventory to be your ssh config file, there is a dynamic inventory script called 'ssh_config.py' that ships with ansible that will do that for you. On Jul 9, 2014 7:56 AM, Simon Tyler simon.systems.supp...@gmail.com wrote: ok

Re: [ansible-project] Parameterize the HostName HostKey in the hosts file

2014-07-09 Thread Henry Finucane
If you have a separate inventory for dev, test, and prod, you could have jenkins choose the environment, and keep the hostnames, etc, in the inventory. On Jul 9, 2014 6:06 AM, Suresh Katta kattasureshku...@gmail.com wrote: Hi, I'm a newbie in Ansible and trying for a solution to this issue.

[ansible-project] Copy module not working with sudo or su

2014-07-09 Thread Alberto Losada Grande
Hi all, I can't find why my code is not working when running copy with another user than root. It works fine with root and also other modules like template or yum are working fine with no root permissions I tried with sudo and then move to su with no luck... thanks in advance! Error:

[ansible-project] trying to nest loop with a hash

2014-07-09 Thread Alainkr
Hello, Want I'd like to do is something like that : - name: firewalling allow from loadbalancer ufw: rule=allow from_ip={{item[1]}} proto=tcp to_port={{item[0].value.porthttp}} with_nested: - my_apps_dict - trusted_networks tags: - ufw with my_apps_dict looking like :

Re: [ansible-project] problem with ansible bastion hosts /playbook connectivity

2014-07-09 Thread Simon Tyler
Hi Henry, I am most definitely stupider than normal; I blame a recent pigeon infestation and the resulting lack of sleep. I did not find that script on my system, so I downloaded it from here https://github.com/ansible/ansible/blob/release1.6.2/plugins/inventory/ssh_config.py. It appears to

Re: [ansible-project] trying to nest loop with a hash

2014-07-09 Thread Serge van Ginderachter
On 9 July 2014 18:37, Alainkr akreienb...@gmail.com wrote: with my_apps_dict looking like : my_apps_dict: app1: porthttp: xxx ... app2: porthttp: xxx ... ... ... and trusted network being a simple list. ​Maybe ​ with_nested: - my_apps_dict.items()

Re: [ansible-project] Helper library for modules written in PHP?

2014-07-09 Thread Andrew Udvare
I have finished the project for now. Just so in case anyone is interested https://github.com/appdynamics/ansible-php . It requires PHP 5.3+ and Composer and all that. The README details everything. Yes, it involves copying over the dependency but that actually is not as bad as I thought. If

Re: [ansible-project] problem with ansible bastion hosts /playbook connectivity

2014-07-09 Thread Henry Finucane
On Wed, Jul 9, 2014 at 10:56 AM, Simon Tyler simon.systems.supp...@gmail.com wrote: Hi Henry, I am most definitely stupider than normal; I blame a recent pigeon infestation and the resulting lack of sleep. I did not find that script on my system, so I downloaded it from here

Re: [ansible-project] Helper library for modules written in PHP?

2014-07-09 Thread Timothy Appnel
Seems like a whole lot of trouble to avoid learning python. I don't see why this is any better or really necessary otherwise. -- 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,

[ansible-project] Intersection of group variables inside a Jinja template.

2014-07-09 Thread Ehtesh Choudhury
I'm using ec2.py as my hostfile and I'm writing the following templating in Jinja2. {% for host in groups[tag_provides_logstash-server] %} # {{ hostvars[host][ec2_ip_address] }} {{ hostvars[host][ec2_tag_Name] }} {% endfor %} # This isn't valid in Jinja2, but is what Im looking

[ansible-project] Ansible windows with PowerShell -ValueError: zero length field name in format

2014-07-09 Thread L Venkatraman
Hi I hit upon an issue using ansible to run PowerShell commands against windows nodes. I followed the instructions and got the basics working. On my linux controller node I had Python 2.6.6 and when running the simple setup module I got this error: python ansible windows -m setup Traceback

[ansible-project] ansible_env.PATH, how is it set?

2014-07-09 Thread cjohnston
Hi Folks, I'm a recent adoptee of Ansible and have found it to be a very productive alternative to both Chef and Puppet. Nicely done. I'm hoping to learn a little more about the fact system and how it works; I'm running a playbook on both CentOS 6.5 and RHEL 6.4 and found the value of

Re: [ansible-project] Can I set ansible_ssh_pass in a task?

2014-07-09 Thread Michael DeHaan
Can Ansible reference two inventories? If both inventories are in the same directory, -i directory_name will load them both. Any number of them can be executable or static (INI based) and group_vars/ and host_vars/ variables in that directory will also be loaded for each. On Tue, Jul 8,

Re: [ansible-project] Stop service before copying config file?

2014-07-09 Thread Michael DeHaan
Here's a way to do it using the stat module that may contain some errors, as I wrote this a little quickly :) - copy: src=foo dest=/path/one.new - stat: path=/path/one get_md5=yes register: one - stat: path=/path/one.new get_md5=yes register: two - shell: mv /path/one.new /path/one

Re: [ansible-project] Re: Windows Support Stage 2: Engage Battlestations!

2014-07-09 Thread Michael DeHaan
On Wed, Jul 9, 2014 at 5:08 AM, Andrew Udvare audv...@gmail.com wrote: I would find this interesting (even though I only have a few boxes for real Windows) but due to how different things are between Windows and basically everything else, I think it pretty much requires a new project. If

Re: [ansible-project] Helper library for modules written in PHP?

2014-07-09 Thread Andrew Udvare
Where did I write about avoiding learning Python? It is obvious you have not read any of this thread nor the project page. On Wednesday, 9 July 2014 12:01:25 UTC-7, Timothy Appnel wrote: Seems like a whole lot of trouble to avoid learning python. I don't see why this is any better or really

Re: [ansible-project] Issue filtering by hosts group if host in both static and dynamic inventory

2014-07-09 Thread Michael DeHaan
There *isn't* an issue with --limit and dynamic groups at all. Can you explain what you are trying in more detail? My guess is you may have named the group something and GCE is returning a different group name, thus you've limited yourself to 0 hosts. Commands and output would be helpful. On

Re: [ansible-project] vmware/esx/vsphere module - planning

2014-07-09 Thread Michael DeHaan
This is actually already in core. On Wed, Jul 9, 2014 at 8:11 AM, kesten broughton kesten.brough...@gmail.com wrote: If you've got a public git branch, i can help with testing and documentation. I've worked with pysphere a bit. kesten On Tuesday, July 8, 2014 6:23:06 PM UTC-5, Corey

Re: [ansible-project] How to keep the content returned by uri from being printed in the console?

2014-07-09 Thread Michael DeHaan
Currently? Don't use verbose mode. There's a pull request to make no_log: True (which disables remote syslog for a task) to also hide local output. On Wed, Jul 9, 2014 at 3:13 AM, Behrang Saeedzadeh behran...@gmail.com wrote: Hi all, Is there a way to stop Ansible from printing the

Re: [ansible-project] --skip-tags equivalent inside playbooks

2014-07-09 Thread Michael DeHaan
Correct. Tags in playbooks apply tags to tasks. --tags means run the things that are so tagged --skip-tags means the opposite On Wed, Jul 9, 2014 at 9:47 AM, C. Morgan Hamill cham...@wesleyan.edu wrote: Excerpts from Dmitry Makovey's message of 2014-07-08 18:49:22 -0400: Hi everybody,

Re: [ansible-project] Parameterize the HostName HostKey in the hosts file

2014-07-09 Thread Michael DeHaan
Take a look at --extra-args. Should be easy to pass parameterized Jenkins parameters down that way. You may also be interested in Ansible Tower that provides more shiny alternatives and also some better access control and credential sharing. On Wed, Jul 9, 2014 at 11:09 AM, Henry Finucane

Re: [ansible-project] Copy module not working with sudo or su

2014-07-09 Thread Michael DeHaan
Update first to the latest Ansible. If you can produce this error with 1.6.5, please file a bug in GitHub, as tracebacks are errors and need to be handled. On Wed, Jul 9, 2014 at 10:24 AM, Alberto Losada Grande alosadagra...@gmail.com wrote: Hi all, I can't find why my code is not

Re: [ansible-project] Using register with exact_count when launching an instance on EC2

2014-07-09 Thread Michael DeHaan
For clarity, this: - debug: var=ec2_info On Wed, Jul 9, 2014 at 11:03 AM, Michael Peters michael00pet...@gmail.com wrote: Try using debug on ec2_info to see what it contains. It seems that instances is coming back with a list of strings and not a list of objects like you thought. On

Re: [ansible-project] trying to nest loop with a hash

2014-07-09 Thread Michael DeHaan
You may need to write a custom iterator lookup plugin for something like that. Not sure what I'd call it. On Wed, Jul 9, 2014 at 1:57 PM, Serge van Ginderachter se...@vanginderachter.be wrote: On 9 July 2014 18:37, Alainkr akreienb...@gmail.com wrote: with my_apps_dict looking like :

Re: [ansible-project] vmware/esx/vsphere module - planning

2014-07-09 Thread kesten broughton
I was referring to the vsphere_clone mentioned, not vsphere_guest which is in trunk https://github.com/ansible/ansible/tree/devel/library/cloud As far as i can tell, vsphere_guest currently only supports creating a vm from .iso What i really need is creating clones from a template. k On Wed,

Re: [ansible-project] ansible_env.PATH, how is it set?

2014-07-09 Thread Michael DeHaan
Hmm.. The path the individual modules run in shouldn't really be of consequence as nearly all executable invocations rely on finding the executables it needs in a specific search path. Ultimately though, ansible is designed to ignore shell preferences unless you have in some way specified to

Re: [ansible-project] Ansible windows with PowerShell -ValueError: zero length field name in format

2014-07-09 Thread Michael DeHaan
Thanks! Can you file this in a github ticket at github.com/ansible/ansible so we don't lose track of this? On Wed, Jul 9, 2014 at 1:36 PM, L Venkatraman venkat@gmail.com wrote: Hi I hit upon an issue using ansible to run PowerShell commands against windows nodes. I followed the

Re: [ansible-project] Intersection of group variables inside a Jinja template.

2014-07-09 Thread Michael DeHaan
In your template above I'd probably just assign a my_hosts variable to the expression to clean up the loop a bit. {# set my_hosts = groups[tag_provides_logstash-server] | intersect(groups[tag_env_dev]) #} {% for host in my_hosts %} etc The other thing you have is the play_hosts variable in

Re: [ansible-project] vmware/esx/vsphere module - planning

2014-07-09 Thread Michael DeHaan
It seems in this case we should try to work the features into the existing module, since they are both about creating guests? On Wed, Jul 9, 2014 at 3:54 PM, kesten broughton kesten.brough...@gmail.com wrote: I was referring to the vsphere_clone mentioned, not vsphere_guest which is in

[ansible-project] Using pre_tasks to install a role right before using it on a managed node?

2014-07-09 Thread Jonathan Rowlands
I don't know if this is a normal use-case but I am using packer.io and the local ansible provisioner to build docker images. I wanted to use a pre_task to actually install the role and then immediately use the role on a managed node. The problem is that *I think* there is a sanity check that

Re: [ansible-project] Helper library for modules written in PHP?

2014-07-09 Thread Timothy Appnel
I've absolutely read over this thread and the project page. You've ported the ansible module helpers to PHP so you can write your modules in PHP rather than learn some Python and use what's already there. -- You received this message because you are subscribed to the Google Groups Ansible

Re: [ansible-project] Using pre_tasks to install a role right before using it on a managed node?

2014-07-09 Thread Brian Coca
not a sanity check, the playbook gets 'compiled' before running.​ -- 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.

[ansible-project] Re: Using register with exact_count when launching an instance on EC2

2014-07-09 Thread Stuart Reynolds
ec2_info.tagged_instances? Does that give all of the instances matching the tag, whether or not they we created in the prior step. Test with: - debug: var=ec2_info On Wednesday, July 9, 2014 1:50:08 AM UTC-7, Ofer Herman wrote: Hi, I'm using exact_count when creating an instance on EC2,

Re: [ansible-project] --skip-tags equivalent inside playbooks

2014-07-09 Thread Dmitry Makovey
On Wednesday, July 9, 2014 1:49:16 PM UTC-6, Michael DeHaan wrote: Correct. Tags in playbooks apply tags to tasks. --tags means run the things that are so tagged --skip-tags means the opposite darn. May I suggest some clarification for the documentation then? The way it is written

Re: [ansible-project] ansible_env.PATH, how is it set?

2014-07-09 Thread cjohnston
Hi Michael, Thanks for the response, I'll try and be a little more concrete about what I'm doing... I'm installing an alternate ruby interpreter using RVM, but only if necessary. To check, I'm first running a command to check the installed ruby version: - name: check ruby version

Re: [ansible-project] Helper library for modules written in PHP?

2014-07-09 Thread Andrew Udvare
On Wednesday, 9 July 2014 14:39:48 UTC-7, Timothy Appnel wrote: I've absolutely read over this thread and the project page. You've ported the ansible module helpers to PHP so you can write your modules in PHP rather than learn some Python and use what's already there. I have written

[ansible-project] facts and callback behaviour

2014-07-09 Thread lupindeterd
Hi, I'm testing the callback feature and somehow they data I'm after(facts) aren't showing up anymore after couple of run. It appears that the setup module wasn't being called anymore. Appreciate for any pointer/hints. setup/facts stopped working after a few run testing on callback feature.

Re: [ansible-project] facts and callback behaviour

2014-07-09 Thread Michael DeHaan
Hmm, don't see why that would be the case. Reading this - there is a on on_setup callback, but the on_runner_ok one should still fire. https://github.com/ansible/ansible/blob/devel/lib/ansible/callbacks.py Better topic for ansible-devel in the future, BTW, if you don't mind. On Wed, Jul 9,

Re: [ansible-project] Using pre_tasks to install a role right before using it on a managed node?

2014-07-09 Thread Michael DeHaan
yeah I can't guarantee this will work even if it happened to work now. A better idea might be to have a requirements file and run ansible-galaxy (the CLI) against the requirements_file to slurp it all in. See ansible-galaxy --help for details. If you have private roles, I recommend

Re: [ansible-project] --skip-tags equivalent inside playbooks

2014-07-09 Thread Michael DeHaan
Now the other question: would it be reasonable to ask for such feature then? It would not :) I think it makes much more sense to explicitly tag things. For instance, think of flickr.com and I tag all pictures in an album vacation, I don't have the ability to take another album and tag pictures

Re: [ansible-project] ansible_env.PATH, how is it set?

2014-07-09 Thread Michael DeHaan
The official RVM project shared a role in Galaxy which may be helpful: https://galaxy.ansible.com/list#/roles/1087 On Wed, Jul 9, 2014 at 6:11 PM, cjohnston c...@architech.ca wrote: Hi Michael, Thanks for the response, I'll try and be a little more concrete about what I'm doing... I'm

Re: [ansible-project] ansible_env.PATH, how is it set?

2014-07-09 Thread cjohnston
Thanks. Unfortunately it only supports Ubuntu. What I ended up doing was: 1) registering a variable the output of: /usr/local/rvm/bin/rvm current - name: get installed ruby command: /usr/local/rvm/bin/rvm current register: rvm_ruby_version changed_when: false 2) creating a fact for the

Re: [ansible-project] facts and callback behaviour

2014-07-09 Thread lupindeterd
On Thursday, July 10, 2014 10:49:04 AM UTC+12, Michael DeHaan wrote: Hmm, don't see why that would be the case. Reading this - there is a on on_setup callback, but the on_runner_ok one should still fire. https://github.com/ansible/ansible/blob/devel/lib/ansible/callbacks.py Better

[ansible-project] How to skip local_action if file exists?

2014-07-09 Thread Stuart Reynolds
I'm trying to write a set of tasks to create an ec2 key_pair (if one doesn't exist) and save it to svn. Sadly, ec2_key is quite slow for me, even if the key already exists (maybe my network?). How can I prevent this task step from being run if I already have a key file locally? ... other

Re: [ansible-project] Ansible windows with PowerShell -ValueError: zero length field name in format

2014-07-09 Thread L Venkatraman
Welcome ! Sure I shall have filed a ticket. -Venkat On Thursday, 10 July 2014 01:27:50 UTC+5:30, Michael DeHaan wrote: Thanks! Can you file this in a github ticket at github.com/ansible/ansible so we don't lose track of this? On Wed, Jul 9, 2014 at 1:36 PM, L Venkatraman