[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.  Good luck for whatever is next.

 On Saturday, January 31, 2015 at 5:56:17 AM UTC+8, Michael DeHaan wrote:

 As some of you may have noticed from my blog and twitter, today is my 
 last day working with Ansible, Inc -- and in the future I'll be around the 
 project a lot less than I have been in the past.   I'll still continue to 
 be a big fan of the project and suspect I'm going to make a lot of use of 
 it!

 http://michaeldehaan.net/post/109595670406/happy-trails-ansible

 While my blog post says this, I want to underscore it again -- this 
 project is about YOU -- and my life has been really happy as a result of 
 it.  Thank you all for all of your contributions, whether ideas, code, bug 
 reports, helping share ansible at meetups, anything!  It's been very cool 
 to watch things spread and to meet a lot of very interesting people as a 
 result.

 If anything I've realized, it's the ansible project is now an alive 
 thing, basically an organism -- and it's going to keep kicking very nicely. 

 James Cammarata, whom you all know, is going to take over project 
 leadership -- and I think it's in fantastic hands.  We've also still got 
 Brian and Toshio from Ansible Inc helping out, who are super awesome as 
 well.  I owe these guys a ton for all the work they have done for the 
 project.

 Thank you all so very much, and I suspect we'll cross paths again.  It's 
 a small world.

 Also, if I have a parting request, please leave cowsay enabled.  It's the 
 right thing to do.

 (also also, if anyone wants to reach me for non-tech support purposes, my 
 personal email is detailed at the bottom of the blog post.)

 Later!

 --Michael 







-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/cb6d0e32-c14c-4994-a060-4f46412e6c8b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Thank you everyone!

2015-01-30 Thread Michael DeHaan
As some of you may have noticed from my blog and twitter, today is my last
day working with Ansible, Inc -- and in the future I'll be around the
project a lot less than I have been in the past.   I'll still continue to
be a big fan of the project and suspect I'm going to make a lot of use of
it!

http://michaeldehaan.net/post/109595670406/happy-trails-ansible

While my blog post says this, I want to underscore it again -- this project
is about YOU -- and my life has been really happy as a result of it.  Thank
you all for all of your contributions, whether ideas, code, bug reports,
helping share ansible at meetups, anything!  It's been very cool to watch
things spread and to meet a lot of very interesting people as a result.

If anything I've realized, it's the ansible project is now an alive thing,
basically an organism -- and it's going to keep kicking very nicely.

James Cammarata, whom you all know, is going to take over project
leadership -- and I think it's in fantastic hands.  We've also still got
Brian and Toshio from Ansible Inc helping out, who are super awesome as
well.  I owe these guys a ton for all the work they have done for the
project.

Thank you all so very much, and I suspect we'll cross paths again.  It's a
small world.

Also, if I have a parting request, please leave cowsay enabled.  It's the
right thing to do.

(also also, if anyone wants to reach me for non-tech support purposes, my
personal email is detailed at the bottom of the blog post.)

Later!

--Michael

-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAM_h8itkvSAe1CgFvDfutc8BE9J1xcTjkjFzd5UUQ5fXOH1Vxg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Customizing how 'su' is used?

2015-01-09 Thread Michael DeHaan
Replacing the name of the command is not presently possible -- Sudo flags
(those sent to sudo) are controllable, however.



On Thu, Jan 8, 2015 at 7:14 PM, Ian Whitney whit0...@umn.edu wrote:

 Can not. This a battle that has come up before.

 Although it's a very different tool, I know that Capistrano I can override
 how it calls certain shell commands. Is such a thing possible in Ansible?
 If so, I could just turn all use of su into sudo su

 On Thursday, January 8, 2015 at 5:46:44 PM UTC-6, Michael DeHaan wrote:

 There aren't any options for sudo + su together.

 Are you sure you can't just sudo user and skip the su'ing?





 On Thu, Jan 8, 2015 at 4:14 PM, Ian Whitney whit...@umn.edu wrote:

 Hi,

 I've been learning Ansible and have run into a behavior that causes
 problems with the server setup here at work. I'm wondering if there's a way
 to fix it.

 On our server I have to run certain commands as an admin user. But I
 can't just switch users with 'su superuser'. I have to execute su with
 sudo. So, 'sudo su superuser'.

 If I do:

 ansible all -a whoami -R superuser

 Then the command hangs, as the server is asking for a password, which I
 do not have.

 And if I do:

 ansible all -a whoami -s -R superuser

 I get the error message about trying to combine sudo and su.

 Do I have options?

 Thanks,


 Ian


  --
 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...@googlegroups.com.
 To post to this group, send email to ansible...@googlegroups.com.
 To view this discussion on the web visit https://groups.google.com/d/
 msgid/ansible-project/c35ae424-1d2d-4e4c-a6aa-
 b5f64ac12bce%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/c35ae424-1d2d-4e4c-a6aa-b5f64ac12bce%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


  --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/ea5867b7-9094-4ef5-aff5-059e44a22c87%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/ea5867b7-9094-4ef5-aff5-059e44a22c87%40googlegroups.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgy6oC6xsTsGLLr6mUu8TDiHPB8Zg7q6dbYajy4BinFmNQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Ansible tower setup fails (centos 6.5)

2015-01-08 Thread Michael DeHaan
Hi,

Please ask Tower questions to supp...@ansible.com - this list is for the
open source project.   We'll be super happy to help you over there.

Thanks!

--Michael



On Thu, Jan 8, 2015 at 6:33 PM, Guy Knights guy.knig...@gmail.com wrote:

 I just tried to run the latest ansible tower setup (2.1.0) and it failed
 installing redis with the following error:

 TASK: [packages_el | install yum repositories]
 
 ok: [localhost] = (item=
 http://download.opensuse.org/repositories/home:cedric-vincent/CentOS_CentOS-6/home:cedric-vincent.repo)
 = {changed: false, dest: /etc/yum.repos.d/home:cedric-vincent.repo,
 gid: 0, group: root, item: 
 http://download.opensuse.org/repositories/home:cedric-vincent/CentOS_CentOS-6/home:cedric-vincent.repo;,
 md5sum: 6bde4c4761979e3786e068ef764e27e7, mode: 0644, msg: OK
 (306 bytes), owner: root, secontext:
 unconfined_u:object_r:etc_t:s0, sha256sum: , size: 306, src:
 /tmp/tmpLwijnm, state: file, uid: 0, url: 
 http://download.opensuse.org/repositories/home:cedric-vincent/CentOS_CentOS-6/home:cedric-vincent.repo
 }
 failed: [localhost] = (item=
 https://copr.fedoraproject.org/coprs/jlaska/redis-28/repo/epel-6/jlaska-redis-28-epel-6.repo)
 = {failed: true, item: 
 https://copr.fedoraproject.org/coprs/jlaska/redis-28/repo/epel-6/jlaska-redis-28-epel-6.repo
 }

 msg: Unsupported proxy scheme: https. Currently ansible only supports HTTP
 proxies.

 FATAL: all hosts have already failed -- aborting

 I had to edit roles/packages_el/vars/CentOS-6.yml and change the protocol
 for the URL for jlaska-redis-28-epel-6.repo to http from https to get it to
 work.

 Once I fixed the above, the script continued until hitting the following
 error:

 TASK: [postgres | determine if postgresql user exists]
 
 failed: [localhost] = {changed: false, cmd: [psql, postgres,
 -tAc, SELECT 1 FROM pg_roles WHERE rolname='awx'], delta:
 0:00:00.038819, end: 2015-01-08 15:09:26.522631, failed: true,
 failed_when_result: true, rc: 2, start: 2015-01-08 15:09:26.483812,
 stdout_lines: []}
 stderr: psql: could not connect to server: No such file or directory
 Is the server running locally and accepting
 connections on Unix domain socket /tmp/.s.PGSQL.5432?
 ...ignoring

 TASK: [postgres | create the postgresql user for awx]
 *
 failed: [localhost] = {failed: true}
 msg: unable to connect to database: could not connect to server: No such
 file or directory
 Is the server running locally and accepting
 connections on Unix domain socket /tmp/.s.PGSQL.5432?


 FATAL: all hosts have already failed -- aborting

 To fix this I edited vi roles/postgres/tasks/conf.yml and added
 state=started to the postgres service definition ('configure postgresql to
 startup automatically').

 I ran setup.sh again and it got past the previous error but then the
 following happened:

 TASK: [awx_install | create awx database schema]
 **
 failed: [localhost] = {changed: false, cmd: [awx-manage, syncdb,
 --noinput], delta: 0:00:03.017540, end: 2015-01-08
 15:16:46.468519, rc: 1, start: 2015-01-08 15:16:43.450979,
 stdout_lines: [Syncing...]}
 stderr: Traceback (most recent call last):
   File /usr/bin/awx-manage, line 9, in module
 load_entry_point('ansible-tower==2.1.0', 'console_scripts',
 'awx-manage')()
   File /usr/lib/python2.6/site-packages/awx/__init__.py, line 91, in
 manage
   File
 /usr/lib64/python2.6/site-packages/django/core/management/__init__.py,
 line 399, in execute_from_command_line
 utility.execute()
   File
 /usr/lib64/python2.6/site-packages/django/core/management/__init__.py,
 line 392, in execute
 self.fetch_command(subcommand).run_from_argv(self.argv)
   File
 /usr/lib64/python2.6/site-packages/django/core/management/base.py, line
 242, in run_from_argv
 self.execute(*args, **options.__dict__)
   File
 /usr/lib64/python2.6/site-packages/django/core/management/base.py, line
 285, in execute
 output = self.handle(*args, **options)
   File
 /usr/lib64/python2.6/site-packages/django/core/management/base.py, line
 415, in handle
 return self.handle_noargs(**options)
   File
 /usr/lib/python2.6/site-packages/awx/lib/site-packages/south/management/commands/syncdb.py,
 line 92, in handle_noargs
 syncdb.Command().execute(**options)
   File
 /usr/lib64/python2.6/site-packages/django/core/management/base.py, line
 285, in execute
 output = self.handle(*args, **options)
   File
 /usr/lib64/python2.6/site-packages/django/core/management/base.py, line
 415, in handle
 return self.handle_noargs(**options)
   File
 /usr/lib64/python2.6/site-packages/django/core/management/commands/syncdb.py,
 line 57, in handle_noargs
 cursor = connection.cursor()
   File
 /usr/lib64/python2.6/site-packages/django/db/backends/__init__.py, line
 162, in cursor
 cursor = util.CursorWrapper(self._cursor(), self)
   File
 /usr/lib64/python2.6/site-packages/django/db/backends/__init__.py, line
 

Re: [ansible-project] Customizing how 'su' is used?

2015-01-08 Thread Michael DeHaan
There aren't any options for sudo + su together.

Are you sure you can't just sudo user and skip the su'ing?





On Thu, Jan 8, 2015 at 4:14 PM, Ian Whitney whit0...@umn.edu wrote:

 Hi,

 I've been learning Ansible and have run into a behavior that causes
 problems with the server setup here at work. I'm wondering if there's a way
 to fix it.

 On our server I have to run certain commands as an admin user. But I can't
 just switch users with 'su superuser'. I have to execute su with sudo. So,
 'sudo su superuser'.

 If I do:

 ansible all -a whoami -R superuser

 Then the command hangs, as the server is asking for a password, which I do
 not have.

 And if I do:

 ansible all -a whoami -s -R superuser

 I get the error message about trying to combine sudo and su.

 Do I have options?

 Thanks,


 Ian


  --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/c35ae424-1d2d-4e4c-a6aa-b5f64ac12bce%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/c35ae424-1d2d-4e4c-a6aa-b5f64ac12bce%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgy1urkd4qq4GM_2_vQmfUuOoQ%2BHm5tqh19nChYDQ9Km%3DQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] PDF Documentation

2015-01-08 Thread Michael DeHaan
Ansible evolves quickly, and we want to encourage people to be looking at
new versions, understaning the new features, and getting the latest
corrections to the documentation.   Often when looking at module
documentation you'll see a new option added in 1.8 and say Hey, I really
need to consider 1.8 that you would not get exploring the 1.4
documentation -- and as a result, we'd probably get a lot of bug tickets
against an old release we are not maintaining too :)

The documentation is also a great way to communicate with users that are
not on this list, with things like Ansible Fest, being able to share things
like Ansible Galaxy coming out, the preview of the O'Reilly book, and so
on.   These are very important things to us.  Right now, the mailing list
has about 4000 subscribers, but we have hundreds of thousands (if not more)
Ansible users.   The docs are our way of communicating with those folks.

If you need offline module documentation, you are welcome to use
ansible-doc to read the module documentation, which can be used offline.
 man ansible-doc for details.

You can also build a snapshot of the HTML docs for local consumption on
restricted networks by make webdocs from a source checkout after
installing python-sphinx.


On Thu, Jan 8, 2015 at 4:34 AM, Stuart Budd s2b...@gmail.com wrote:

 Thank you for the replies.

 I think that the lack of PDF documentation is a bit disappointing and lets
 does a good product.
 I can not really recommend the client goes with this product and then has
 to produce their own offline PDF documents. I do not think that the idea
 will fly at all well, especially when they are paying for the product.

 Thanks for the replies though.




 On Wednesday, 7 January 2015 22:16:15 UTC, Tom Bamford wrote:

 Personally I find Michael's explanation very reasonable, but admittedly I
 have absolutely no use for PDF documentation. I'm certainly not going to
 print it out.

 If your motivation is to have offline documentation, why not simply build
 it yourself? (see the Makefile)


 On 7 January 2015 at 23:36, Stuart Budd s2b...@gmail.com wrote:

 Thank you Mat

 After reading the referenced post I feel that the reasoning why there
 are no PDF versions of the documentation is more of an excuse really rather
 than a justification.

 There is certainly a case for online documentation.
 There is also a case for PDF versions.
 Everyone else manages to provide PDF versions and really it is the
 professional thing to do.

 Other organisations manage to provide PDF versions for operating
 systems. This is an application. It is far less complex than an OS.
 All software changes. To not provide adequate documentation and use the
 fact that there are ongoing changes is not really very good in my opinion.




 On Wednesday, 7 January 2015 21:03:02 UTC, Matt Martz wrote:

 You may want to see the explanation at https://github.com/ansible/
 ansible/pull/8906#issuecomment-54889577

 On Wed, Jan 7, 2015 at 2:47 PM, Stuart Budd s2b...@gmail.com wrote:

 Why does Ansible not provide documentation in PDF format?

 Other software providers provide  manage to provide PDF versions.
 Red Hat manages to provide PDF versions of their documentation and the
 Linux OS is not static and certainly more complex than Ansible.
 Oracle provides PDF versions of their products documentation.
 CFEngine provides PDF versions of their product documentation.

 The vast majority of software providers manage to provide PDF versions
 of their software products.
  I can not think of any other software provider that does not provide
 PDF versions of documentation.

 The Ansible Tower software has a PDF version of the documentation.
 That is not static.

 I feel that the reason provided of changes are constant is not a
 real reason.

 The online documentation is only available online and therefore
 somewhat limited.
 The providing of PDF versions of documentation is really the
 professional thing to do.

 Maybe it is worth having a re-think as to the reason why Ansible do
 not do this.



 On Wednesday, 7 January 2015 13:17:28 UTC, Brian Coca wrote:

 Docs are available at docs.ansible.com, through the ansible-doc tool
 and man pages, docs are maintained inside the main ansible repo and
 within each module.

 There is no official pdf provided, mostly because it is too static a
 format and changes are constant as ansible continually grows.

 --
 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...@googlegroups.com.
 To post to this group, send email to ansible...@googlegroups.com.
 To view this discussion on the web visit https://groups.google.com/d/
 msgid/ansible-project/d6fd19a2-9c90-47c0-871b-9b456f260067%
 40googlegroups.com
 

Re: [ansible-project] PDF Documentation

2015-01-08 Thread Michael DeHaan
We generate the Tower docs via a different system - but yes, there is a PDF
there.

Just so it's clear that there isn't any favoritism, Tower users don't get
any special PDF of ansible docs either, they are 100% the exact same docs :)

I actually haven't looked into rst2pdf (which apparently supports Sphinx)
-- though I still think there's a lot of value in getting the recent bits
and viewing those, and I think if folks get snapshotted to a particular
version of Ansible, that will eventually result in a degree of frustration.

(Particularly, as libraries change -- API breaks in libraries we use do
happen -- folks need to stay up to date)


On Thu, Jan 8, 2015 at 1:04 PM, Mark Phillips m...@probably.co.uk wrote:

 On Thursday, 8 January 2015 10:34:04 UTC+1, Stuart Budd wrote:


 I do not think that the idea will fly at all well, especially when they
 are paying for the product.


 And when they pay for it (Ansible Tower) they get a PDF ... problem
 solved! :)


   --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/789de41a-dd06-4d29-9162-07f4a53dc631%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/789de41a-dd06-4d29-9162-07f4a53dc631%40googlegroups.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgz8AZOnpXzQz1gjFSote5QTmSa-ispq1GNRjvygmd_V%3Dg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Build automation using ESXi, Ansible, Pysphere

2015-01-07 Thread Michael DeHaan
If you don't want to bake in the ks.cfg (for instance, if you have
different install profiles coming off the same OS), supplying the kernel
argument ks=http://server.example.com/foo.ks also works.



