Re: [ansible-project] Inventory updates not appearing after provisioning ec2 instance

2014-08-06 Thread Steven Ringo
Having a look at the inventory file immediately after the machine is provisioned, it does in fact update correctly. However it appears that the inventory file is run/read only once at the beginning of a playbook, so it will not reflect the new host if the deploy playbook is run by including it

[ansible-project] Inventory updates not appearing after provisioning ec2 instance

2014-08-06 Thread Steven Ringo
Hi, After provisioning a machine on ec2 module, the inventory doesn't reflect the new host (using ec2.py). I am using a tag_name for the target host that comes from the inventory. I have tried all of the following: - pause of 60 seconds after provisioning. - local_action to refresh the c

Re: [ansible-project] Module to get directory from path?

2014-08-06 Thread Steven Ringo
Hi, Great, thanks. Clearly I didn't look hard enough in the documentation: http://docs.ansible.com/playbooks_variables.html#other-useful-filters Steve On 7 Aug 2014, at 11:31 am, Matt Martz wrote: > Ansible includes a |dirname filter that will do this for you. > > On Wednesday, August 6, 20

Re: [ansible-project] Module to get directory from path?

2014-08-06 Thread Matt Martz
Ansible includes a |dirname filter that will do this for you. On Wednesday, August 6, 2014, Steven Ringo wrote: > Hi, > > I wish to pass in a parameter for a file, e.g: > * /var/log/atlas/service.log* > > The directory at */var/log/atlas/* must also be created before the > application writes to

Re: [ansible-project] ansible doesn't support commands containing special letters

2014-08-06 Thread Greg Andrews
Have you tried the shell module instead of the command module? On Wed, Aug 6, 2014 at 5:38 PM, 曹锐创 wrote: > such as "ls && cd .." and " if [ ! -d "/myfolder" ]". so some command can > be run at the terminal but not in ansible, sometimes we have to write a > script file to enable the command. >

[ansible-project] ansible doesn't support commands containing special letters

2014-08-06 Thread 曹锐创
such as "ls && cd .." and " if [ ! -d "/myfolder" ]". so some command can be run at the terminal but not in ansible, sometimes we have to write a script file to enable the command. Personally thinking, I think this feature could be improved. -- You received this message because you are subscrib

[ansible-project] Module to get directory from path?

2014-08-06 Thread Steven Ringo
Hi, I wish to pass in a parameter for a file, e.g:* /var/log/atlas/service.log* The directory at */var/log/atlas/* must also be created before the application writes to this file. Is there a way to get the directory from the path, perhaps with a jinja2 filter? Or if anyone knows of a filter th

Re: [ansible-project] Templated file used as variable?

2014-08-06 Thread AJ Daws
I created a simple example to demonstrate at https://github.com/tdaws/ansible-templated-file-to-var-example. To try it directly, you can git clone https://github.com/tdaws/ansible-templated-file-to-var-example && run-me.sh Or you can browse the files directly. The run-me.sh script just shows

Re: [ansible-project] VMWare Dynamic Inventory Script

2014-08-06 Thread Michael DeHaan
Yeah currently we have the inventory module using one python module and the provisioner users the other. Both are functional but would be nice to standardize for sure. I don't think it would replace "vsphere_guest" the module at all - we still want the module, but the module can be open to using

Re: [ansible-project] Speed up 'yum' related tasks?

2014-08-06 Thread John Oliver
WOW! Disabling fastestmirror made a HUGE difference! It wouldn't let me remove the package, though... it's a dependency for yum :-( On Wednesday, August 6, 2014 3:53:44 PM UTC-7, Michael DeHaan wrote: > > With Fedora I believe mirrormanager will pick something good for you based > on GeoIP.

Re: [ansible-project] Speed up 'yum' related tasks?

2014-08-06 Thread Greg DeKoenigsberg
On Aug 6, 2014 6:05 PM, "Michael DeHaan" wrote: > > Also, be sure you have yum fastestmirror uninstalled, it usually lies :) > > And if you have PackageKit installed, remove it, since it can occasionally grab a lock. If by "occasionally" you mean "seemingly continuously", yes. :) > > > On Wed, A

Re: [ansible-project] Speed up 'yum' related tasks?

2014-08-06 Thread Michael DeHaan
With Fedora I believe mirrormanager will pick something good for you based on GeoIP. There's even some cool magic for things like IBM internal mirrors if you work for IBM. Not sure about how CentOS works, but EPEL should be using this too. The issue is fastestmirror tends to take a while to figu

Re: [ansible-project] Speed up 'yum' related tasks?

2014-08-06 Thread John Oliver
Thanks, I don't have PackageKit installed, but I do have fastestmirror... I'll try without. Does yum just do some kind of round-robin without it? On Wednesday, August 6, 2014 3:05:40 PM UTC-7, Michael DeHaan wrote: > > Also, be sure you have yum fastestmirror uninstalled, it usually lies :) > >

Re: [ansible-project] Speed up 'yum' related tasks?

2014-08-06 Thread Michael DeHaan
Also, be sure you have yum fastestmirror uninstalled, it usually lies :) And if you have PackageKit installed, remove it, since it can occasionally grab a lock. On Wed, Aug 6, 2014 at 6:05 PM, Michael DeHaan wrote: > Yeah so even though it groups things in one transaction, it calls > repoque

Re: [ansible-project] Speed up 'yum' related tasks?

2014-08-06 Thread Michael DeHaan
Yeah so even though it groups things in one transaction, it calls repoquery a lot because it wants to decide to be idempotent and not run the "update" commands for things it should not need to update. Seth believed this was the right way to go (RIP - you were awesome my friend and helped us immens

[ansible-project] Speed up 'yum' related tasks?

2014-08-06 Thread John Oliver
The 'yum' module is pretty slow for me. That might be an artifact from running my play books against a VM, but running 'yum install a b c d e f' is a lot faster than: - name: Install PHP packages yum: name={{item}} state=latest with_items: - php - php-common - php-xml - php-

Re: [ansible-project] Host Inventory Patterns (Many Hosts) Exclude a single host in between

2014-08-06 Thread Henry Finucane
You could split it into two lines with 25 missing. If you think you're going to be doing a lot of special casing, you should consider a dynamic inventory too. On Wed, Aug 6, 2014 at 5:40 AM, Christian Schmitt wrote: > Hello is there a way to exclude a host inside a Host pattern in a inventory > f

Re: [ansible-project] VMWare Dynamic Inventory Script

2014-08-06 Thread mwinter
You may consider reviewing https://github.com/vmware/pyvmomi, which offers a full rest-api to vsphere. This will enhance or possibly replace vsphere_guest functionality On Wednesday, January 8, 2014 12:29:46 PM UTC-8, Romeo Theriault wrote: > > On Wed, Jan 8, 2014 at 4:05 AM, Brian Coca > wrote

[ansible-project] pagerduty module not working

2014-08-06 Thread Nicolas G
Hi, I'm trying to use the pagerduty module with no luck, when I run the bellow tasks with the right credentials I get a "failed to create the window: HTTP Error 400: Bad Request" : TASK: """ - name: Create a 1 hour maintenance window in PagerDuty pagerduty: name=mydomain user=u...@mydomain.co

[ansible-project] Ansible 1.7 is released and now available!

2014-08-06 Thread Michael DeHaan
Hi everyone! 1.7 is now available! See full information on the release here: http://www.ansible.com/blog/ansible-1.7-is-released-windows-beta-and-more Reminder: this does contain security updates for two separate items, so it's a good idea if you update. Details are in the blog post. Thanks

Re: [ansible-project] Is it possible to jump to the next task without waiting for any Reason Code / Output?

2014-08-06 Thread Karl E. Jorgensen
Hi On Wed, Aug 06, 2014 at 03:00:59AM -0700, Julián Jamardo wrote: > Hi everybody, > > I'm deploying Adobe CQ projects with Ansible, everything works fine except the > restart at the end of the deployment. > > The excerpt of the my playbook: > > - name: Stop of CQ instance > command: sudo

[ansible-project] read multiple variables from dynamically generated file

2014-08-06 Thread Michael Baydoun
I have a playbook that runs on all database servers, gathers information about every database found, does error checking and eliminated duplicates (same db on mulitple servers). The result is an output file that contains three fields for every database "DBNAME SCRIPTNAME HOSTNAME" Next I want

[ansible-project] git checkout and remote rsync

2014-08-06 Thread Quentin Stafford-Fraser
Hi there - A common deployment model I'm using is to checkout a git repo on the target machine and then copy the subdirectory(s) I actually want into position (e.g. under /var/www somewhere) using a remote rsync command. There may be a better way to do this, but here's how I run rsync so that

Re: [ansible-project] msg: Failed to find required executable gem

2014-08-06 Thread Michael DeHaan
If not specified, it will look in the standard system path. Note that ansible will take measures to ensure any user config (.bashrc) is not loaded, because it wants things to be predictable and repeatable, so this would be the normal things like /usr/bin/gem, etc, where you would find gem if you d

Re: [ansible-project] Templated file used as variable?

2014-08-06 Thread Michael DeHaan
"Tried the lookup('file', 'my-user-data.yml') but it does not appear to be parsed by jinja2" Not sure why this would be the case but would need to see the playbook. Needs to be surrounded by "{{ }}" to evaluate of course, which may be part of the problem. On Tue, Aug 5, 2014 at 8:17 PM, Amr Ali

Re: [ansible-project] Conditional register not working

2014-08-06 Thread Michael DeHaan
Can you share what a failure means in the above, any output you have, and what ansible version you are running? Thanks! On Wed, Aug 6, 2014 at 10:02 AM, Manuel Quiñones wrote: > Hi, > > I'm trying to do a conditional register in a playbook: > > tasks: > - shell: echo /opt/cache/www/ >

[ansible-project] Conditional register not working

2014-08-06 Thread Manuel Quiñones
Hi, I'm trying to do a conditional register in a playbook: tasks: - shell: echo /opt/cache/www/ register: www_data when: ansible_hostname | match("^xy-") - shell: echo /mnt/code/www/ register: www_data when: ansible_hostname | match("^az-") - debug: var=www

Re: [ansible-project] Collect playbook results

2014-08-06 Thread Michael DeHaan
Probably the best option is you could write a callback plugin that sends an email. We actually have an example of this that would run when a playbook completes: https://github.com/ansible/ansible/blob/devel/plugins/callbacks/mail.py See the docs for info about writing callback plugins if interes

[ansible-project] Collect playbook results

2014-08-06 Thread Ulrich Schreiner
hi, we currently use ansible with a playbook to install software packages on many servers. the installation is a vendor specific shell-script and we need the output of this script. currently i use the "mail" action to send the output, but with many hosts in my inventory i'm sending many mails.

Re: [ansible-project] Dynamic inventory group as a child of managed group - group_vars unavailable

2014-08-06 Thread Serge van Ginderachter
On 6 August 2014 10:52, Ran wrote: > 2. hosts file consists of: > > [workercommon] > > [tag_worker_1:children] > workercommon > > 3. group_vars has a file workercommon.yml which includes variables. > > - > > The play's pattern references tag_worker_1 (the ec2 group). However the > variables from

Re: [ansible-project] Dynamic inventory group as a child of managed group - group_vars unavailable

2014-08-06 Thread Michael DeHaan
Please note the name of an ec2 tag group will be "ec2_tag_tagName_tagValue" not "tag_tagName_value". This is likely the problem. Using the inventory scripts on the development branch, the tag "ec2_tag_tagName" will also be available containing everything with that tag. Also, mixing dynamic inve

[ansible-project] Dynamic inventory group as a child of managed group - group_vars unavailable

2014-08-06 Thread Ran
I cannot make an ec2 group (via dynamic inventory script) as a child of a managed group defined in hosts. For example: 1. ec2 dynamic script returns a group of "tag_worker_1" 2. hosts file consists of: [workercommon] [tag_worker_1:children] workercommon 3. group_vars has a file workercommo

[ansible-project] Is it possible to jump to the next task without waiting for any Reason Code / Output?

2014-08-06 Thread Julián Jamardo
Hi everybody, I'm deploying Adobe CQ projects with Ansible, everything works fine except the restart at the end of the deployment. The excerpt of the my playbook: - name: Stop of CQ instance command: sudo /etc/init.d/cq stop - name: make sure CQ is stopped service: name=cq stat

Re: [ansible-project] Remove packages

2014-08-06 Thread Christian Rusa
It is really easy just use apt module with state=absent http://docs.ansible.com/apt_module.html On 2014-08-06 10:17, 'Diogene Laerce' via Ansible Project wrote: > Hi, > > Is there a way, other that with a bash script, to do this > command please (in Ansible of course.. :) )? > > $ apt-get remove

Re: [ansible-project] deploying with ansible

2014-08-06 Thread 'Jasper N. Brouwer' via Ansible Project
Hi all! A little introduction for context: I'm a college/employee of Ramon de la Fuente, and we both maintain the f500.* roles in Galaxy. So when I refer to "our module", that's the same module as the one Ramon refers to. I'd like to sum up my thoughts on the discussion so far: - We choose to

[ansible-project] Host Inventory Patterns (Many Hosts) Exclude a single host in between

2014-08-06 Thread Christian Schmitt
Hello is there a way to exclude a host inside a Host pattern in a inventory file? Example, I have the following inventory: [hosts] www[01:50].example.com is it possible to exclude host 25 ? -- You received this message because you are subscribed to the Google Groups "Ansible Project" group.

[ansible-project] How to loop over all elements of a list when elements are not known in advance?

2014-08-06 Thread Valentino Gagliardi
Hello friends I've some lists of elements which contains values like plugin: "someplugin", directive: "somedirective". For reference see Variables: https://github.com/valentinogagliardi/collectd/blob/master/README.md#example-playbook Template: https://github.com/valentinogagliardi/collectd/bl

Re: [ansible-project] Re: Remove packages

2014-08-06 Thread 'Diogene Laerce' via Ansible Project
On 08/06/2014 10:51 AM, Paul Tötterman wrote: > $ apt-get remove package* > > > Reading a bit more carefully, if your problem is with the glob, maybe > try a playbook like this: > > | > --- > -hosts:all > tasks: > -command:dpkg-query -f '${Package}\n'-W 'package*' > register:query

[ansible-project] Re: Remove packages

2014-08-06 Thread Paul Tötterman
> > $ apt-get remove package* > Reading a bit more carefully, if your problem is with the glob, maybe try a playbook like this: --- - hosts: all tasks: - command: dpkg-query -f '${Package}\n' -W 'package*' register: query - apt: name={{item}} state=absent with_items: query.stdout

Re: [ansible-project] Re: Remove packages

2014-08-06 Thread 'Diogene Laerce' via Ansible Project
On 08/06/2014 10:39 AM, Paul Tötterman wrote: > $ apt-get remove package* > > > From : > > | > # Remove "foo" package > -apt:name=foo state=absent Thanks but I did see that. Still it doesn't seem to remove all related packages as the

[ansible-project] Re: Remove packages

2014-08-06 Thread Paul Tötterman
> > $ apt-get remove package* > >From : # Remove "foo" package > - apt: name=foo state=absent > Cheers, Paul -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and sto

[ansible-project] Remove packages

2014-08-06 Thread 'Diogene Laerce' via Ansible Project
Hi, Is there a way, other that with a bash script, to do this command please (in Ansible of course.. :) )? $ apt-get remove package* Thank you, -- “One original thought is worth a thousand mindless quotings.” “Le vrai n'est pas plus sûr que le probable.”

Re: [ansible-project] dynamic inventory / hostvars with shell vars not working w/ 1.6

2014-08-06 Thread Lucas, Sascha
Hi, From: James Cammarata Date: Wed, 6. Aug 2014 04:27 > Hi Sascha, I've just looked into this and the issue has already been resolved > in the devel branch. As Michael said, we'll be releasing 1.7 very soon, and > this fix will be included in that release. Thanks. I can confirm, that this wor