On Wed, Jan 7, 2015 at 11:28 AM, Earl Robinson e...@v-studios.com wrote:

 Parimal,

 To use kickstart you first need to present a boot media which is
 configured to pull the kickstart file
 See:
 http://www.centos.org/docs/5/html/5.2/Installation_Guide/s1-kickstart2-howuse.html

 You can use ansible to present the VM with such bootable media by
 launching it in a VLAN with a PXE boot server which will present the media,
 or by presenting the VM with a CD image with the kickstart file built in.

 I've gone the CD image route with ansible, you can specify a cd image to
 boot like this:

 vsphere_guest:
   vm_hardware:
 vm_cdrom:
   type: iso
   iso_path: DatastoreName/cd-image.iso

 Of course you need to give the vsphere_guest module all other required
 arguments, but this is the simplest way I've found to kiskstart a vm using
 ansible.

 -earl


 On Tue, Jan 6, 2015 at 4:07 AM, Patel Parimal parimalj.pat...@gmail.com
 wrote:

 Hi,
 I am newbie to Ansible.

 I have gone through the online documentation and examples for creating
 new VM on Ansible Docs - vsphere_guest (
 http://docs.ansible.com/vsphere_guest_module.html).

 I want to automate VM creation and OS installation process using Ansible.

 Currently I have VMWare ESXi available which doesn't support VM cloning,
 so I need to create a new VM every time from scratch and install OS(RHEL 6)
 into it.

 Is there any way to provide kickstart file URL in Ansible Playbook (for
 example, static HTTP URL like http://192.168.0.1/ks/ks.cfg) so after
 newly built VM is powered on, OS will be installed into it ?

 Thanks and regards,
 Parimal

 --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/da56aeef-01f0-41f6-8dc9-3cd1bdd138d5%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/da56aeef-01f0-41f6-8dc9-3cd1bdd138d5%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


  --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/CABGf5APRF_HeN%3Dgyvh0UGdBP%2BV8AeLsaXZZR1SYX833C17wrkQ%40mail.gmail.com
 https://groups.google.com/d/msgid/ansible-project/CABGf5APRF_HeN%3Dgyvh0UGdBP%2BV8AeLsaXZZR1SYX833C17wrkQ%40mail.gmail.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgz-ioBDvJAZeRWeS7Mu1hCMvn%2BrbEk8ALpn_KKk5Bwthw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Can core user module be extended?

2015-01-05 Thread Michael DeHaan
Cut-n-paste the entire group.py and user.py files into a custom module,
minus the trouble of having to write it myself. 

Well, to answer the original question, extension in Ansible modules happens
by module_utils/*.py, which exists in the main repo.  So ansible does have
a facility for sharing common code.

Normal remote modules however, cannot be trivially subclassed.

(This does not apply to action plugins, but that's not helpful to your
question in this case)




On Mon, Jan 5, 2015 at 7:26 AM, Alan Ray alan.ray...@gmail.com wrote:

 A good point. I'm not exactly sure how that helps me, though. It seems
 like my options are:
 1. Cut-n-paste the entire group.py and user.py files into a custom module,
 minus the trouble of having to write it myself.
 2. Wait for the merge conflicts to be resolved and for this to make it
 into some sort of development release.
 3. Put together a custom build and installation of Ansible.

 It seems like what I want to do in the short-term is extend the core
 module. Is there a way to extend the core module for just OS X without
 cut-n-pasting the entire user module?

 (I realize I'm repeating my question from my original post here, but I'm
 not seeing how the pull request changes the situation other than it means I
 don't have to write the Darwin implementations myself.)

 Thanks,
 Alan

 On Friday, December 26, 2014 1:49:55 AM UTC-5, Chris Church wrote:

 There's already an open PR to support OS X: https://github.com/ansible/
 ansible-modules-core/pull/66


 On Mon, Dec 22, 2014 at 6:45 PM, Alan Ray alan@gmail.com wrote:

 I'm looking to extend the core user module to work (at least partially)
 with OS X (Darwin). The nearest discussion I can find is about 18 months
 old (https://groups.google.com/forum/#!searchin/ansible-
 project/extend$20module/ansible-project/7SByPqJxa7Q/NVeOAWdAio4J) and
 is pretty negative about the possibility of extending a core module.

 However, I notice that core user module seems to have extensibility
 built in since it automatically selects the best class based on the
 platforms/distributions defined in the subclasses. Short of cut-n-pasting
 the whole user module (1500 lines of code), is there a way of just writing
 the OS X extension and having it be automatically loaded for OS X platforms?

 Thanks,
 Alan

 --
 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...@googlegroups.com.
 To post to this group, send email to ansible...@googlegroups.com.
 To view this discussion on the web visit https://groups.google.com/d/
 msgid/ansible-project/d80faeef-208c-445c-89e8-
 4ffe6b10f4a1%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/d80faeef-208c-445c-89e8-4ffe6b10f4a1%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


  --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/70a7d276-d5e4-4d25-aeb6-9f766c6941ae%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/70a7d276-d5e4-4d25-aeb6-9f766c6941ae%40googlegroups.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgwb2%3DKF6w%3D_vnYcO4dPXNz%3Dtu4wdO16Ly3KB63xxmg40A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: How to write an Ansible task using with_dict in a loop (with_items)?

2015-01-05 Thread Michael DeHaan
I would be tempted to keep it as a dictionary, but just to render the INI
file using the template module.

That way additional lookup plugins can be avoided.

On Mon, Jan 5, 2015 at 7:37 AM, adéaime cetout adm1...@free.fr wrote:

 hello,
 I find very interesting this way of organizing variables for .ini files.

 I wanted to use it myself, so I worked on a plugin that allows to generate
 all the keys of an .ini file in one pass with the inifile module.
 It works fine and I use to manage my OpenStack configuration files.

 I am not a specialist in development, but I think this plugin can be
 useful for everyone, so if someone wants to take over to maintain and
 integrate it into ansible, he is welcome.

 The plugin transforms the hierarchy data in a list (section, key, value)
 for use directly with the inifile module with_inidata as below:

 vars file :
 ...
 glanceapi_conf:
   DEFAULT:
 verbose: {{ image_log_verbose }}
 rabbit_host: {{ amqp_host }}
 rabbit_port: {{ amqp_port }}
 rabbit_userid: {{ amqp_userid }}
 rabbit_password: {{ amqp_password }}
 rabbit_ha_queues: {{ amqp_ha_queues }}
   database:
 connection: mysql://{{ image_db_user }}:{{ image_db_password }}@{{
 db_host }}/{{ image_db }}
   keystone_authtoken:
 auth_uri: http://{{ identity_admin_host }}:{{ identity_api_port
 }}/v2.0
 identity_uri: http://{{ identity_admin_host }}:{{
 identity_admin_port }}
 admin_tenant_name: {{ image_ks_tenant }}
 admin_user: {{ image_ks_user }}
 admin_password: {{ image_ks_password }}
   paste_deploy:
 flavor: keystone
   glance_store:
 default_store: file
 filesystem_store_datadir: /var/lib/glance/images/
 ...



 plugin code :

 # (c) 2014, Pierre-Yves KERVIEL pierreyves.kerv...@orange.com
 #
 # Ansible is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # the Free Software Foundation, either version 3 of the License, or
 # (at your option) any later version.
 #
 # Ansible is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
 # along with Ansible.  If not, see http://www.gnu.org/licenses/.

 # inidata is used to manage ini

 import ansible.utils as utils
 import ansible.errors as errors

 class LookupModule(object):

 def __init__(self, basedir=None, **kwargs):
 self.basedir = basedir


 def run(self, terms, inject=None, **kwargs):
 terms = utils.listify_lookup_plugin_terms(terms, self.basedir,
 inject)

 if not isinstance(terms, dict):
 raise errors.AnsibleError(inidata lookup expects a
 dictionnary , got '%s' %terms)

 ret = []
 for item0 in terms:
 if not isinstance(terms[item0], dict):
 raise errors.AnsibleError(inidata lookup expects a
 dictionary, got '%s' %terms[item0])
 for item1 in terms[item0]:
 ret.append((item0, item1, terms[item0][item1]))

 return ret





 Task code :

 - name: configuration.modify_glance-api_conf_file / modify glance-api.conf
 ini file
   ini_file:
 section: {{ item.0 }}
 dest: /etc/glance/glance-api.conf
 option: {{ item.1 }}
 value: {{ item.2 }}
 backup: yes
   with_inidata: glanceapi_conf




 To use it, simply copy the plugin code with the name dataini in the
 directory defined in /etc/ansible.cfg. This should be
 /usr/share/ansible_plugins/lookup_plugins
 for the Ubuntu distribution and write your tasks as in my example. That's
 all.

 I hope that this plugin will allow you to simplify your ini files
 management.

 Best Regards

  --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/608eaab9-eba1-4d99-b8ee-ab3a21f98c16%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/608eaab9-eba1-4d99-b8ee-ab3a21f98c16%40googlegroups.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgxnpqd7Uqhm2ZNAajw2cXQY4XmcaLyVEjgypb5WpjbBmw%40mail.gmail.com.
For more options, 

Re: [ansible-project] Calculating with Variables?

2015-01-05 Thread Michael DeHaan
for loops in Jinja2 can't be used (with any definition of sanity) in
Ansible playbooks.

They can be used in templates used by the template module.

Let's step back a moment...

Can you remove the recursive reference and just call it actual_free_mem
or something, and see where you are from there.






On Mon, Jan 5, 2015 at 8:48 AM, Tom Bamford t...@atpla.net wrote:

 Hi Ulrich

 How about a ‘for’ loop (in Jinja2) contained as a parameter to the
 set_fact module, iterating the facts you gathered as presented in the {{
 hostvars }} magic variable?

 Regards
 Tom

 On 4 January 2015 at 03:02, Ulrich Hochholdinger 
 ulrich.hochholdin...@gmail.com wrote:

 Hi,
 I just started playing around with ansible and tried to achieve a simple
 operations task with it:

 Iterate over all nodes of my Xen-Cluster -- get free_memory of every node
 and sum up those values.
 next step would be making a decision e.g. spawning a new VM without
 overprovisioning the cluster.

 So I wrote a simple module which collects xm info values as
 ansible_facts. This was easy...

 Next step: write a playbook which sums up one of the collected fact
 (free_memory) -- here I got stuck and have no more ideas how to solve
 this...

 This is a not working idea:

 # vim:ft=ansible:
 ---
 - hosts: Cluster
   vars:
  # should be initially set to zero??
 sum_free_memory: {{ sum_free_memory|int + xm_infos.free_memory|int
 }}
   tasks:
 - name: gather xen facts
   xm_info:

 - name: show free_memory on host
   debug: msg={{ xm_infos.free_memory|int }}

 - name: increment sum_free_memory
   debug: msg={{ sum_free_memory|int }}

 = which obviously doesn't work:
 ERROR: recursive loop detected in template string: {{ sum_free_memory|int
 + xm_infos.free_memory|int }}

 So how can I sum up collected facts from more than one host?

 Cheers
   Ulli


  --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/85495348-c277-40f4-ac7a-bade124f02c6%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/85495348-c277-40f4-ac7a-bade124f02c6%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.

 ​

 --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/CAAnNz0PREA8CCG-n0cvb%3DQMmOfXoWWBvocG%3D0KURMPFf73JqeA%40mail.gmail.com
 https://groups.google.com/d/msgid/ansible-project/CAAnNz0PREA8CCG-n0cvb%3DQMmOfXoWWBvocG%3D0KURMPFf73JqeA%40mail.gmail.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgz%3DtoZ%3D0zWtcgz49Mi86BKqUQ%3D9_eAX0vZQ-6izgKBMeA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] How to include vars files in another vars file?

2015-01-05 Thread Michael DeHaan
There is no facility for a variable file including another.

Jinja2 is also not invoked when reading variable files at that time, so
include won't help.



On Mon, Jan 5, 2015 at 6:17 AM, Mark beanb...@googlemail.com wrote:

 Hi,

 I'm trying to create some sort of factory pattern I guess in my vars files
 for creating Amazon data pipeline jobs. What I want is to have a list of
 dicts, and each one will contain a parameter (step) that I want to be
 different per item. However, since this value is quite large  complicated,
 and will be used for 90% of the items, i don't want to have to duplicate
 this value 40 or so times.

 So, is it possible to include a vars file in another one? I tried using
 jinja2's include function, but it complained that certain variables
 weren't defined because it was trying to resolve the variables in the
 included file. In fact, those variables should be parsed later in the main
 play, now when including one vars file into the main one. I can't use roles
 because this is part of a larger pattern in which the main vars file is
 loaded dynamically depending on another variable.

 Some examples might make clear what I mean.

 Here's my playbook, create-job.yml:

 - name: Create a data pipeline and definition for {{ product }} {{ job }}
   hosts: localhost
   gather_facts: True
   vars_files:
 - vars/pipelines/{{ group }}/env/{{ env }}.yml
 - vars/pipelines/{{ group }}/{{ job }}.yml


 Here's my vars file, job1.yml, for the job1 job:

 template: multiple-emr
 startTime: 03:00:00
 definitions:
 - product: web_v2
   suite: websuite
   {% include default_step.yml %} # how to include default_step.yml?
 - product: db2
suite: dbsuite
   {% include default_step.yml %}
 - product: custom
   suite: customsuite
   {% include custom_step.yml %}
 ... x 40


 And here's the contents of default_step.yml:

 s3_precondition: /raw/data/#{node.myDate}/{{ product }}/
 step:
 - s3://my-bucket/artifacts/emr-jar-2.1.1.jar
 - com.example.SampleEMR
 - -Dinput=s3n://example-{{ env }}-data{{ s3_precondition | replace('node.', 
 '') }}*{{ suite }}_#{myDate}.*.gz
 - -Doutput=s3n://example-{{ env }}-data/intermediate/data/#{myDate}/{{ 
 product }}/{{ suite }}/,
 - -DoutputFormat=json,
 ...


 How can I achieve this with ansible?

 Mark

 --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/cbe7f116-aadf-4d57-94ea-712834cb498a%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/cbe7f116-aadf-4d57-94ea-712834cb498a%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgzTyMeQcBqXVscJjK64i3urvR0ZWz4XHtqwS%3DH8y0AsiQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: Template paths

2015-01-05 Thread Michael DeHaan
This is in template.py which is going to be superceeded by the v2 tree,
unfortunately.

We are unlikely to release this file again in it's current state.





On Mon, Jan 5, 2015 at 2:41 PM, Randy Syring randy.syr...@level12.io
wrote:

  Michael,

 I understand, success always brings with it a requirement to priorities.

 My pull request is only five lines and I believe pretty benign.  Anything
 I can do to make it more likely to get merged in?

 https://github.com/ansible/ansible/pull/9933/files

 *Randy Syring*
 Chief Executive Developer
 Direct: 502.276.0459
 Office: 812.285.8766
 [image: Level 12 Technologies] https://www.level12.io/

  On 01/05/2015 01:22 PM, Michael DeHaan wrote:

 Everything is going to get attention, the question is simply what gets
 attention next :)

  It might help if people quit telling others how good Ansible is, and
 such.  /kidding

  Ultimately we do admit we are concentrating on things that affect the
 most folks first.

 On Sat, Jan 3, 2015 at 2:58 PM, randy.syr...@level12.io wrote:

 I've had the same problem.  There is an issue for it:

 https://github.com/ansible/ansible/issues/7106

 and I have created a patch that will also use the roles directory as a
 base for the lookups:

 https://github.com/ansible/ansible/pull/9933

 However, there are 300+ pull requests sitting out there, I'm a bit bummed
 that it may not get any attention.
  --
 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 to this group, send email to ansible-project@googlegroups.com.
  To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/7815f7bb-c68f-4ed6-aeb6-a6a9c7abb890%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/7815f7bb-c68f-4ed6-aeb6-a6a9c7abb890%40googlegroups.com?utm_medium=emailutm_source=footer.


 For more options, visit https://groups.google.com/d/optout.


  --
 You received this message because you are subscribed to a topic in the
 Google Groups Ansible Project group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/ansible-project/hLBux9z4JbI/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 ansible-project+unsubscr...@googlegroups.com.
 To post to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgy7ct6_B3hMbqmHYSHM8KqdS53u1Bp%2B7Fc497cpPYg3EA%40mail.gmail.com
 https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgy7ct6_B3hMbqmHYSHM8KqdS53u1Bp%2B7Fc497cpPYg3EA%40mail.gmail.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


  --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/54AAE8F8.1010304%40level12.io
 https://groups.google.com/d/msgid/ansible-project/54AAE8F8.1010304%40level12.io?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgy2M3iuSXbzWDhXat%3DT%3DE4fLEYwtBarJkX5880dT9VZAA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: Template paths

2015-01-05 Thread Michael DeHaan
v2 is not open for submissions just yet, plugins are in progress -- we
anticipate this should be ready in about a month or so for helping testing
and development.   There will be an analogous file in the action_plugins
tree, called template.py, and be pretty similar, just a bit nicer.

The main parts are cleaning up the other pieces of code that it uses and
touches it.





On Mon, Jan 5, 2015 at 5:51 PM, Joe Adams adams10...@gmail.com wrote:

 I'm very glad that someone else has run into the same issue. That makes me
 feel that my use isn't totally off the wall.

 This file looks to be the one you'll need but it's pretty empty at the
 moment. I don't think that v2 is mature enough at the moment to accept any
 changes because most of it isn't functional yet from the looks of the code.

 https://github.com/ansible/ansible/blob/devel/v2/ansible/executor/template_engine.py

 I would think that it would actually do a lot of good merging this change
 into the current tree whether or not it gets released. It can always be run
 from a git checkout if the feature is critical. When the template engine
 gets reworked for v2, these changes or considerations would be more visible
 to whoever makes the code change. Just my 2 cents, but I hope it helps.



 On Monday, January 5, 2015 5:07:42 PM UTC-5, Randy Syring wrote:

  Can you point me to the comparable file in the v2 tree?  If you think
 you would approve a similar logic change, I'll work on making it.  Or,
 maybe this issue is already addressed in v2?

 *Randy Syring*
 Chief Executive Developer
 Direct: 502.276.0459
 Office: 812.285.8766
 [image: Level 12 Technologies] https://www.level12.io/

  On 01/05/2015 05:03 PM, Michael DeHaan wrote:

  This is in template.py which is going to be superceeded by the v2 tree,
 unfortunately.

  We are unlikely to release this file again in it's current state.





 On Mon, Jan 5, 2015 at 2:41 PM, Randy Syring randy@level12.io
 wrote:

  Michael,

 I understand, success always brings with it a requirement to priorities.

 My pull request is only five lines and I believe pretty benign.
 Anything I can do to make it more likely to get merged in?

 https://github.com/ansible/ansible/pull/9933/files

 *Randy Syring*
 Chief Executive Developer
 Direct: 502.276.0459
 Office: 812.285.8766
 [image: Level 12 Technologies] https://www.level12.io/

   On 01/05/2015 01:22 PM, Michael DeHaan wrote:

  Everything is going to get attention, the question is simply what gets
 attention next :)

  It might help if people quit telling others how good Ansible is, and
 such.  /kidding

  Ultimately we do admit we are concentrating on things that affect the
 most folks first.

 On Sat, Jan 3, 2015 at 2:58 PM, randy@level12.io wrote:

 I've had the same problem.  There is an issue for it:

 https://github.com/ansible/ansible/issues/7106

 and I have created a patch that will also use the roles directory as a
 base for the lookups:

 https://github.com/ansible/ansible/pull/9933

 However, there are 300+ pull requests sitting out there, I'm a bit
 bummed that it may not get any attention.
  --
 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...@googlegroups.com.
 To post to this group, send email to ansible...@googlegroups.com.
  To view this discussion on the web visit https://groups.google.com/d/
 msgid/ansible-project/7815f7bb-c68f-4ed6-aeb6-
 a6a9c7abb890%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/7815f7bb-c68f-4ed6-aeb6-a6a9c7abb890%40googlegroups.com?utm_medium=emailutm_source=footer.


 For more options, visit https://groups.google.com/d/optout.


  --
  You received this message because you are subscribed to a topic in the
 Google Groups Ansible Project group.
 To unsubscribe from this topic, visit https://groups.google.com/d/
 topic/ansible-project/hLBux9z4JbI/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 ansible-proje...@googlegroups.com.
 To post to this group, send email to ansible...@googlegroups.com.
  To view this discussion on the web visit https://groups.google.com/d/
 msgid/ansible-project/CA%2BnsWgy7ct6_B3hMbqmHYSHM8KqdS53u1Bp%
 2B7Fc497cpPYg3EA%40mail.gmail.com
 https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgy7ct6_B3hMbqmHYSHM8KqdS53u1Bp%2B7Fc497cpPYg3EA%40mail.gmail.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


  --
 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...@googlegroups.com.
 To post to this group, send email to ansible...@googlegroups.com.
  To view this discussion on the web visit https://groups.google.com/d/
 msgid/ansible-project/54AAE8F8.1010304%40level12.io
 https

Re: [ansible-project] Re: Template paths

2015-01-05 Thread Michael DeHaan
Everything is going to get attention, the question is simply what gets
attention next :)

It might help if people quit telling others how good Ansible is, and such.
 /kidding

Ultimately we do admit we are concentrating on things that affect the most
folks first.

On Sat, Jan 3, 2015 at 2:58 PM, randy.syr...@level12.io wrote:

 I've had the same problem.  There is an issue for it:

 https://github.com/ansible/ansible/issues/7106

 and I have created a patch that will also use the roles directory as a
 base for the lookups:

 https://github.com/ansible/ansible/pull/9933

 However, there are 300+ pull requests sitting out there, I'm a bit bummed
 that it may not get any attention.

 --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/7815f7bb-c68f-4ed6-aeb6-a6a9c7abb890%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/7815f7bb-c68f-4ed6-aeb6-a6a9c7abb890%40googlegroups.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgy7ct6_B3hMbqmHYSHM8KqdS53u1Bp%2B7Fc497cpPYg3EA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: win_template and line breaks

2015-01-05 Thread Michael DeHaan
We backed win_template out of the devel branch for the time being, as we
believe it does need to extend/inherit from the existing module, and that
change needs to hold onto the 'v2' tree before it happens.

So, not a bug so much, just yet.

I do very much want to see this in the core, so that will come.



On Mon, Jan 5, 2015 at 12:58 PM, Joey kad...@gmail.com wrote:

 Instead of forcing the replacement, does it make sense to update
 template_from_file to properly read \r\n vs \n? I think it'd be better to
 keep the file as-is regardless of the line endings instead of having to
 turn replacement on/off via parameter. Or is template_from_file something
 from jinja2 that we can't really modify? I haven't looked too far into that
 yet.


 On Saturday, December 27, 2014 3:49:36 PM UTC-8, J Hawkesworth wrote:

 Ok, as it stands, it seems the templating only generates \n line endings.

 Its easy enough to force dos line endings by making a one-line change to
 win_template.py
 after
  resultant = template.template_from_file(self.runner.basedir,
 source, inject, vault_password=self.runner.vault_pass)
 just add
  resultant = resultant.replace('\n', '\r\n')

 However, I'm wondering whether it should be optional.

 Since you have a use case, do you have an opinion on whether something
 like 'force_dos_line_endings' should be a module parameter for
 win_template.  If so I'm guessing defaulting it to True would be the best
 option?

 Jon


 On Wednesday, December 24, 2014 8:52:22 AM UTC, J Hawkesworth wrote:

 I think that should be enough too.  Soon as I get the chance I'll see if
 I can work out what is going on.

 Jon

 On Monday, December 22, 2014 6:50:57 PM UTC, Joey wrote:

 Checked with od and I have \r\n at the end of every line, which I think
 should do it.

 On Saturday, December 20, 2014 9:19:25 AM UTC-8, J Hawkesworth wrote:

 Hmm... not sure the integration tests cover this, could be a bug.

 I'd try using

 od -cx your_template | more

  to make sure you have got CR and LF at the end of your lines to start
 with.  If they are there in the template then please shout, as it sounds
 like it might need a fix.

 Jon



 On Thursday, December 18, 2014 5:48:02 PM UTC, Joey wrote:

 I'm using win_template to copy a text file with a couple variables to
 a windows client. However, it seems to be removing all lines breaks from
 the file. I tried using unix2dos on the template, as well as adding 
 #jinja2:trim_blocks:
 False, but neither one seemed to work. Any other ideas?

  --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/f920615f-b7fd-455a-82aa-9b3dcbd33dbc%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/f920615f-b7fd-455a-82aa-9b3dcbd33dbc%40googlegroups.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgyMCm8v8JMoZ1O9ZCzUn%3DcLO0vTPwLQ4uGF87OHr9aUmg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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

2014-12-19 Thread Michael DeHaan
You're bumping a bit of an old thread.

The trick here is to use fact caching, have one play gather your facts, and
other plays can just rely on those facts.



On Fri, Dec 19, 2014 at 8:38 AM, Dmitry Zelenkovsky 
dmitry.zelenkov...@gmail.com wrote:

 That's exactly what I'm looking for, please implement it with
 gather_facts: force - in playbook to override --limit  --tags settings.
 Is there any way to push it to official release? vote?

 BR
 Dmtiry Z.


 On Saturday, October 18, 2014 1:31:58 PM UTC-7, Craig Tracey wrote:

 I also have this issue with some playbooks that we have.

 Michael, nice work on the caching! While fact caching is definitely
 useful and something that we will likely implement, I also liked the idea
 of 'gather_facts_force.'  Therefore, I have gone ahead an implemented this
 via pull request:

 https://github.com/ansible/ansible/pull/9377

 Let me know what you all think.

 Best,
 Craig

 On Friday, August 15, 2014 10:54:30 AM UTC-4, Michael DeHaan wrote:

 Great!

 Yep, these are part of the live docs now:

 http://docs.ansible.com/playbooks_variables.html#fact-caching





 On Fri, Aug 15, 2014 at 9:21 AM, Thijs Cadier th...@appsignal.com
 wrote:

 Awesome, works like a charm. The docs in this commit were helpful as
 well: https://github.com/ansible/ansible/commit/
 160ddf6b046c1a7976f356ed02d506223b6cd0ae


 On Friday, August 15, 2014 12:33:00 AM UTC+2, Michael DeHaan wrote:

 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.co
 m/msg07964.html




 On Thu, Aug 14, 2014 at 12:26 PM, Thijs Cadier th...@appsignal.com
 wrote:

 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. We need to do it host by host and check the state in between.
 Does anybody know of any workarounds to do this?



 On Wednesday, July 16, 2014 6:28:41 AM UTC+2, Henry Finucane wrote:

 I have a similar problem with a more limited scope- I'd like to be
 able to inspect group variables as applied to hosts without gathering 
 facts
 everywhere- I use them to generate monitoring configuration.

 It's a little intractable because they could be dynamic and depend
 on fact gathered variables, but I'd be happy dealing with that 
 restriction.
 On Jul 15, 2014 9:21 PM, Thijs Cadier th...@80beans.com wrote:

  I'm also running into this. Would be great if there was a way to
 enable fact gathering for all (or possibly a subset of) hosts when 
 scoping
 on tags or hosts. Without something like that you always have to run 
 on all
 machines to be able to get a list of ip addresses of machines for a
 firewall config, for example.



 On Tuesday, September 10, 2013 3:22:34 PM UTC+2, Nick Groenen wrote:

 I have a very large playbook which configures our entire
 infrastructure. Because of this, various steps are tagged so that
 only
 specific parts of the playbook can be run, cutting down on runtime
 when required.

 Parts of this setup use facts/hostvars to automatically create
 correct
 configuration files. For example, nginx config adding all the
 application servers that are defined in the inventory to the
 correct
 upstream definitions, and iptables on the appservers automatically
 opening up the correct ports to the loadbalancers.

 However, when running the playbook with --limit, or --tags, not
 all
 hosts are contacted, and as a result, facts aren't available on
 every
 system in the infrastructure. This causes all kinds of problems
 for my
 setup, obviously.

 Is there any way to force gathering of facts on all hosts, even
 when
 specifying one of these options? Or another way to deal with this
 situation that I haven't thought of?

 Right now, I'm solving it for the --tags case by having one task
 at
 the start of the playbook, which simply calls the ping module and
 has
 every tag that's used listed. This way, this task is kicked off no
 matter which tag is specified, causing facts to be gathered on
 every
 system in our inventory.

 Obviously, this isn't a practical solution however, nor does it
 solve
 the case where limit it used.

  --
 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...@googlegroups.com.
 To post to this group, send email to ansible...@googlegroups.com.

 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/2c0c5d72-1
 32b-4fd4-adfe-448284d02ad5%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/2c0c5d72-132b-4fd4-adfe-448284d02ad5%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more

Re: [ansible-project] run_once per group.

2014-12-19 Thread Michael DeHaan
- hosts: headnode
  tasks:
- ... # run once stuff goes here

- hosts: webservers
  tasks:
- ... # stuff to do to everything

Alternatively:

when: inventory_hostname == groups['webservers'][0]



On Fri, Dec 19, 2014 at 8:55 AM, Nico K. nkrabsh...@gmail.com wrote:

 Hi,

 I have groups of hosts that I copy files to, one those files are copied I
 call a webservice on the groups master; this webservice will call a
 deployment script.
 The problem I'm having is that the webservice call will be made for every
 host but it only needs to be called once per group. The 'run_once' syntax
 doesn't help me since if there are multiple groups it will only run once
 for everything.

 Illustrated

 group1:
 host1
 host2
 host3

 master1

 group2:
 host4
 host5
 host6

 master2

 - task runs to populate host*
 - Webservice on groupX is called for each host
 - When limiting with run_onceonly one group's webservice would be called

 Ideally we would have something like 'run_once_per_group'. The only
 solution I see at the moment is splitting out the webservice call in a
 separate playbook which only runs on the 'masters'.
 Any other ideas / approaches are welcome.

 Thanks,
 Nico

 --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/1351b47c-50f6-496c-8aa4-d8d5c8a270dc%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/1351b47c-50f6-496c-8aa4-d8d5c8a270dc%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgwr%2Bi5%2BJLYj3Xc2NG8GA9pSX%2BYf8VupM18%2BbtL6Uf6Eag%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Using binary data in Ansible Vaults.

2014-12-19 Thread Michael DeHaan
If the primary goal of this is to encrypt the value given to the src of a
copy operation (or template operation), I wonder if there's a better way to
make this happen without needing to shell out to an extra CLI.

It might require vault knowing that a file is not YAML when it is executed
though...



On Fri, Dec 19, 2014 at 5:34 PM, Stephen Gargan steve.gar...@gmail.com
wrote:

 I've been using a pattern of base64 encoded values and jinja templates
 deal with storing binary data in vaults and have put together scripts to
 simplify the process; I've found them pretty useful and figured others
 might get some use out of them.

 https://github.com/sgargan/ansible-vault-tools

 I've considered writing a dedicated module to take the place of the
 playbook and template, but in the meantime this works pretty well.

 regards,

 Steve.

 --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/f0c60c7b-fd99-4333-b628-c7fe39dabfc4%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/f0c60c7b-fd99-4333-b628-c7fe39dabfc4%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgzf3arwbPV2cmKVX0dQTqRO5vJRuzx77TGVbFtj%3DjGvwQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Async Fire and Forget Issues - Ansible 1.7.1

2014-12-19 Thread Michael DeHaan
Well, it wasn't a new feature in 1.8, though there was a bug fixed in the
fire and forget operation when you don't specify a lifetime of the process,
IIRC - I remember you filing it, all the same :)

Let us know if you have the same problem in 1.8, regardless.


On Fri, Dec 19, 2014 at 4:11 PM, Adam Miller maxamill...@fedoraproject.org
wrote:

 On Fri, Dec 19, 2014 at 2:30 PM, Xavier Krantz xak...@gmail.com wrote:
  Hello,
 
 
  I am trying to use the Async capabilities of ansible to fire and
 forget a
  job and then check it later and wait till its end.
  I have followed the example mentioned here :
  http://docs.ansible.com/playbooks_async.html

 Async fire and forget was a new feature in Ansible 1.8 so you'll
 need to update to get that functionality.

 -AdamM

 
  But I am facing an issue and I don't really understand what's happening.
 
 
  The playbook looks like
 
- name: 'MyPlay | Fire and Forget'
  command: /opt/PROGRAM/bin/gremlin -e
  /opt/PROGRAM/scripts/load_graph.grm ...
  async: 1000
  poll: 0
  register: load_graph_async
 
 
- name: 'MyPlay | Check Job'
  async_status: jid={{ load_graph_async.ansible_job_id }}
  register: job_result
  until: job_result.finished
  retries: 30
 
 
 
  The playbook logs look like :
 
  TASK: [MyPlay | Fire and forget] *
  job 759951815367.27671 finished on Host1
 
 
  TASK: [MyPlay | Check Job] *
  fatal: [Host1] = error while evaluating conditional: job_result.finished
 
 
 
  What I do understand is :
   job 759951815367.27671
 
  * 759951815367 is the JobID
  * 27671 is the PID of the wrapper process
 
 
  But when I go on the Host after the failed run, I saw
 
  root 27674  0.0  0.0 136548  3672 ?S21:15   0:00
  /usr/bin/python
 
 /home/USER/.ansible/tmp/ansible-tmp-1419020105.57-13577669747697/async_wrapper
  759951815367 1000 /home/USER/.ansibl
  root 27675  0.0  0.0 136548  3900 ?S21:15   0:00  \_
  /usr/bin/python
 
 /home/USER/.ansible/tmp/ansible-tmp-1419020105.57-13577669747697/async_wrapper
  759951815367 1000 /home/USER/.an
  root 27676  0.1  0.0 138008  7320 ?S21:15   0:00  \_
  /usr/bin/python
  /home/USER/.ansible/tmp/ansible-tmp-1419020105.57-13577669747697/command
  /home/USER/.ansible/tmp/ansible-tm
  root 27677  0.0  0.0 115504  1544 ?S21:15   0:00
   \_
  /bin/bash /opt/PROGRAM/bin/gremlin -e /opt/PROGRAM/scripts/load_graph.grm
  ...
  root 27727 84.0 14.4 4875920 1187256 ? Sl   21:15   0:21
  \_ /usr/lib/jvm/java-7-oracle/bin/java -server -Xms4g -Xmx4g -cp
  /opt/PROGRAM/conf:/opt/PROGRAM
 
 
  So any ideas ?
 
 
  Thanks a lot for your help every one :)
 
 
  --
  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 to this group, send email to ansible-project@googlegroups.com.
  To view this discussion on the web visit
 
 https://groups.google.com/d/msgid/ansible-project/4c29214f-ce7d-4c30-8bdd-4107736a92eb%40googlegroups.com
 .
  For more options, visit https://groups.google.com/d/optout.

 --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/CAA_4i2EGV9fBrwCS3HeN8eoQ_7Axe7Cj-ZTYcnFhkjX-RPJcKg%40mail.gmail.com
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgzzzSqKtv1ZgGAkP8y29D4O5jGMErh1X51cD5LjqLFAsQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Gather facts with delegate_to

2014-12-18 Thread Michael DeHaan
The idiomatic way is:

- hosts: thisserver
  tasks: []

- hosts: webservers
  tasks:
-

Rather than have the delegate_to in there, as that will run once per host
in the host loop and will be very abusive of that extra server or servers

Or just

- hosts: all
  tasks: []

- hosts: webservers
  gather_facts: no  # already done
  tasks:
-


On Thu, Dec 18, 2014 at 10:44 AM, Antoine Rouaze antoine.rou...@gmail.com
wrote:

 Ok, with these two ways I can get the facts like this
 hostvars['mrk-test-sql1']

 Thanks for the help !

 Antoine Rouaze

 On Thursday, December 18, 2014 4:33:37 PM UTC+1, Brian Coca wrote:

 Currently, 2 ways:

 - create a first play that just gathers on all hosts, it can be in
 same file as the current play or not, but it needs to be run on the
 same ansible invocation.
 - enabled fact caching, you just have to have contacted that host
 withing the cache lifetime.



 --
 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-project+unsubscr...@googlegroups.com.
 To post to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/b3a78178-b931-4300-817d-6c6d08a13f89%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/b3a78178-b931-4300-817d-6c6d08a13f89%40googlegroups.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgxmtC_BmrS5nCvNn0JaweWqPL%3D7u6yuc%2BtOvPciux92oA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Should tags work on includes?

2014-12-17 Thread Michael DeHaan
Hi,

This was asked recently.

Tags work on task includes, and roles.

They do not currently do anything on playbook level includes.

This is something we may consider after the current refactoring effort (1.9
timeframe) completes.




On Wed, Dec 17, 2014 at 1:00 PM, Quentin Stafford-Fraser 
quenti...@gmail.com wrote:

 Hello all...

 In the docs here http://docs.ansible.com/playbooks_tags.html it
 suggests that I should be able to add tags to an include statement like
 this:

 ---
 - include: site.yml tags=foo


 This simple playbook works fine unless I try actually doing anything with
 tags, like this:

 ansible-playbook -i hosts foo.yml --tags foo


 which gives me an error:

  ERROR: tag(s) not found in playbook: foo.  possible values:


 The documentation suggests this should work.  Am I doing something foolish?

 Many thanks!
 Quentin

  --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/d636f98b-9ac6-4930-90a3-6d726802293f%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/d636f98b-9ac6-4930-90a3-6d726802293f%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgxkymxQBqqc2gMFZ1_pKSnqOgcDkGpTnGQzXQWGfAGsqg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Should tags work on includes?

2014-12-17 Thread Michael DeHaan
That's a common logical error that I've come across too. Tags aren't
called, they are only applied in playbooks, someone might be able to word
that better.

Unless I didn't follow, I don't think that was the above misunderstanding,
but it is true that the include directive labels things with tags.  It's
just not true you can label tags when you do a playbook include.

(It is true that including doesn't select things with certain tags, as well)

I agree -- Google is rough at search for everything but Google.com -- Gmail
also, grr :)





On Wed, Dec 17, 2014 at 1:16 PM, Quentin Stafford-Fraser 
quenti...@gmail.com wrote:

 Thanks, all...

 I can work around them for now.  Apologies for not seeing the earlier
 message.  I did try searching but didn't find it.  Ironic, on a Google site
 :-)

 Q

  --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/a07dcb84-3785-4e8e-9798-8f5300f5adad%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/a07dcb84-3785-4e8e-9798-8f5300f5adad%40googlegroups.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgwK_dK9%2BzieBuStpwZUEfzZ99gZeedppidcRvfENAg9Bw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: cross-playbook serial?

2014-12-16 Thread Michael DeHaan
Sounds like you are looking for a flag to override --serial to me, which
may be reasonable.

In the meantime, can you just set serial: 1 on each play?

On Tue, Dec 16, 2014 at 12:57 PM, kesten broughton 
kesten.brough...@gmail.com wrote:

 +1
 I have this problem a lot when I use delegate_to with multiple targets
 making a request of a single delegate.  Lock conflicts cause intermittent
 failure.


 On Tuesday, December 16, 2014 9:41:04 AM UTC-6, Hagai Kariti wrote:

 Hi
 I'm running a deployment that consists of different plays, some of which
 are already written that I would like to reuse. There's about one one play
 for each stage:

 1) Remove server from cluster
 2) Shut down the server
 3) Provision a new server to replace it

 When running, I need each set of plays to run on one server at a time, so
 setting 'serial' on the play level isn't enough. I know I can run another
 ansible-playbook instance with the command module, but then I wouldn't see
 the progress for each play. I guess I can copy-paste my existing playbooks
 and play with delegate_to to achieve what I want, but that feels wrong.
 What I'm doing currently is splitting my playbook run to several pieces and
 gluing them with bash, looping when necessary on a single playbook.

 It feels like Ansible doesn't support this use case well currently. Is
 there a better way to solve that than using bash? Are there features in the
 pipeline to help with this case?

 Thanks a lot!


  --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/dc2cc05f-f534-41b6-836e-a6b73cfaa298%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/dc2cc05f-f534-41b6-836e-a6b73cfaa298%40googlegroups.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgymEfmR18H0NVVWeA1T%3Dz0H77vLLDPQ3f0y6g20-jZXRg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] AnsibleFest London CFP closes in less than 2 days

2014-12-16 Thread Michael DeHaan
So far the AnsibleFest London CFP has 3x the submissions than any of our
previous events -- it looks GREAT.

Should you want to submit a talk, competition may be tight, but you have a
couple of days left.

Submissions close 3pm Thursday Eastern Standard Time.

Send your abstracts (one paragraph about the talk and another about you and
your company, etc, is probably enough) to c...@ansible.com

For details on the event (Feb 5th, 2015, Hyde Park) see
http://www.ansible.com/ansiblefest-london

Accepted talks should be announced within a couple of weeks.

--Michael

-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgzbA31NxZMGo4s_-e0f%2B59jHEGRZewS9_Yod%2Bdtf%3Dpf5w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] git diff vault files

2014-12-15 Thread Michael DeHaan
But doesn't solve the issue when I DID edit the file, and want a quick
check to see what I've edited.

I suspect that feature is not going to be a thing, as it would require
comparing the unencrypted versions in memory.

If the implementation is small, we might consider it.




On Fri, Dec 12, 2014 at 10:53 AM, Damjan Georgievski gdam...@gmail.com
wrote:



 On Friday, December 12, 2014 1:28:01 AM UTC+1, Michael DeHaan wrote:

 I'd consider using the new ansible-vault view command to view when you
 don't want to edit -- it's new on the devel branch if not actually part of
 1.8.

 I don't remember :) ... but it may help and avoid writing the script.


 ansible-vault view is in 1.8 yes, very helpful.
 But doesn't solve the issue when I DID edit the file, and want a quick
 check to see what I've edited.


 On Tue, Dec 9, 2014 at 7:45 PM, Toshio Kuratomi tkur...@ansible.com
 wrote:

 I haven't used vault extensively so I've never had to dive into this
 before.  however, I think that either filters or pointing git at an
 external diff tool which you write a short wrapper to do the
 decryption are the ways to do this.  Doing some web searching I do
 notive that other people are using git's filters for similar
 transparent encryption and decryption operations.  For instance:

 https://www.agwa.name/projects/git-crypt/
 http://stackoverflow.com/questions/11575398/how-can-i-
 save-my-secret-keys-and-password-securely-in-my-version-control-system

 Sorry I don't have an out of the box recipe for you but it does seem
 doable with a bit of time and reading.

 -Toshio

 On Tue, Dec 9, 2014 at 8:26 AM, Damjan Georgievski gda...@gmail.com
 wrote:
  Now that we started using vault files for secret data, one of the
 problems
  is that git diff on the vault files gives the whole file as changed
  (understandably).
  The trouble I have now is that I use git diff before I commit to double
  check I didn't change something I didn't want to.
 
  Is there some trick that people are using to git diff encrypted files?

  --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/dacd7bac-3b00-46c6-9310-0bcb4de1c705%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/dacd7bac-3b00-46c6-9310-0bcb4de1c705%40googlegroups.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgwayOCAw4a1%3DcKjt5Z_X7k8ioM8GUEN48dWNxfHQ1kvdA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] sysctl.conf

2014-12-15 Thread Michael DeHaan
Let's not add a new backup parameter.

The existing backup=yes/no parameter that only creates local backups needs
to be overhauled to do remotes, and we can generalize it at this time.



On Fri, Dec 12, 2014 at 12:51 PM, Mzp45 melzerpi...@gmail.com wrote:

 Sure, I'll work on the pull request.

 On Wednesday, December 10, 2014 1:17:42 PM UTC-5, tkuratomi wrote:

 Yeah, I just noticed that backup actually does exist on a lot of the
 file-like modules.  I just hadn't noticed them before.  So yeah,
 adding a backup parameter that does the same thing for sysctl seems
 like a good idea.  Could you open a pull request if you can code it or
 an issue if you can't so that hte idea doesn't get lost?

 Thanks,
 -Toshio

 On Wed, Dec 10, 2014 at 8:20 AM, Mzp45 melze...@gmail.com wrote:
  I was thinking an implementation along the lines of the lineinfile
 module
  where you can edit a file and create a backup at the same time. For the
  sysctl module if you have to edit a sysctl.conf file then a backup
 seems
  like a good failsafe.
 
  On Tuesday, December 9, 2014 7:08:46 PM UTC-5, tkuratomi wrote:
 
  In general, ansible modules do not perform backups of files that they
  modify.  I'm not sure that sysctl is especially special in this
  regard.  Is there a reason you need this for sysctl but not for copy,
  or any of the other modules?
 
  -Toshio
 
  On Tue, Dec 9, 2014 at 7:41 AM, Mzp45 melze...@gmail.com wrote:
   Hello,
   Is there a way to create a backup of /etc/sysctl.conf when making a
   change
   using the sysctl core module? If not can this feature be added?
  
   Thanks
  
   --
   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...@googlegroups.com.
   To post to this group, send email to ansible...@googlegroups.com.
   To view this discussion on the web visit
  
   https://groups.google.com/d/msgid/ansible-project/
 dacf22c0-e242-4cf8-9618-6e9678485f61%40googlegroups.com.
   For more options, visit https://groups.google.com/d/optout.
 
  --
  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...@googlegroups.com.
  To post to this group, send email to ansible...@googlegroups.com.
  To view this discussion on the web visit
  https://groups.google.com/d/msgid/ansible-project/
 d08acda3-d1d5-465e-bb0f-60d301dfca5a%40googlegroups.com.
  For more options, visit https://groups.google.com/d/optout.

  --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/a7f6dbd3-e391-40a7-b457-1b922e0d39b4%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/a7f6dbd3-e391-40a7-b457-1b922e0d39b4%40googlegroups.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgz-d8xvEX5S--035o5UU%3Dp8oMQeUJ9awa0eZp-DPG%2BRvw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Search on AWS inventory and add to hosts

2014-12-15 Thread Michael DeHaan
It would look like this, simply using the add host module to create a new
group based on that pattern.

- hosts: tag_Name_basebox_myteksi_net:tag_Provisioned_False
  tasks:
 - add_host:  key=my_new_dynamic_group_alias

Note that this would only happen in memory, to do other things, you might
wish to use the ec2_tag module to assign new tags as well.

Hope this helps and let me know if there are any questions!




On Sat, Dec 13, 2014 at 4:39 AM, Navid Paya m...@navidpaya.com wrote:

 Hi all
 I have come up with a search on AWS inventory. What I want to do is add
 the resulted instances to using add_host. This is how use ec2.py to find
 the instances:

 ec2.py 'tag_Name_basebox_myteksi_net:tag_Provisioned_False'

 What would the task for this look like?

 --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/3d24cd67-5027-407b-a3f5-633869e710ab%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/3d24cd67-5027-407b-a3f5-633869e710ab%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgzzaMXPcLyy4Jh3itQ8CCSSRo-VqHrpdAc%2B6xufKjb97w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: Best way to manage DNS via ansible.

2014-12-15 Thread Michael DeHaan
Cobbler templated BIND and dnsmasq back in the day without too much
difficulty - you could do this with host variables and a single template
call, where each host has both a variable for it's IP (or just uses the
fact) and has another variable hostname.

Shouldn't need to loop much in the playbook itself at all, just the
template.

dnsmasq is obviously easier to configure if it's sufficient.



On Sun, Dec 14, 2014 at 2:14 AM, Kevin Burton burtona...@gmail.com wrote:

 you know, I guess I could use loops:

 http://docs.ansible.com/playbooks_loops.html#standard-loops

 and define a map from host - IP and then have one loop do the forward DNS
 and another do the reverse.

 On Saturday, December 13, 2014 11:13:23 PM UTC-8, Kevin Burton wrote:

 Since we have all of our cluster in Ansible I want to also manage our DNS
 this way too.

 What I was thinking of is having a playbook that runs before all of our
 other playbooks.

 One issue though is that I'd like a module that does forward and reverse
 DNS with one pass.

 I haven't found any that can do it... the dnsimple module looks nice but
 it can't do forward and reverse DNS.


  --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/ece8e64a-eb04-4e7d-b212-c95761b2f26f%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/ece8e64a-eb04-4e7d-b212-c95761b2f26f%40googlegroups.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgxDcFAy1o%3DduAvuS6nOS6fpN%3DzTxV9sN1f4i0kAVpBJUg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] How to have different settings gather fact in two roles of playbook

2014-12-15 Thread Michael DeHaan
- hosts: whichever
  gather_facts: False
  tasks:
- ... install python ...

- hosts:  whichever
  gather_facts: True # or omit for default
  tasks:
 - ...

The same could be done with roles, or even a playbook that includes
another, like:

- include: setup_python.yml
- include: regular_config.yml

Let me know if you have more questions on this!  Thanks!



On Sun, Dec 14, 2014 at 2:41 PM, Ivan Korjavin korja...@gmail.com wrote:

 I have playbook with a lot of roles,
 A few of them, can't use gather facts cos, no python is avalible at that
 time, this roles use raw and install python.

 But after that another rules must have gather facrs due to using facts in
 templates.

 How to combine this in one playbook?

 --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/fa372782-9e1b-4c0a-8cc4-bb68ab595a25%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/fa372782-9e1b-4c0a-8cc4-bb68ab595a25%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgzpoZhLLpB99WMgyK_THoAo6a7wWwqVG1WpK_U4rMRUiw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Create user on host if is in specific group

2014-12-15 Thread Michael DeHaan
Looks like you may want:

when: users_group[0] in item.groups

You may also just wish to change this:

users_group: admin




On Sun, Dec 14, 2014 at 10:13 AM, Werner Dijkerman werner...@gmail.com
wrote:

 Hi there,

 I'm busy with an module for managing users (With public keys) for my work.

 I've got the following vars:

 users:
  - name: Werner Dijkerman
state: present
uid: 1000
gid: 1000
groups:
  - admin
  - simple_group

 users_group:
  - admin

 And I have the following task:

  - name: Check users state
user: name={{ item.name }}
  state={{ item.state }}
with_items: {{ users }}
when: users_group in item.groups

 When I add the users_group var in an host_group var file (Like
 group_vars/all), the users in that specific group needs te be created on
 the host.

 But when I run the playbook, it keeps skipping.

 What am I missing or doing wrong? I tried to use it with with_subelements
 but it still keep skipping

 Kind regards,

 Werner

 --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/172fcef0-8b37-4366-94ca-7a72b70d3658%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/172fcef0-8b37-4366-94ca-7a72b70d3658%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgwqVrZ4TyE_6E_o04SSQ%2BJL3Z%2B9%2BDDTqfF2Bhr9JQ-dzw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Users isn't created

2014-12-15 Thread Michael DeHaan
Replied to another copy of this one :)

First posts are moderated to prevent spam, so that's why we occasionally
approve duplicate posts.

Sorry for confusion!





On Sun, Dec 14, 2014 at 2:55 PM, Werner Dijkerman werner...@gmail.com
wrote:

 Hi there,

 I'm trying to setup an users role so that it will create users. This is
 not really difficult, but I only want to create users on a host if you are
 in a group.

 I've got the following vars:
 users:
  - name: Werner Dijkerman
state: present
uid: 1000
gid: 1000
groups:
  - admin
  - monitor

 users_group:
  - admin

 And the following task:
  - name: Create user task
user: name={{ item.name }}
  state={{ item.state }}
with_items: {{ users }}
when: users_group in item.groups

 When I run the playbook, it is skipping the Create user task. I know I
 do miss some arguments in the user task. I would expect an error message
 instead of skipping the task.

 So when you are in the admin group, it will create you on the host.
 But this won't work. What am I missing or doing wrong?

 Kind regards,
 Werner

 --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/c8a2f160-68bb-4189-a049-cf6cbc0edcb0%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/c8a2f160-68bb-4189-a049-cf6cbc0edcb0%40googlegroups.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgwQ4FBA%2BjaU%3DcwPB%3D6xASsNerhH7Nd6TvkVA0z7YLHi6A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: Directory always marked as changed

2014-12-15 Thread Michael DeHaan
What version of Ansible were you using?

Thanks!

On Sun, Dec 14, 2014 at 5:09 PM, John Dewey j...@dewey.ws wrote:

  Things work as expected for me in my vagrant test.

 http://paste.openstack.org/show/150780/

 On Sunday, December 14, 2014 at 12:14 PM, Mirko Friedenhagen wrote:

 Hello,

 has no one a hint what might be going wrong :-).
 Regards Mirko
 --
 http://illegalstateexception.blogspot.com/
 https://github.com/mfriedenhagen/ (http://osrc.dfm.io/mfriedenhagen)
 https://bitbucket.org/mfriedenhagen/


 On Wed, Dec 10, 2014 at 8:46 PM, Mirko Friedenhagen
 mfriedenha...@gmail.com wrote:

 Hello,

 I have the following in a role definition for jenkins:

 - name: Ensure jenkins .vnc directory does exist.
 file:
 path: /var/lib/jenkins/.vnc/
 state: directory
 owner: jenkins
 group: jenkins
 mode: 0750

 Whenever I run the playbook, this directory creation is always marked
 as changed.

 Immediately before this I run:

 - name: Ensure jenkins .m2 directory does exist.
 file:
 path: /var/lib/jenkins/.m2/
 state: directory
 owner: jenkins
 group: jenkins
 mode: 0750

 and this one is only created once and marked as unchanged.

 Regards Mirko
 --
 http://illegalstateexception.blogspot.com/
 https://github.com/mfriedenhagen/ (http://osrc.dfm.io/mfriedenhagen)
 https://bitbucket.org/mfriedenhagen/


 --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/CAK8jvqyRA9UdAOKUwP07%3DY4CVbv8nDfWmcBbjOtonY-C8pE9MQ%40mail.gmail.com
 .
 For more options, visit https://groups.google.com/d/optout.


  --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/D9CA400E454447F0A1BFD377CA317CCD%40dewey.ws
 https://groups.google.com/d/msgid/ansible-project/D9CA400E454447F0A1BFD377CA317CCD%40dewey.ws?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgwubHRPQ9A-SkCow3PTs%3D3VZWSB4CuhTW0kUfK61oUc1w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Register data from script Ansible.

2014-12-15 Thread Michael DeHaan
The debug msg keyword is really only there to print simple strings, this
works better:

- debug: var=foo

It can't take complex expressions, but will dump a top level variable.



On Sun, Dec 14, 2014 at 9:36 PM, Timothy Gerla t...@gerla.net wrote:

 Hi Jimmy,

 I think that if you do:

 - name: set the fact
   set_fact:
 keyobject: {{ registerVar|from_json }}

 You should then be able to do keyobject[key]. The complex arguments form
 works because Ansible (for reasons I am not fully understanding) will
 preserve the data structure when passed this way, but not using the
 all-in-one-line form with the equals signs.

 Hope this helps!

 -Tim

 On Sun, Dec 14, 2014 at 2:54 PM, ji...@pristine.io wrote:

 I am going to keep this post short and sweet and hope someone can help me
 wrap my head around how to grab values from key,value pairs returned by a
 script I an running.

 I use the ansible shell: module to run a script that generates and API
 key and ID and prints the results to stdout and then I use register to save
 the data.

 Lets say I use register: or set_fact: to save the results of the
 following command to 'keyobject':

 ./script generatekey bar --bw --obj
 {
   app: bar,
   id: 3aa234234dfadsf2348351,
   key: aeb46dasdfasdfcc9c5e2b031eds2e56c33c7d61efbb071fb06
 }

 When I attempt to do a simple debug: msg={{ keyobject }} it will print
 everything out no problem (with some extra stuff added). But if I try
 something like {{ keyobject['key'] }} or keyobject.key or any other
 multitude of variations on that I am not having much success. It seems the
 json gets mangled or extra info added like 'msg'.

 I am too worn out now to post all of the different things I have tried
 and their resulting failures. I've gotten close but not further than close.
 If this isn't possible let me know and I will stop torturing myself.

 Based on the above output what would you try? I've also tried from_json
 and some other things. I was certain I would have this pegged within a few
 hours but after reading a million posts and trying to figure it out
 unsuccessfully with a co-worker I am feeling defeated :)

 Thanks!

 --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/061a2beb-82a6-4553-8b21-28c1332fefed%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/061a2beb-82a6-4553-8b21-28c1332fefed%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.

  --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/CAH4wdVU8jVOQ%2B0%2BuevCr%3D5KTOrxrfnjtvGo3hOy_9X4%2BHqu4dg%40mail.gmail.com
 https://groups.google.com/d/msgid/ansible-project/CAH4wdVU8jVOQ%2B0%2BuevCr%3D5KTOrxrfnjtvGo3hOy_9X4%2BHqu4dg%40mail.gmail.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgw3fLJjxygyRJE4FVc9PV4eftD7c5rBnYvkoCHuH%3D1sTQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Integrating application level smoke tests with ansible runs

2014-12-15 Thread Michael DeHaan
This is a good read if you haven't seen it already -
http://docs.ansible.com/test_strategies.html

On Mon, Dec 15, 2014 at 4:33 AM, Bryan Berry bryan.be...@gmail.com wrote:

 Dear Ansiblists,

 I need to integrate application-level tests with ansible runs. These test
 are quite specific to that applications we are deploying and go quite
 beyond the existing test support in ansible. The purpose of these tests is
 not to test the ansible code but the entire deployment stack. Running these
 tests as part as part of the ansible playbook makes sense as the ansible
 run knows the location of all created resources. I am happy to go off and
 create this on my own, but I would really like to collaborate if there are
 others working on similar problems. I want to write the tests using plain
 python unittest so it will be familiar to my developers.

 here is an example where i want to test a Consul cluster of 5 nodes. I
 want to verify that the Consul API functions as expected.

 here is a code example of what I am looking to test

 # tests/test_consul.py
 import unittest
 import os.environ
 import requests
 import consul
 import time


 class TestConsul(unittest.TestCase):

   def setUp(self):
 self.members = os.environ['CONSUL_CLUSTER'].split(',')

   def test_nodes_return_same_membership_list(self):
 results = []
 for member in self.members:
   member_list = requests.get('http://member:/v1/cluster/members'
 % member)
   member_list.sort()
   results.append(member_list)
 self.assertTrue(all([True for result in results if result ==
 results[0]))

   def test_kv_put(self):
 c =
 consul.Consul(self.members[0])

 c.kv.put('foo', 'bar')
 # wait for
 replication

 time.sleep(5)
 results = []
 for member in self.members:
   c =
 consul.Consul(member)

   results.append(c.kv.get('foo'))
 self.assertTrue(all([True for result in results if result == 'bar']))



 as you can see, I plan on passing the list of nodes as an environment
 variable, but I would love to hear alternate approaches.

 I currently plan to trigger the running of these tests by an environment
 variable.

 $ RUN_TESTS=TRUE ansible-playbook my-plays.yml

 - name: run tests
   when: {{ lookoup('ENV', 'RUN_TESTS')|bool}}
   roles:
  - execute-tests# executes tests in tests/test_*.py using unittest
 module, yet to be written

 It's really key that my developers be able to write tests using plain
 python code rather than Ansible's YAML. This decouples the tests from
 ansible. AThis could we helpful later if we every choose to run the exact
 same tests later separately from ansible, for example executing them as
 part of regular monitoring.

 Thoughts?

 Regards,

 Bryan W. Berry



  --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/02e8c1c1-cb08-416c-9bf5-907607b529f5%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/02e8c1c1-cb08-416c-9bf5-907607b529f5%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgyNwsvqJOhoikq3hiDjJn%2BRsNG1VD7M%3DabwHX4-EH1MRA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Integrating application level smoke tests with ansible runs

2014-12-15 Thread Michael DeHaan
Yeah in that case, it probably doesn't make sense to have ansible launch
that job, but it could.

Those tests are good for testing an ansible playbook while I am looking to
test the actual API of the services I am spinning up, and in a far more
flexible way. From that page:

In our case, we'll fire off an install of Ansible in Jenkins against a
QA/Stage environment, and then a dependent Jenkins job will launch
automated API and Selenium tests.



On Mon, Dec 15, 2014 at 7:15 AM, Bryan Berry bryan.be...@gmail.com wrote:

 Hi Michael,

 I have read it and I believe we will use some of those testing strategies.
 Those tests are good for testing an ansible playbook while I am looking to
 test the actual API of the services I am spinning up, and in a far more
 flexible way. From that page:

 Something like an integration test battery should be written by your QA
 team if you are a production webservice. This would include things like
 Selenium tests or automated API tests and would usually not be something
 embedded into your Ansible playbooks.

 This is my exact use case, though not using Selenium specifically. We have
 a QA team that will be writing integration tests. I would like run them at
 the end of the ansible run.

 On Mon, Dec 15, 2014 at 1:10 PM, Michael DeHaan mich...@ansible.com
 wrote:

 This is a good read if you haven't seen it already -
 http://docs.ansible.com/test_strategies.html

 On Mon, Dec 15, 2014 at 4:33 AM, Bryan Berry bryan.be...@gmail.com
 wrote:

 Dear Ansiblists,

 I need to integrate application-level tests with ansible runs. These
 test are quite specific to that applications we are deploying and go quite
 beyond the existing test support in ansible. The purpose of these tests is
 not to test the ansible code but the entire deployment stack. Running these
 tests as part as part of the ansible playbook makes sense as the ansible
 run knows the location of all created resources. I am happy to go off and
 create this on my own, but I would really like to collaborate if there are
 others working on similar problems. I want to write the tests using plain
 python unittest so it will be familiar to my developers.

 here is an example where i want to test a Consul cluster of 5 nodes. I
 want to verify that the Consul API functions as expected.

 here is a code example of what I am looking to test

 # tests/test_consul.py
 import unittest
 import os.environ
 import requests
 import consul
 import time


 class TestConsul(unittest.TestCase):

   def setUp(self):
 self.members = os.environ['CONSUL_CLUSTER'].split(',')

   def test_nodes_return_same_membership_list(self):
 results = []
 for member in self.members:
   member_list = requests.get('http://member:/v1/cluster/members'
 % member)
   member_list.sort()
   results.append(member_list)
 self.assertTrue(all([True for result in results if result ==
 results[0]))

   def test_kv_put(self):
 c =
 consul.Consul(self.members[0])

 c.kv.put('foo', 'bar')
 # wait for
 replication

 time.sleep(5)
 results = []
 for member in self.members:
   c =
 consul.Consul(member)

   results.append(c.kv.get('foo'))
 self.assertTrue(all([True for result in results if result == 'bar']))



 as you can see, I plan on passing the list of nodes as an environment
 variable, but I would love to hear alternate approaches.

 I currently plan to trigger the running of these tests by an environment
 variable.

 $ RUN_TESTS=TRUE ansible-playbook my-plays.yml

 - name: run tests
   when: {{ lookoup('ENV', 'RUN_TESTS')|bool}}
   roles:
  - execute-tests# executes tests in tests/test_*.py using
 unittest module, yet to be written

 It's really key that my developers be able to write tests using plain
 python code rather than Ansible's YAML. This decouples the tests from
 ansible. AThis could we helpful later if we every choose to run the exact
 same tests later separately from ansible, for example executing them as
 part of regular monitoring.

 Thoughts?

 Regards,

 Bryan W. Berry



  --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/02e8c1c1-cb08-416c-9bf5-907607b529f5%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/02e8c1c1-cb08-416c-9bf5-907607b529f5%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.

  --
 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 to this group, send

Re: [ansible-project] playbook includes and tags

2014-12-15 Thread Michael DeHaan
Hi Adam,

This looks like it's because you can add tags when pulling in roles, as
well as tasks, but you can't tag a playbook on an include.

It's something that sounds reasonable, but probably not something that has
been done before.

Try this:

- hosts: all
  tasks:
 - include: my_tasks.yml tags=foo

Etc

And should be good to go.

Alternatively:

   roles:
 - { name: foo, tags: [ 'foo', 'bar' ] }

etc



On Mon, Dec 15, 2014 at 7:07 AM, Adam Guthrie asguth...@gmail.com wrote:

 I'm trying to add tags to tasks via includes but it doesn't work as I
 expect. I have

 $ cat site.yml
 #- { include: foo.yml, tags: [ foo ] }
 - include: foo.yml tags=foo

 $ cat foo.yml
 - hosts: all
   tasks:
  - name: foo
debug: msg=foo

 Then

 $ ansible-playbook -i inventory site.yml -t foo
 ERROR: tag(s) not found in playbook: foo.  possible values:

 Same error with 1.8.2 and current devel branch and with the other include
 syntax commented above.

 Any help much appreciated,

 Adam

 --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/066af8dd-6b55-4def-b458-7007a686e941%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/066af8dd-6b55-4def-b458-7007a686e941%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgytk3AyfrHuBAxkOzYBfLfC0M1oys9PVy5t3uCqUORhXA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Template module question

2014-12-15 Thread Michael DeHaan
I am not sure if I scrubbed any/all references to a virtual module yet,
but that what really means is an action_plugin.

The template module for instance consists of componentry that runs on the
ansible control machine (the action_plugin template) as well as the
remote side (the regular module template).

(More of a topic for ansible-devel list really)

Anyhow, the template action_plugin isn't really easily reusable, due to the
way it's written to just pair with the template module on the other side.




On Sun, Dec 14, 2014 at 7:19 PM, Dmitry Moskowski m...@corpix.ru wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA256

 Hello.

 I am writing a custom module that works with files for my needs(it's
 my first module for Ansible) and I want to have templating system
 support. I have looked at template module source code[1] in core
 modules repository and can't understand... where is the actual module
 code and what is virtual module? Maybe someone could provide a
 documentation link on this?

 Thanks.

 1.

 https://github.com/ansible/ansible-modules-core/blob/devel/files/template.py#L1
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v2

 iQIcBAEBCAAGBQJUjikSAAoJELEDc0wJQMdg5CUP/irmmKq0KlsXs2u1i8EczIi8
 AtclOq+VzfhY5VR2JFWqe4XvEkYqdmWnJqp/GiqgVNahXLwYV+oLvW4Ek82uhdnr
 Ojo0bIV+61OdVvqn7gpHdydBr75U1nT0Tkt3A3xLg4za6SsM0EJf39cQVnOmDAAv
 aBybwPxFDCEsvgH5YDQsuVDGGdjsxwMYtGBMIWjrW9t7lcZkpdpfbDThyjCNmZva
 W+ol1xLvht7nz6vpDREHIoAdSV7jOSc6JatC0ga2tYzJD+kColQpEeIJXXSg1lU4
 DP4RtQKzFE/0eHpey3xDaj4SO/QcfwezwFxKe9MpDpUOeil5jK3NELMpgTaV4CpL
 z/TfrYj0HGdnsJx80W9VBL5lLgSPn3CtGy9GfPbX85QK9Md6xtociRk6DtQSgDmo
 b7AhtfVHOU/h3ihYy5BonIrcC0o8GojiiLlT6zLyGmQ1mLR2u9OHjnrRB3xA6Dp3
 XZb5Gf8bTj+hiZzkhfS0inwwW8OxE7BSh2crnLHmTWH4Wm8RcS1LBMi/nfS8b3fR
 EMd3EfY9zOfKMOwXn21qdhdjyEGbh2EPl1SdqqySQwgpFGBeTRqX35lRmQhQXmQM
 9pcnaYkskSP4WDiEh81BOPJjwJIoCdhpxwma3aTR0AdKmAVI3HVHhGKgg/CYeEoZ
 Feno+Lxi6eEWX4MRTb7H
 =buF7
 -END PGP SIGNATURE-

 --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/548E2915.6080601%40corpix.ru
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgyvNCBKj3VNSZW08oWcXzyHqWWe0BYcnFrXB7RKJsGdHQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] URI module / json parsing problem with escaped doueble qoutes

2014-12-15 Thread Michael DeHaan
Hmm, that's curious.

Things like jsonlint pass, but it seems the Python JSON formatter does not
like what you have.

Here's a simple test program:

STRING = 

{ names: [

  nameA,

  \double quoted name\,

  nameB

] }




import json

print json.loads(STRING)


I'm wondering if this might actually not be valid JSON, or just that there
is a bug in the python json library.




2014-12-15 7:09 GMT-05:00 Lucas, Sascha sascha.lu...@gisa.de:

 Hi,

 I'm talking to a REST/json webservice via the URI module. The webservice
 is correctly returning a list like this:

 { names: [
   nameA,
   \double quoted name\,
   nameB
 ] }

 However the uri module does not retrun the json key, because
 json.loads(content) fails. If I comment out try/expect the last line of
 python trace is:

   File /usr/lib64/python2.6/json/decoder.py, line 227, in JSONArray
 raise ValueError(errmsg(Expecting , delimiter, s, end))
 ValueError: Expecting , delimiter: line 371 column 16 (char 10160)

 In the URI module content key, the list looks like this (white space
 truncated):

 \names\: [\n \nameA\,\n \\double quoted name\\,\n \nameB\\n ]

 I asume, that the backslash preserving the double qoute in JSON must be
 escaped it self:

 \names\: [\n \nameA\,\n \\\double quoted name\\\,\n \nameB\\n ]

 Would be nice if someone can provide a quick fix for this problem.

 Thanks, Sascha.

 Aufsichtsratsvorsitzender: Herbert Vogel
 Geschäftsführung: Michael Krüger
 Sitz der Gesellschaft: Halle/Saale
 Registergericht: Amtsgericht Stendal | Handelsregister-Nr. HRB 208414
 UST-ID-Nr. DE 158253683

 Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte
 Informationen. Wenn Sie nicht der richtige Empfänger sind oder diese E-Mail
 irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und
 vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte
 Weitergabe dieser Mail oder des Inhalts dieser Mail sind nicht gestattet.
 Diese Kommunikation per E-Mail ist nicht gegen den Zugriff durch Dritte
 geschützt. Die GISA GmbH haftet ausdrücklich nicht für den Inhalt und die
 Vollständigkeit von E-Mails und den gegebenenfalls daraus entstehenden
 Schaden. Sollte trotz der bestehenden Viren-Schutzprogramme durch diese
 E-Mail ein Virus in Ihr System gelangen, so haftet die GISA GmbH - soweit
 gesetzlich zulässig - nicht für die hieraus entstehenden Schäden.

 --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/383FAD2C9609F74D8F075EFF2B86B57998F2CFD8%40SGIS111.gisa-halle.de
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgw4e%3D1%2Bah34SZXbeXF_OW1r33oDfdHcwSUc_9085YWhLQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] sudo not working

2014-12-15 Thread Michael DeHaan
Replied on the ticket.

I'm sympathetic to the problem but we really do want this on by default.

I'm definitely open to creative solutions.



On Mon, Dec 15, 2014 at 8:19 AM, Roy Smith r...@panix.com wrote:

 I've tracked down what was causing this, and opened a bug on it.

 https://github.com/ansible/ansible/issues/9813




 On Dec 14, 2014, at 4:26 PM, Roy Smith wrote:

 I'm running ansible 1.8.2.  My local machine is running OSX 10.7.5.  The
 remote machine I'm trying to manage is running Ubuntu 14.04.

 I have one host in my inventory file.  My playbook is:

 ---
 - hosts: all
   remote_user: roy
   tasks:
   - name: create users
 sudo: yes
 user: name=hyc comment=Harlem Yacht Club shell=/bin/bash

 If I ssh to the Ununtu box as user roy (with ssh key authentication) and
 do sudo -s, it works fine; I get prompted for my password and after I
 type it, I have a root shell.  But, ansible says:

 $ ansible-playbook -i inventory --ask-sudo-pass playbook.yml
 sudo password:


 PLAY [all]
 


 GATHERING FACTS
 ***
 ok: [dev.hyc.org]


 TASK: [create users]
 **
 failed: [dev.hyc.org] = {failed: true, parsed: false}


 roy is not in the sudoers file.  This incident will be reported.




 FATAL: all hosts have already failed -- aborting


 PLAY RECAP
 
to retry, use: --limit @/Users/roy/playbook.retry


 dev.hyc.org: ok=1changed=0unreachable=0failed=
 1

 What's going on that sudo works on the command line but not via ansible?



 --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/ad5ef0ab-9ffd-4a70-a5e5-3555b1d79fc0%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/ad5ef0ab-9ffd-4a70-a5e5-3555b1d79fc0%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.



 --
 Roy Smith
 r...@panix.com



  --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/DD2B5C0F-1828-49A6-A163-006CC9BB3C02%40panix.com
 https://groups.google.com/d/msgid/ansible-project/DD2B5C0F-1828-49A6-A163-006CC9BB3C02%40panix.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgwoj8pQDD7GEFH60wM9LEBuXumKsUrXAd9YP_DYx0%3DSiw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] playbook includes and tags

2014-12-15 Thread Michael DeHaan
Tenatively, yes, I don't see a problem with it applying to all the
tasks/roles if done simply enough.

However given the ongoing v2 refactoring we should probably wait until this
is complete.   This should be in 1.9 (current release) timeframe.





On Mon, Dec 15, 2014 at 9:06 AM, Adam Guthrie asguth...@gmail.com wrote:

 Yeah, I guess I misunderstood the docs (
 http://docs.ansible.com/playbooks_tags.html) here.

 Would you be open to a pull request to implement this?

 Adam

 On Monday, 15 December 2014 13:24:51 UTC, Michael DeHaan wrote:

 Hi Adam,

 This looks like it's because you can add tags when pulling in roles, as
 well as tasks, but you can't tag a playbook on an include.

 It's something that sounds reasonable, but probably not something that
 has been done before.

 Try this:

 - hosts: all
   tasks:
  - include: my_tasks.yml tags=foo

 Etc

 And should be good to go.

 Alternatively:

roles:
  - { name: foo, tags: [ 'foo', 'bar' ] }

 etc



 On Mon, Dec 15, 2014 at 7:07 AM, Adam Guthrie asgu...@gmail.com wrote:

 I'm trying to add tags to tasks via includes but it doesn't work as I
 expect. I have

 $ cat site.yml
 #- { include: foo.yml, tags: [ foo ] }
 - include: foo.yml tags=foo

 $ cat foo.yml
 - hosts: all
   tasks:
  - name: foo
debug: msg=foo

 Then

 $ ansible-playbook -i inventory site.yml -t foo
 ERROR: tag(s) not found in playbook: foo.  possible values:

 Same error with 1.8.2 and current devel branch and with the other
 include syntax commented above.

 Any help much appreciated,

 Adam

 --
 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...@googlegroups.com.
 To post to this group, send email to ansible...@googlegroups.com.
 To view this discussion on the web visit https://groups.google.com/d/
 msgid/ansible-project/066af8dd-6b55-4def-b458-
 7007a686e941%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/066af8dd-6b55-4def-b458-7007a686e941%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.

  --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/40f4f070-c3d7-4e92-952d-793f0421330c%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/40f4f070-c3d7-4e92-952d-793f0421330c%40googlegroups.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgwcoHTEwo3Tkang6%2BpVKspfRpgxWYrBG2SSU9MTa%3DfPyw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Evaluating variables in tasks

2014-12-15 Thread Michael DeHaan
Sorry for being dense, but these two values look the same to me:

 krb_gdc_co_test01
 krb_gdc_co_test01

What part of that is the incorrect part?

Thanks!





On Mon, Dec 15, 2014 at 10:39 AM, Eric Van Steenbergen vs.e...@gmail.com
wrote:

 Hello Michael,

 Thank you for your reply. That's the main issue I'm facing. The variable
 krb_hostname gets substituted by the value krb_gdc_co_test01 while I would
 like to see the value of that variable krb_gdc_co_test01 which I defined in
 the vars file.

 Kind regards,

 Eric

 On Monday, December 15, 2014 12:54:13 PM UTC+1, Michael DeHaan wrote:

 Hi, I'm a little confused by the above, in particular this part:

 stderr: kinit: Keytab contains no suitable keys for
 krb_gdc_co_tes...@msgreen.dom while getting initial credentials

 This looks like krb_gdc_co_tes...@msgreen.dom is being substituted where
 you have {{ krb_hostname }} correctly.

 Can you elaborate on where the problem is in your view?

 Thanks!

 On Sat, Dec 13, 2014 at 12:14 AM, Eric Van Steenbergen vs@gmail.com
 wrote:

 Hi all,

 I'm having an issue with a variable not providing the value it should.
 I'm creating a variable name dynamically and save it in a variable. When
 calling that variable I get what's stored in it which makes sense but I
 want the value (variable name) substituted by its value which is stored in
 a file.

 I've got my problem solved partially. So I have:

 in my var file:


 krb_hostname: krb_{{ inventory_hostname_short | regex_replace('-', '_')
 }}

 krb_gdc_in1_nbapi01: GDC-IN1-NBAPI01\$\@MSGREEN.DOM
 krb_gdc_in1_nbcl01besv01: GDC-IN1-NBC1BV1\$\@MSGREEN.DOM
 krb_gdc_in1_nbmess01: GDC-IN1-NBMESS1\$\@MSGREEN.DOM
 krb_gdc_in1_nbife01: GDC-IN1-NBIFE01\$\@MSGREEN.DOM
 krb_gdc_in1_nbfeed01: GDC-IN1-NBFEED1\$\@MSGREEN.DOM
 krb_gdc_in1_nbfe01: GDC-IN1-NBFE01\$\@MSGREEN.DOM
 krb_gdc_in1_nbfe02: GDC-IN1-NBFE02\$\@MSGREEN.DOM
 krb_gdc_in1_nbvodb01: GDC-IN1-NBVODB1\$\@MSGREEN.DOM

 My task:

 - name: Run kinit -k with hostname from varfile (tag = kerberos)
   shell: kinit -k {{ krb_hostname  }}
   tags:
 - integration

 But when I run it, the result is this:

 failed: [gdc-co-test01] = {changed: true, cmd: kinit -k
 krb_gdc_co_test01, delta: 0:00:00.011155, end: 2014-12-12
 13:41:04.489263, rc: 1, start: 2014-12-12 13:41:04.478108}
 stderr: kinit: Keytab contains no suitable keys for
 krb_gdc_co_tes...@msgreen.dom while getting initial credentials

 So the variable gets created correctly but krb_hostname is not being
 substituted by the value of the generated variable, in the example
 krb_gdc_co_test01 which is a variable in my var file and holds
 GDC-CO-TEST01\$\@MSGREEN.COM http://msgreen.com/ as value.

 Any help is greatly appreciated.

 Kind regards,

 Eric

 --
 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...@googlegroups.com.
 To post to this group, send email to ansible...@googlegroups.com.
 To view this discussion on the web visit https://groups.google.com/d/
 msgid/ansible-project/beb7f33e-6741-4950-a0c2-
 c3b0f27cc1aa%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/beb7f33e-6741-4950-a0c2-c3b0f27cc1aa%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.

  --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/f11c7284-c35f-4fb5-a340-01bd41e67826%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/f11c7284-c35f-4fb5-a340-01bd41e67826%40googlegroups.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgx9tnEJ%2B%3DLKVmLZ86SroG60Au%3DcWjNGhKA9xx%3DvagowMg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: Having variables in task names

2014-12-15 Thread Michael DeHaan
Basically think of it as each variable (for a large infrastructure)
basically having 500 different values

Ansible can't tell the variable has only *one* value, since the variable is
inventory scope as such, it can't plug it in, because the task header
(that preceeds the next 500 task results) would not apply equally to all
hosts.

So it's a cosmetic thing, but done for a very good (if not slightly
confusing!) reason.



On Mon, Dec 15, 2014 at 12:44 PM, Brian Coca bc...@ansible.com wrote:

 short answer: yes, this is expected behaviour

 long one:
 #1 happens because of main/defaults.yml has the lowest precedence
 possible and vars there don't get merged in until task execution,
 name: gets set during task definition, this is because host vars are
 allowed to override them. You can use vars/main.yml for 'non
 overridable' higher precedence vars.

 #2 happens because jinja2 is given the full name:  string to evaluate,
 and it throws a 'variable undefined error' (with default settings)
 which we capture, ignore and return the original string, this is done
 in some cases (like name:) as it should not play/task execution.

 Using vars, extra vars or role vars (but not defaults) should give you
 what you need for task names.

 --
 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-project+unsubscr...@googlegroups.com.
 To post to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/CAJ5XC8%3Dc%2BrK2BBSgyVW3RXF_zZayvT3d%2BK4JLdtPGDO%3DD8UdDA%40mail.gmail.com
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgy7fTJPwXNNXY5z4Nio6HR28Bb2C-XMj%3DzKhzDUPyGBoQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] sysctl.conf

2014-12-15 Thread Michael DeHaan
Honestly, no idea.

We need to get the v2 refactoring out in 1.9 (worst case 2.0) first, and
then we'll be in a good position to make a generalized backup mechanism.

Until then, something like a fetch module call to manually do it would be
a good solution.



On Mon, Dec 15, 2014 at 1:35 PM, Mzp45 melzerpi...@gmail.com wrote:

 In which release would the overall be completed?

 Thanks

 On Monday, December 15, 2014 6:51:20 AM UTC-5, Michael DeHaan wrote:

 Let's not add a new backup parameter.

 The existing backup=yes/no parameter that only creates local backups
 needs to be overhauled to do remotes, and we can generalize it at this time.



 On Fri, Dec 12, 2014 at 12:51 PM, Mzp45 melze...@gmail.com wrote:

 Sure, I'll work on the pull request.

 On Wednesday, December 10, 2014 1:17:42 PM UTC-5, tkuratomi wrote:

 Yeah, I just noticed that backup actually does exist on a lot of the
 file-like modules.  I just hadn't noticed them before.  So yeah,
 adding a backup parameter that does the same thing for sysctl seems
 like a good idea.  Could you open a pull request if you can code it or
 an issue if you can't so that hte idea doesn't get lost?

 Thanks,
 -Toshio

 On Wed, Dec 10, 2014 at 8:20 AM, Mzp45 melze...@gmail.com wrote:
  I was thinking an implementation along the lines of the lineinfile
 module
  where you can edit a file and create a backup at the same time. For
 the
  sysctl module if you have to edit a sysctl.conf file then a backup
 seems
  like a good failsafe.
 
  On Tuesday, December 9, 2014 7:08:46 PM UTC-5, tkuratomi wrote:
 
  In general, ansible modules do not perform backups of files that
 they
  modify.  I'm not sure that sysctl is especially special in this
  regard.  Is there a reason you need this for sysctl but not for
 copy,
  or any of the other modules?
 
  -Toshio
 
  On Tue, Dec 9, 2014 at 7:41 AM, Mzp45 melze...@gmail.com wrote:
   Hello,
   Is there a way to create a backup of /etc/sysctl.conf when making
 a
   change
   using the sysctl core module? If not can this feature be added?
  
   Thanks
  
   --
   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...@googlegroups.com.
   To post to this group, send email to ansible...@googlegroups.com.
   To view this discussion on the web visit
  
   https://groups.google.com/d/msgid/ansible-project/dacf22c0-
 e242-4cf8-9618-6e9678485f61%40googlegroups.com.
   For more options, visit https://groups.google.com/d/optout.
 
  --
  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...@googlegroups.com.
  To post to this group, send email to ansible...@googlegroups.com.
  To view this discussion on the web visit
  https://groups.google.com/d/msgid/ansible-project/d08acda3-
 d1d5-465e-bb0f-60d301dfca5a%40googlegroups.com.
  For more options, visit https://groups.google.com/d/optout.

  --
 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...@googlegroups.com.
 To post to this group, send email to ansible...@googlegroups.com.
 To view this discussion on the web visit https://groups.google.com/d/
 msgid/ansible-project/a7f6dbd3-e391-40a7-b457-
 1b922e0d39b4%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/a7f6dbd3-e391-40a7-b457-1b922e0d39b4%40googlegroups.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.

  --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/ea616141-2c81-4cb8-8276-a00a9e9aee87%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/ea616141-2c81-4cb8-8276-a00a9e9aee87%40googlegroups.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgwcPXhtr-JXQ14X6Vb-AobcGANv_jLbBxOho0XLU%2BVCLw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Two factor authentication?

2014-12-15 Thread Michael DeHaan
Hi Adam,

Generally this is done from two-factoring your VPN for login purposes by
gating a bastion host.

For sudo, it's not going to be well supported at this point, but might not
be terrible -- I think it applying to multiple hosts might be.

Can you share more about the 2FA config you have?

--Michael



On Mon, Dec 15, 2014 at 2:27 PM, Adam Morris zwack...@gmail.com wrote:

 Greetings,

 We are looking at using two factor authentication on our hosts.  Is it
 possible to use Ansible as well or not?  To be clear we're not using it for
 login but for sudo access.

 Adam

 --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/077d236e-eed2-4ae2-9bec-fa81635e2a64%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/077d236e-eed2-4ae2-9bec-fa81635e2a64%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgzioTjdtcAgdGmE76Bhoon0daBDjbtJQHzHAX4AjEC3Wg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Exit with_items loop after first success?

2014-12-11 Thread Michael DeHaan
I would like to be able to exit a with_items loop based on the result of
the previous iteration. Think of it as a generalisation of
with_first_found. 

Would like to step back to use cases first before we propose it be done
with the with_foo here, as that's not how that part works.

Curious what kinds of files you are downloading - for instance, package
managers like yum already do this, etc.



On Thu, Dec 11, 2014 at 10:41 AM, Hugh Saunders h...@wherenow.org wrote:

 Hi All,
 I've been asking on IRC,  twitter
 https://twitter.com/wherenow_hugh/status/543048678588829696, and github
 https://github.com/ansible/ansible/issues/9782 about this and was asked
 to post to the ML as well so here goes :)

 I would like to be able to exit a with_items loop based on the result of
 the previous iteration. Think of it as a generalisation of
 with_first_found.

 Two use cases:

1. I have a list of mirrors known to host file, I want to iterate over
that list until I successfully retrieve the file, then stop iterating. No
point in downloading the file multiple times.
2. I have a git ref (branch/tag) and a list of mirrors of that repo (
git.openstack.org, github.com), I want to resolve that ref to a SHA
without cloning the repo. Run git ls-remote via shell passing in each
remote url in turn until the ref is successfully resolved. No point in
resolving it twice. Note that for this use case I do not want to clone the
repo.

 I'm sure there are other situations where it would be useful to break out
 of a loop.

 As explained in the issue, I can think of two ways of doing this, both
 would require modifications to ansible:

1. Add previous_iteration variable for use in when clause, eg when:
previous_iteration | failed
2. Allow registered variable to be used within a loop, eg when:
shell_result['results'][-1].rc != 0


 Thanks for any insight.

 --
 Hugh Saunders

 --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/be63ee7b-502b-40a8-a776-cf05d8534c1c%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/be63ee7b-502b-40a8-a776-cf05d8534c1c%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgzi%3DOhWEfGgVQ0pdZcQW8F1nLcTvoHi9H8ATPUO0es01g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] How to convince ansible-playbook to colorize output?

2014-12-11 Thread Michael DeHaan
Actually, it's just

export ANSIBLE_FORCE_COLOR=True

unset the variable to remove the behavior




On Thu, Dec 11, 2014 at 10:31 AM, Brian Coca bc...@ansible.com wrote:

 try setting the environment variable in your master's shell
 ANSIBLE_COLOR=True



 --
 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-project+unsubscr...@googlegroups.com.
 To post to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/CAJ5XC8mhWL0AhVSUq5JHHhOQ8HFdV1nS6N5F0emzdvYtLJzwng%40mail.gmail.com
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgzAcwbVZ89NJCpKFhJv87u2ShmBjVO9UFs%3DceJZ7dKiww%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] ansible fails to restart if handler is broken?

2014-12-11 Thread Michael DeHaan
Don't see how this is a bug.  Can you elaborate.

Tried --force-handlers ?



On Tue, Dec 9, 2014 at 10:00 PM, Kevin Burton burtona...@gmail.com wrote:

 this is a bug...

 TASK: [pdns-recursor | recursor.conf file]
 
 changed: [10.56.252.12]
 ERROR: change handler (restart pdns-recursor) is not defined


 ... so my issue was that the handler wasn't defined (typo).  So now it has
 a new file, and the daemon NEEDS to be restarted , but it isn't.

 Now, when I run ansible again, it does NOT restart the daemon, because the
 template is already updated.

 The solution here would obviously need to restart the daemon and properly
 run the handler.

 I think the fix is to revert the 'template' so that the previous file was
 used.

 --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/de02e7e4-b996-4f1c-b4df-0bd773512d7f%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/de02e7e4-b996-4f1c-b4df-0bd773512d7f%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgyv%3DeMYD9aWe%2B%3DZT6rPUDT7X2T0PNLK6FT6RYTbPfQn1w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Exit with_items loop after first success?

2014-12-11 Thread Michael DeHaan
if you are downloading tars of git repos from GitHub from lots of
production servers, that seems to be a bit of a bad practice to me that
assaults the mirror.

I would consider setting up a mirror of all that content on one server
initially and then have your individual production nodes download off that
box.






On Thu, Dec 11, 2014 at 11:09 AM, Hugh Saunders h...@wherenow.org wrote:

 On 11 December 2014 at 16:00, Michael DeHaan mich...@ansible.com wrote:

 I would like to be able to exit a with_items loop based on the result
 of the previous iteration. Think of it as a generalisation of
 with_first_found. 

 Would like to step back to use cases first before we propose it be done
 with the with_foo here, as that's not how that part works.

 Curious what kinds of files you are downloading - for instance, package
 managers like yum already do this, etc.


 In this particular instance, I am downloading tars of git repos.

 See also the second use case, its a bit of an edge case but shows that a
 general answer may be more useful than fixing a specific module. For
 example the file download case could be solved by modifying they get_url
 module to take a list of sources, but that only solves one specific case.
 Add the functionality to core and it can be used with any module.

 I'm also not sure a new with_ is needed, maybe access to another variable
 within loop conditionals, or a new conditional such as break_when?

 --
 Hugh Saunders

 --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/CAAD%2BY3Vh7uwrAwTVVcDf-MkbciLOTn%3Dj-5WSbq9OQu%3D0puhR_Q%40mail.gmail.com
 https://groups.google.com/d/msgid/ansible-project/CAAD%2BY3Vh7uwrAwTVVcDf-MkbciLOTn%3Dj-5WSbq9OQu%3D0puhR_Q%40mail.gmail.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgzUAHpiKj-_bBRX1UwgrZu1phMvAMymRpj1Tq59GhBM3g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Exit with_items loop after first success?

2014-12-11 Thread Michael DeHaan
Anyway... is there a way of breaking out of a loop or would patches be
accepted to provide such a mechanism?

Still want to understand your use case before we start talking
implementation and language changes to find the best way to express the
construct.

Ultimately Ansible isn't a arbitrary scripting language, and I don't want
to make it one - but we do want to find the best possible way to express
what you may want to express.




On Thu, Dec 11, 2014 at 11:33 AM, Hugh Saunders h...@wherenow.org wrote:

 On 11 December 2014 at 16:18, Michael DeHaan mich...@ansible.com wrote:

 if you are downloading tars of git repos from GitHub from lots of
 production servers, that seems to be a bit of a bad practice to me that
 assaults the mirror.

 I would consider setting up a mirror of all that content on one server
 initially and then have your individual production nodes download off that
 box.


 I haven't said that I had multiple servers downloading the same content.

 Anyway... is there a way of breaking out of a loop or would patches be
 accepted to provide such a mechanism?

 --
 Hugh Saunders

 --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/CAAD%2BY3VzJH1cLe6QOBC%3DQ9z_YtZSes15Q0o%2BPj-Zd%2BEKgqKXFA%40mail.gmail.com
 https://groups.google.com/d/msgid/ansible-project/CAAD%2BY3VzJH1cLe6QOBC%3DQ9z_YtZSes15Q0o%2BPj-Zd%2BEKgqKXFA%40mail.gmail.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgycRkqb-7FVuGy_2m%2BpT96muC4OZ3nfMfFRXOhb9n_DaQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] ansible fails to restart if handler is broken?

2014-12-11 Thread Michael DeHaan
No, you actually use that after.

If you had a failure and you needed a handler to run on the next run
because something should have triggered but did not, you can use that flag.

The retry suggestion has been made before.


On Thu, Dec 11, 2014 at 11:54 AM, Petros Moisiadis ernes...@yahoo.gr
wrote:

  On 12/11/14 18:15, Michael DeHaan wrote:

 Don't see how this is a bug.  Can you elaborate.

  Tried --force-handlers ?


 The option --force-handlers will work only proactively. You must use it
 _before_ the failure occurs. However, this is almost never the case.
 Normally, you don't expect your playbook tasks to fail.
 A much better solution would be to extend retry files to include handlers
 that have already been notified before the failure, so that when using the
 retry files, these handlers are pre-notified regardless of the results of
 the tasks that notify them normally. I guess that would be a nice feature
 for v2. :)



 On Tue, Dec 9, 2014 at 10:00 PM, Kevin Burton burtona...@gmail.com
 wrote:

 this is a bug...

  TASK: [pdns-recursor | recursor.conf file]
 
 changed: [10.56.252.12]
 ERROR: change handler (restart pdns-recursor) is not defined


  ... so my issue was that the handler wasn't defined (typo).  So now it
 has a new file, and the daemon NEEDS to be restarted , but it isn't.

 Now, when I run ansible again, it does NOT restart the daemon, because
 the template is already updated.

 The solution here would obviously need to restart the daemon and properly
 run the handler.

 I think the fix is to revert the 'template' so that the previous file was
 used.
--
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/de02e7e4-b996-4f1c-b4df-0bd773512d7f%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/de02e7e4-b996-4f1c-b4df-0bd773512d7f%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


  --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgyv%3DeMYD9aWe%2B%3DZT6rPUDT7X2T0PNLK6FT6RYTbPfQn1w%40mail.gmail.com
 https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgyv%3DeMYD9aWe%2B%3DZT6rPUDT7X2T0PNLK6FT6RYTbPfQn1w%40mail.gmail.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.




-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgyXeOxYO6%3DG0E8f1sK7urAbMQT8%3D9BSHVLViWfnz6bjjw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] How do I pass a list as an --extra-vars

2014-12-11 Thread Michael DeHaan
JSON needs to be valid JSON :)



On Thu, Dec 11, 2014 at 2:30 PM, Mikael Sandström orav...@gmail.com wrote:

 Thanks!

 I cant get it to behave as a 'normal' list though, so obviously I'm doing
 something wrong.

 If I run this playbook without extra vars:


 ---
 - hosts: localhost
   connection: local
   gather_facts: false
   vars:
 listname:
   - name: ble
 version: 1
 path: /some/path

   tasks:
   - name: test extravars
 debug: msg=version - {{ item.version }}
 #debug: msg=
 with_items: listname



 It works as expected, and I get this:

 TASK: [test extravars]
 
 ok: [localhost] = (item={'path': '/some/path', 'version': 1, 'name':
 'ble'}) = {
 item: {
 name: ble,
 path: /some/path,
 version: 1
 },
 msg: *version - 1*
 }


 However, if I try to do this

 ansible-playbook extravar.yml *-e '{listname:[name: foo, path:
 /asd/bsdfr, version: 2]}'*


 PLAY [localhost]
 **


 TASK: [test extravars]
 
 fatal: [localhost] = One or more undefined variables: 'unicode object'
 has no attribute 'version'


 And I guess that is because everything in 'item' is treated like one string



 TASK: [test extravars]
 
 ok: [localhost] = (item=name: foo, path: /asd/bsdfr, version: 2) = {
 item: name: foo, path: /asd/bsdfr, version: 2,
 msg: 
 }


 If I quote each pair, I get 3 different 'items'

 ansible-playbook extravar.yml -e '{listname:[name: foo, path:
 /asd/bsdfr, version: 2]}'


 PLAY [localhost]
 **


 TASK: [test extravars]
 
 ok: [localhost] = (item=name: foo) = {
 item: name: foo,
 msg: 
 }
 ok: [localhost] = (item=path: /asd/bsdfr) = {
 item: path: /asd/bsdfr,
 msg: 
 }
 ok: [localhost] = (item=version: 2) = {
 item: version: 2,
 msg: 



 So, how should the quotes be placed to get it to behave like a 'normal'
 list? Or is there something else I need to do?

 regards
 /M




 Den torsdagen den 11:e december 2014 kl. 18:36:19 UTC+1 skrev James
 Cammarata:

 Hi Mikael,

 There are essentially two ways you can do this:

 1) Use quoted JSON
 2) Put the data in either a JSON or YAML file.

 Please refer to the documentation here for more details:
 http://docs.ansible.com/playbooks_variables.html#
 passing-variables-on-the-command-line

 Thanks!

 On Thu, Dec 11, 2014 at 11:22 AM, Mikael Sandström ora...@gmail.com
 wrote:

 Hi,

 I got a list that looks like this

 listname:
   - name: ble
 version: 1
 path: /some/path
 ...
 ...


 which is accessed as

 - name: do something
   shell: run some command
   with_items: listname


 If I want to pass the list to a playbook as an --extra-vars, how would I
 do that?

 regards
 /M

 --
 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...@googlegroups.com.
 To post to this group, send email to ansible...@googlegroups.com.
 To view this discussion on the web visit https://groups.google.com/d/
 msgid/ansible-project/bd3b24c6-0936-41a6-87ed-
 581142f0b354%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/bd3b24c6-0936-41a6-87ed-581142f0b354%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


  --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/c670d5db-060a-4208-9aff-d921b6bf258b%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/c670d5db-060a-4208-9aff-d921b6bf258b%40googlegroups.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgzKb0AfBUV2FBRP1COwKf94mkruSE9pO%3D-%2B7dJtofCYpQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Using dependency graphs to speed up ansible?

2014-12-11 Thread Michael DeHaan
Yep, I would highly recommend tags to reference just the stuff you changed.

There is nothing that is going to monitor what files you edited
automatically - that's a bit too complex of a problem and not a use case
we're interested in.

Do read http://www.ansible.com/blog/ansible-performance-tuning if you have
not already.



On Thu, Dec 11, 2014 at 3:18 PM, James Cammarata jcammar...@ansible.com
wrote:

 Hi Kevin,

 This is probably something better suited for ansible-devel, however to
 answer your question we do already provide several methods for limiting the
 scope of playbook runs (--tags, --start-at-task, --step, etc.). Ansible is
 really very linear, even when considering role dependencies (we compile
 everything down into a single list of tasks, and iterate through that), so
 there's no crazy dependency resolution to fix.

 Also, there is the added complication that things on remote targets may
 have changed, so in general you would not want to automatically limit the
 execution of a playbook to only those parts of the play which have changed
 on the controlling machine.

 While your suggestion might be technically possible, it definitely seems
 overly complex for what Ansible does. If you only need to re-run a single
 role or even a small subset of tasks, it is pretty trivial to create a new
 playbook to do so.

 Thanks!


 On Thu, Dec 11, 2014 at 1:48 PM, Kevin Burton burtona...@gmail.com
 wrote:

 Has anyone done any work on using dependency graphs to speed up ansible.

 For example, if I have one big site.yml, and I only change an edge role,
 something small, it doesn't make sense to re-run ALL playbooks.

 There might be situations where this makes sense.  There might be some
 API dependencies though but maybe you could hard code some exemptions for
 dependency computation.

 This is generally how incremental compilers work btw.  No sense
 recompiling your whole app if dependencies haven't changed.

 --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/0ba85b46-00fc-426c-87ea-7ba54a8cc585%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/0ba85b46-00fc-426c-87ea-7ba54a8cc585%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


  --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/CAMFyvFhZtF%3DR3G1%3DzNtWVYXvDZdCyoj_Bq9A5OWg9_dOP-dY1Q%40mail.gmail.com
 https://groups.google.com/d/msgid/ansible-project/CAMFyvFhZtF%3DR3G1%3DzNtWVYXvDZdCyoj_Bq9A5OWg9_dOP-dY1Q%40mail.gmail.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgxxMqQwUeVCueGsUZBxpd7hw1iUKLeBrRs%3DVyc786kyPQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] ansible fails to restart if handler is broken?

2014-12-11 Thread Michael DeHaan
I am afraid this is not correct. I am testing it now with 1.8.2 and I can
assure you that  '--force-handlers' will not trigger a handler if that
handler has not been notified by a task.

Can you please paste a minimal playbook that shows this as well as your CLI
invocation?

Thanks!



On Thu, Dec 11, 2014 at 1:58 PM, Kevin Burton burtona...@gmail.com wrote:

 Interesting.  Nice discussion.

 I think one issue is that there would be no easy way to revert tasks that
 fail without some type of API that instrumented changes.  Either that or
 have the tasks run in some sort of container that logged changes.  But of
 course you're not sure what type of changes to expect.  It could be a
 sysctl, FS changes, API call, etc.  How do you reliably roll those back?

 So I guess the solution is to just be careful and know what your scripts
 are doing.  And maybe in the future tasks could implement a rollback API
 for when they fail but of course this might not be reliably supported
 everywhere.

 --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/30797ca0-8128-4f2e-9600-0650d1b92d40%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/30797ca0-8128-4f2e-9600-0650d1b92d40%40googlegroups.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgxeRNXJj9o_yGfJfndjqmm%2BUUNJJucJJkEc05jhbZJJpA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] using anyconfig-0.0.5 as a module in ansible

2014-12-11 Thread Michael DeHaan
  Are there any other requirements or protocols unique to windows
modules? 

Generally if submitting them to core (I don't understand anyconfig yet so
not sure we'd take it), docs go in a corresponding .py file (see other
windows modules for an example.

But that's pretty much it - just follow the examples of the others, etc.



On Thu, Dec 11, 2014 at 5:16 PM, skinnedknuckles 
andersonjonatha...@gmail.com wrote:

 Along with updating software remotely I need to update multiple parameter
 files where sometimes values are to be overwritten and other times original
 values should be persisted (maintained) if they already exist. I found a
 python library called anyconfig https://pypi.python.org/pypi/anyconfigwhich
 seems to have this capability using the MS_REPLACE and MS_NO_REPLACE
 flags.  So as I understand, in order to use this code as an ansible module
 I need to modify it to conform to ansible module standards as defined in
 the documentation
 http://docs.ansible.com/developing_modules.html#common-module-boilerplate.
 And since my remote nodes are windows machines it will be set up to run on
 windows and the module name should be prefixed with win_ like all the
 other windows modules.  Are there any other requirements or protocols
 unique to windows modules?  This is a bit over my head so before I dive in
 and wrestle with it for days I just want to be sure I'm on the right track.
 OR maybe there is an easier way to do this. And I'd like to know that I'm
 attempting something that is at least in the realm of possibility.  Any
 comments or suggestions are welcome.

 --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/ee88172a-b916-4092-ae7b-a165238f0045%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/ee88172a-b916-4092-ae7b-a165238f0045%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgzhTKM5HMXdJ2-gGN8JLqa6quNBvkBHvtNOQB-sfLN5gg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] mysql_db state=import only once

2014-12-11 Thread Michael DeHaan
 as I was running several tasks in a row, all using with_items on the same
array and could not use a handler.

If using with_items and a handler, you'll get one notification if anything
in the list reports changed.

I think what you have is ok really, because you'll want those things to
happen then rather than at the end when handlers normally run, so good
work!

On Mon, Dec 8, 2014 at 2:14 PM, Jae Task m...@jaetask.com wrote:

 Hi, First of all I want to thank you all for this thread, it helped me
 solve a problem that I was struggling with. This is my first post to the
 group and want to say hello :)

 I have a slightly different solution to this problem as I was running
 several tasks in a row, all using with_items on the same array and could
 not use a handler.

 I am building a multi wordpress installation playbook and solved the
 problem like this:

 - name: Create wordpress database
   mysql_db: name={{ item.wp_db_name }} state=present
   with_items: wordpress_nginx_sites
   register: create_wordpress_databases

 #- name: debug reg
 #  debug: var={{ create_wordpress_databases }}

 - name: Create wordpress database user
   mysql_user: name={{ item.wp_db_user }} password={{ item.wp_db_password
 }} priv={{ item.wp_db_name }}.*:ALL host='localhost' state=present
   with_items: wordpress_nginx_sites

 - name: Copy the wordpress mysql db
   copy: src=files/sites/{{ item.item.name }}/{{ item.item.wp_db_name
 }}.sql dest=/tmp
   when: item.changed == True
   with_items: create_wordpress_databases.results

 - name: Import the database
   mysql_db: name={{ item.item.wp_db_name }} state=import target=/tmp/{{
 item.item.wp_db_name }}.sql
   when: item.changed == True
   with_items: create_wordpress_databases.results


 As you can see. Because there are multiple databases being created via
 looping a dictionary, I could not see a way to call a handler and know
 which element of the dictionary had triggered the handler.

 The interesting part of this is when looping the result of the create
 task, you must use {{ item.item.name }} to get at the value.

 I am fairly new to ansible so feel free to advise on a better way of doing
 this if Its not best practice.

 Jae.



 On Friday, 7 February 2014 04:06:48 UTC, Jeff Geerling wrote:

 Coming into this discussion a little late, but here's an example to
 illustrate what's being suggested:

 Play:

 - name: Ensure example database exists.
   mysql_db: name=exampledb state=present
   notify: import example database

 Handler:

 - name: import example database
   mysql_db: name=example state=import target=/path/to/example_schema.sql

 This works great, and avoids errors I was getting when I tried doing the
 import straightaway; the import only seems to work if the database already
 exists.

 On Tuesday, November 26, 2013 3:12:25 PM UTC-6, Fred Badel wrote:

 I don’t know why, but in my mind, notifying handlers was only to restart
 a service … now I can see the light!! :)

 Although, this would not help if the db exists but is empty, you just
 help me understand how I can use and how useful “notify” can be !

 Thank you.

 fred

 On Nov 26, 2013, at 19:18 , David Karban da...@karban.eu wrote:

 Hi,

 you can use notify in create DB to create schema. That way, it will be
 called only on db creation.

 David
  Dne 26.11.2013 17:42 Fred Badel fr...@never-mind.ch napsal(a):

 Hello,

 I have a playbook that create a mysql DB and import an empty schema:

 - name: create DB
   mysql_db: name={{ db_name }} state=present login_host=127.0.0.1

 - name: create schema
   mysql_db: name={{ db_name }} state=import login_host=127.0.0.1
 target=/create_tables.sql

 From what i could notice, the sql file is imported each time the
 playbook is run ... (aka, the task is marked as changed each time I run the
 playbook)
 is this an expected behavior?
 does someone have a recommended way of using the import feature and run
 it only once?

 Thanks.

 Fred

 --
 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...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


 --
 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...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


  --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/c622bc6c-d7c9-4440-81bb-1d048b8df7c3%40googlegroups.com
 

Re: [ansible-project] Re: Passing register variable to a role called by playbook?

2014-12-11 Thread Michael DeHaan
Perhaps I'm not completely following the question:

 I am able to capture the elastic IP via register but how do I call it
from the role?

Basically any variable already registered can be used like {{ foo }} in
subsequent roles/tasks/whatever -- so maybe you could help me understand
where the point of confusion is?

Want to help, just a bit unclear on it.  Thanks!



On Wed, Dec 10, 2014 at 3:18 PM, ji...@pristine.io wrote:

 Quick correction on this. I pasted the wrong data where it says name:
 allocate a new elastic IP without associating it to anything The play
 actually looks like this:

 - name: Associate a new Elastic IP to instance
   ec2_eip: region=us-east-1 in_vpc=yes instance_id={{ item }}
   with_items: ec2.instance_ids
   register: eiptest

 On Wednesday, December 10, 2014 2:11:41 PM UTC-6, ji...@pristine.io wrote:

 I am launching one-off ec2 instance for development purposes and in the
 main playbook I am launching an EC2 instance then assigning an elastic IP.
 Once all of that is done I am configuring the server via a role. I am able
 to capture the elastic IP via register but how do I call it from the role?
 Or more specifically how can I call it in a configuration template from
 within the role that is applied?

 Here's an example:

 launch-server.yml:

 - name: Launch ec2 instance
   hosts: localhost
   gather_facts: False
   vars:
 key_name: ssh-key
 instance_type: t2.medium
 group_id: sg-f834234
 image: ami-b234234
 region: us-east-1
 vpc_subnet_id: subnet-65wer234
   tasks:

 - name: Launch instance
   local_action: ec2 key_name={{ key_name }} group_id={{ group_id }}
 instance_type={{ instance_type }} image={{ image }} wait=true region={{
 region }} vpc_subnet_id={{ vpc_subnet_id }} instance_tags='{Name:ec2-
 instance}'
   register: ec2

 - name: allocate a new elastic IP without associating it to anything
   action: ec2_eip region=us-east-1
   register: eiptest

 - name: output the IP
   debug: msg=Allocated IP is {{ eiptest.public_ip }} --- this
 prints the elastic IP to the screen.

 - name: Add new instance to host group
   local_action: add_host hostname={{ item.private_ip }}
 groupname=launched
   with_items: ec2.instances

 - name: Wait for SSH to come up
   local_action: wait_for host={{ item.private_ip }} port=22 delay=60
 timeout=320 state=started
   with_items: ec2.instances

 - name: Configure instance
   hosts: launched
   sudo: True
   gather_facts: True
   roles:
 - myrole

 In the template from within the role it doesn't know about
 eiptest.public_ip so it fails and reading the docs it seems that var will
 be destroyed at the end of the play that calls the role. If I run ansible
 hostname -m setup I don't see any entries for the elastic IP assigned to
 the instance.

 I've tried a number of things and read through the docs but not having
 much luck. I would like to keep the roles separate from the plays that
 launch the instances if at all possible.

 Thanks!

  --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/6613e7b0-3be9-40f1-9eb9-4fbe685297ea%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/6613e7b0-3be9-40f1-9eb9-4fbe685297ea%40googlegroups.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgxH_VcJYzw47Q6c%2BwD_5if7JnbKa1oqTLe6v%2B1EcYxDbw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Regexp matching with replace module, but not with lineinfile

2014-12-11 Thread Michael DeHaan
Alas, not much time to help debug a regex.

It is said:

There was a man who had a problem.  He tried to solve it with a regex.
Now the man had two problems.

I generally like to use the template module whenever I can, as Ansible's
ethos is generally keep things simple wherever possible.

Lineinfile only really makes sense when there is no other way, and even
then, sed can occasionally be an easier thing to master.  I'm not a great
fan of the module, to be honest.  Others like it though, so it stays :)



On Wed, Dec 10, 2014 at 11:58 AM, Florent B flor...@coppint.com wrote:

 Hi,

 I'm a newbie with Ansible, and I have a problem.

 First, I use version 1.8.2, stock, without anything added.

 Then, I want to configure /etc/network/interfaces file with Ansible, so I
 need to work with regexp to do what I want.

 My goal is to add or rewrite some bridges configuration in that file.

 I use this :

 - name: Configure /etc/network/interfaces
   lineinfile:
 dest: /etc/network/interfaces
 regexp: '[\r\n](# DO NOT TOUCH BEGIN[\n\r])?auto[ \t]+{{ item.if }}[
 \t]*[\n\r](?:[ \t]*.*[\n\r])*?[ \t]*bridge_maxwait[ \t]+0[ \t]*([\n\r]# DO
 NOT TOUCH END[\n\r])?'
 line: |

   # DO NOT TOUCH BEGIN
   auto {{ item.if }}
   iface {{ item.if }} inet static
   address {{ item.ip }}{{ ipconfig.stdout|trim }}
   netmask 255.255.0.0
   bridge_portsnone
   bridge_stp  off
   bridge_fd   0
   bridge_maxwait  0
   # DO NOT TOUCH END
   with_items: vlans
   register: interface_configured

 I want to add the DO NOT TOUCH for existing bridges too, and of course
 create lines for non-existing ones.

 You can test regexp here : https://regex101.com/r/sK7iF0/1

 We can see that for example, it matches for vmbr10.

 Instead of replacing those lines, Ansible lineinfile add the line at the
 end of file :

 # DO NOT TOUCH BEGIN
 auto vmbr10
 iface vmbr10 inet static
 address 10.111.0.2
 netmask 255.255.0.0
 bridge_portsnone
 bridge_stp  off
 bridge_fd   0
 bridge_maxwait  0
 # DO NOT TOUCH END

 If I change lineinfile and line with replace and replace, it works
 ! It replaces the matched result, but of course it does not add lines when
 bridge does not exists :(

 I see in documentation that replace module is working with multiline
 regexp, but if I force multiline mode in lineinfile adding (?m) at the
 beginning, it does not work better... :(

 Is someone understanding what is my problem ? And how can I do it better :)

 Thank you a lot.

 --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/296f1ded-339a-4221-908c-4fc13e16c7ee%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/296f1ded-339a-4221-908c-4fc13e16c7ee%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgwKPp702s20AqHxwafJXpSJGNsXPRN%2Bp6Tgj8buXaCexQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] git diff vault files

2014-12-11 Thread Michael DeHaan
I'd consider using the new ansible-vault view command to view when you
don't want to edit -- it's new on the devel branch if not actually part of
1.8.

I don't remember :) ... but it may help and avoid writing the script.



On Tue, Dec 9, 2014 at 7:45 PM, Toshio Kuratomi tkurat...@ansible.com
wrote:

 I haven't used vault extensively so I've never had to dive into this
 before.  however, I think that either filters or pointing git at an
 external diff tool which you write a short wrapper to do the
 decryption are the ways to do this.  Doing some web searching I do
 notive that other people are using git's filters for similar
 transparent encryption and decryption operations.  For instance:

 https://www.agwa.name/projects/git-crypt/

 http://stackoverflow.com/questions/11575398/how-can-i-save-my-secret-keys-and-password-securely-in-my-version-control-system

 Sorry I don't have an out of the box recipe for you but it does seem
 doable with a bit of time and reading.

 -Toshio

 On Tue, Dec 9, 2014 at 8:26 AM, Damjan Georgievski gdam...@gmail.com
 wrote:
  Now that we started using vault files for secret data, one of the
 problems
  is that git diff on the vault files gives the whole file as changed
  (understandably).
  The trouble I have now is that I use git diff before I commit to double
  check I didn't change something I didn't want to.
 
  Is there some trick that people are using to git diff encrypted files?
 
  --
  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 to this group, send email to ansible-project@googlegroups.com.
  To view this discussion on the web visit
 
 https://groups.google.com/d/msgid/ansible-project/05816297-316c-48fb-b1a0-875202ef1fc6%40googlegroups.com
 .
  For more options, visit https://groups.google.com/d/optout.

 --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/CAG9juEqz0BvLzEqmHTFzaw1XeXZNZq99a1L9SHjfETkMujpHOA%40mail.gmail.com
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgwJqeHCgprAYfAGhG9g2JG6tpAUMEBKWFe1VD3ZXrFgWg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] how to build docker image?

2014-12-11 Thread Michael DeHaan
Yeah so we find it odd that a Dockerfile, that usually contains
ansible-playbooks, would be executed by Ansible.

We think in most cases it would be executed by a build system (like
Jenkins), or even a Makefile... and that like most packaging tools it would
be done before the ansible-playbook was run.

So the command module is we think the nice way to go, if you really want to
do that, and I think that's fine.

Hope this helps!

On Thu, Dec 11, 2014 at 6:18 PM, Shunsuke Mie sux2m...@gmail.com wrote:

 I find docker_image module, but this module is deprecated.
 So now, I using commands module.
 Can i build docker image any way?


  --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/a8030ff0-71e2-4eff-9a8d-62d46f84e3b1%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/a8030ff0-71e2-4eff-9a8d-62d46f84e3b1%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgzJrM9xaZn9rJM2z%3DSBZ1Ri0W%2BZmioXKog%2BLW%3DbsiNVGQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Creating Windows modules

2014-12-11 Thread Michael DeHaan
They are required to be in powershell (unfortunately for those that don't
like Powershell!  maybe fortunate for those that do - as it does provide a
very strong 'standard library' of stuff to do on Windows that Microsoft
maintains for us - so ... that's a win).   This is so we don't have to
install any agents on the remote machines, and they work using Windows
powershell remoting.



On Thu, Dec 11, 2014 at 5:43 PM, skinnedknuckles 
andersonjonatha...@gmail.com wrote:

 Are modules intended to run on windows remote nodes required to be written
 in powershell script or is there a way to turn python code into a windows
 module?

 --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/aa18830a-30d9-483e-b446-e0562491ddd7%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/aa18830a-30d9-483e-b446-e0562491ddd7%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgymdeL-_%2BiVSDitRULqVEb2k4LH_Ds-RWpbGcTDFk6FrA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] What is the best way to manage firewalls with Ansible?

2014-12-11 Thread Michael DeHaan
CentOS has /etc/sysconfig/iptables if I knew iptables. 

Learning iptables config is not hard actually, nor is templating it.

It can be used for very complex things (
http://www.ex-parrot.com/pete/upside-down-ternet.html) but simple
accept/deny rules are straightforward

You just write the iptables config file and then have to do /sbin/service
iptables restart to make it apply

Google manage iptables and you should be able to find some good examples.

I can't say I have any specific tutorials or references that I like, but
others may have some good ones.

So anyway, hopefully at least good for some encouragement!




On Thu, Dec 11, 2014 at 9:41 PM, David Reagan jer...@gmail.com wrote:

 So, to resurrect an old topic... And remind myself why I like having a
 hardware firewall covering my behind...

 I've about figured out how to use the UFW module correctly. Which makes me
 happy.

 Unfortunately, I have to administer SLES and CentOS vm's as well. I was
 going to use the firewalld module, but then I couldn't find a firewalld
 package in the repos to install...

 That leaves me kind of hanging...

 CentOS has /etc/sysconfig/iptables if I knew iptables.

 Not sure if SLES has a decent command line interface I could use... It
 does use a GUI tool, and force me to install a GUI on the server, so I
 might just run them manually...

 Anyway, apologies for the rambling, it's the end of the day for me. Here
 are my questions:

 Has anyone looked at creating an iptables module that would just work on
 all OS's that have Python and iptables? Maybe make the most common stuff
 easy, and then have a way for people to input a full iptables command? So,
 for people running simple stuff, like me, could make a task like

 iptables: ports=22, proto=tcp,udp allowed_from=10.0.0.0/8
 allowed_to=everywhere

 More complicated stuff could be:

 iptables: command=stuff that is currently gibberish to me


 Micheal, you mentioned a config file, which one were you talking about?


 Is there a way to install firewalld that my google-fu missed? Or even ufw?


 Is there a really good introduction to iptables that you would recommend?
 Since the obvious route to solve my problem is to suck it up and learn
 iptables...


 Thanks!

 --David Reagan

 On Tue, Oct 8, 2013 at 8:09 AM, Michael DeHaan mich...@ansibleworks.com
 wrote:

 Generally speaking, I like to do the following with iptables

 {% if 'webservers' in group_names %}
section of iptables config for webservers
 {% endif %}

 And just template the config file, and set up a notify to reload iptables
 when it changes.

 I should also point out there is a firewalld module in the devel branch
 now too.


 On Tue, Oct 8, 2013 at 9:15 AM, Guillaume Subiron maet...@subiron.org
 wrote:

 I also think shorewall is a good way to deploy firewall configuration
 using ansible.

 I tried to use iptables-persitent, but shorewall allows to split the
 rules in many files. Using run-parts in /etc/shorewall/rules, you can
 put any file in rules.d/.

 So in my common playbook, I only deploy common rules (close
 everything by default, allow ping and ssh). Then, each roles can add
 some rules. The webserver role, for instance, adds a rule file to
 open HTTP and HTTP ports.

 You just have to pay attention to the order in which the files will be
 executed.

 Le 13/10/08 14:43, Kahlil Hodgson claviotta :
  I'm using shorewall for all my VMs.  It's kinda overkill for a single
  nic, but I find it works quite well with ansible.
  The configuration for VMs with a single nic is very basic.
 
  The files
 
 shorewall.conf (1 one setting changed from default)
 policy (3 lines)
 zones  (2 lines)
 interfaces (1 line)
 
  are somewhat trivial and identical across all VMs.
 
  The
 
 rules  (3 - 10 lines)
 
  file is where the ingress and egress filtering is controlled and is
  easily templated.
 
  I also 'chain' handlers as follows to ensure modifications don't leave
  iptables in a bad state:
 
  tasks:
  
 
  notify: check shorewall
 
  
 
  handlers:
 
  - name: check shorewall
command: /sbin/shorewall check
notify: restart shorewall
 
  - name: restart shorewall
action: service name=shorewall state=restarted
 
  I'm happy to provide some initial content to get you started.
 
  Cheers,
 
  K
 
  Kahlil (Kal) Hodgson   GPG: C9A02289
  Head of Technology (m) +61 (0) 4 2573 0382
  DealMax Pty Ltd(w) +61 (0) 3 9008 5281
 
  Suite 1415
  401 Docklands Drive
  Docklands VIC 3008 Australia
 
  All parts should go together without forcing.  You must remember that
  the parts you are reassembling were disassembled by you.  Therefore,
  if you can't get them together again, there must be a reason.  By all
  means, do not use a hammer.  -- IBM maintenance manual, 1925
 
 
 
  On Tue, Oct 8, 2013 at 1:49 PM, David Reagan

Re: [ansible-project] Is this a bug or a security feature? I am not sure...

2014-12-09 Thread Michael DeHaan
ok: [a.b.c.c] = {msg: check mode not supported for shell, skipped:
true}

shell commands don't run in check mode because usually they have side
effects, and check mode is there to be a dry run.

As such, this is neither a bug *NOR* a security feature, it's just making
sure check mode doesn't *do* anything.

If I'm missing the question, perhaps you can summarize what I missed above.

Thanks!




On Tue, Dec 9, 2014 at 12:20 AM, Steven Truong djatlan...@gmail.com wrote:

 Hi all,

 Here is the situation that I am not sure how to deal with it.

   shell: echo {{ ec2_tag_Name | regex_replace('(^[a-z]+-[a-z0-9]+).*',
 '\\1') }}

 And certainly, I have other shell command where I echo something and use
 register to capture the output such as the following:

 - name: get public ipv4 address
   shell: curl http://169.254.169.254/latest/meta-data/public-ipv4
   register: public_ipv4


 So when I ran these in ansible_pull then these tasks worked just fine.
 When I ran against the public_hostname of the EC2 instance with

 ansible-playbook myplaybookyml   -i /usr/local/src/public_hostname

 where public_hostname in AWS has the public DNS entry of the instance and
 I believe this entry will resolve to private IP address in AWS. This will
 NOT work.

 ansible-playbook myplaybook.yml -i host.localhost

 where host.localhost has 'localhost as the only entry and this will NOT
 work either.

 ansible-playbook myplaybook.yml -i ec.py --limit $public_ip

 The public IP address is just the actual IP address of the instance.  This
 will work.

 For those 2 cases when things failed to work I did not get error message
 but and OK with something like the following:

 ok: [a.b.c.c] = {msg: check mode not supported for shell, skipped:
 true}

 So shell module seemed to give me these message and fail to execute the
 shell command at all in the case I use localhost or the public DNS name in
 AWS that resolves to the private IP address.

 I ran these locally on the instance.

 Please share your thoughts on what could have been the case here.  Bug or
 security feature???

 Thank you very much,
 Steven


  --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/4faa6ac0-75fa-4db2-bfaa-2b00963f0194%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/4faa6ac0-75fa-4db2-bfaa-2b00963f0194%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgzNtmAtDoJ_arc-fUqMdy9u6XeD3psEt8uFhxDW3OLXVw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] git module profiling

2014-12-09 Thread Michael DeHaan
Can you please define slow and explain a bit about how you are testing it?



On Mon, Dec 8, 2014 at 5:24 PM, Toshio Kuratomi tkurat...@ansible.com
wrote:

 There may be better methods but I'd just instrument the code to spit
 out timestamps at various points in its run.  I'd use this method
 because the git module invokes the git command line frequently so
 chances are that one of the git command line calls is what's slow.
 Putting some code to log the time around the calls to external git
 will let you track down which call it is and also doesn't require you
 to learn a lot of python to get started.

 For doing this quick and dirty, I would use the python-q library which
 does simplistic logging to $TMPDIR/q:  https://pypi.python.org/pypi/q
  With it you can put lines in your code like:

 import q, time; q.q('before: %s' % time.time())
 # [git module gets invoked]
 q.q('after: %s' % time.time())

 Then $TMPDIR/q on the box ansible is talking to will contain these
 timestamps.

 If you want to get more involved, you can look into several modules
 from the python stdlib including timeit
 https://docs.python.org/2/library/timeit.html  and profile:
 https://docs.python.org/2/library/profile.html  but these will require
 learning a bit more python and probably aren't needed for the
 granularity of this particular problem.

 -Toshio

 On Mon, Dec 8, 2014 at 6:46 AM, Josef Špak josef.s...@gmail.com wrote:
  Hello,
 
  I'm trying to find out why the git module is so incredibly slow.
 
  * I'd like to fix it if possible
  * I need a better profiling tool than eyeballing git module run in htop
 on
  the remote host.
 
  I tried https://github.com/rkern/line_profiler but I couldn't get
 anywhere,
  probably because I'm a python newbie.
 
  Would anyone be able give me a few pointers on how to profile ansible
 module
  code?
 
 
  Thanks,
 
  Josef
 
  --
  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 to this group, send email to ansible-project@googlegroups.com.
  To view this discussion on the web visit
 
 https://groups.google.com/d/msgid/ansible-project/2597e894-30e6-4ada-afb1-3e14fe37aa90%40googlegroups.com
 .
  For more options, visit https://groups.google.com/d/optout.

 --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/CAG9juErTT8vEbo%2BL5%3D4p30c2eaXXxB%2B8qcDmLtca3Fg7YL7UzQ%40mail.gmail.com
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgzo2f%3D4VJOLiJ7ip_JTdaniguXkBs%2BUh84%2BBsJDC4PJsQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] need to use more faster way to synchronize packages

2014-12-09 Thread Michael DeHaan
If these are packages, how about setting up a package manager and use a
local mirror?

(I guess the first question is what kind of packages?)



On Tue, Dec 9, 2014 at 1:05 AM, Jun Young Kim juneng...@gmail.com wrote:

 Hi, groups['ALL'].

 I need to copy packages from a build server to the other servers.
 Currently, I am using synchronize to copy them. however, this kind of
 stuff is too slow if the target machines are very large.
 Even if I am using parallel executions, It spent quite long time to
 complete.  The counts of target machines are over 700 and the size of
 packages is over hundreds megabytes and I need to do them all under a max
 network bandwidth.

 is there any more faster to deploy packages?

 My simple idea is that if synchronize is using echoing style deployment,
 the performance will be better.

 --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/844674be-061f-4f83-b603-2f5b934d880c%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/844674be-061f-4f83-b603-2f5b934d880c%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgyh6pFNA1NMJLy64FDEjh%3DFLZG6rodL%3Dsyw0da4-naXng%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Feature idea: Adding a vault/ subdir to group_vars and host_vars

2014-12-09 Thread Michael DeHaan
You can have subdirectories under group_vars/groupname/*.yml if you want,
and some of those can be vault encrypted.



On Tue, Dec 9, 2014 at 9:28 AM, Hagai Kariti hkar...@gmail.com wrote:

 The pull request for the docs has been merged already. The relevant doc
 page is here: http://docs.ansible.com/intro_inventory.html

 Just search for 'vault' in that page. It doesn't have info this thread
 doesn't though...

 On Tue, Dec 9, 2014 at 3:14 PM, Chris Adams chrisdaggi...@gmail.com
 wrote:

 Hi all,

 I just came across this after puzzling over how best to use ansible-vault
 to manage sensitive credentials in group vars, without encrypting
 everything, and I couldn't find the pull request for this when looking
 through the github issues for

 Would someone share a link to it?

 Thanks

 Chris

 On Friday, 23 May 2014 15:36:18 UTC+2, Hagai Kariti wrote:

 Yeah that's me :-)
 On May 23, 2014 3:19 PM, Michael DeHaan mic...@ansible.com wrote:

 Docs are open source and there's already an open pull request for that
 in the docs.




 On Thu, May 22, 2014 at 4:57 AM, Hagai Kariti hka...@gmail.com wrote:


 On Thu, May 22, 2014 at 1:16 AM, Michael DeHaan mic...@ansible.com
 wrote:

 Using Vault in group_vars has the downside of losing version
 control on the vaulted file

 This is not neccessarily the case.

 group_vars/ folders are also loaded if they live alongside the
 playbook, so that can be a good option.

 You could also keep the variables in a role vars/ directory and pull
 them in to hosts that need them.

 In fact, a role can contain nothing but vars, and that works too!


 Yeah I know, but that's not helping my specific use case, as I need
 different sensitive variables based on inventory, not role or playbook.
 Serge's suggestion was what solved it for me - too bad this feature
 isn't documented!



 On Wed, May 21, 2014 at 11:21 AM, Hagai Kariti hka...@gmail.com
 wrote:

 Whoa, dude. Didn't know that trick. Yeah that actually solves my
 case pretty nicely. Thanks a bunch.

 On Wednesday, May 21, 2014 6:16:19 PM UTC+3, Serge van Ginderachter
 wrote:


 On 21 May 2014 16:53, Hagai Kariti hka...@gmail.com wrote:

 It's really the same idea as group_vars. For each group a host is
 a member of, two files are included:
 - The file under group_vars/, as usual
 - The vaulted file under the vaulted group_vars dir

 This allows you to separate the sensitive and normal parts of your
 group_vars, so that you won't lose version control on the normal 
 parts.


 ​OK, actually, you already can do something similar, what I do:

 for each group X I have a directory group_vars/X/

 every file in that dir will be loaded for group X
 then you van have a group_vars/X/secret.yml e.g. which is vaulted.​

 Would that work for you?

  --
 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...@googlegroups.com.
 To post to this group, send email to ansible...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/
 cc0d252e-fb8b-407e-abf1-3bad7c19eae0%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/cc0d252e-fb8b-407e-abf1-3bad7c19eae0%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


  --
 You received this message because you are subscribed to a topic in
 the Google Groups Ansible Project group.
 To unsubscribe from this topic, visit https://groups.google.com/d/
 topic/ansible-project/VgGIyBhFtZM/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 ansible-proje...@googlegroups.com.
 To post to this group, send email to ansible...@googlegroups.com.
 To view this discussion on the web visit https://groups.google.com/d/
 msgid/ansible-project/CA%2BnsWgx4yAt_LJsc3nn%2BQWxhXDGd8_
 aj2zk7pyGTEi1yKPBCvw%40mail.gmail.com
 https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgx4yAt_LJsc3nn%2BQWxhXDGd8_aj2zk7pyGTEi1yKPBCvw%40mail.gmail.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


  --
 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...@googlegroups.com.
 To post to this group, send email to ansible...@googlegroups.com.
 To view this discussion on the web visit https://groups.google.com/d/
 msgid/ansible-project/CAO0%3DbmHB44%3DyFj-oW7%
 2B25MCdzFytXjpCoCY82GoBqZGO%2BLiW0A%40mail.gmail.com
 https://groups.google.com/d/msgid/ansible-project/CAO0%3DbmHB44%3DyFj-oW7%2B25MCdzFytXjpCoCY82GoBqZGO%2BLiW0A%40mail.gmail.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


  --
 You received this message because you are subscribed to a topic in the
 Google Groups Ansible

Re: [ansible-project] Limiting hosts when including playbooks stopped working in 1.8

2014-12-07 Thread Michael DeHaan
Yeah the scope is wrong on this one - You can't do that.

If it happened to work like this before, it would be an accident :)




On Sun, Dec 7, 2014 at 2:32 PM, Wolfgang Ziegler nup...@gmail.com wrote:

 As noted in the example over at
 https://github.com/ansible/ansible/issues/9733 I'm setting the host-group
 when including the playbook like this:


 - include: test-include.yml hosts=group




 Am Samstag, 6. Dezember 2014 05:50:17 UTC+1 schrieb Michael DeHaan:

 Where did you define the 'my group' variable?



 On Fri, Dec 5, 2014 at 2:48 PM, Wolfgang Ziegler nup...@gmail.com
 wrote:

 Sure, I've been using {{ hosts }} - I just copied the example from the
 old docs - sry for that. I did some more testing and think this is a bug. I
 reported it with a simple example playbook at
 https://github.com/ansible/ansible/issues/9733

 Am Freitag, 5. Dezember 2014 01:56:26 UTC+1 schrieb Michael DeHaan:

 Ansible hasn't used a dollar sign for variable replacement in a long
 time

 Try

 {{ hosts }}



 On Thu, Dec 4, 2014 at 2:10 AM, Wolfgang Ziegler // fago 
 nup...@gmail.com wrote:

 I figured, the variabel replacement still works fine - but for some
 reason the host groups are not forwarded to the included playbook anymore.
 E.g., in root playbook the host is in group mygroup, but when the
 included playbook runs for mygroup the host is not matched any more. The
 output is like this:

 PLAY [mygroup] **
 
 skipping: no hosts matched

 2014-12-04 10:40 GMT+01:00 Wolfgang Ziegler nup...@gmail.com:

 Hi!

 I'm using the pattern outlined at https://github.com/ansible/ans
 ible/pull/1956 to include playbooks for a limitted group of hosts.
 In short:

  ---
  # configure-webservers.yaml
  - name: configure the webservers
hosts: webservers:$hosts tasks: ...

  ---
  # Configure staging server
 - include: configure-webservers.yaml hosts=staging




 However, this stopped working when upgrading to ansible 1.8.1. Is
 this a bug, or is passing variables to playbook includes like that not
 supported any more?

 If it's not supported any more, any other suggestions on how to do
 this?

 My use case is a rather general provising playbook - including
 multiple roles and possibly some custom tasks - which I want to be able 
 to
 dynamically apply to some hosts from a playbook run. It shouldn't apply 
 to
 all hosts though.

 Best regards,
 Wolfgang

 --
 You received this message because you are subscribed to a topic in
 the Google Groups Ansible Project group.
 To unsubscribe from this topic, visit https://groups.google.com/d/to
 pic/ansible-project/c8bdwPtR640/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 ansible-proje...@googlegroups.com.
 To post to this group, send email to ansible...@googlegroups.com.
 To view this discussion on the web visit https://groups.google.com/d/
 msgid/ansible-project/03e0501f-ade6-4a4d-ae3a-59cc9eba118c%
 40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/03e0501f-ade6-4a4d-ae3a-59cc9eba118c%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


  --
 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...@googlegroups.com.
 To post to this group, send email to ansible...@googlegroups.com.
 To view this discussion on the web visit https://groups.google.com/d/
 msgid/ansible-project/CAL0uX3SK3kNtTAnaocPFQ7moBDUEhat6NbZ66w2
 Pr3_3SN9EBw%40mail.gmail.com
 https://groups.google.com/d/msgid/ansible-project/CAL0uX3SK3kNtTAnaocPFQ7moBDUEhat6NbZ66w2Pr3_3SN9EBw%40mail.gmail.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.


  --
 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...@googlegroups.com.
 To post to this group, send email to ansible...@googlegroups.com.
 To view this discussion on the web visit https://groups.google.com/d/
 msgid/ansible-project/492b382f-7567-41ec-8e80-
 ac0c4d28cabc%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/492b382f-7567-41ec-8e80-ac0c4d28cabc%40googlegroups.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.


  --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/6f593126-9555-4f24-9a26-3e8040dc8ec1%40googlegroups.com
 https

Re: [ansible-project] Limiting hosts when including playbooks stopped working in 1.8

2014-12-07 Thread Michael DeHaan
Perhaps you meant this was a playbook level include -- which perhaps should.

Can we see the top level playbook in entirety?



On Sun, Dec 7, 2014 at 4:37 PM, Michael DeHaan mich...@ansible.com wrote:

 Yeah the scope is wrong on this one - You can't do that.

 If it happened to work like this before, it would be an accident :)




 On Sun, Dec 7, 2014 at 2:32 PM, Wolfgang Ziegler nup...@gmail.com wrote:

 As noted in the example over at
 https://github.com/ansible/ansible/issues/9733 I'm setting the
 host-group when including the playbook like this:


 - include: test-include.yml hosts=group




 Am Samstag, 6. Dezember 2014 05:50:17 UTC+1 schrieb Michael DeHaan:

 Where did you define the 'my group' variable?



 On Fri, Dec 5, 2014 at 2:48 PM, Wolfgang Ziegler nup...@gmail.com
 wrote:

 Sure, I've been using {{ hosts }} - I just copied the example from the
 old docs - sry for that. I did some more testing and think this is a bug. I
 reported it with a simple example playbook at
 https://github.com/ansible/ansible/issues/9733

 Am Freitag, 5. Dezember 2014 01:56:26 UTC+1 schrieb Michael DeHaan:

 Ansible hasn't used a dollar sign for variable replacement in a long
 time

 Try

 {{ hosts }}



 On Thu, Dec 4, 2014 at 2:10 AM, Wolfgang Ziegler // fago 
 nup...@gmail.com wrote:

 I figured, the variabel replacement still works fine - but for some
 reason the host groups are not forwarded to the included playbook 
 anymore.
 E.g., in root playbook the host is in group mygroup, but when the
 included playbook runs for mygroup the host is not matched any more. 
 The
 output is like this:

 PLAY [mygroup] **
 
 skipping: no hosts matched

 2014-12-04 10:40 GMT+01:00 Wolfgang Ziegler nup...@gmail.com:

 Hi!

 I'm using the pattern outlined at https://github.com/ansible/ans
 ible/pull/1956 to include playbooks for a limitted group of hosts.
 In short:

  ---
  # configure-webservers.yaml
  - name: configure the webservers
hosts: webservers:$hosts tasks: ...

  ---
  # Configure staging server
 - include: configure-webservers.yaml hosts=staging




 However, this stopped working when upgrading to ansible 1.8.1. Is
 this a bug, or is passing variables to playbook includes like that not
 supported any more?

 If it's not supported any more, any other suggestions on how to do
 this?

 My use case is a rather general provising playbook - including
 multiple roles and possibly some custom tasks - which I want to be able 
 to
 dynamically apply to some hosts from a playbook run. It shouldn't apply 
 to
 all hosts though.

 Best regards,
 Wolfgang

 --
 You received this message because you are subscribed to a topic in
 the Google Groups Ansible Project group.
 To unsubscribe from this topic, visit https://groups.google.com/d/to
 pic/ansible-project/c8bdwPtR640/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 ansible-proje...@googlegroups.com.
 To post to this group, send email to ansible...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/03e0501f-
 ade6-4a4d-ae3a-59cc9eba118c%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/03e0501f-ade6-4a4d-ae3a-59cc9eba118c%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


  --
 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...@googlegroups.com.
 To post to this group, send email to ansible...@googlegroups.com.
 To view this discussion on the web visit https://groups.google.com/d/
 msgid/ansible-project/CAL0uX3SK3kNtTAnaocPFQ7moBDUEhat6NbZ66w2
 Pr3_3SN9EBw%40mail.gmail.com
 https://groups.google.com/d/msgid/ansible-project/CAL0uX3SK3kNtTAnaocPFQ7moBDUEhat6NbZ66w2Pr3_3SN9EBw%40mail.gmail.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.


  --
 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...@googlegroups.com.
 To post to this group, send email to ansible...@googlegroups.com.
 To view this discussion on the web visit https://groups.google.com/d/
 msgid/ansible-project/492b382f-7567-41ec-8e80-
 ac0c4d28cabc%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/492b382f-7567-41ec-8e80-ac0c4d28cabc%40googlegroups.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.


  --
 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 to this group, send

Re: [ansible-project] Role Dependency Not Being Executed

2014-12-07 Thread Michael DeHaan
Hard to see with the way it's written above, do you perhaps have a
bare-minimum repo to share?



On Sat, Dec 6, 2014 at 1:17 PM, Jamal B jm151...@gmail.com wrote:

 Hi I have run into an issue where I'm not sure if it's a bug in Ansible or
 just my lack of understand how roles are activated. Using Ansible 1.7.2,  I
 have a playbook defined as such:

 app/site.yml
 app/roles/core/tasks/main.yml
 app/roles/app-common/tasks/main.yml
 app/roles/app-compA/meta/main.yml  - contains a dependency on app-common
 app/roles/app-compA/tasks/main.yml
 app/roles/app-compB/meta/main.yml - contains a dependency on app-common
 app/roles/app-compB/tasks/main.yml

 Where site.yml activates roles like such:

 - hosts: all
   vars:
home: /usr/local/app
release: {{ lookup('env','RELEASE') }}
group: {{ lookup('env','GROUP') }}

   roles:
   - core

   # Component Specific Stuff
   - { role: app-compA, when: group== 'compA' }
   - { role: app-compB, when: group== 'compB' }


 When I run the playbook like so:
 export GROUP=compA
 ansible-playbook site.yml -c local

 The roles core, app-common  app-compA execute like expected.

 However when I run the playbook like so:
 export GROUP=compB
 ansible-playbook site.yml -c local

 Only the roles core and app-compB are executed and the app-common role is
 not executed.  Shouldn't the app-common role also be executed in this case?
   Is this a bug or have I mis-understood how roles are executed when role
 dependencies exists?  My intent was to minimize the duplication of the
 tasks defined in app-common that are required by the app-compA  app-compB
 roles, so if there is another way to do this I'm all ears.

 Thanks

 --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/3754460d-d331-4f22-bc8c-318abf8a7d7c%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/3754460d-d331-4f22-bc8c-318abf8a7d7c%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgxZQ5u4%2Bk%3DX2JVgd3AqNknuqaWB28zgZWCD0m%2BRgUSTFA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: delegate_to not working with hosts not in inventory?

2014-12-05 Thread Michael DeHaan
delegate_to only works when the host we wnat to delegate to is in the
current inventory, is this intentional? It was working fine on 1.7.2

Ok, doesn't sound to be super breaking, but we're on it.  Thanks for the
report.



On Fri, Dec 5, 2014 at 6:43 AM, James Cammarata jcammar...@ansible.com
wrote:

 Thanks Tim, there was a bugfix related to delegate_to in this release,
 which may have created this bug.  We'll look into this today.

 On Fri, Dec 5, 2014 at 7:27 AM, Tim Rice timric...@gmail.com wrote:

 Can add that we have downgraded to 1.8.1 and both things appear to work
 fine..

 --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/6aa85194-dd24-47af-b51a-d347ec5f1027%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/6aa85194-dd24-47af-b51a-d347ec5f1027%40googlegroups.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.


  --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/CAMFyvFgzMoroP6OT-zXRCYe8ZWXOAnT2HO3CCCHEJ6B6z5GtVg%40mail.gmail.com
 https://groups.google.com/d/msgid/ansible-project/CAMFyvFgzMoroP6OT-zXRCYe8ZWXOAnT2HO3CCCHEJ6B6z5GtVg%40mail.gmail.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgxW8cqp_0F5%2BnqC3o75TaTFVbaFmvd9w2%2B1yh2msBFZiA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Ansible + Jenkins

2014-12-05 Thread Michael DeHaan
or check out Tower :)



On Fri, Dec 5, 2014 at 9:50 AM, Azul Inho m...@azulinho.com wrote:

 I use jenkins heavily for orchestration, in a setup where I have multiple
 jenkins CD pipelines in different environments all deploying code using
 Ansible.

 See this setup below, it's an example for deploying jenkins, setting up
 the jobs and dependencies.
 It also shows how to provisioning and configure a zabbix box using Ansible
 executed from a jenkins job,
 you should be able to adapt it to execute anything you like

 https://github.com/Azulinho/ansible-jenkins-showcase




 On Monday, November 17, 2014 8:39:54 PM UTC, Michael DeHaan wrote:

 An alternative, which you may like, is to install Ansible Tower, and then
 use ansible-tower-cli in your shell step.

 It makes integration with Jenkins a one liner.

 It will get you nicer output, particularly for a larger number of hosts,
 than Jenkins, and also some nice ways to edit inventory and identify
 problems.



 On Mon, Nov 17, 2014 at 7:08 AM, Manuel Jesús Recena Soto 
 rec...@klicap.es wrote:

 Hello Alex,

 As Torsten said you, you can use Shell buildstep and invoke your
 playbook (Ansible).
 At ClinkerHQ (Hosted CI service based on Jenkins) you can available
 Ansible Playbook.

 Disclaimer: I work at ClinkerHQ.

 Regards,

 On 15 November 2014 09:47, Torsten Reinhard in...@torstenreinhard.de
 wrote:
  Hi,
 
  why dont use a “Shell” Buildstep and inside just do:
 
  ansible-playbook –i /path/to/hosts playbook.yml –v –extra-vars .
 and so
  on?
 
  Of course you need an Ansible installation on your system, first.
 
  That´s the way how I´ve setup this – and all playbooks are executed
  immediately after a SVN commit – running against local virtual
 environments.
 
  Regards, Torsten
 
  From: Alex T
  Sent: Thursday, November 13, 2014 9:27 AM
  To: ansible...@googlegroups.com
  Subject: [ansible-project] Ansible + Jenkins
 
  Hi!
  Everybody knows, how to run ansible playbook from jenkins ci?
  --
  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...@googlegroups.com.
  To post to this group, send email to ansible...@googlegroups.com.
  To view this discussion on the web visit
  https://groups.google.com/d/msgid/ansible-project/
 fd43f237-4bf9-4913-a442-5c7e8c44b09d%40googlegroups.com.
  For more options, visit https://groups.google.com/d/optout.
 
  --
  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...@googlegroups.com.
  To post to this group, send email to ansible...@googlegroups.com.
  To view this discussion on the web visit
  https://groups.google.com/d/msgid/ansible-project/
 18684390802C4A8D9689089F90394B39%40SamsungRF710.
 
  For more options, visit https://groups.google.com/d/optout.



 --
 Manuel Jesús Recena Soto
 Founder, CEO  CTO of klicap - ingeniería del puzle

 mobile phone +34 664 000 629
 work phone + 34 954 894 322
 www.klicap.es | blog.klicap.es

 --
 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...@googlegroups.com.
 To post to this group, send email to ansible...@googlegroups.com.
 To view this discussion on the web visit https://groups.google.com/d/
 msgid/ansible-project/CAL4oHL8cM%2B8Fe_PKf1GGK9oYJnHb_NkjGPpKo6BtGea-
 %3DziuXg%40mail.gmail.com.
 For more options, visit https://groups.google.com/d/optout.


  --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/5a3f6bd2-3e68-4a90-ac8b-c37e8db9d46a%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/5a3f6bd2-3e68-4a90-ac8b-c37e8db9d46a%40googlegroups.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgxGZHqa77812c5Lh39b%3Dj%2B3fXFj3SfjYNP3%3D8OsdC-COA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Role namespacing directories vs. dot notation

2014-12-05 Thread Michael DeHaan
Ansible doesn't necessarily support nested role directories like you
mention, so I am going to stick with dot notation.

Ansible can check out role paths anywhere you want, you'll just have to
configure the roles path in ansible.cfg OR stick the / in there when
referring to the role name.



On Fri, Dec 5, 2014 at 2:36 PM, Matt Martz m...@sivel.net wrote:

 Dot notation is currently used by Galaxy, however the namespaces there are
 typically usernames.

 Ansible doesn't necessarily support nested role directories like you
 mention, so I am going to stick with dot notation.

 It's really just a directory name with a period in it at that point.

 To reference it, you need to use the full dot notated name such as
 fizz.buzz


 On Friday, December 5, 2014, Mirko Friedenhagen mfriedenha...@gmail.com
 wrote:

 Hello,

 when you have a lot of roles, it might be feasible give them a
 structure. What's the preferred way in ansible?
 Using directory hierarchies like roles/fizz/buzz or dots roles/fizz.buzz?

 Regards Mirko
 --
 http://illegalstateexception.blogspot.com/
 https://github.com/mfriedenhagen/ (http://osrc.dfm.io/mfriedenhagen)
 https://bitbucket.org/mfriedenhagen/

 --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/CAK8jvqyNsDAhtwe%2Bde_NH27xg4pu_km7OoEeNdBz9r_pHDkwvg%40mail.gmail.com
 .
 For more options, visit https://groups.google.com/d/optout.



 --
 Matt Martz
 @sivel
 sivel.net

  --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/CAD8N0v9%2BbmzsGgmChLGqYbDK-EB8ftB3S%2BOJCTY91StJzrM18A%40mail.gmail.com
 https://groups.google.com/d/msgid/ansible-project/CAD8N0v9%2BbmzsGgmChLGqYbDK-EB8ftB3S%2BOJCTY91StJzrM18A%40mail.gmail.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgxi2sUwUA9nqKS25gn4KoCps2E4GZwTrZPcEdXM939T6g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Limiting hosts when including playbooks stopped working in 1.8

2014-12-05 Thread Michael DeHaan
Where did you define the 'my group' variable?



On Fri, Dec 5, 2014 at 2:48 PM, Wolfgang Ziegler nup...@gmail.com wrote:

 Sure, I've been using {{ hosts }} - I just copied the example from the old
 docs - sry for that. I did some more testing and think this is a bug. I
 reported it with a simple example playbook at
 https://github.com/ansible/ansible/issues/9733

 Am Freitag, 5. Dezember 2014 01:56:26 UTC+1 schrieb Michael DeHaan:

 Ansible hasn't used a dollar sign for variable replacement in a long time

 Try

 {{ hosts }}



 On Thu, Dec 4, 2014 at 2:10 AM, Wolfgang Ziegler // fago 
 nup...@gmail.com wrote:

 I figured, the variabel replacement still works fine - but for some
 reason the host groups are not forwarded to the included playbook anymore.
 E.g., in root playbook the host is in group mygroup, but when the
 included playbook runs for mygroup the host is not matched any more. The
 output is like this:

 PLAY [mygroup] **
 
 skipping: no hosts matched

 2014-12-04 10:40 GMT+01:00 Wolfgang Ziegler nup...@gmail.com:

 Hi!

 I'm using the pattern outlined at https://github.com/ansible/
 ansible/pull/1956 to include playbooks for a limitted group of hosts.
 In short:

  ---
  # configure-webservers.yaml
  - name: configure the webservers
hosts: webservers:$hosts tasks: ...

  ---
  # Configure staging server
 - include: configure-webservers.yaml hosts=staging




 However, this stopped working when upgrading to ansible 1.8.1. Is this
 a bug, or is passing variables to playbook includes like that not supported
 any more?

 If it's not supported any more, any other suggestions on how to do this?

 My use case is a rather general provising playbook - including multiple
 roles and possibly some custom tasks - which I want to be able to
 dynamically apply to some hosts from a playbook run. It shouldn't apply to
 all hosts though.

 Best regards,
 Wolfgang

 --
 You received this message because you are subscribed to a topic in the
 Google Groups Ansible Project group.
 To unsubscribe from this topic, visit https://groups.google.com/d/
 topic/ansible-project/c8bdwPtR640/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 ansible-proje...@googlegroups.com.
 To post to this group, send email to ansible...@googlegroups.com.
 To view this discussion on the web visit https://groups.google.com/d/
 msgid/ansible-project/03e0501f-ade6-4a4d-ae3a-
 59cc9eba118c%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/03e0501f-ade6-4a4d-ae3a-59cc9eba118c%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


  --
 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...@googlegroups.com.
 To post to this group, send email to ansible...@googlegroups.com.
 To view this discussion on the web visit https://groups.google.com/d/
 msgid/ansible-project/CAL0uX3SK3kNtTAnaocPFQ7moBDUEh
 at6NbZ66w2Pr3_3SN9EBw%40mail.gmail.com
 https://groups.google.com/d/msgid/ansible-project/CAL0uX3SK3kNtTAnaocPFQ7moBDUEhat6NbZ66w2Pr3_3SN9EBw%40mail.gmail.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.


  --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/492b382f-7567-41ec-8e80-ac0c4d28cabc%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/492b382f-7567-41ec-8e80-ac0c4d28cabc%40googlegroups.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgy9y2rUjBx9wtDoGQCrsVmagr8QPai16vW705ESxckWRA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: Three questions regarding asynchronous jobs

2014-12-04 Thread Michael DeHaan
1.  async_status works on a particular JID but cannot be called on
wildcards.

2.  killing fire and forget jobs?  Not presently.

3.  For the async directory you would want to delete the leftover files
manually.  I believe non fire and forget jobs do delete the file.



On Thu, Dec 4, 2014 at 1:25 PM, Ingmar Schlecht ing...@gmail.com wrote:

 Hi there,

 just bumping my old question up again.

 Especially the first and second question are still of high interest for me
 (nobody using async jobs in the way I do?):

 1.) How can I check the async_status of a fire and forget job on all my
 servers at once? So instead of checking a specific server's job id
 115503716196.18657 (mind the dot) I would like to basically check
 115503716196.*, which doesn't work. Also just 115503716196 doesn't work.

 2.)  Is there a way to kill fire and forget async jobs?

 Best
 Ingmar


 On Wednesday, November 12, 2014 3:14:31 PM UTC+1, Ingmar Schlecht wrote:

 Hi there,

 just three short questions regarding async jobs.

 1.) How can I check the async_status of a fire and forget job on all my
 servers at once? So instead of checking a specific server's job id
 115503716196.18657 (mind the dot) I would like to basically check
 115503716196.*, which doesn't work. Also just 115503716196 doesn't work.

 2.)  Is there a way to kill fire and forget async jobs?

 3.) Is there some sort of garbage collection being done for the
 ~/.ansible_async/ directory or does that grow forever?

 Here's a bit more explanation regarding just my first question, how I can
 check the async_status of a job on all my servers at once:

 Say I'm executing an async job like that:

 ansible all -B 90 -P 0 -a sleep 80

 I get a confirmation of successful start like this:

 background launch...

 ip_srv1 | success  {
 ansible_job_id: 115503716196.18657,
 results_file: /home/ubuntu/.ansible_async/115503716196.18657,
 started: 1
 }

 ip_srv2 | success  {
 ansible_job_id: 115503716196.6532,
 results_file: /home/ubuntu/.ansible_async/115503716196.6532,
 started: 1
 }


 Now, is there a way to check the status of the job on all servers at once?

 I tried the obvious choice first and did:

 ansible all -m async_status -a jid=115503716196

 However, this just results in:

 ip_srv1 | FAILED  {
 ansible_job_id: 115503716196,
 failed: true,
 msg: could not find job
 }

 ip_srv2 | FAILED  {
 ansible_job_id: 115503716196,
 failed: true,
 msg: could not find job
 }

 Only if I do:

 ansible all -m async_status -a jid=115503716196.18657

 I get what I want - but of course only for the server of which I typed in
 the concret job id.


 54.171.202.93 | success  {
 ansible_job_id: 115503716196.18657,
 changed: false,
 results_file: /home/ubuntu/.ansible_async/115503716196.18657,
 started: 1
 }

 54.72.229.37 | FAILED  {
 ansible_job_id: 115503716196.18657,
 failed: true,
 msg: could not find job
 }

 Cheers
 Ingmar


  --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/e3b5c01a-f36d-4173-b502-53e56eeb5eb6%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/e3b5c01a-f36d-4173-b502-53e56eeb5eb6%40googlegroups.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgxXPMP-PbgRVQdvRO6brqU8YOJBokZhaG5nAqbXz_9cSg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] no_log will not always hide sensitive data

2014-12-04 Thread Michael DeHaan
yeah it's important for debug that we show the loop counter of the item, so
we don't hide that with no_log.  I think most times people would want to
see what task is exec'ing in the loop - there could be hundreds.

Now, here's the trick I was alluding to on Twitter:

in group_vars/foo or wherever, assume a vault-encrypted file:

user_details:
timmy:
   username: timmy
   password: foo
jimmy:
   username: jimmy
   password: bar

And in your playbook:

 - shell: some task ... {{ user_details[item][password] }} ...
   with_items: user_names
   no_log: True

And this way it will print the name on each loop indicator, but not the
details that you don't want to show

There are a couple of other ways to do this, the main trick is just don't
loop over the sensitive items.   I believe we have a keys() filter to use
or there's one in stock Jinja that makes this easier as well.





On Thu, Dec 4, 2014 at 3:54 PM, Frederic Lemay frederic.le...@gmail.com
wrote:

 Hi,

 Sometimes playbooks need sensitive information like username/password and you 
 may want to hide it from your log. So you can use the no_log feature and in 
 most cases, it works. However, using it with with_items does not.

 The following simple example demonstrates it.

 Ansible version 1.8.1:

 *test.yml*
 ---
 - hosts: 127.0.0.1
   vars_files:
 - vars.yml
   tasks:
 - shell: echo {{ username }} {{ password }}
   register: result
   with_items: auth
   no_log: True

 - fail: msg=something bad
   when: result is defined and item.rc != 0
   with_items: result.results
   no_log: True

 *vars.yml*
 ---
 auth:

   - { username: user1, password: pass1 }
   - { username: user2, password: pass2 }
   - { username: user3, password: pass3 }

 Command: ansible-playbook -v test.yml

 Result is shown below!

 Any thoughts?

 If you use -vv, *no_log* will not hide anything (I know it is intent to be 
 used with -v only). I personally think it would be nice to have the option to 
 display {{ password }} instead of the real password. I could still benefit 
 from having more information in the log and at the same time not worrying 
 about displaying sensitive information. It is more useful to see something 
 like echo {{ username }} {{ password }} in the log rather than censored: 
 results hidden due to no_log parameter.



 

 root@553a7fa15e9f:/opt/workspace# ansible-playbook -v test.yml

 PLAY [127.0.0.1] 
 **

 GATHERING FACTS 
 ***
 ok: [127.0.0.1]

 TASK: [shell echo {{ username }} {{ password }}] 
 **
 changed: [127.0.0.1] = {censored: results hidden due to no_log 
 parameter, changed: true, rc: 0}
 changed: [127.0.0.1] = {censored: results hidden due to no_log 
 parameter, changed: true, rc: 0}
 changed: [127.0.0.1] = {censored: results hidden due to no_log 
 parameter, changed: true, rc: 0}

 TASK: [fail msg=something bad] 
 **
 skipping: [127.0.0.1] = (item={u'cmd': u'echo user4 pass4', u'end': 
 u'2014-11-26 03:18:53.800823', u'stderr': u'', u'stdout': u'user4 pass4', 
 u'changed': True, u'rc': 0, 'item': {'username': 'user1', 'password': 
 'pass1'}, u'warnings': [], u'delta': u'0:00:00.065612', 'invocation': 
 {'module_name': u'shell', 'module_args': u'echo user4 pass4'}, u'start': 
 u'2014-11-26 03:18:53.735211'})
 skipping: [127.0.0.1] = (item={u'cmd': u'echo user4 pass4', u'end': 
 u'2014-11-26 03:18:53.917499', u'stderr': u'', u'stdout': u'user4 pass4', 
 u'changed': True, u'rc': 0, 'item': {'username': 'user2', 'password': 
 'pass2'}, u'warnings': [], u'delta': u'0:00:00.062923', 'invocation': 
 {'module_name': u'shell', 'module_args': u'echo user4 pass4'}, u'start': 
 u'2014-11-26 03:18:53.854576'})
 skipping: [127.0.0.1] = (item={u'cmd': u'echo user4 pass4', u'end': 
 u'2014-11-26 03:18:54.030859', u'stderr': u'', u'stdout': u'user4 pass4', 
 u'changed': True, u'rc': 0, 'item': {'username': 'user3', 'password': 
 'pass3'}, u'warnings': [], u'delta': u'0:00:00.062825', 'invocation': 
 {'module_name': u'shell', 'module_args': u'echo user4 pass4'}, u'start': 
 u'2014-11-26 03:18:53.968034'})

 PLAY RECAP 
 
 127.0.0.1  : ok=3changed=1unreachable=0failed=0

  --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/c781f8c0-c843-4ce4-a685-0dd9ac9e9746%40googlegroups.com
 

Re: [ansible-project] Limiting hosts when including playbooks stopped working in 1.8

2014-12-04 Thread Michael DeHaan
Ansible hasn't used a dollar sign for variable replacement in a long time

Try

{{ hosts }}



On Thu, Dec 4, 2014 at 2:10 AM, Wolfgang Ziegler // fago nup...@gmail.com
wrote:

 I figured, the variabel replacement still works fine - but for some reason
 the host groups are not forwarded to the included playbook anymore. E.g.,
 in root playbook the host is in group mygroup, but when the included
 playbook runs for mygroup the host is not matched any more. The output is
 like this:

 PLAY [mygroup]
 **
 skipping: no hosts matched

 2014-12-04 10:40 GMT+01:00 Wolfgang Ziegler nup...@gmail.com:

 Hi!

 I'm using the pattern outlined at
 https://github.com/ansible/ansible/pull/1956 to include playbooks for a
 limitted group of hosts. In short:

  ---
  # configure-webservers.yaml
  - name: configure the webservers
hosts: webservers:$hosts tasks: ...

  ---
  # Configure staging server
 - include: configure-webservers.yaml hosts=staging




 However, this stopped working when upgrading to ansible 1.8.1. Is this a
 bug, or is passing variables to playbook includes like that not supported
 any more?

 If it's not supported any more, any other suggestions on how to do this?

 My use case is a rather general provising playbook - including multiple
 roles and possibly some custom tasks - which I want to be able to
 dynamically apply to some hosts from a playbook run. It shouldn't apply to
 all hosts though.

 Best regards,
 Wolfgang

 --
 You received this message because you are subscribed to a topic in the
 Google Groups Ansible Project group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/ansible-project/c8bdwPtR640/unsubscribe
 .
 To unsubscribe from this group and all its topics, send an email to
 ansible-project+unsubscr...@googlegroups.com.
 To post to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/03e0501f-ade6-4a4d-ae3a-59cc9eba118c%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/03e0501f-ade6-4a4d-ae3a-59cc9eba118c%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


  --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/CAL0uX3SK3kNtTAnaocPFQ7moBDUEhat6NbZ66w2Pr3_3SN9EBw%40mail.gmail.com
 https://groups.google.com/d/msgid/ansible-project/CAL0uX3SK3kNtTAnaocPFQ7moBDUEhat6NbZ66w2Pr3_3SN9EBw%40mail.gmail.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgzAcomRm%2BKQSDbjyx8XoWU%3Dz2_zgFrKODLYoOK47S0UgA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] set_fact retain the fact between run?

2014-12-04 Thread Michael DeHaan
Indeed they can!

http://docs.ansible.com/playbooks_variables.html#fact-caching



On Thu, Dec 4, 2014 at 5:17 PM, Steve Kieu msh.comput...@gmail.com wrote:

 Hi Team,

 I read that it is retained between each play.

 So I got

 TASK: [web_base | set fact CUSTOMER_LOCATOR_PORT]
 *
 ok: [demo-web-kr] = {ansible_facts: {CUSTOMER_LOCATOR_PORT: 52360}}

 But then I run
 ansible -i hosts 'demo-web-kr' -u root -k -msetup|grep LOCATOR

 found nothing about that variable. (I did remove the grep and search for
 it :-) .

 And it looks like the same when using ansible-playbook. In the real
 example on my hosts file I set


 CUSTOMER_LOCATOR_PORT={{ansible_CUSTOMER_LOCATOR_PORT|default(6|random(5,10))}}

 and the set_fact is in one of the role task but it does not work - that
 means it changes every time I run playbook.

 Any idea why?

 thanks in advance.

  --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/86822515-e83b-43d1-8963-9f0fd8b1d6af%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/86822515-e83b-43d1-8963-9f0fd8b1d6af%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgxg1c1RfTtA5r%2BsUqMTKdozW8ziMZHQyachH62YjOJiaw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: template error

2014-12-03 Thread Michael DeHaan
Removing the code that lets you know when there's a syntax error seems to
be a bad thing :)

not sure what's up there to be honest, but I think pinning down what the
error is is appropriate.



On Wed, Dec 3, 2014 at 10:50 AM, simonq si...@qubs.se wrote:

 Sorry for the late reply, forgot about this one. Anyway, after looking
 through some commits it seems this error message comes with b61a785:

 in lib/ansible/utils/template.py;

 except TemplateSyntaxError, e:
 raise errors.AnsibleError(template error while templating
 string: %s % str(e))

 Removing those lines makes the playbook run without errors :)


 On Tuesday, 11 November 2014 22:58:23 UTC+1, simonq wrote:

 I get* template error while templating string: unexpected '.' *when
 running this task using ansible 1.8 (devel fa953e162e). Used to work with
 previous version I was running (1d04e4b3d2). Any thoughts?

 - name: Get image id
   command: 
 docker inspect -f '{% raw %}{{ .Image }}{% endraw %}' nginx
   register: container_image

 - name: Do something with image
   command: echo {{ container_image.stdout }}

  --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/44a6710c-ea35-43c4-aaf9-5d03b871805f%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/44a6710c-ea35-43c4-aaf9-5d03b871805f%40googlegroups.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgyGvhAYcSYgnsAS%2BBd1EUB9p7NoBg9fLMSABN7eS-sUxA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] How can I troubleshoot the speed of ansible-playbook runs?

2014-12-03 Thread Michael DeHaan
Please let us know if you observe problems in 1.8.X -- we won't be doing
backports to an older series, though I suppose you could if you really
wanted to, we can't support older versions on this list.



On Tue, Dec 2, 2014 at 9:18 PM, Alex King a...@king.net.nz wrote:

 Indeed it runs _much_ faster with host_key_checking disabled.

 I have a dynamic inventory - I written a script to produces the groups,
 hosts and hostvars.

 I'm on ansible 1.7.2+dfsg-2, the version in Debian testing and destined
 for Debian stable release in the next few months.  I'm happy to test with
 later/latest versions, but once things are working I'll see if the fix also
 translates back to 1.7.2 since staying on that would be easier for me.

 Cheers,
 Alex

 On Sunday, November 30, 2014 11:36:19 AM UTC+13, Michael DeHaan wrote:

 Sometimes this can happen if the system isn't adding your host file to a
 host file ansible is looking for, so Ansible tightens down, executes a
 lock, and anticipates a question about whether you need to confirm adding a
 new host to your host file.

 Try temporarily disabling host key checking to see if this makes it go
 away, and if it does, we can persue from there.

 Also be sure you are on Ansible 1.8.1 -- the latest release version -- as
 well, as we recently made some changes regarding reading more possible host
 file locations.


  --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/e1f73be7-070e-4e4e-b8e3-d9dbbcaeb22b%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/e1f73be7-070e-4e4e-b8e3-d9dbbcaeb22b%40googlegroups.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgxs5pCMAPKiF6XfMooB3WvGBpJW6Nevi7kTtQOwr_0Ydw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] ansible fact availability

2014-12-03 Thread Michael DeHaan
Nevermind, this is indeed ansible_hostname, which is not available because
it's a fact -- sorry!



On Wed, Dec 3, 2014 at 11:15 AM, Michael DeHaan mich...@ansible.com wrote:

 Sounds like he's discussing a variable in his inventory file and not a
 fact, though.

 However, it's more apt to say that template expressions are not evaluated
 in ad-hoc commands.



 On Wed, Dec 3, 2014 at 8:06 AM, Brian Coca bc...@ansible.com wrote:

 ad hoc commands do not gather facts, which is what sets
 ansible_hostname, this is an expected result


 --
 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-project+unsubscr...@googlegroups.com.
 To post to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/CAJ5XC8%3D6d5Djhgp9wpwUZNcPCiGyqJURcKcmvDtfJ4jsgrbawQ%40mail.gmail.com
 .
 For more options, visit https://groups.google.com/d/optout.




-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgyEBv93rp372uTXaMAEsQP5bQqQeWc7RyLn2v6iK4WKmQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Filtering local facts

2014-12-03 Thread Michael DeHaan
Filtering isn't very deep, but that's not really the point of the feature.
Basically the filter is there for humans doing browsing, not the API or
scripts.

In templates, you would just access the variable as normal.

{{ ansible_local.java.JAVA_HOME }}

or equivalently:

{{ ansible_local[java][JAVA_HOME] }}



On Wed, Dec 3, 2014 at 11:20 AM, Rick Kasten rickkas...@gmail.com wrote:

 I am writing facts on my targets that I want to collect using ansible. In 
 this example, I have a facts.d/prefs.fact and a facts.d/java.fact. I can see 
 this works:

 # ansible tomcat_servers -i inventory -m setup -a 'filter=ansible_local'
 tomcat02 | success  {
 ansible_facts: {
 ansible_local: {
 prefs: {
 java: {
 java_home: 
 /com/envs/inventory/tomcat02/java/jdk1.7.0_55,
 java_version: jdk1.7.0_55
 }
 },
 java: {
 java:
 JAVA_HOME: 
 /com/envs/inventory/tomcat02/java/jdk1.7.0_55,
 java_version: jdk1.7.0_55
 }
 }
 }
 },
 changed: false
 }

 But how do I get only the contents of facts.d/java.fact? These examples all 
 fail with the same results:

 # ansible tomcat_servers -vvv -i inventory -m setup -a 
 'filter=ansible_local[java]'
 # ansible tomcat_servers -vvv -i inventory -m setup -a 
 'filter=ansible_local.java'
 # ansible tomcat_servers -vvv -i inventory -m setup -a 
 'filter=ansible_local[java]'
 # ansible tomcat_servers -vvv -i inventory -m setup -a 
 'filter=ansible_local.java.JAVA_HOME'
 tomcat02 | success  {
 ansible_facts: {},
 changed: false
 }

  --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/8472f809-7489-42e6-b14d-51ad06bf016d%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/8472f809-7489-42e6-b14d-51ad06bf016d%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgy0AcithyYAE05_7G3oB%2Bb4LBJzb1v%2BeSf1mgnkZhbLjw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] include: and variables (changed in 1.8?)

2014-12-03 Thread Michael DeHaan
Also I'd double check that those two vars in the include do not come from
facts or inventory.

(That would have been any any-version thing)


On Wed, Dec 3, 2014 at 4:38 PM, Brian Coca bc...@ansible.com wrote:

 a few bugs with variables were present in 1.8.x, could you test with
 current devel as there are fixes there (soon to be released) that
 might solve your issue.

 On Wed, Dec 3, 2014 at 4:31 PM, Ross Becker ross.bec...@gmail.com wrote:
  So, I have a batch of playbooks that include tasks where the filenames
 are
  determined by variables;
 
   - include: tasks/mytask-{{onevar}}-{{anothervar}}.yml
 
  This was working up through ansible 1.7.2.   As of ansible 1.8.0 (and
 also
  tested on ansible 1.8.1) this stopped working;  the variables are no
 longer
  interpreted, and ansible exits complaining with a message:
 
  ERROR: file could not read:
 /root/work/playbooks/tasks/bar-{{platform}}.yml
 
 
  Below are the bits to reproduce:
 
  foo.yml:
  - hosts: slave
user: root
 
vars:
  platform: rpm
 
tasks:
  - include: tasks/bar-{{platform}}.yml
 
  tasks/bar-rpm.yml:
  - name: install OS package dependencies
action: yum pkg={{item}} state=installed
with_items:
  - wget
  - ntpdate
 
 
  hosts.inv:
  [slave]
  sc-cluster-20-04
  sc-cluster-20-05
  sc-cluster-20-06
 
 
 
  The above case works on all ansible versions up through 1.7.2, and
 breaks on
  1.8.0+.  I searched on here a bit regarding this, and found the
 suggestion
  that variables as part of include filenames would only work if passed in
 as
  extra vars, as only those would be resolvable early enough.  I tested
 that
  on 1.7.2 by taking out the vars: section and passing the value in as an
  extra var on the command-line.  That test worked on 1.7.2 and earlier,
 but
  does not work in 1.8.0+.
 
  Is there any means where this functionality should actually work in
 1.8.x?
 
  --
  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 to this group, send email to ansible-project@googlegroups.com.
  To view this discussion on the web visit
 
 https://groups.google.com/d/msgid/ansible-project/c2604edb-dc50-4770-82e1-d638e099b766%40googlegroups.com
 .
  For more options, visit https://groups.google.com/d/optout.



 --
 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-project+unsubscr...@googlegroups.com.
 To post to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/CAJ5XC8kLBbfRctHR2nKSjPu4P_p3d3OGnZxpydRc7qgQEwxwDw%40mail.gmail.com
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgwwSrTKfAh1xcQQN0NKozDvq825zzKjsueKUnnKiow4-A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] ansible fact availability

2014-12-03 Thread Michael DeHaan
Yeah I think I remember the template commit.

(But it's not going to gather facts first, because facts are a playbook
concept)

The v2/ tree effort is essentially going to make in memory playbooks for
ad hoc commands so might make this easy with a --gather-facts switch in the
future or something like that.



On Wed, Dec 3, 2014 at 6:09 PM, Steve Kieu msh.comput...@gmail.com wrote:

 It is not true.
 If I run adhoc command and using variable defined in inventory it works
 fine.

 So ansible does not  get facts only, but these variable defiend in hosts
 and host_vars and magic var like inventory_hostname works.



 On Thu, Dec 4, 2014 at 2:55 AM, Brian Coca bc...@ansible.com wrote:

 micheal's other point still stands, ad-hoc does not do any templating,
 so even if you had the var it would not work.


 --
 Brian Coca

 --
 You received this message because you are subscribed to a topic in the
 Google Groups Ansible Project group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/ansible-project/SBurnxQCDpE/unsubscribe
 .
 To unsubscribe from this group and all its topics, send an email to
 ansible-project+unsubscr...@googlegroups.com.
 To post to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/CAJ5XC8m3TZJ-KBAkmBat1putjrbZ-J5ProfuuvAf6wOKEfJ0CA%40mail.gmail.com
 .
 For more options, visit https://groups.google.com/d/optout.




 --
 Steve Kieu

 --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/CAAQ-o%2B-CacujvjYJDLZXSNe%2BuLhyyz9Xudp_3ys9ZN7FXsTrwQ%40mail.gmail.com
 https://groups.google.com/d/msgid/ansible-project/CAAQ-o%2B-CacujvjYJDLZXSNe%2BuLhyyz9Xudp_3ys9ZN7FXsTrwQ%40mail.gmail.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgyxz_OM1QYgkZTXP1YAHukMtcn1RQ5-fwmoT13gehQtpQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Group vars override role vars?

2014-12-03 Thread Michael DeHaan
Role variables are definitely a thing.

Where you can move top level playbook things to vars/ or defaults/ in a
role it can be a good idea.

Simple playbooks like fix shellshock could use vars or vars_files fine,
or even if you find other uses, that's fine too.

We're not particularly dogmatic about it.


On Wed, Dec 3, 2014 at 6:08 PM, Josh Smift j...@care.com wrote:

 MH I’m not sure why I’d ever want to use vars/ then. Sure I could be
 MH convinced of a use-case

 A use case I've seen, which doesn't seem all that uncommon, is when you
 want to use a given role with multiple inventories, each of which has its
 own inventory/group/host vars structure. Putting the default in the role
 lets you have it in one place, and be confident that it's consistent
 across your various inventories unless you explicitly override it.

   -Josh (j...@care.com)



 This email is intended for the person(s) to whom it is addressed and may
 contain information that is PRIVILEGED or CONFIDENTIAL. Any unauthorized
 use, distribution, copying, or disclosure by any person other than the
 addressee(s) is strictly prohibited. If you have received this email in
 error, please notify the sender immediately by return email and delete the
 message and any attachments from your system.

 --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/21631.38923.225316.18272%40gargle.gargle.HOWL
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgz1b7H7zE%2Byo7OcaS95Q2JtXnS1xYOjLimgN-fA99yTXw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Ansible Week

2014-12-02 Thread Michael DeHaan
changed_when: False



On Tue, Dec 2, 2014 at 12:10 AM, Yvo van Beek y...@codegazer.com wrote:

 With regards to point 5, I noticed that Ansible 1.8.1 no longer reports
 creates= as skipped. So that's great. Is there an option we can use to
 report when: as ok too?

 --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/6e5e403e-959e-43c0-a087-982f1405641c%40googlegroups.com
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgwRc5WBSsopNXmZ5OyNadftx0Kx3Z-iGxgL70BAjbieJw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] How do i send data to the callback

2014-12-01 Thread Michael DeHaan
Hi Ritesh,

Sorry for the late response.  As this is a development question, can you
please post this on ansible-devel?

Thanks!



On Wed, Nov 26, 2014 at 3:33 PM, Ritesh Shetty ritesh.s.she...@gmail.com
wrote:

 Hi All,
 My application trigger the playbook using the python api. Now since there
 are many tasks and each might take a long time, i need to keep the user
 informed of what is going on. So i have create a Job and Tasks table and
 idea is to create the Job before initiating the playbook.run() . Now for me
 to keep updating the state of the tasks i need to implement the callback
 plugin and here i can insert the tasks to the database and keep updating
 the states. Now problem is how do i get the data(my_custom_job_id) i
 defined in the calling code where i ran playbook.run()


 class CallbackModule(object):
 
 logs playbook results, per host, in /var/log/ansible/hosts
 

 def __init__(self):
 self.stats = {}
 self.task_id = None

 def on_any(self, *args, **kwargs):
 pass

 def runner_on_failed(self, host, res, ignore_errors=False):
 if type(self.task_id) is str:
 print Task name + self.task.name
 print Task id +self.task_id
 log(host, 'FAILED', res)

 def runner_on_ok(self, host, res):
 if type(self.task_id) is str:
 print Task name + self.task.name
 print Task id +self.task_id
 log(host, 'OK', res)

 def playbook_on_task_start(self, name, is_conditional):
 
 Logs the start of each task
 
 #  HOW DO I GET THE my_custom_job_id WHICH I DEFINED IN MY PYTHON API
 WHERE TO DID A playbook.run()
 #  jobapi.createjob(my_custom_job_id )
 task_id=str(randint(2,9))
 # jobapi.addTask(my_custom_job_id, task_id,name)
 self.task_id = task_id

  --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/a6455abe-5c2e-42ba-919a-d7a99b1181b5%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/a6455abe-5c2e-42ba-919a-d7a99b1181b5%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgxGxsz-mA5J5SNpHs0OJDJuN8PDYrbqCq_bMwmNVf1dLw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] how to add custom jinja filters

2014-12-01 Thread Michael DeHaan
If that path is not taking on the 1.8.X series, please do.   Thanks!



On Thu, Nov 27, 2014 at 3:34 AM, Ilin Tatabitovski itatabitov...@gmail.com
wrote:

 Hi Branko,

 Thanks for the reply, I got it working.

 What was different in my case is that the folder was named filters.
 I renamed it to filter_plugins and it works fine now.

 I also noticed that the setting
 http://docs.ansible.com/intro_configuration.html#filter-plugins
 in the config file has no effect. I may open issue on github.

 Regards,
 ilin


 On 26 November 2014 at 23:01, Branko Majic bra...@majic.rs wrote:

 On Wed, 26 Nov 2014 08:58:48 -0800 (PST)
 Ilin itatabitov...@gmail.com wrote:

  Hi,
 
  Is there a good example how to extend ansible with custom jinja filters?
 
  I have added this, but my filter is not found
  http://docs.ansible.com/intro_configuration.html#filter-plugins
 
  Adding the function to core.py works, but it just looks wrong
 
 

 As it turns out, I played around a bit with this just a couple of weeks
 ago, and it's quite simple.

 The easiest way is to simply create a directory where your top-level
 playbook is (site.yml?) called filter_plugins. Within that directory
 you simply put .py files with content similar to (% is just to
 show where file begins/ends, don't copy that :):

 %
 def uppercase_all(arg):
 return arg.upper()


 class FilterModule(object):
 def filters(self):
 return {'uppercase_all': uppercase_all}
 %

 With the above in place, you can simply use the filter uppercase_all
 within your playbooks, roles etc. Note that you don't necessarily need
 to have the same name for function and filter, but it's probably better
 to do it that way.

 If you look at the page you posted, it will direct you to
 http://docs.ansible.com/developing_plugins.html which describes most of
 I wrote (although, in a bit of a less verbose way, and without
 examples).

 I hope this helps.

 Best regards

 --
 Branko Majic
 Jabber: bra...@majic.rs
 Please use only Free formats when sending attachments to me.

 Бранко Мајић
 Џабер: bra...@majic.rs
 Молим вас да додатке шаљете искључиво у слободним форматима.

 --
 You received this message because you are subscribed to a topic in the
 Google Groups Ansible Project group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/ansible-project/A7fGX-7X-ks/unsubscribe
 .
 To unsubscribe from this group and all its topics, send an email to
 ansible-project+unsubscr...@googlegroups.com.
 To post to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/20141126230152.52d18fcb%40zetkin.primekey.se
 .
 For more options, visit https://groups.google.com/d/optout.




 --
 G+ :: https://plus.google.com/+IlinTatabitovski

 --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/CAEibsVCGQmugycum7xG3hKBiuV0w01P3%2BRUMfZiU6U9%2BR6fUeQ%40mail.gmail.com
 https://groups.google.com/d/msgid/ansible-project/CAEibsVCGQmugycum7xG3hKBiuV0w01P3%2BRUMfZiU6U9%2BR6fUeQ%40mail.gmail.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgwiu3z9Gc1W%2BxPsp6S1PVc43%3D1S-7VuzN6vDQ7GphsN3g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: Inventory with more than one server per host

2014-12-01 Thread Michael DeHaan
 It looks like ansible's smallest unit is the host. But we have here up to
6 application servers per host 

Consider something like a

with_items: app_servers attached to your task.



On Thu, Nov 27, 2014 at 6:30 AM, Ronny ronny.w...@capgemini.com wrote:

 Thank you very much Hugo.
 That is a very good solution that I can work with.

 Best regards,
 Ronny

 Am Mittwoch, 26. November 2014 07:57:37 UTC+1 schrieb Ronny:

 Hello,

 I am trying to make a playbook with the following inventory work:

  ## hosts
 [applicationservers:children]
 dev1_appserver
 dev2_appserver

 [dev1_appserver]
 host1

 [dev2_appserver]
 host1

 [dev1_appserver:vars]
 appserver_name=dev1
 appserver_home=somepath/dev1/...
 appserver_port=9090

 [dev2_appserver:vars]
 appserver_name=dev2
 appserver_home=somepath/dev2/...
 appserver_port=8080

 

 They share the same host, it's not mistake. If I write a playbook like
 this:
 ## playbook
 - hosts: applicationservers
  tasks:
  -name: deploy our application
  shell: doDeploy.sh {{ appserver_name }} {{ appserver_home }} {{
 appserver_port }}
 

 If I run this, the task deploy our application is only executed once.
 It looks like ansible's smallest unit is the host. But we have here up to 6
 application servers per host and want to deploy them at once.
 How should the inventory look like?

 Thank you!

  --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/0f26a7a1-ec97-41be-bcb1-7801b40dcb86%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/0f26a7a1-ec97-41be-bcb1-7801b40dcb86%40googlegroups.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgx80fppWh-r%3DrRWB6B4fFWuvyEtjT9KMy2k0H_JAvvM9A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] packer/local vs remote, service restart failure

2014-12-01 Thread Michael DeHaan
I don't use Packer often, but I'm unclear on why anyone would want to use
the remote version, to be honest.

It seems the local version would always be simpler.


On Thu, Nov 27, 2014 at 7:18 AM, Steve Porter st...@yuppiechef.com wrote:

 Having a problem with a packer/local vs normal ansible remote provision.

 *Remote*

 On the remote, I provision mysql, then change the mysql settings and
 restart mysql - everything goes swimmingly.

 - file: path={{ item }} state=absent
   with_items:
 - /var/lib/mysql/ib_logfile0
 - /var/lib/mysql/ib_logfile1
 - /var/lib/mysql/ib_logfile2
   notify: restart-mysql
   tags: mysql

 - name: restart-mysql
   service: name=mysql state=restarted sleep=10

 Remote:

 NOTIFIED: [mysql | restart-mysql]
 *
 192.168.56.101 REMOTE_MODULE service name=mysql state=restarted
 192.168.56.101 EXEC ['/bin/sh', '-c', 'mkdir -p
 $HOME/.ansible/tmp/ansible-tmp-1417087683.16-109709247336195  chmod a+rx
 $HOME/.ansible/tmp/ansible-tmp-1417087683.16-109709247336195  echo
 $HOME/.ansible/tmp/ansible-tmp-1417087683.16-109709247336195']
 192.168.56.101 PUT /tmp/tmpUOthBA TO
 /home/vagrant/.ansible/tmp/ansible-tmp-1417087683.16-109709247336195/service
 192.168.56.101 EXEC /bin/sh -c 'sudo -k  sudo -H -S -p [sudo via
 ansible, key=ufnibuoyecqmoknrwhhfsbkwbevetxkc] password:  -u root /bin/sh
 -c '''echo SUDO-SUCCESS-ufnibuoyecqmoknrwhhfsbkwbevetxkc; LANG=C
 LC_CTYPE=C /usr/bin/python
 /home/vagrant/.ansible/tmp/ansible-tmp-1417087683.16-109709247336195/service;
 rm -rf
 /home/vagrant/.ansible/tmp/ansible-tmp-1417087683.16-109709247336195/
 /dev/null 21
 changed: [192.168.56.101] = {changed: true, name: mysql, state:
 started}

 PLAY RECAP
 

 *Local*

 On a local provision, I do the same as above from within the VM and
 everything goes swimmingly.

 *Packer/Local*

 If I run the above from packer i.e. local build, no matter what service I
 try to restart it fails:

 virtualbox-iso: NOTIFIED: [mysql | restart-mysql]
 *
 virtualbox-iso: 192.168.56.101 REMOTE_MODULE service name=mysql
 state=restarted sleep=10
 virtualbox-iso: 192.168.56.101 EXEC ['/bin/sh', '-c', 'mkdir -p
 $HOME/.ansible/tmp/ansible-tmp-1417090379.74-133308290545382  chmod a+rx
 $HOME/.ansible/tmp/ansible-tmp-1417090379.74-133308290545382  echo
 $HOME/.ansible/tmp/ansible-tmp-1417090379.74-133308290545382']
 virtualbox-iso: 192.168.56.101 PUT /tmp/tmpidQgBv TO
 /home/vagrant/.ansible/tmp/ansible-tmp-1417090379.74-133308290545382/service
 virtualbox-iso: 192.168.56.101 EXEC /bin/sh -c 'sudo -k  sudo -H
 -S -p [sudo via ansible, key=pfctarqsvenqtrfjkqxhizisscmtqntc] password: 
 -u root /bin/sh -c '''echo SUDO-SUCCESS-pfctarqsvenqtrfjkqxhizisscmtqntc;
 LANG=C LC_CTYPE=C /usr/bin/python
 /home/vagrant/.ansible/tmp/ansible-tmp-1417090379.74-133308290545382/service;
 rm -rf
 /home/vagrant/.ansible/tmp/ansible-tmp-1417090379.74-133308290545382/
 /dev/null 21
 virtualbox-iso: failed: [192.168.56.101] = {failed: true}
 virtualbox-iso: msg: start: Job failed to start

 Ansible version in all instances is 1.7.2

 Any guidance?

 --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/ae5978cd-3b93-4ccc-9875-6a7f6227f752%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/ae5978cd-3b93-4ccc-9875-6a7f6227f752%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgzO_QY22GO7drxk6NtBnZcqOrpM%3Dyt0E8YT-EDZK87COg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Running Ansible from source on Linux with F-Secure SSH instead of OpenSSH; only user privileges

2014-12-01 Thread Michael DeHaan
1) Ansible source seems to hard code /usr/bin/python (2.6.8).

See the docs regarding ansible_python_interpreter for remote interpreters,
elsewhere it will use whatever Python is in your path.



On Thu, Nov 27, 2014 at 5:13 PM, Ed Voncken e...@edvoncken.net wrote:

 Hi Brian,

 for fsecure you might need a new connection plugin if it is that
 different than the ssh one. Have you tried with paramiko?


 Nope, haven't tried Paramiko - will look into that, thanks.

 --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/f9b2a513-8f6f-4868-a93f-10e93962a096%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/f9b2a513-8f6f-4868-a93f-10e93962a096%40googlegroups.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgzhcTnHVW-R2kafg1En6jTtr3ifyzz8D4U9yXh2bsPV6Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Internal ansible-galaxy

2014-12-01 Thread Michael DeHaan
Right, I am suggesting we code the default templates in the program itself
-- there's a design point that the existing method allows it easier to
change the defaults, true... but there are tradeoffs.



On Mon, Dec 1, 2014 at 1:53 PM, Brian Coca bc...@ansible.com wrote:

 init just creates a skeleton for the module, it contacts the server to
 download the default files.

 On Mon, Dec 1, 2014 at 1:10 PM, Hani Suleiman h...@formicary.net wrote:
  Installation is fine. The problem I'm having is that I'm unable to run
 ansible-galaxy init mymodule --force, which does try to contact the api
 server. Are there any docs for doing what the init does manually?
 
  --
  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 to this group, send email to ansible-project@googlegroups.com.
  To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/2a2e7517-f7ea-4bbe-80c8-76bbfc349290%40googlegroups.com
 .
  For more options, visit https://groups.google.com/d/optout.



 --
 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-project+unsubscr...@googlegroups.com.
 To post to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/CAJ5XC8mBBtgbm7zaG0ib56Xw_h%2BPpb2zJwXP7d1DyoXQAmb4sA%40mail.gmail.com
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgw_AmLH6ADK5NTBkBmj1ttXjRp8wi6xQE0pEwJ8Kf95aw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Consistent requirement of the state parameter between modules ec2_group and rds_subnet_group

2014-12-01 Thread Michael DeHaan
I think defaulting to 'present' is reasonable and we would be fine with
changes to this effect.



On Mon, Dec 1, 2014 at 12:57 PM, Dan Vaida vaida@gmail.com wrote:

 Hi,

 Just for the sake of consistency, is there a particular reason why the
 state should be required for one module but not for the other one?

 Thanks.

 --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/bd9c0fae-871b-4acc-b4bc-050cedf063bd%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/bd9c0fae-871b-4acc-b4bc-050cedf063bd%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgzXrkOWZFiDaUsayS7c2im25S_SNm6NQhjCyDE7e3HxYQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] parameterized role and with_dict loop

2014-12-01 Thread Michael DeHaan
Roles cannot be presently used with iterators.  This is something the 'v2/'
subtree may allow at a later date.

Until then, the solution is to apply the loop to each task inside the role
that needs to be looped.



On Mon, Dec 1, 2014 at 3:03 PM, r...@pandastrike.com wrote:




 I have a role, route53-healthcheck, which execute a series of command:
 tasks using the aws cli (Ansible route53 module is for DNS records-only).

 I have a dictionary of Application names and metadata in group_vars/all.
 I want am trying to loop over the dictionary using with_dict calling the
 roll each time with different parameters:

 route53-healthchecks.yml
 ---
 # create Route53 Health check and CloudWatch Alarm
 - name: Route53 Health Checks for all Apps
   hosts: webservers[0]
   connection: local
   gather_facts: no
   roles:
 - { role: route53-healthcheck,
   app: '{{ item.key }}' ,
   app_domain: '{{ app_host }}',
   fqdn: '{{ item.key }}-{{ app_environment }}.{{ app_host }}',
 with_dict: apps }


 I am getting an error that 'item' is undefined:


 $ ansible-playbook -vvv -i staging route53-healthcheck.yml

 PLAY [Route53 Health Checks for all Apps]
 *

 TASK: [route53-healthcheck | Route53 Caller Reference for this Health
 Check] ***
 fatal: [web-1.us-east-1.example.com] = One or more undefined variables:
 'item' is undefined

 FATAL: all hosts have already failed -- aborting

 PLAY RECAP
 
to retry, use: --limit @/home/ubuntu/route53-healthcheck.retry

 web-1.us-east-1.example.com : ok=0changed=0unreachable=1
  failed=0


 What is the proper way to loop through calling roles?

 Thanks,
 Robb

 --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/ae023bb8-226f-456f-be49-99af5840aedb%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/ae023bb8-226f-456f-be49-99af5840aedb%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgx3uek6VVzCVERSJf69LL2o8TToo9bVs0aS5qBjoYkxMg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Internal ansible-galaxy

2014-12-01 Thread Michael DeHaan
Here's all of the Ansible-galaxy CLI source:

https://github.com/ansible/ansible/blob/devel/bin/ansible-galaxy

Looks like you just need to pass --offline although it would be nice if the
API config check didn't happen for the init task, and that's easily
switchable.

It appears we are already using local templates.




On Mon, Dec 1, 2014 at 6:30 PM, Hani Suleiman h...@formicary.net wrote:

  So presumably I could just copy the defaults into the repo manually,
 where do these files live currently?

  On Dec 1, 2014, at 4:33 PM, Michael DeHaan mich...@ansible.com wrote:

  Right, I am suggesting we code the default templates in the program
 itself -- there's a design point that the existing method allows it easier
 to change the defaults, true... but there are tradeoffs.



 On Mon, Dec 1, 2014 at 1:53 PM, Brian Coca bc...@ansible.com wrote:

 init just creates a skeleton for the module, it contacts the server to
 download the default files.

 On Mon, Dec 1, 2014 at 1:10 PM, Hani Suleiman h...@formicary.net wrote:
   Installation is fine. The problem I'm having is that I'm unable to
 run ansible-galaxy init mymodule --force, which does try to contact the api
 server. Are there any docs for doing what the init does manually?
 
  --
  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 to this group, send email to ansible-project@googlegroups.com.
  To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/2a2e7517-f7ea-4bbe-80c8-76bbfc349290%40googlegroups.com
 .
  For more options, visit https://groups.google.com/d/optout.



  --
 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-project+unsubscr...@googlegroups.com.
 To post to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/CAJ5XC8mBBtgbm7zaG0ib56Xw_h%2BPpb2zJwXP7d1DyoXQAmb4sA%40mail.gmail.com
 .
  For more options, visit https://groups.google.com/d/optout.



  --
 You received this message because you are subscribed to a topic in the
 Google Groups Ansible Project group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/ansible-project/1nZUU8woKU8/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 ansible-project+unsubscr...@googlegroups.com.
 To post to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgw_AmLH6ADK5NTBkBmj1ttXjRp8wi6xQE0pEwJ8Kf95aw%40mail.gmail.com
 https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgw_AmLH6ADK5NTBkBmj1ttXjRp8wi6xQE0pEwJ8Kf95aw%40mail.gmail.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


   --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/5F755316-6499-4668-8270-E730FCF4E7E8%40formicary.net
 https://groups.google.com/d/msgid/ansible-project/5F755316-6499-4668-8270-E730FCF4E7E8%40formicary.net?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgwnUn0D_-gMKV0j2XUjJFRXyeCk5FguEOYu6ZoX_CLWnw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: Ansible 1.8.1 update

2014-11-28 Thread Michael DeHaan
Yeah, I need to get back to my regular computer to replace the version on
releases.ansible.com.

PyPi was easy to replace.

I should know this, but does home-brew perhaps hardcode a SHA/MD5SUM of
this file?






On Thu, Nov 27, 2014 at 11:58 PM, Gilles Cornu gilles.co...@gmail.com
wrote:

 Thank you Michael for looking into this so quickly during Thanksgiving
 days!

 Just to clarify, http://releases.ansible.com/ansible/ansible-1.8.1.tar.gz
 is still the original package (12M, sha1:
 f911952d21a82e067157f41d42677f163e7b2d23).

 To avoid breaking package providers that rely on that precise file (e.g.
 homebrew
 https://github.com/Homebrew/homebrew/blob/cef8c1d41d84d6d8edfed0d55f5124e8a451dd19/Library/Formula/ansible.rb#L5-L6),
 I'd recommend to not replace this tarball (or warn with enough time to let
 people adapt).
 Your thoughts?

 Again, and ever again: Thanks a bundle for all the Ansible awesomeness 3
 3 3

 Best,
 Gilles

 Le vendredi 28 novembre 2014 01:54:58 UTC+1, Michael DeHaan a écrit :

 I've updated PyPi with a new 1.8.1 tar ball that does not have the .git
 history.

 The fix was a small change to MANIFEST.in to make sure these didn't hop
 in.

 I'm not sure why they didn't show in 1.8, but it's trivial.

 Good to go!



 On Thu, Nov 27, 2014 at 3:31 PM, Michael DeHaan mic...@ansible.com
 wrote:

 Will investigate the build issue.

  If so, we should see 1.8.2 soon.

 This doesn't necessarily warrant a 1.8.2 specifically but we are likely
 to include other updates.



 On Thu, Nov 27, 2014 at 7:41 AM, Mehul Ved mehul...@gmail.com wrote:

 On Thu, Nov 27, 2014 at 4:35 PM, Tomas Karasek tom.to...@gmail.com
 wrote:
  Hi, I don't see 1.8.1 (nor 1.8) in the ppa:
  https://launchpad.net/~ansible/+archive/ubuntu/ansible
 
  I got the ppa link from:
  http://docs.ansible.com/intro_installation.html#latest-
 releases-via-apt-ubuntu

 Probably removed because of the git gotcha? If so, we should see 1.8.2
 soon.

 --
 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...@googlegroups.com.
 To post to this group, send email to ansible...@googlegroups.com.
 To view this discussion on the web visit https://groups.google.com/d/
 msgid/ansible-project/CADTL0oaT%2BY2-j8%3DZtxb3sdjeCAEOFFc9wZy_fFF-
 Z0hcy0Uu3w%40mail.gmail.com.
 For more options, visit https://groups.google.com/d/optout.



  --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/e8c45521-a586-46fc-a2a6-da40818d9b11%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/e8c45521-a586-46fc-a2a6-da40818d9b11%40googlegroups.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgw7qUHvpzwkTsvgWNFtHC%3Dp6vyec4LHWeWFgQ%2BKZNLc6A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: Ansible 1.8 Released!

2014-11-26 Thread Michael DeHaan
If you run with -v you should see all the things the script module
returns.

rc/stdout and the usual stuff from command, more or less, IIRC.



On Wed, Nov 26, 2014 at 9:22 AM, Lorin Hochstein 
lorin.hochst...@sendgrid.com wrote:

 One last question: When you invoke a script with the 'script' module, can
 it return values?  i.e., can I set changed=true/false, or invoke it with a
 register clause?


 Lorin

 On Wed, Nov 26, 2014 at 12:26 AM, Michael DeHaan mich...@ansible.com
 wrote:

 The question in (A) means that modules must emit json, and key=value
 pairs one per line are not acceptable module stdout any longer.

 The capability of modules to not take JSON for non-Python modules still
 is around, ergo the WANT_JSON thing is still there.   However, I can see
 this eventually requiring JSON all the time, as most cases of folks wanting
 to write something in bash can be replaced with the 'script' module easily
 enough.

 The question in (B) is ... yes, by submitting a github pull request which
 is a symlink.   However -- we have more OpenStack renaming planned instead,
 that will make things more like os_floating_ip instead, and stop using
 some codenames.  This is more of an Ansible-devel discussion to an extent,
 Monty has weighed in with some suggestions on this in the future.   We are
 apt to continue the existing OpenStack modules for some time and deprecate
 them, and this may result in slightly different and better unified module
 parameters, and other related things as well.



 On Tue, Nov 25, 2014 at 9:04 PM, Lorin Hochstein 
 lorin.hochst...@sendgrid.com wrote:

 Cool! I've got a couple of questions:


 On Tuesday, November 25, 2014 5:56:21 PM UTC-5, James Cammarata wrote:

 For developers writing modules:

 * The 'baby JSON' support in module responses, originally intended for
 writing modules in bash, is removed as a feature to simplify logic, script
 module remains available for running bash scripts.


 Does this mean that Ansible always passes JSON to modules (no more #
 WANT_JSON), or does this mean that Ansible always expects modules to return
 JSON, or both, or something else?


 * added ability for shipped modules to have aliases with symlinks


 Nice! Is there a mechanism for proposing aliases upstream? For example,
 if I wanted to submit an alias for the quantum_floating_ip as
 neutron_floating_ip, can I submit a pull request with a symlink? Or is
 this strictly up to the downstream packages to create these type of
 symlinks?

 Lorin

  --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/164e7e57-a875-4a96-9417-350c0392a670%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/164e7e57-a875-4a96-9417-350c0392a670%40googlegroups.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.


  --
 You received this message because you are subscribed to a topic in the
 Google Groups Ansible Project group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/ansible-project/w1Uj8Jl1G3E/unsubscribe
 .
 To unsubscribe from this group and all its topics, send an email to
 ansible-project+unsubscr...@googlegroups.com.
 To post to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgzDXtaVDk_NwXirORxu3h3qE6oT8vpY1Wc_AVjR8OPD5g%40mail.gmail.com
 https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgzDXtaVDk_NwXirORxu3h3qE6oT8vpY1Wc_AVjR8OPD5g%40mail.gmail.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.


  --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/CACkJihNhbOMm1vKhoc8Pcvwswsf8RVSKJezu5QcesXHp7ENLhA%40mail.gmail.com
 https://groups.google.com/d/msgid/ansible-project/CACkJihNhbOMm1vKhoc8Pcvwswsf8RVSKJezu5QcesXHp7ENLhA%40mail.gmail.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion

Re: [ansible-project] Somebody ranted about Ansible using Jinja and YAML.

2014-11-26 Thread Michael DeHaan
Yeah this is an old post and this person is wrong on the internet.

http://xkcd.com/386/

In the future, there's no need to share these w/ the list, but feel free to
argue with them in the comment section :)

Regardless, thanks for nice words Steven!




On Wed, Nov 26, 2014 at 11:08 AM, Steven Truong djatlan...@gmail.com
wrote:

 Hi all,

 I am a fan of Ansible and I just do not see the validity in his complaints.


 http://thefsb.tumblr.com/post/94644144890/ansible-reminds-me-of-phps-salad-days

 RTM and follow the best practices and you should be fine.  I have used
 Ansible for almost 3 years and thanks God I do not miss Puppet or such.

 I recently joined a new company and in the process of porting our
 SaltStack over to Ansible.

 I am a believer in Ansible and you just have to use it to see how much
 times you will save.

 Cheers.

 --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/2ec8fea0-0b6e-4a62-bf84-a90701ba961d%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/2ec8fea0-0b6e-4a62-bf84-a90701ba961d%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgwnvZkcJRY3TAUww7KQh8NdzrmNLpJ6Khx1noe481ZCKA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Ansible 1.8.1 update

2014-11-26 Thread Michael DeHaan
Hi all,

We've updated 1.8 to include a few fixes that needed to make the release.

These include some bugfixes to improve recent quoting changes to the
postgresql and mysql modules.   Users of database modules will want to be
sure they pick 1.8.1, not 1.8.

Similarly, there are fixes applied for lookup plugins search paths and some
overzealous early evaluation of variables.

1.8.1 is now available via the usual means (PyPi + releases.ansible.com +
PPA), as usual, distros are also waiting to update.

Thanks!

--Michael

-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgwdot2HRP3EC-Q8gB1reKuoxo-bEQ2APSYsAJOReqs8uQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Ansible 1.8 Released!

2014-11-25 Thread Michael DeHaan
For those looking for fact-caching docs BTW:

http://docs.ansible.com/playbooks_variables.html#id34

Hastily produced blog post:

http://www.ansible.com/blog

:)





On Tue, Nov 25, 2014 at 5:56 PM, James Cammarata jcammar...@ansible.com
wrote:

 Hi all,

 We have released Ansible 1.8.0, which adds some exciting new features and
 modules, as well as many enhancements to cloud modules and other various
 bug fixes:

 * Fact caching support, pluggable, initially supports Redis (DOCS pending)
 * The new omit value can be used to leave off a parameter when not set,
 like so module_name: a=1 b={{ c | default(omit) }}, would not pass value
 for b (not even an empty value) if c was not set.
 * no_log parameter now surpressess data from callbacks/output as well as
 syslog
 * ansible-galaxy install -f requirements.yml allows advanced options and
 installs from non-galaxy SCM sources and tarballs.

 For developers writing modules:

 * The 'baby JSON' support in module responses, originally intended for
 writing modules in bash, is removed as a feature to simplify logic, script
 module remains available for running bash scripts.* async jobs started in
 fire  forget mode can now be checked on at a later time.
 * added ability to subcategorize modules for docs.ansible.com
 * added ability for shipped modules to have aliases with symlinks
 * added ability to deprecate older modules by starting with _ and
 including deprecated: message why in module docs

 And much more! Be sure to check the CHANGELOG for a full list of changes
 and fixes in this release.

 This update is available via PyPi and releases.ansible.com now, and
 packages for distros will be available as soon as possible.

 Thanks!

 --
 You received this message because you are subscribed to the Google Groups
 Ansible Announcements group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to ansible-announce+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgzisoLAW%3DOUGOCS-RvU%3D2zf2r07c_QHBnCh%2BcPSHFr2pw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: Ansible 1.8 Released!

2014-11-25 Thread Michael DeHaan
The question in (A) means that modules must emit json, and key=value pairs
one per line are not acceptable module stdout any longer.

The capability of modules to not take JSON for non-Python modules still is
around, ergo the WANT_JSON thing is still there.   However, I can see this
eventually requiring JSON all the time, as most cases of folks wanting to
write something in bash can be replaced with the 'script' module easily
enough.

The question in (B) is ... yes, by submitting a github pull request which
is a symlink.   However -- we have more OpenStack renaming planned instead,
that will make things more like os_floating_ip instead, and stop using
some codenames.  This is more of an Ansible-devel discussion to an extent,
Monty has weighed in with some suggestions on this in the future.   We are
apt to continue the existing OpenStack modules for some time and deprecate
them, and this may result in slightly different and better unified module
parameters, and other related things as well.



On Tue, Nov 25, 2014 at 9:04 PM, Lorin Hochstein 
lorin.hochst...@sendgrid.com wrote:

 Cool! I've got a couple of questions:


 On Tuesday, November 25, 2014 5:56:21 PM UTC-5, James Cammarata wrote:

 For developers writing modules:

 * The 'baby JSON' support in module responses, originally intended for
 writing modules in bash, is removed as a feature to simplify logic, script
 module remains available for running bash scripts.


 Does this mean that Ansible always passes JSON to modules (no more #
 WANT_JSON), or does this mean that Ansible always expects modules to return
 JSON, or both, or something else?


 * added ability for shipped modules to have aliases with symlinks


 Nice! Is there a mechanism for proposing aliases upstream? For example, if
 I wanted to submit an alias for the quantum_floating_ip as
 neutron_floating_ip, can I submit a pull request with a symlink? Or is
 this strictly up to the downstream packages to create these type of
 symlinks?

 Lorin

  --
 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 to this group, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/164e7e57-a875-4a96-9417-350c0392a670%40googlegroups.com
 https://groups.google.com/d/msgid/ansible-project/164e7e57-a875-4a96-9417-350c0392a670%40googlegroups.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.


-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgzDXtaVDk_NwXirORxu3h3qE6oT8vpY1Wc_AVjR8OPD5g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


  1   2   3   4   5   6   7   8   9   10   >