Re: [ansible-project] Grunt Module

2015-01-07 Thread Shahar Kedar
Actually I was pretty much convinced that using the shell or command modules is 
good enough. We’re doing it in production already for almost a year, and we 
didn’t have any problems.

On Thu, Jan 8, 2015 at 4:04 AM, Eli Finkelshteyn 
wrote:

> Any update on this? I'd love to use such a module.
> On Tuesday, June 18, 2013 11:47:47 AM UTC-7, Shahar Kedar wrote:
>>
>> I'd like to add that I haven't (yet) tried running Grunt using the 'shell' 
>> or 'command' modules. There's a good chance that failures in the build 
>> process are not well presented when using these modules, in which case a 
>> dedicated module might also be beneficial. 
>>
>> I'll let you know as soon as I know more.
>>
>>
>> On Tue, Jun 18, 2013 at 9:36 PM, Shahar Kedar > > wrote:
>>
>>> Grunt: grunt build
>>> Ansible: grunt: task=build
>>>
>>> ==
>>> Grunt: grunt build:debug
>>> Ansible: grunt: task=build target=debug
>>>
>>> ==
>>> Grunt: grunt build:debug --gruntfile /tmp/gruntfile
>>> Ansible: grunt: task=build target=debug file=/tmp/gruntfile
>>>
>>> ** when using the shell or command modules, the --gruntfile option will 
>>> always have to be passed, otherwise grunt will not find the gruntfile 
>>> (unless you do something like this 'shell: cd /myproj; grunt build:debug') 
>>>
>>> ==
>>> Grunt: grunt build:debug --foo=bar
>>> Ansible: grunt: task=build target=debug foo=bar
>>>
>>> ==
>>> Grunt: grunt build:debug --tasks=/usr/lib/grunttasks
>>> Ansible grunt: task=build target=debug include=/usr/lib/grunttasks
>>>
>>> I agree that the original grunt command look very similar to the ansible 
>>> commands, but I still prefer the Ansible style. 
>>>
>>> On Tue, Jun 18, 2013 at 8:37 PM, Michael DeHaan >> > wrote:
>>>
 Please show me an example of the grunt command vs the Ansible command in 
 this case, preferably several examples?




 On Tue, Jun 18, 2013 at 10:33 AM, Shahar Kedar >>> > wrote:

> Hi Michael,
>
> I admit that the grunt CLI is simple enough to be executed using the 
> 'shell' or 'command' modules. However, the way I see it, modules can be 
> useful not only when there's lots of logic involved, but also when there 
> can be a more expressive or concise (or both) way of doing things. Also, 
> a 
> module can help 'translate' the underlying technology output to something 
> more suitable for automation.
>
> In the case of Grunt, this could be the execution of specific targets 
> and tasks; passing extra arguments; pointing to a different gruntfile 
> etc. 
> I agree that this module won't contain complex logic, but it will IMO 
> help 
> developers write more expressive playbooks.
>  
> Shahar
>
> P.S. - in this vein I certainly think that writing an Ant module might 
> have been very beneficial (albeit nobody uses Ant anymore. I hope...)
>
>
> On Tue, Jun 18, 2013 at 5:50 PM, Michael DeHaan <
> mic...@ansibleworks.com > wrote:
>
>> There's no central ansible-contrib but we link to things from 
>> http://www.ansibleworks.com/docs/contrib.html
>>
>> I guess I'm failing to understand that, if it is a makefile 
>> replacement, what the module would do to make it deserve some code 
>> around 
>> it, rather than just using the shell or command module.  In this vein, 
>> this 
>> is also why there is not a module for Make or Ant.
>>
>> Can you help me understand what the module would actually do?
>>
>> (As for Riak, it has quite a lot of logic in that module.)
>>
>> Thanks!
>>
>>
>>
>>
>> On Mon, Jun 17, 2013 at 10:27 PM, Shahar Kedar > > wrote:
>>
>>> Grunt is a multi-purpose task executor written in Node.js but not 
>>> used exclusively (or even in majority of cases) for node.js apps. 
>>> Makefile 
>>> replacement is a good analogy although  as a former Java developer, 
>>> I personally prefer the "Ant replacement" analogy better (Ant is 
>>> actually 
>>> sort of a Makefile replacement so I guess it doesn't really matter :). 
>>> We, 
>>> and many others, use it as a build tool for web applications, or more 
>>> specifically - rich client applications. For example, we use it to 
>>> concat 
>>> and minify JS files, to compile Jade templates, run tests etc. 
>>>
>>> A common use case for us when deploying our application is to run 
>>> Grunt after we pull the latest changes. I'm pretty sure that many (out 
>>> of 
>>> the ~5900 ) users use it for the 
>>> same purpose, which makes it an integral part of their application 
>>> deployment. If I had to compare it to other core modules, I would guess 
>>> that Grunt is more popular then Riak (don't get me wrong - I love 
>>> riak), 
>>> and it gains a lot of traction.
>>>

[ansible-project] Referencing Ansible Variables

2015-01-07 Thread Peter Mooshammer
Hi there, 

I am fairly new with ansible and I am having some with variables :-).

Here is my 1st problem, I have a playbook I do have a variable:

- name: Create instance(s)
  hosts: local
  gather_facts: no
  connection: local
  tags: provisioning
  vars:

groupname: launched
port: 8080


Later I use it in the add_host line:

 
 - name: Add host to groupname
add_host: hostname={{ item.public_ip }} 
ansible_ssh_private_key_file=PATH_TO_KEYFILE 
groupname={{ groupname }}
with_items: gce.instance_data



and then I use it again at:

-
 name: Manage new instances
  hosts: "{{ groupname }}"
  connection: ssh
  sudo: True
  roles:
  - { role: webserver, port: "{{ port }}" }



but I doesn't work - replacing it with:
 hosts: launched

Second problem - maybe related I try to overwrite a variable in a role I 
include:

roles:
  - { role: webserver, port: "{{ port }}" }

this also doesn't work. Any hints?

thanks

Peter







-- 
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/28fa7149-29e5-46f7-ac90-fb79e67ac422%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Are there any module for yum groupinstall?

2015-01-07 Thread hce h
Hi,

I could not find ansible module to run yum groupinstall, or should I call 
it from shell statement?

Thank you.

- j

-- 
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/23ca89a0-6216-49db-ba43-d1c4025cdcc7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] handler is called in v1.8.2

2015-01-07 Thread hce h
Hi,

I have a task to use notify statement to call the handler, but it did not 
seem called. The output of tasks did not show the handler task. Should the 
output of tasks show the handler task if it was called?

Thanks.

- j

-- 
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/a1177d22-7953-44ab-b120-2da40eb36bbb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Grunt Module

2015-01-07 Thread Eli Finkelshteyn
Any update on this? I'd love to use such a module.

On Tuesday, June 18, 2013 11:47:47 AM UTC-7, Shahar Kedar wrote:
>
> I'd like to add that I haven't (yet) tried running Grunt using the 'shell' 
> or 'command' modules. There's a good chance that failures in the build 
> process are not well presented when using these modules, in which case a 
> dedicated module might also be beneficial. 
>
> I'll let you know as soon as I know more.
>
>
> On Tue, Jun 18, 2013 at 9:36 PM, Shahar Kedar  > wrote:
>
>> Grunt: grunt build
>> Ansible: grunt: task=build
>>
>> ==
>> Grunt: grunt build:debug
>> Ansible: grunt: task=build target=debug
>>
>> ==
>> Grunt: grunt build:debug --gruntfile /tmp/gruntfile
>> Ansible: grunt: task=build target=debug file=/tmp/gruntfile
>>
>> ** when using the shell or command modules, the --gruntfile option will 
>> always have to be passed, otherwise grunt will not find the gruntfile 
>> (unless you do something like this 'shell: cd /myproj; grunt build:debug') 
>>
>> ==
>> Grunt: grunt build:debug --foo=bar
>> Ansible: grunt: task=build target=debug foo=bar
>>
>> ==
>> Grunt: grunt build:debug --tasks=/usr/lib/grunttasks
>> Ansible grunt: task=build target=debug include=/usr/lib/grunttasks
>>
>> I agree that the original grunt command look very similar to the ansible 
>> commands, but I still prefer the Ansible style. 
>>
>> On Tue, Jun 18, 2013 at 8:37 PM, Michael DeHaan > > wrote:
>>
>>> Please show me an example of the grunt command vs the Ansible command in 
>>> this case, preferably several examples?
>>>
>>>
>>>
>>>
>>> On Tue, Jun 18, 2013 at 10:33 AM, Shahar Kedar >> > wrote:
>>>
 Hi Michael,

 I admit that the grunt CLI is simple enough to be executed using the 
 'shell' or 'command' modules. However, the way I see it, modules can be 
 useful not only when there's lots of logic involved, but also when there 
 can be a more expressive or concise (or both) way of doing things. Also, a 
 module can help 'translate' the underlying technology output to something 
 more suitable for automation.

 In the case of Grunt, this could be the execution of specific targets 
 and tasks; passing extra arguments; pointing to a different gruntfile etc. 
 I agree that this module won't contain complex logic, but it will IMO help 
 developers write more expressive playbooks.
  
 Shahar

 P.S. - in this vein I certainly think that writing an Ant module might 
 have been very beneficial (albeit nobody uses Ant anymore. I hope...)


 On Tue, Jun 18, 2013 at 5:50 PM, Michael DeHaan <
 mic...@ansibleworks.com > wrote:

> There's no central ansible-contrib but we link to things from 
> http://www.ansibleworks.com/docs/contrib.html
>
> I guess I'm failing to understand that, if it is a makefile 
> replacement, what the module would do to make it deserve some code around 
> it, rather than just using the shell or command module.  In this vein, 
> this 
> is also why there is not a module for Make or Ant.
>
> Can you help me understand what the module would actually do?
>
> (As for Riak, it has quite a lot of logic in that module.)
>
> Thanks!
>
>
>
>
> On Mon, Jun 17, 2013 at 10:27 PM, Shahar Kedar  > wrote:
>
>> Grunt is a multi-purpose task executor written in Node.js but not 
>> used exclusively (or even in majority of cases) for node.js apps. 
>> Makefile 
>> replacement is a good analogy although  as a former Java developer, 
>> I personally prefer the "Ant replacement" analogy better (Ant is 
>> actually 
>> sort of a Makefile replacement so I guess it doesn't really matter :). 
>> We, 
>> and many others, use it as a build tool for web applications, or more 
>> specifically - rich client applications. For example, we use it to 
>> concat 
>> and minify JS files, to compile Jade templates, run tests etc. 
>>
>> A common use case for us when deploying our application is to run 
>> Grunt after we pull the latest changes. I'm pretty sure that many (out 
>> of 
>> the ~5900 ) users use it for the 
>> same purpose, which makes it an integral part of their application 
>> deployment. If I had to compare it to other core modules, I would guess 
>> that Grunt is more popular then Riak (don't get me wrong - I love riak), 
>> and it gains a lot of traction.
>>
>> Having said that - I'm no fanatic. I wasn't aware of the Ansible 
>> Contrib project (it's this one 
>> , right?), and if you're 
>> still not convinced, then I'll put it there. 
>>
>>
>>
>> On Mon, Jun 17, 2013 at 6:54 AM, Michael DeHaan <
>> mic...@ansibleworks.com > wrote:
>>
>>> I'm having a little difficult

Re: [ansible-project] Pass dictionary variables to the role does not work

2015-01-07 Thread hce h
I've found the dictionary variable problem, there is a task register the 
same variable name as follows:

- name: register the variable
  register: nfsServer
  .
  when: nfsServer is not defined

When I define the - { role: nfs-client, nfsServer: { 'ansible_facts': { 
'ansible_eth0' : { 'ipv4' : { 'address': 'hce.com' } } } } }, I thought the 
when checked it, the register should never be called, but no, the register 
is still being called, the vairable nfsServer I defined in the playbook is 
changed to be the registered variable which got contents of {u'skipped': 
True, u'changed': False}. If I commented the register statement out, it 
works.

The question is why the register can still be called even the when 
condition is in false status?



On Wednesday, January 7, 2015 10:00:29 PM UTC+11, hce h wrote:
>
>
> Hi Toshio,
>
>  
> On Wednesday, January 7, 2015 4:51:57 AM UTC+11, tkuratomi wrote:
>>
>> Are you able to post a small reproducer?  It would help to determine if 
>> this is a bug or not.
>>
> That problem only occurred on CentOS 6.5, it did not repeat in CentOS 7 
> and Ubuntu 14. I suspect that might be caused by different python version, 
> CentOS 6 uses python 2.6, both CentOS 7 and Ubuntu 14 use python 2.7. It 
> does not seem the bug in the ansible code, but it is fragile .
>
> Anyway, the original issue still remains in v1.8.2 although Tom said it 
> did not break in his site, I still could not get it work. Both CentOS 7 and 
> Ubuntu 14 got the same exception at - { role: nfs-client, nfsServer: { 
> 'ansible_facts': { 'ansible_eth0' : { 'ipv4' : { 'address': 'hce.com' } } 
> } } }
>
>
>
> Thanks Toshio.
>
> Thanks, Toshio
>> On Jan 5, 2015 5:59 PM, "hce h"  wrote:
>>
>>>
>>> I set up ansible_ssh_host=10.1.0.1 in my inventory file, but the 
>>> function def _get_host(self, hostname) in inventory __init__.py checks if 
>>> hostname == host.name, when the hostname is "ansible_ssh_host", it 
>>> cannot match and return None and exception. Is it a bug in 1.8.2?
>>>
>>>
>>> On Tuesday, January 6, 2015 10:28:37 AM UTC+11, hce h wrote:

 After updating to v1.8.2, I've got following error which was running 
 fine in v1.7. I've got no idea what it stuck about, there is nothing 
 changed except updating to 1.8.2, what could be possible wrong here?

 fatal: [nfsserver -> 127.0.0.1] => {'msg': 'Exception: host not found: 
 ansible_ssh_host', 'failed': True}

 Thanks.

 -

 On Monday, January 5, 2015 6:59:25 PM UTC+11, hce h wrote:
>
> ve1.7, I am going to update to v1.8.2 and will see how it goes.
>
> Thanks Tom.
>
> - j
>
> On Monday, January 5, 2015 3:15:37 PM UTC+11, Tom Bamford wrote:
>>
>> What version of Ansible are you using? It works for me with v1.8.2. 
>> Even when referencing an undefined variable, I don't get an exception.
>>
>> Can you paste the nfs-client task which fails?
>>
>> Tom
>>
>>
>> On 5 January 2015 at 05:55, hce h  wrote:
>>
>>> Hi,
>>>
>>> I cannot install ansible to one of our NFS server, I tried to fake a 
>>> dictionary variable at following playbook:
>>>
>>> - { role: nfs-client, nfsServer: { 'ansible_facts': { 'ansible_eth0' 
>>> : { 'ipv4' : { 'address': 'hce.com' } } } } }
>>>
>>> The nfs-client tasks uses the variable nfsServer['ansible_facts'], 
>>> but I got following error, it cannot find dictionary variable 
>>> nfsServer['ansible_facts']:
>>>
>>> fatal: One or more undefined variables: 'dict' object has no 
>>> attribute 'ansible_facts'.
>>>
>>> What I was missing the syntax here?
>>>
>>> Thanks.
>>>
>>> - j
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>  -- 
>>> 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/
>>> 995e60f0-a5f4-4a6c-971f-5dfd226f61d9%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/4f1fdaf8-f4e5-4404-9f09-0413

Re: [ansible-project] include: "{{ ansible_os_family }}.yml" not working

2015-01-07 Thread Francisco Reyes
On Sunday, January 4, 2015 6:40:06 PM UTC-5, Tom Bamford wrote:
>
> I tried this with v1.8.2 and it failed as your attempt, apparently not 
> expanding the variable. I thought this would have worked in previous 
> releases, but I could be wrong.
>
> - include: "{{ ansible_distribution }}.yml" 
>
>
>
>
> Thanks Tom. Will dig a little more into the documentation. Perhaps there 
has been a change and old examples found on the web refer to a 
configuration/syntax no longer supported. 

>
>
>
>
>  
>

-- 
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/4ba24357-efa9-4231-bd76-efc16e5fc5a0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] unregister

2015-01-07 Thread hce h
Hi,

I need to unregister a variable after using (the following statement is 
meaningless, it just gives you an example), but I could not find a module 
called unregister or clear, or reset the register variable, please advice.

- name: register something
  register: temVariable
  when: temVariable is not defined

- name: check temVariable
   shell: runsomething
   when: temVariable is defined

- name: unregister temVariable
  unregister: temVariable
  when: temVariable is defined

Thank you.

- j

-- 
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/909117a5-b4f6-4725-9326-59c76f4aa76f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Ansible-vault errors with "Odd-length string"

2015-01-07 Thread Mxx
Nobody knows anything about this error? :/

On Monday, January 5, 2015 12:25:09 PM UTC-5, Mxx wrote:
>
> I'm running Ansible 1.8.2
> I have a vaulted file created on another system. On that system it works 
> without any problems.
> However, when I run it on my local system I get the follow error:
>
> $» ansible-vault --debug view vars/vaulted_vars.yml
> Vault password:
> Traceback (most recent call last):
>   File "/usr/bin/ansible-vault", line 225, in main
> fn(args, options, parser)
>   File "/usr/bin/ansible-vault", line 172, in execute_view
> this_editor.view_file()
>   File "/usr/lib/python2.7/site-packages/ansible/utils/vault.py", line 280, 
> in view_file
> dec_data = this_vault.decrypt(tmpdata)
>   File "/usr/lib/python2.7/site-packages/ansible/utils/vault.py", line 136, 
> in decrypt
> data = this_cipher.decrypt(data, self.password)
>   File "/usr/lib/python2.7/site-packages/ansible/utils/vault.py", line 545, 
> in decrypt
> data = unhexlify(data)
> TypeError: Odd-length string
>
> ERROR: Odd-length string
> $»
>
>
> I tried to manually type in the password or copy-pasting it, but the error 
> still happens.
> What is going on here?
>

-- 
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/38e88776-bdd9-4001-95fe-a478f04378b3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Task/role separation when provisioning with Docker

2015-01-07 Thread Gary Malouf
I want to get an idea what the recommended way of organizing your files 
would be around doing the following:


   1. Provision N EC2 instances of a specific size with appropriate AMI 
   (CentOS + Docker)
   2. Create container on each instance running Image A
   3. Create container on each instance running Image B
   4. Provision ELBs to provide HTTP access to the services


Specifically, I'm wondering what role people would put the EC2 instance 
creation and ELB provisioning under.  I currently have roles for deploying 
Image A and Image B, but the tasks for setting up the ELBs and EC2 
instances respectively are just sitting in my playbook.  

My initial temptation is to create a variablized EC2 instance provisioning 
role, but all it's doing is putting a thin wrapper over the EC2 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/dd340124-b15b-46f5-bc24-370f8716078b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] PDF Documentation

2015-01-07 Thread Tom Bamford
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  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  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
>>> 
>>> .
>>>
>>> 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/eab21ba2-f63b-41a3-bd0e-a79e5b065877%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Tom Bamford

*@Planet*
ATPLANET (Pty) Ltd
atpla.net

Cell: +27 (0)79-095-7112
Fax: +27 (0)86-599-1310

-- 
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/CAAnNz0PXh6t_fzNxEebZ8k79GsPOnbaMUqwFNcO4gX%3DdqEMbhQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] PDF Documentation

2015-01-07 Thread Erik Anderson
Disclaimer: I have no associattion with the Ansible org other than
being a user of their application.

On Wed, Jan 7, 2015 at 3:36 PM, Stuart Budd  wrote:
> Everyone else manages to provide PDF versions and really it is the
> professional thing to do.

The three examples you gave earlier (Redhat, Oracle, CFEngine) of
"everyone" that provides PDF documentation are all vastly larger
organizations with many, many more resources to throw at documentation
than Ansible has. Ansible has limited resources to deal with this sort
of thing and they've chosen to stick with a single "authoritative"
documentation source.

> Other organisations manage to provide PDF versions for operating systems.
> This is an application. It is far less complex than an OS.

Yes indeed, far less complex. But complexity isn't the problem - rate
of change is the problem. I'm not certain how often Ansible
re-generates their documentation, but it may be as often as with each
merged pull request. For Redhat, the rate of change is *very* slow.
They probably re-generate their documentation once a quarter or less.

> 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.

Ansible *does* provide very adequate documentation - some of the best
in the industry. Accusing them of not providing adequate documentation
seems a bit disingenuous. Their documentation is just not in your
preferred format. That's OK. My preference is to have html
documentation. I suspect the vast majority of Ansible users feel the
same way, which is another reason why the documentation is in that
format.

You're always free to take the RST sources[1] and generate PDF docs
for yourself. Heck, you can even take the work done by Matt in pull
request 8906 that he linked to earlier, and use that as your starting
point.

-ea

[1] https://github.com/ansible/ansible/tree/devel/docsite/rst

-- 
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/CADdM08o%2BpJXbwW2XUsWW1CK6gx%2BQ9VCx_iML3x-p8HgWZ8R-NA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] gce_net and multiple firewall rules

2015-01-07 Thread Peter Mooshammer
Hi there,


According to this example:

# Simple example of creating a new firewall rule
- local_action:
module: gce_net
name: privatenet
fwname: all-web-webproxy
allowed: tcp:80,8080
src_tags: ["web", "proxy"]



I should be able to create a network with 2 firewall rules in 1 step. In 
this example both rules relate to the tcp protocol. Is there a way to 
define rules for tcp as well as ucp in one line?

Currently I do a with_dict loop .

thx

Peter

-- 
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/fd215562-b347-4db3-978b-0f0d085228ab%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: ansible and gce.py

2015-01-07 Thread Peter Mooshammer
Hi Kesten,

should have updated the thread. I had a typo in the email address required 
for authentication. Stupid - but they don't really check if you are able to 
authenticate. So when auth fails there is an empty or no json object 
returned and we see this error 

What I did: I dont use GCE_INI_PATH, I only use PYTHONPATH and point it the 
dir that contains secrets.py. 

gce.ini isn't really used that much unlike ec2.ini 

Hope this helps

Peter


On Wednesday, January 7, 2015 10:27:34 AM UTC-8, kesten broughton wrote:
>
> Hi Peter,
>
> I tried the secrets.py way and got the same error.
> I did get things working by setting the GCE_INI_PATH
>
> > cat $GCE_INI_PATH
> [gce]
>
> # You can find your generated gce_service_account_email_address on the 
> compute web console
> gce_service_account_email_address =  10*redacted#
> k...@developer.gserviceaccount.com 
> I may also be allowed to use your personal account, but haven't verified.
> #gce_service_account_email_address =   @gmail.com
>
> # You can download creds and possible convert pkcs12 to pem format 
> according to the GCE authorization docs
> gce_service_account_pem_file_path = 
> /user/space/path/to/your/.pem
>
> # gce_project_id is the name gcloud console generated for you, not the 
> name you gave the project.  
> # Check on the console web page
>
> gce_project_id = 
>
> # END OF FILE #
>
>
> On Tuesday, January 6, 2015 2:53:42 PM UTC-6, Peter Mooshammer wrote:
>>
>> Hi there,
>>
>> I assume I am missing a step in the setup:
>>
>> 1.) I set:
>>
>> ANSIBLE_HOSTS=/./ansible/gce.py
>>
>> this files copied from the 1.8.2 branch ../plugins/inventory/gce.py
>>
>> libcloud is installed with pip.
>>
>> PYTHONPATH=//ansible
>>
>> The secrets.py seems be correct as I can create a vm with a static hosts 
>> file.
>>
>> What happens is:
>>
>> ./gce.py --list
>>
>> Traceback (most recent call last):
>>
>>   File "./gce.py", line 287, in 
>>
>> GceInventory()
>>
>>   File "./gce.py", line 101, in __init__
>>
>> self.driver = self.get_gce_driver()
>>
>>   File "./gce.py", line 177, in get_gce_driver
>>
>> gce = get_driver(Provider.GCE)(*args, **kwargs)
>>
>>   File 
>> "/Library/Python/2.7/site-packages/libcloud/compute/drivers/gce.py", line 
>> 605, in __init__
>>
>> self.zone_list = self.ex_list_zones()
>>
>>   File 
>> "/Library/Python/2.7/site-packages/libcloud/compute/drivers/gce.py", line 
>> 936, in ex_list_zones
>>
>> response = self.connection.request(request, method='GET').object
>>
>>   File "/Library/Python/2.7/site-packages/libcloud/common/google.py", 
>> line 669, in request
>>
>> *args, **kwargs)
>>
>>   File "/Library/Python/2.7/site-packages/libcloud/common/base.py", line 
>> 696, in request
>>
>> params, headers = self.pre_connect_hook(params, headers)
>>
>>   File "/Library/Python/2.7/site-packages/libcloud/common/google.py", 
>> line 645, in pre_connect_hook
>>
>> self.token_info = self.auth_conn.refresh_token(self.token_info)
>>
>>   File "/Library/Python/2.7/site-packages/libcloud/common/google.py", 
>> line 369, in refresh_token
>>
>> return self.get_new_token()
>>
>>   File "/Library/Python/2.7/site-packages/libcloud/common/google.py", 
>> line 501, in get_new_token
>>
>> return self._token_request(request)
>>
>>   File "/Library/Python/2.7/site-packages/libcloud/common/google.py", 
>> line 348, in _token_request
>>
>> response = self.request('/o/oauth2/token', method='POST', data=data)
>>
>>   File "/Library/Python/2.7/site-packages/libcloud/common/base.py", line 
>> 736, in request
>>
>> response = responseCls(**kwargs)
>>
>>   File "/Library/Python/2.7/site-packages/libcloud/common/base.py", line 
>> 119, in __init__
>>
>> self.object = self.parse_body()
>>
>>   File "/Library/Python/2.7/site-packages/libcloud/common/google.py", 
>> line 263, in parse_body
>>
>> (code, message) = self._get_error(body)
>>
>>   File "/Library/Python/2.7/site-packages/libcloud/common/google.py", 
>> line 204, in _get_error
>>
>> code = err.get('reason', None)
>>
>> AttributeError: 'str' object has no attribute 'get'
>>
>> Anything I may have done wrong?
>>
>> thanks
>>
>> Peter
>>
>>
>>
>>

-- 
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/187612bb-1107-40a4-a530-bceeb341b583%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] PDF Documentation

2015-01-07 Thread Stuart Budd
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  > 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
>>  
>> 
>> .
>>
>> 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/eab21ba2-f63b-41a3-bd0e-a79e5b065877%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] provisioning azure VMs with azure module

2015-01-07 Thread Jeffrey Liu
In Azure, there's a concept of a cloud service (sort of a container that is 
created first) that is associated with one or more VM instances, and in 
fact that is created by the ansible play.   So it looks like the Azure API 
has changed where it expects additional information regarding the VM.


On Wednesday, January 7, 2015 3:53:32 PM UTC-5, Jeffrey Liu wrote:
>
> Okay, looks like I'm getting the same error as reported here:
>
> https://github.com/ansible/ansible-modules-core/issues/397
>
> No attribute 'public_ips'
>
>
> $ ansible-playbook -i hosts azure.yml
>
> PLAY [localhost] 
> **
>
> TASK: [create test instance] 
> **
> failed: [localhost -> 127.0.0.1] => {"failed": true, "parsed": false}
> Traceback (most recent call last):
>   File 
> "/home/jklee/.ansible/tmp/ansible-tmp-1420663902.48-135102767689358/azure", 
> line 2049, in 
> main()
>   File 
> "/home/jklee/.ansible/tmp/ansible-tmp-1420663902.48-135102767689358/azure", 
> line 445, in main
> (changed, public_dns_name, deployment) = 
> create_virtual_machine(module, azure)
>   File 
> "/home/jklee/.ansible/tmp/ansible-tmp-1420663902.48-135102767689358/azure", 
> line 309, in create_virtual_machine
> virtual_network_name=virtual_network_name)
>   File 
> "/usr/lib/python2.6/site-packages/azure/servicemanagement/servicemanagementservice.py",
>  
> line 1259, in create_virtual_machine_deployment
> reserved_ip_name),
>   File 
> "/usr/lib/python2.6/site-packages/azure/servicemanagement/__init__.py", 
> line 2392, in virtual_machine_deployment_to_xml
> media_location)
>   File 
> "/usr/lib/python2.6/site-packages/azure/servicemanagement/__init__.py", 
> line 2230, in role_to_xml
> network_configuration_set)
>   File 
> "/usr/lib/python2.6/site-packages/azure/servicemanagement/__init__.py", 
> line 2193, in network_configuration_to_xml
> if configuration.public_ips:
> AttributeError: 'ConfigurationSetInputEndpoints' object has no attribute 
> 'public_ips'
>
>
> FATAL: all hosts have already failed -- aborting
>
> PLAY RECAP 
> 
>to retry, use: --limit @/home/jklee/azure.retry
>
> localhost  : ok=0changed=0unreachable=0failed=1
>
> On Wednesday, January 7, 2015 3:50:16 PM UTC-5, Jeffrey Liu wrote:
>>
>> Silly me.  Yes, that gets me farther.  
>> Thank you.
>>
>> Now it seems to be failing on checking if the name is available - looks 
>> like a management cert error.
>> I'll have to continue debugging
>>
>>
>> TASK: [create test instance] 
>> **
>> failed: [localhost -> 127.0.0.1] => {"failed": true, "parsed": false}
>> Traceback (most recent call last):
>>   File 
>> "/home/jklee/.ansible/tmp/ansible-tmp-1420663748.48-67769107595964/azure", 
>> line 2049, in 
>> main()
>>   File 
>> "/home/jklee/.ansible/tmp/ansible-tmp-1420663748.48-67769107595964/azure", 
>> line 445, in main
>> (changed, public_dns_name, deployment) = 
>> create_virtual_machine(module, azure)
>>   File 
>> "/home/jklee/.ansible/tmp/ansible-tmp-1420663748.48-67769107595964/azure", 
>> line 249, in create_virtual_machine
>> cloud_service_name_available = 
>> azure.check_hosted_service_name_availability(name)
>>   File 
>> "/usr/lib/python2.6/site-packages/azure/servicemanagement/servicemanagementservice.py",
>>  
>> line 811, in check_hosted_service_name_availability
>> AvailabilityResponse)
>>   File 
>> "/usr/lib/python2.6/site-packages/azure/servicemanagement/servicemanagementclient.py",
>>  
>> line 218, in _perform_get
>> response = self.perform_get(path, x_ms_version)
>>   File 
>> "/usr/lib/python2.6/site-packages/azure/servicemanagement/servicemanagementclient.py",
>>  
>> line 114, in perform_get
>> response = self._perform_request(request)
>>   File 
>> "/usr/lib/python2.6/site-packages/azure/servicemanagement/servicemanagementclient.py",
>>  
>> line 190, in _perform_request
>> resp = self._filter(request)
>>   File "/usr/lib/python2.6/site-packages/azure/http/httpclient.py", line 
>> 205, in perform_request
>> self.send_request_headers(connection, request.headers)
>>   File "/usr/lib/python2.6/site-packages/azure/http/httpclient.py", line 
>> 184, in send_request_headers
>> connection.endheaders()
>>   File "/usr/lib64/python2.6/httplib.py", line 908, in endheaders
>> self._send_output()
>>   File "/usr/lib64/python2.6/httplib.py", line 780, in _send_output
>> self.send(msg)
>>   File "/usr/lib64/python2.6/httplib.py", line 739, in send
>> self.connect()
>>   File "/usr/lib64/python2.6/httplib.py", line 1116, in connect
>> self.sock = ssl.wrap_socket(sock, self.key_file, self.cert_file)
>>   File "/usr/lib64/python2.6/ssl.py", line 342, in wrap_socket
>> suppress_ragged_eofs=suppress_ragged_eofs)
>>   File "/usr/lib64/python2.

Re: [ansible-project] provisioning azure VMs with azure module

2015-01-07 Thread Brian Coca
that seems to be an error with the azure python library


-- 
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/CAJ5XC8k7tdeTBwZWW_NpS69tyDmThpjWrYXisOs%2Br08Ocanmag%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] PDF Documentation

2015-01-07 Thread Matt Martz
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  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-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/d6fd19a2-9c90-47c0-871b-9b456f260067%40googlegroups.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/CAD8N0v_-sY3xcWPedd2y0f5xJKWAEyg8RpTgBjrfRz7j8X633g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] provisioning azure VMs with azure module

2015-01-07 Thread Jeffrey Liu
Okay, looks like I'm getting the same error as reported here:

https://github.com/ansible/ansible-modules-core/issues/397

No attribute 'public_ips'


$ ansible-playbook -i hosts azure.yml

PLAY [localhost] 
**

TASK: [create test instance] 
**
failed: [localhost -> 127.0.0.1] => {"failed": true, "parsed": false}
Traceback (most recent call last):
  File 
"/home/jklee/.ansible/tmp/ansible-tmp-1420663902.48-135102767689358/azure", 
line 2049, in 
main()
  File 
"/home/jklee/.ansible/tmp/ansible-tmp-1420663902.48-135102767689358/azure", 
line 445, in main
(changed, public_dns_name, deployment) = create_virtual_machine(module, 
azure)
  File 
"/home/jklee/.ansible/tmp/ansible-tmp-1420663902.48-135102767689358/azure", 
line 309, in create_virtual_machine
virtual_network_name=virtual_network_name)
  File 
"/usr/lib/python2.6/site-packages/azure/servicemanagement/servicemanagementservice.py",
 
line 1259, in create_virtual_machine_deployment
reserved_ip_name),
  File 
"/usr/lib/python2.6/site-packages/azure/servicemanagement/__init__.py", 
line 2392, in virtual_machine_deployment_to_xml
media_location)
  File 
"/usr/lib/python2.6/site-packages/azure/servicemanagement/__init__.py", 
line 2230, in role_to_xml
network_configuration_set)
  File 
"/usr/lib/python2.6/site-packages/azure/servicemanagement/__init__.py", 
line 2193, in network_configuration_to_xml
if configuration.public_ips:
AttributeError: 'ConfigurationSetInputEndpoints' object has no attribute 
'public_ips'


FATAL: all hosts have already failed -- aborting

PLAY RECAP 

   to retry, use: --limit @/home/jklee/azure.retry

localhost  : ok=0changed=0unreachable=0failed=1

On Wednesday, January 7, 2015 3:50:16 PM UTC-5, Jeffrey Liu wrote:
>
> Silly me.  Yes, that gets me farther.  
> Thank you.
>
> Now it seems to be failing on checking if the name is available - looks 
> like a management cert error.
> I'll have to continue debugging
>
>
> TASK: [create test instance] 
> **
> failed: [localhost -> 127.0.0.1] => {"failed": true, "parsed": false}
> Traceback (most recent call last):
>   File 
> "/home/jklee/.ansible/tmp/ansible-tmp-1420663748.48-67769107595964/azure", 
> line 2049, in 
> main()
>   File 
> "/home/jklee/.ansible/tmp/ansible-tmp-1420663748.48-67769107595964/azure", 
> line 445, in main
> (changed, public_dns_name, deployment) = 
> create_virtual_machine(module, azure)
>   File 
> "/home/jklee/.ansible/tmp/ansible-tmp-1420663748.48-67769107595964/azure", 
> line 249, in create_virtual_machine
> cloud_service_name_available = 
> azure.check_hosted_service_name_availability(name)
>   File 
> "/usr/lib/python2.6/site-packages/azure/servicemanagement/servicemanagementservice.py",
>  
> line 811, in check_hosted_service_name_availability
> AvailabilityResponse)
>   File 
> "/usr/lib/python2.6/site-packages/azure/servicemanagement/servicemanagementclient.py",
>  
> line 218, in _perform_get
> response = self.perform_get(path, x_ms_version)
>   File 
> "/usr/lib/python2.6/site-packages/azure/servicemanagement/servicemanagementclient.py",
>  
> line 114, in perform_get
> response = self._perform_request(request)
>   File 
> "/usr/lib/python2.6/site-packages/azure/servicemanagement/servicemanagementclient.py",
>  
> line 190, in _perform_request
> resp = self._filter(request)
>   File "/usr/lib/python2.6/site-packages/azure/http/httpclient.py", line 
> 205, in perform_request
> self.send_request_headers(connection, request.headers)
>   File "/usr/lib/python2.6/site-packages/azure/http/httpclient.py", line 
> 184, in send_request_headers
> connection.endheaders()
>   File "/usr/lib64/python2.6/httplib.py", line 908, in endheaders
> self._send_output()
>   File "/usr/lib64/python2.6/httplib.py", line 780, in _send_output
> self.send(msg)
>   File "/usr/lib64/python2.6/httplib.py", line 739, in send
> self.connect()
>   File "/usr/lib64/python2.6/httplib.py", line 1116, in connect
> self.sock = ssl.wrap_socket(sock, self.key_file, self.cert_file)
>   File "/usr/lib64/python2.6/ssl.py", line 342, in wrap_socket
> suppress_ragged_eofs=suppress_ragged_eofs)
>   File "/usr/lib64/python2.6/ssl.py", line 118, in __init__
> cert_reqs, ssl_version, ca_certs)
> ssl.SSLError: [Errno 336265225] _ssl.c:341: error:140B0009:SSL 
> routines:SSL_CTX_use_PrivateKey_file:PEM lib
>
>
> FATAL: all hosts have already failed -- aborting
>
> PLAY RECAP 
> 
>
> On Wednesday, January 7, 2015 3:25:14 PM UTC-5, Brian Coca wrote:
>>
>> test.yml is not a valid playbook, it only lists tasks, you need a play. 
>>
>> try adding this to the top and indenting the rest to be

Re: [ansible-project] provisioning azure VMs with azure module

2015-01-07 Thread Jeffrey Liu
Silly me.  Yes, that gets me farther.  
Thank you.

Now it seems to be failing on checking if the name is available - looks 
like a management cert error.
I'll have to continue debugging


TASK: [create test instance] 
**
failed: [localhost -> 127.0.0.1] => {"failed": true, "parsed": false}
Traceback (most recent call last):
  File 
"/home/jklee/.ansible/tmp/ansible-tmp-1420663748.48-67769107595964/azure", 
line 2049, in 
main()
  File 
"/home/jklee/.ansible/tmp/ansible-tmp-1420663748.48-67769107595964/azure", 
line 445, in main
(changed, public_dns_name, deployment) = create_virtual_machine(module, 
azure)
  File 
"/home/jklee/.ansible/tmp/ansible-tmp-1420663748.48-67769107595964/azure", 
line 249, in create_virtual_machine
cloud_service_name_available = 
azure.check_hosted_service_name_availability(name)
  File 
"/usr/lib/python2.6/site-packages/azure/servicemanagement/servicemanagementservice.py",
 
line 811, in check_hosted_service_name_availability
AvailabilityResponse)
  File 
"/usr/lib/python2.6/site-packages/azure/servicemanagement/servicemanagementclient.py",
 
line 218, in _perform_get
response = self.perform_get(path, x_ms_version)
  File 
"/usr/lib/python2.6/site-packages/azure/servicemanagement/servicemanagementclient.py",
 
line 114, in perform_get
response = self._perform_request(request)
  File 
"/usr/lib/python2.6/site-packages/azure/servicemanagement/servicemanagementclient.py",
 
line 190, in _perform_request
resp = self._filter(request)
  File "/usr/lib/python2.6/site-packages/azure/http/httpclient.py", line 
205, in perform_request
self.send_request_headers(connection, request.headers)
  File "/usr/lib/python2.6/site-packages/azure/http/httpclient.py", line 
184, in send_request_headers
connection.endheaders()
  File "/usr/lib64/python2.6/httplib.py", line 908, in endheaders
self._send_output()
  File "/usr/lib64/python2.6/httplib.py", line 780, in _send_output
self.send(msg)
  File "/usr/lib64/python2.6/httplib.py", line 739, in send
self.connect()
  File "/usr/lib64/python2.6/httplib.py", line 1116, in connect
self.sock = ssl.wrap_socket(sock, self.key_file, self.cert_file)
  File "/usr/lib64/python2.6/ssl.py", line 342, in wrap_socket
suppress_ragged_eofs=suppress_ragged_eofs)
  File "/usr/lib64/python2.6/ssl.py", line 118, in __init__
cert_reqs, ssl_version, ca_certs)
ssl.SSLError: [Errno 336265225] _ssl.c:341: error:140B0009:SSL 
routines:SSL_CTX_use_PrivateKey_file:PEM lib


FATAL: all hosts have already failed -- aborting

PLAY RECAP 


On Wednesday, January 7, 2015 3:25:14 PM UTC-5, Brian Coca wrote:
>
> test.yml is not a valid playbook, it only lists tasks, you need a play. 
>
> try adding this to the top and indenting the rest to be under 'tasks:' 
>
> - hosts: localhost 
>   gather_facts: false 
>   tasks: 
>
>
> -- 
> 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/4e604a79-2f2a-4829-8fe5-ecd0b071bab3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] PDF Documentation

2015-01-07 Thread Stuart Budd
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-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/d6fd19a2-9c90-47c0-871b-9b456f260067%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] provisioning azure VMs with azure module

2015-01-07 Thread Brian Coca
test.yml is not a valid playbook, it only lists tasks, you need a play.

try adding this to the top and indenting the rest to be under 'tasks:'

- hosts: localhost
  gather_facts: false
  tasks:


-- 
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/CAJ5XC8mDbTc%2Bb9i22n_oLSLECaBVACjM-p3BsXMPgGL3-fw7UA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Set boolean to true based on a fact

2015-01-07 Thread Willem Bos
Hi Tom/Tomasz,

Thanks for your help. I will definitely look into set_fact but went with 
Tomasz's advise. I changed the playbook to :

---
- hosts: all

  vars:

rhel5: '{{ ansible_os_family == "RedHat" and 
ansible_distribution_major_version == "5" }}'
rhel6: '{{ ansible_os_family == "RedHat" and 
ansible_distribution_major_version == "6" }}'
rhel7: '{{ ansible_os_family == "RedHat" and 
ansible_distribution_major_version == "7" }}'

  tasks:

  - name: Just debugging
copy: src=/etc/hosts dest=/tmp/test
when: rhel5 or rhel6

and that works fine. Thanks again!

Regards,
Willem.



On Sunday, December 28, 2014 2:20:03 PM UTC+1, Willem Bos wrote:
>
> Hi All,
>
> I would like to be able to set a boolean to true only when two facts have 
> certain values:
>
> ---
> - hosts: all
>
>   vars:
>
> rhel5: true
> when:
>   ansible_os_family == "RedHat" and
>   ansible_distribution_major_version == "5"
>
> rhel6: true
> when:
>   ansible_os_family == "RedHat" and
>   ansible_distribution_major_version == "6"
>
>   tasks:
>
>   - name: Just debugging
> copy: src=/etc/hosts dest=/tmp/test
> when: rhel5 or rhel6
>
>
> Now, the rhel5 and rhel6 booleans are always true so I guess either the 
> 'when:' option is not valid (the parser does not complain) or I'm going 
> about it the wrong way. Any suggestions are much appreciated.
>
> Regards,
> Willem.
>

-- 
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/5ac6584e-cf23-45e8-ad49-b5b93372a51a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] provisioning azure VMs with azure module

2015-01-07 Thread Jeffrey Liu

Hi All,

Ansible:  1.8.2
Python-azure:  0.9.0

I'm trying to use ansible to provision an Azure VM, but I'm getting the 
following error:

$ ansible-playbook test.yml
ERROR: local_action is not a legal parameter at this level in an Ansible 
Playbook


$ cat test.yml
---
# Provision virtual machine example
 - local_action:
 module: azure
 name: my-virtual-machine
 role_size: Small
 image: 
b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu_DAILY_BUILD-precise-12_04_3-LTS-amd64-server-20131205-en-us-30GB
 location: 'East US'
 user: ubuntu
 ssh_cert_path: /path/to/azure_x509_cert.pem
 storage_account: my-storage-account
 wait: yes


Not sure if I'm doing something wrong?

Thanks,
Jeff


-- 
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/03d4998a-f0b6-4c7a-a44c-1534c1c2dbfb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2015-01-07 Thread Stephen Granger
Hi Mark,

Thanks for posting that code, I've been unsure of how to extra the mac
address for newly created VM's. I can now parse that to cobbler to
create/update vm's.

Is anyone else using a similar workflow? I'm only using cobbler because we
presently use it allows us to use our existing kickstart files.


Thanks!

On 7 January 2015 at 09:49, Mark Phillips  wrote:

> Hello,
>
> I've recently done just this - and I coupled the VM creation with PXE
> booting. I have two PXE menus in place, the default one just says 'boot to
> HD'. The other one is the install menu, with a kickstart line. I control
> the use of this with Ansible by doing the following:
>
> https://gist.github.com/phips/2777a564e10d53824df8
>
>
> On Tuesday, 6 January 2015 10:07:53 UTC+1, Patel Parimal 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/4af2ebed-cecb-4ba1-964a-bd76c0e128ed%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
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/CA%2BemtqvrF1DeL1aLYSHPfRbj-Pj2WfYTZ2BYm6vrO8_tHzgxrw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] action for getting Digital Ocean keys

2015-01-07 Thread Akos Vandra
Hi!

I have build a digitalocean_facts module, which I intend to release once
it's cleaned up a bit. Can send it to you in its current form, if you're
interested

Akos

On 5 January 2015 at 13:50, Paul Mackay  wrote:

> Is there any way to get a list of keys with IDs from a Digital Ocean
> account? If not, might that be a useful task? I have a scenario where I
> have keys in my account and would like to add them to a droplet I'm
> creating using ansible. But the only way I could find the IDs of the keys
> was to construct a separate HTTP call to the DO API and check the result
> (the DO interface doesnt show the IDs at all). But that becomes hard to
> automate if the keys change.
>
> --
> 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/cb6f04b0-46cb-496f-a206-a55777f6fa99%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/CAHHcNoc6_LCTdhJ42qMeiDWeaFFiWMe1bsp0_cOzz6PQLmEvsw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Exception: host not found issue with v1.8.2

2015-01-07 Thread Toshio Kuratomi
I'm not getting the host_not_found error in either 1.8.2 or devel but
I suspect that I need something specific in my inventory file to
reproduce this?  Are you able to post what that should be?

-Toshio

On Wed, Jan 7, 2015 at 6:49 AM, James Morgan  wrote:
> Issue is in 1.8.2, I misnamed the repo. Apologies
>
> --
> 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/9b7ddea5-6d35-4d28-bc82-624561a28db1%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/CAG9juEqo%2Bms%3DDY0LqE2PnpYYg%3D0Zxz9iRto15PmmWMVFUn7XpA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: ansible and gce.py

2015-01-07 Thread kesten broughton
Hi Peter,

I tried the secrets.py way and got the same error.
I did get things working by setting the GCE_INI_PATH

> cat $GCE_INI_PATH
[gce]

# You can find your generated gce_service_account_email_address on the 
compute web console
gce_service_account_email_address = 
 10*redacted#k...@developer.gserviceaccount.com
I may also be allowed to use your personal account, but haven't verified.
#gce_service_account_email_address =   @gmail.com

# You can download creds and possible convert pkcs12 to pem format 
according to the GCE authorization docs
gce_service_account_pem_file_path = 
/user/space/path/to/your/.pem

# gce_project_id is the name gcloud console generated for you, not the name 
you gave the project.  
# Check on the console web page

gce_project_id = 

# END OF FILE #


On Tuesday, January 6, 2015 2:53:42 PM UTC-6, Peter Mooshammer wrote:
>
> Hi there,
>
> I assume I am missing a step in the setup:
>
> 1.) I set:
>
> ANSIBLE_HOSTS=/./ansible/gce.py
>
> this files copied from the 1.8.2 branch ../plugins/inventory/gce.py
>
> libcloud is installed with pip.
>
> PYTHONPATH=//ansible
>
> The secrets.py seems be correct as I can create a vm with a static hosts 
> file.
>
> What happens is:
>
> ./gce.py --list
>
> Traceback (most recent call last):
>
>   File "./gce.py", line 287, in 
>
> GceInventory()
>
>   File "./gce.py", line 101, in __init__
>
> self.driver = self.get_gce_driver()
>
>   File "./gce.py", line 177, in get_gce_driver
>
> gce = get_driver(Provider.GCE)(*args, **kwargs)
>
>   File 
> "/Library/Python/2.7/site-packages/libcloud/compute/drivers/gce.py", line 
> 605, in __init__
>
> self.zone_list = self.ex_list_zones()
>
>   File 
> "/Library/Python/2.7/site-packages/libcloud/compute/drivers/gce.py", line 
> 936, in ex_list_zones
>
> response = self.connection.request(request, method='GET').object
>
>   File "/Library/Python/2.7/site-packages/libcloud/common/google.py", line 
> 669, in request
>
> *args, **kwargs)
>
>   File "/Library/Python/2.7/site-packages/libcloud/common/base.py", line 
> 696, in request
>
> params, headers = self.pre_connect_hook(params, headers)
>
>   File "/Library/Python/2.7/site-packages/libcloud/common/google.py", line 
> 645, in pre_connect_hook
>
> self.token_info = self.auth_conn.refresh_token(self.token_info)
>
>   File "/Library/Python/2.7/site-packages/libcloud/common/google.py", line 
> 369, in refresh_token
>
> return self.get_new_token()
>
>   File "/Library/Python/2.7/site-packages/libcloud/common/google.py", line 
> 501, in get_new_token
>
> return self._token_request(request)
>
>   File "/Library/Python/2.7/site-packages/libcloud/common/google.py", line 
> 348, in _token_request
>
> response = self.request('/o/oauth2/token', method='POST', data=data)
>
>   File "/Library/Python/2.7/site-packages/libcloud/common/base.py", line 
> 736, in request
>
> response = responseCls(**kwargs)
>
>   File "/Library/Python/2.7/site-packages/libcloud/common/base.py", line 
> 119, in __init__
>
> self.object = self.parse_body()
>
>   File "/Library/Python/2.7/site-packages/libcloud/common/google.py", line 
> 263, in parse_body
>
> (code, message) = self._get_error(body)
>
>   File "/Library/Python/2.7/site-packages/libcloud/common/google.py", line 
> 204, in _get_error
>
> code = err.get('reason', None)
>
> AttributeError: 'str' object has no attribute 'get'
>
> Anything I may have done wrong?
>
> thanks
>
> Peter
>
>
>
>

-- 
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/9c7ccea6-1fc0-427a-8f3a-94780fa8ba57%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2015-01-07 Thread Mark Phillips
Hello,

I've recently done just this - and I coupled the VM creation with PXE 
booting. I have two PXE menus in place, the default one just says 'boot to 
HD'. The other one is the install menu, with a kickstart line. I control 
the use of this with Ansible by doing the following:

https://gist.github.com/phips/2777a564e10d53824df8

On Tuesday, 6 January 2015 10:07:53 UTC+1, Patel Parimal 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/4af2ebed-cecb-4ba1-964a-bd76c0e128ed%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] How to run a Docker Container as a daemon with Ansible?

2015-01-07 Thread Dimitrios Alexiou
Hello to everyone,

I came across this issue and until now I haven't found a practical 
solution. 

When running normally on my docker host  this commad: docker run -d -p 
80:80 -v /var/run/docker.sock:/tmp/docker.sock -t dalexiou/nginx_docker-gen

I am spinning up a container as a daemon. 

Now I have a playbook to automate this process. This playbook creates a 
directory on the host I want to spin up the container, puts inside the 
Dockerfile. Executes the Dockerfile to build the image and finally run the 
image to start a daemon container.

---
- name: Create the nginx directory with the Dockerfile.
  file: path=/home/finch/nginx state=directory

- name: Copy the Dockerfile to the created nginx directory.
  copy: src=Dockerfile dest=/home/finch/nginx/

- name: Build the nginx_docker-gen image from the copied Dockerfile.
  docker_image: path="/home/finch/nginx/" name="dalexiou/nginx_docker-gen" 
state=present

- name: Run nginx_docker-gen container(s) from the image created before.
  docker:
image: dalexiou/nginx_docker-gen
ports:
  - 80:80
volumes:
  - /var/run/docker.sock:/tmp/docker.sock
name: nginx_lb
state: running

The problem is that the playbook works fine with no errors. I can spin up 
the docker container but not as a daemon. Is anyone coming across with the 
same issue as well?

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/470c6e87-fc0c-4413-b468-5e4866da75e7%40googlegroups.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  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 
> 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
>> 
>> .
>> 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
> 
> .
>
> 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] Build automation using ESXi, Ansible, Pysphere

2015-01-07 Thread Earl Robinson
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 
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
> 
> .
> 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.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Typecasting in vars

2015-01-07 Thread ammullan
Hi there,

I'm working on moving my conditions from my when statements into proper 
vars but I'm having problems with typecasting.

In an Ansible role I could do something like

- debug: msg="Hi"
  when: (ansible_distribution == 'CentOS' or ansible_distribution == 
'Redhat')
and ansible_distribution_major_version | int >= 7

But obviously the '| int' part was to do with Jinja formatting so I can't 
use this in vars. I wanted to be able to assign that condition to a 
variable and then all I have to do is call something like 'when: el_gt_7'

Can someone tell me if this is possible?

Thanks,
Allan

-- 
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/4ca61afe-3295-4d91-9637-57e90574023a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] playbook saving variables for later

2015-01-07 Thread Sergey Dobrovolskiy
Never mind I found an answer:

  tasks:
- name: echo redis ip
  debug: msg="redis ip {{ 
hostvars[groups['tag_role_redis'][0]]['ec2_private_ip_address'] }}"


On Wednesday, January 7, 2015 9:14:58 AM UTC-5, Sergey Dobrovolskiy wrote:
>
> Hi are there any updates on this topic?
>
> My use case is the following: 
>   I'm provisioning Redis server on EC2, after it's done, I'm running 
> ec2_facts module to get the private IP. 
>   Later in the infrastructure provisioning I want to be able to use that 
> IP.
>
> Thanks,
> Sergey
>
> On Wednesday, October 9, 2013 2:27:30 AM UTC-4, jo...@wrale.com wrote:
>>
>> Any update on retaining CloudFormation outputs?  
>>
>> I'm working very intently on making a multi-az multi-tier h/a-minded 
>> multi-VPC CloudFormation framework, using cfndsl 
>>  syntax, deployed strictly with 
>> Ansible playbooks.  (or a custom module, if it comes to that)
>>
>> Rather than using natively nested templates which require to be on S3 
>> hosting, and due to the tiny limits placed on CloudFormation (10 output 
>> values, 51,200 bytes per template), I'm looking to execute 
>> (idempotently-possible) interlocking CloudFormation templates which pass 
>> outputs as parameters to other templates.
>>
>> cfndsl provides the mechanism for doing for each loops to generate 
>> subnets, routes, route tables, etc. for each tier.  At the end of this, 
>> I'll be building a 10-tier 3-zone h/a VPC for application deployment plus a 
>> 2 or 3 tier, 3-zone h/a VPC for "universe" management (Ansible will live 
>> there).
>>
>> The goal is to do something like OpsWorks with Ansible, but with cfndsl 
>> and multi-tier VPC's in mind.  For VPC's an abstraction of "tier" is what I 
>> think most people would really like.  OpsWorks uses "layers" for this, but 
>> they are just barely VPC aware.
>>
>> Thanks,
>> Joshua
>>   
>>
>> On Wednesday, July 17, 2013 9:06:35 PM UTC-4, Michael DeHaan wrote:
>>>
>>> If you have one play firing after the other from the same playbook, you 
>>> are of course fine.
>>>
>>>
>>>
>>> On Wed, Jul 17, 2013 at 9:06 PM, Michael DeHaan >> > wrote:
>>>
 I have an open ticket to cache these (optionally) between runs.

 Right now, you cannot.




 On Wed, Jul 17, 2013 at 7:37 PM, Boris  wrote:

> Can I save a variable in one playbook, so it can be used by another 
> one at a later time?
> For example: playbook running cloudformation server provisioning task 
> outputs some info that later needs to be used by playbook configuring 
> software on those servers.
>
> I guess I could just use lineinfile on a vars file to update a 
> variable there, but may be there is a better way?
>
> Thanks,
> -Boris
>
>  -- 
> 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.
>  
>  
>



 -- 
 Michael DeHaan 
 CTO, AnsibleWorks, Inc.
 http://www.ansibleworks.com/

  
>>>
>>>
>>> -- 
>>> Michael DeHaan 
>>> CTO, AnsibleWorks, Inc.
>>> http://www.ansibleworks.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/7f1c3808-89db-43e2-920c-9c226c2be70e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Exception: host not found issue with v1.8.2

2015-01-07 Thread James Morgan
Issue is in 1.8.2, I misnamed the repo. Apologies

-- 
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/9b7ddea5-6d35-4d28-bc82-624561a28db1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Exception: host not found issue with v1.8.2

2015-01-07 Thread James Morgan
The issue actually seems to be with the hostvars.

Ive knocked up a cut down version that emulates this

https://github.com/jamesdmorgan/ansible1.8.1_template_issue

PLAY [localhost] 
** 

GATHERING FACTS 
*** 
ok: [localhost]

TASK: [env-debug | Create debug directory] 
 
ok: [localhost] => (item=./debug_log)

TASK: [env-debug | Create ansible environmental debug] 
 
fatal: [localhost] => {'msg': 'Exception: host not found: 
ansible_connection', 'failed': True}
fatal: [localhost] => {'msg': 'Exception: host not found: 
ansible_connection', 'failed': True}

FATAL: all hosts have already failed -- aborting

PLAY RECAP 
 
   to retry, use: --limit @/home/jmorgan/site.retry

localhost  : ok=2changed=0unreachable=1failed=0 
  


On Wednesday, 7 January 2015 14:31:58 UTC, James Morgan wrote:
>
> Hi,
>
> I have applied the patch and its producing the same error. I will create a 
> example to demonstrate the problem
>
> It isn't the same as the delegate_to issue though does seem to relate to 
> template handling with groups / group_names in templates
>
> James
>
> On Tuesday, 6 January 2015 18:51:14 UTC, James Morgan wrote:
>>
>> Hi,
>>
>> Thanks for the quick response. I will have a chat with our OPs guys first 
>> thing tomorrow and get them to patch lib/ansible/runner/init.py and see if 
>> it fixed it. 
>>
>> Will let you know soon as I find out.
>>
>> 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/5a9eb848-3393-41da-9e92-ffdc2733b78b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Exception: host not found issue with v1.8.2

2015-01-07 Thread James Morgan
Hi,

I have applied the patch and its producing the same error. I will create a 
example to demonstrate the problem

It isn't the same as the delegate_to issue though does seem to relate to 
template handling with groups / group_names in templates

James

On Tuesday, 6 January 2015 18:51:14 UTC, James Morgan wrote:
>
> Hi,
>
> Thanks for the quick response. I will have a chat with our OPs guys first 
> thing tomorrow and get them to patch lib/ansible/runner/init.py and see if 
> it fixed it. 
>
> Will let you know soon as I find out.
>
> 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/8a86bc6e-ad6e-44ac-ad65-baa68d246329%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Fetch list of hosts in cluster and do something with them

2015-01-07 Thread Brian Coca
sounds right

On Wed, Jan 7, 2015 at 9:19 AM, Paul Slootman  wrote:
> Thanks, something like that might work for me, in combination with setting
> some local facts on the Admin server. I'll be trying a couple of things...
>
> Am I right in assuming that the following:
>
>   - name: create key for oracle
> user: name=oracle createhome=no generate_ssh_key=yes
> ssh_key_file=.ssh/id_oracle ssh_key_passphrase="" state=present
>
> will not change anything for an existing oracle user, besides creating an
> ssh key if it doesn't yet exist?
>
>
> Paul
>
>
> On Wednesday, 7 January 2015 14:07:00 UTC+1, Brian Coca wrote:
>>
>> it seems you want something like:
>>
>>
>> - name: generate ssh key
>>   ...
>>   when: clusterdata.stdout_lines
>>
>> - name: install generated key
>>...
>>when: not clusterdata.stdout_lines
>>
>>
>> or you can check the length of clusterdata.stdout_lines, which seems
>> to be only populated on the admin node. I would still add it to your
>> inventory as it is easier to segregate by groups or a group/host var.
>>
>> --
>> 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/e414e77f-c15e-45f1-ab1f-0a9be56f7e18%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/CAJ5XC8%3DmdMUDUw66ufnwW0KxAQHaodgtqGD3v6EBWr0v2hnB0Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] playbook saving variables for later

2015-01-07 Thread Sergey Dobrovolskiy
Hi are there any updates on this topic?

My use case is the following: 
  I'm provisioning Redis server on EC2, after it's done, I'm running 
ec2_facts module to get the private IP. 
  Later in the infrastructure provisioning I want to be able to use that IP.

Thanks,
Sergey

On Wednesday, October 9, 2013 2:27:30 AM UTC-4, jo...@wrale.com wrote:
>
> Any update on retaining CloudFormation outputs?  
>
> I'm working very intently on making a multi-az multi-tier h/a-minded 
> multi-VPC CloudFormation framework, using cfndsl 
>  syntax, deployed strictly with Ansible 
> playbooks.  (or a custom module, if it comes to that)
>
> Rather than using natively nested templates which require to be on S3 
> hosting, and due to the tiny limits placed on CloudFormation (10 output 
> values, 51,200 bytes per template), I'm looking to execute 
> (idempotently-possible) interlocking CloudFormation templates which pass 
> outputs as parameters to other templates.
>
> cfndsl provides the mechanism for doing for each loops to generate 
> subnets, routes, route tables, etc. for each tier.  At the end of this, 
> I'll be building a 10-tier 3-zone h/a VPC for application deployment plus a 
> 2 or 3 tier, 3-zone h/a VPC for "universe" management (Ansible will live 
> there).
>
> The goal is to do something like OpsWorks with Ansible, but with cfndsl 
> and multi-tier VPC's in mind.  For VPC's an abstraction of "tier" is what I 
> think most people would really like.  OpsWorks uses "layers" for this, but 
> they are just barely VPC aware.
>
> Thanks,
> Joshua
>   
>
> On Wednesday, July 17, 2013 9:06:35 PM UTC-4, Michael DeHaan wrote:
>>
>> If you have one play firing after the other from the same playbook, you 
>> are of course fine.
>>
>>
>>
>> On Wed, Jul 17, 2013 at 9:06 PM, Michael DeHaan  
>> wrote:
>>
>>> I have an open ticket to cache these (optionally) between runs.
>>>
>>> Right now, you cannot.
>>>
>>>
>>>
>>>
>>> On Wed, Jul 17, 2013 at 7:37 PM, Boris  wrote:
>>>
 Can I save a variable in one playbook, so it can be used by another one 
 at a later time?
 For example: playbook running cloudformation server provisioning task 
 outputs some info that later needs to be used by playbook configuring 
 software on those servers.

 I guess I could just use lineinfile on a vars file to update a variable 
 there, but may be there is a better way?

 Thanks,
 -Boris

  -- 
 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.
  
  

>>>
>>>
>>>
>>> -- 
>>> Michael DeHaan 
>>> CTO, AnsibleWorks, Inc.
>>> http://www.ansibleworks.com/
>>>
>>>  
>>
>>
>> -- 
>> Michael DeHaan 
>> CTO, AnsibleWorks, Inc.
>> http://www.ansibleworks.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/96b674cc-332c-4c46-ae9c-bb2208c5d892%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Fetch list of hosts in cluster and do something with them

2015-01-07 Thread Paul Slootman
Thanks, something like that might work for me, in combination with setting 
some local facts on the Admin server. I'll be trying a couple of things...

Am I right in assuming that the following:

  - name: create key for oracle
user: name=oracle createhome=no generate_ssh_key=yes 
ssh_key_file=.ssh/id_oracle ssh_key_passphrase="" state=present

will not change anything for an existing oracle user, besides creating an 
ssh key if it doesn't yet exist?


Paul


On Wednesday, 7 January 2015 14:07:00 UTC+1, Brian Coca wrote:
>
> it seems you want something like: 
>
>
> - name: generate ssh key 
>   ... 
>   when: clusterdata.stdout_lines 
>
> - name: install generated key 
>... 
>when: not clusterdata.stdout_lines 
>
>
> or you can check the length of clusterdata.stdout_lines, which seems 
> to be only populated on the admin node. I would still add it to your 
> inventory as it is easier to segregate by groups or a group/host var. 
>
> -- 
> 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/e414e77f-c15e-45f1-ab1f-0a9be56f7e18%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Same list from multiple vars-files consolidated

2015-01-07 Thread Brian Coca
ansible by default will override previous definitions with newer ones,
in this case group 'all' gets loaded first and then overwritten by
group1.

You can change this behavior globally using the hash_behaviour entry
in ansible.cfg.
Or you can name the variable differently and then use the |union
filter in the task to aggregate them just for that task.



-- 
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/CAJ5XC8kjPPtrbAafYV5zcBBxH%2BP0UrAxp_CWcC-4zL4zjqnOjA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Exception: host not found issue with v1.8.2

2015-01-07 Thread James Morgan
Hi,

Applied the patch and I get the same error. 

James

On Tuesday, 6 January 2015 18:51:14 UTC, James Morgan wrote:
>
> Hi,
>
> Thanks for the quick response. I will have a chat with our OPs guys first 
> thing tomorrow and get them to patch lib/ansible/runner/init.py and see if 
> it fixed it. 
>
> Will let you know soon as I find out.
>
> 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/59212f13-17e0-494b-92ec-946f6ec4572b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Same list from multiple vars-files consolidated

2015-01-07 Thread Sebastian Gumprich
Hello,

I have a list-item in the group-vars for "all" hosts:

"/etc/ansible/group_vars/all"

splunkforwarder_log_items:
  - app_name: var_messages
source: "/var/log/messages"



I also have the same list-item in another (narrowed down) group-var:

"/etc/ansible/group_vars/group_1"
splunkforwarder_log_items:
  - app_name: var_secure
source: "/var/log/secure"
index: "testindex"
sourcetype: linux_secure



Now I want to use both lists (or the conflated list) in the following task, 
so {{ item.app_name }} would be substituted with var_messages
 and var_secure from both lists.


- name: create input configuration
  template:
src=inputs_conf.j2
dest=/etc/apps/{{ item.app_name }}/local/inputs.conf
  with_items: splunkforwarder_log_items


Sadly, only the list from "group_1" is used.
Is there a way to conflate these lists / use both? Or am I doing something 
wrong?


Regards
Sebastian

-- 
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/0e77bece-92e4-4957-ba72-0424dfc4040f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] ansible 1.8.2: json is not parsed from uri result..

2015-01-07 Thread Brian Coca
that should just work, the module does a fuzzy match on
'application/json', the charset part would not matter.

can you show the raw output of the call?

-- 
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%3DtQN4qYT_-q5cyG3b8%3DzryhWeQuihsmoBbak8kbDFpPA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] ansible 1.8.2: json is not parsed from uri result..

2015-01-07 Thread Lucas, Sascha
Hi,

> I don't see json property in configuration... Most probably the reason is 
> that the return type is not "ansible/json" but  
> ...
> "content_type": "application/json; charset=UTF-8", 

If your HTTP-Server returns a header named 'content_type' that starts with 
'application/json' the URI module should parse the response body into the 
structure 'json'

The URI modules python code looks like this:

   if 'content_type' in uresp:
if uresp['content_type'].startswith('application/json'):
try:
js = json.loads(content)
uresp['json'] = js

May be you hit a BUG, where json.loads(content) fails to parse, because the 
response body contains json-escapes. See PR #537 [1] how to fix this.

Thanks, Sascha.

[1] https://github.com/ansible/ansible-modules-core/pull/537


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/383FAD2C9609F74D8F075EFF2B86B57998F3EA59%40SGIS111.gisa-halle.de.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] PDF Documentation

2015-01-07 Thread Brian Coca
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-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/CAJ5XC8mek9PJCoOSY65ns1jei%3DtwoZLBEy5mpFXJ54VRdeHELg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] collecting "items" across roles and then iterating over them in a handler

2015-01-07 Thread Brian Coca
IIRC you can use the  jenkins web api for listing/installing plugins
(using uri module)

-- 
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/CAJ5XC8ncXt_gfNJt%3DDR7mY96cYq%2B8sDaggH4h2W9FtvPgsGewg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Multiple versions of Galaxy role?

2015-01-07 Thread Kevin Kaland
I figured out a solution for this using ansible.cfg.

First, create an ansible.cfg in the playbook directory (if using Vagrant, 
create it in the Vagrantfile directory).

Set roles_path to something like ./data/ansible/roles. Optionally gitignore 
it.

Set up an ansible.yml or ansible.txt file 
(see http://docs.ansible.com/galaxy.html#installing-multiple-roles-from-a-file 
for the format of this file).

Run `ansible-galaxy install -r ansible.yml` to install! Make sure you run 
this from the directory that has ansible.cfg, OR run 
`ANSIBLE_CONFIG=/path/to/ansible.cfg ansible-galaxy install -r ansible.yml`

Replace ansible.yml with the name of your roles file.

I still kind of recommend *not* gitignoring the roles just because there is 
no good way to manage updates; you would have to tell your team manually 
that there was a new version. ansible-galaxy isn't smart enough to realize 
that the code you want to install isn't the same as what it already has, 
and it won't do it when it sees the directory name is the same. If you are 
using fully-versioned roles, though (none running off master branches that 
might change), you could tell your developers always to run `ansible-galaxy 
install --force -r ansible.yml`. This will replace the roles every time 
it's run. So you can see why I don't encourage using it on roles that might 
arbitrarily be updated without a clear new version being specified.

Simply committing the roles into the repo and keeping the ansible.yml file 
as a handy reference for when you want to update them is, in my mind, a 
reasonable approach. Then you guarantee everyone's running the same stuff.

One could get more complex with this setup, e.g. hosting tarballs of 
specific role versions on an internal server and pointing ansible.yml at 
that. But now we're getting into edge cases.

Hope this helps!

On Tuesday, January 6, 2015 9:03:07 PM UTC+1, Kevin Kaland wrote:
>
> When I install a role with `ansible-galaxy`, it is placed in 
> /path/to/inventory/roles. This is fine, but what if I have different 
> playbooks using different versions of the role? Is my only option to 
> install the role directly into the roles directory underneath the playbook? 
> This is not easy to distribute to developers since there is no way to 
> specify the installation location in the text file.
>
> I would just have to commit the roles to source.
>
> Maybe that's how it is, but I wanted to check. I searched the Google Group 
> and didn't find much about this specifically.
>

-- 
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/d46cf3c9-6d40-421d-98ec-57eb9db3506a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] ec2_group_module: No hosts matched

2015-01-07 Thread Brian Coca
that example is not a complete playbook, just a task, try adding this on top:

- hosts: localhost
  gather_facts: false
  connection: local
  tasks:

< put example here indented so it is under tasks:

-- 
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/CAJ5XC8k258X88TZya45dWBv%3DdQkxSuzW11Z3YNY33UxwDnUsAg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Fetch list of hosts in cluster and do something with them

2015-01-07 Thread Brian Coca
it seems you want something like:


- name: generate ssh key
  ...
  when: clusterdata.stdout_lines

- name: install generated key
   ...
   when: not clusterdata.stdout_lines


or you can check the length of clusterdata.stdout_lines, which seems
to be only populated on the admin node. I would still add it to your
inventory as it is easier to segregate by groups or a group/host var.

-- 
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/CAJ5XC8mYf1u7%2B6tjCOh4RWQ9pLfmLtbZZZGi1BtHAigm4ejs%2Bg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] ansible 1.8.2: json is not parsed from uri result..

2015-01-07 Thread 'Maxym Pendyshchuk' via Ansible Project
Hi!
I'm using the last version of Ansible, having the following task:

- uri: url=MY_URL
   method=GET user={{ user }} password={{ password }} 
force_basic_auth=yes return_content=yes
  register: configuration

I don't see json property in configuration... Most probably the reason is 
that the return type is not "ansible/json" but  
...
"content_type": "application/json; charset=UTF-8", 
...

is here any workaround, or I need to look for a 3rd party module to get 
json content parsed?

thanks in advance,
Max

-- 
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/b1fe7b05-2348-4143-a7eb-d6ae512cff14%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] apt show upgraded packages

2015-01-07 Thread vadimv Vatlin
Hello. 

I have the task which upgrade all packages to the latest version

- name: Full upgrade
  apt: upgrade=dist

How can I using --check see which packages would be upgraded ?

-- 
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/fff8f23b-2552-4f6e-b6d0-b534be6023f4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Using the Google Compute Engine module to create Ubuntu instances doesn't work as expected

2015-01-07 Thread Peter Mooshammer
It was reported on stacktrace as well:

http://stackoverflow.com/questions/27605262/other-images-in-ansible-and-gce

not sure you saw that

Peter

On Friday, December 5, 2014 9:31:05 AM UTC-8, Luis Medina wrote:
>
> Hello,
>
> Let me start out with the playbook I'm using (any authentication info you 
> see below has been modified from the original so no worries about privacy 
> concerns):
>
> ---
> - name: Create instance(s)
>   hosts: localhost
>   connection: local
>   gather_facts: no
>
>   vars:
> service_account_email: 
> 457671988709-m1346pm0lmrfb733qqjnmife8na6h...@developer.gserviceaccount.com 
> 
> pem_file: ./roles/google/files/pkey.pem
> project_id: rosy-stronghold-765
> machine_type: n1-standard-1
> image: ubuntu
> zone: us-central1-a
>
>   tasks:
>
>- name: Launch instances
>  gce:
>  instance_names: dev
>  machine_type: "{{ machine_type }}"
>  image: "{{ image }}"
>  service_account_email: "{{ service_account_email }}"
>  pem_file: "{{ pem_file }}"
>  project_id: "{{ project_id }}"
>  zone: "{{ zone }}"
>
>
> I've been trying to use ansible to create a Ubuntu based instance, but no 
> avail. Originally, I was getting this error from Ansible:
>
>
> PLAY [all] 
>  
>
> PLAY [Create instance(s)] 
> * 
>
> TASK: [Launch instances] 
> ** 
> failed: [localhost] => {"changed": false, "failed": true}
> msg: Missing required create instance variable
>
> FATAL: all hosts have already failed -- aborting
>
>
> After doing a fair amount of research, I found out that the stable 0.16.0 
> version of apache-libcloud did not seem to support Ubuntu, at least based 
> on the source code in the gce.py driver. Because of this, I installed the 
> development version of the library which actually does have support for 
> Ubuntu, at least from what I can see in the source:
>
>
> if (partial_name.startswith('debian') or
> partial_name.startswith('backports') or
> partial_name.startswith('nvme-backports')):
> image = self._match_images('debian-cloud', partial_name)
> elif partial_name.startswith('centos'):
> image = self._match_images('centos-cloud', partial_name)
> elif partial_name.startswith('sles'):
> image = self._match_images('suse-cloud', partial_name)
> elif partial_name.startswith('rhel'):
> image = self._match_images('rhel-cloud', partial_name)
> elif partial_name.startswith('windows'):
> image = self._match_images('windows-cloud', partial_name)
> elif partial_name.startswith('container-vm'):
> image = self._match_images('google-containers', partial_name)
> elif partial_name.startswith('coreos'):
> image = self._match_images('coreos-cloud', partial_name)
> elif partial_name.startswith('opensuse'):
> image = self._match_images('opensuse-cloud', partial_name)
> elif partial_name.startswith('ubuntu'):
> image = self._match_images('ubuntu-os-cloud', partial_name)
>
>
>  With this new library, Ansible no longer threw the error above and it now 
> went ahead with the play. However, I noticed that no matter what 
> combination of the string "ubuntu" I use for the "image" parameter, Ansible 
> will always default to creating a CentOS image (I'm guessing that's a 
> default somewhere) and so, I'm kind of stuck now as to what could be going 
> wrong.
>
> Has anyone experienced similar issues when creating Ubuntu issue? Any 
> assistance with this would be greatly appreciated.
>
> Luis
>

-- 
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/218e3d92-539f-463f-9464-00a07eec1055%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] ansible and gce.py

2015-01-07 Thread Peter Mooshammer
Hi there,

I assume I am missing a step in the setup:

1.) I set:

ANSIBLE_HOSTS=/./ansible/gce.py

this files copied from the 1.8.2 branch ../plugins/inventory/gce.py

libcloud is installed with pip.

PYTHONPATH=//ansible

The secrets.py seems be correct as I can create a vm with a static hosts 
file.

What happens is:

./gce.py --list

Traceback (most recent call last):

  File "./gce.py", line 287, in 

GceInventory()

  File "./gce.py", line 101, in __init__

self.driver = self.get_gce_driver()

  File "./gce.py", line 177, in get_gce_driver

gce = get_driver(Provider.GCE)(*args, **kwargs)

  File "/Library/Python/2.7/site-packages/libcloud/compute/drivers/gce.py", 
line 605, in __init__

self.zone_list = self.ex_list_zones()

  File "/Library/Python/2.7/site-packages/libcloud/compute/drivers/gce.py", 
line 936, in ex_list_zones

response = self.connection.request(request, method='GET').object

  File "/Library/Python/2.7/site-packages/libcloud/common/google.py", line 
669, in request

*args, **kwargs)

  File "/Library/Python/2.7/site-packages/libcloud/common/base.py", line 
696, in request

params, headers = self.pre_connect_hook(params, headers)

  File "/Library/Python/2.7/site-packages/libcloud/common/google.py", line 
645, in pre_connect_hook

self.token_info = self.auth_conn.refresh_token(self.token_info)

  File "/Library/Python/2.7/site-packages/libcloud/common/google.py", line 
369, in refresh_token

return self.get_new_token()

  File "/Library/Python/2.7/site-packages/libcloud/common/google.py", line 
501, in get_new_token

return self._token_request(request)

  File "/Library/Python/2.7/site-packages/libcloud/common/google.py", line 
348, in _token_request

response = self.request('/o/oauth2/token', method='POST', data=data)

  File "/Library/Python/2.7/site-packages/libcloud/common/base.py", line 
736, in request

response = responseCls(**kwargs)

  File "/Library/Python/2.7/site-packages/libcloud/common/base.py", line 
119, in __init__

self.object = self.parse_body()

  File "/Library/Python/2.7/site-packages/libcloud/common/google.py", line 
263, in parse_body

(code, message) = self._get_error(body)

  File "/Library/Python/2.7/site-packages/libcloud/common/google.py", line 
204, in _get_error

code = err.get('reason', None)

AttributeError: 'str' object has no attribute 'get'

Anything I may have done wrong?

thanks

Peter



-- 
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/23b5af27-cf52-409c-aefc-738b5946a9df%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Multiple versions of Galaxy role?

2015-01-07 Thread Kevin Kaland
When I install a role with `ansible-galaxy`, it is placed in 
/path/to/inventory/roles. This is fine, but what if I have different 
playbooks using different versions of the role? Is my only option to 
install the role directly into the roles directory underneath the playbook? 
This is not easy to distribute to developers since there is no way to 
specify the installation location in the text file.

I would just have to commit the roles to source.

Maybe that's how it is, but I wanted to check. I searched the Google Group 
and didn't find much about this specifically.

-- 
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/16fba44d-1ec0-4e7a-a3d6-fabde3569069%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] PDF Documentation

2015-01-07 Thread Stuart Budd
Hello

Could someone please direct me towards the Ansible documentation PDF's
I only seem to be able to find the online documentation but no PDF versions.

I have search in this forum but I can not find the answer.

Thank you
Stuart


-- 
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/b48636bc-0213-4fec-97f2-e3d0ebb27841%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] File lookup issue in 1.8.2

2015-01-07 Thread Solomon Gifford
Neither are working for me - I'm getting the same issue even when in yaml 
format.  If I use item.0 the error disappears (but of course the task fails 
because it is incorrect).

- authorized_key:
user: someuser
key: "{{lookup('file',item)}}"
  with_fileglob:
- /tmp/keys/*

On Tuesday, December 9, 2014 11:32:23 AM UTC-5, Mathieu Guillaume wrote:
>
> Looks like some kind of parsing issue, if I use the full YAML syntax below 
> it works, but not if I use key=...
>
> Working:
>
> - authorized_key:
> user: bob
> key: "{{lookup('file',item)}}"
>   with_fileglob:
>   - /some/absolute/path/id_*.pub
>
> Not working:
>
> - authorized_key: user=bob key='{{lookup("file", item)}}'
>   with_fileglob:
>   - /some/absolute/path/id_*.pub
>
>
> On Tuesday, December 9, 2014 5:04:00 PM UTC+1, Brian Coca wrote:
>>
>> I did very simple (if contrived) test and this seems to work fine: 
>>
>>
>>- copy: content={{lookup('file',item)}} dest=/tmp/{{item|basename}} 
>>  with_fileglob: 
>> - files/* 
>>
>>
>> -- 
>> 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/1e54c1ae-d839-4b5d-be29-ebd045871573%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] File lookup issue in 1.8.2

2015-01-07 Thread Solomon Gifford
Matthieu,

I was able to use the pipe lookup to get around this:

- authorized_key: user=bob key='{{lookup("pipe", 
"cat /some/absolute/path/id_*.pub" )}}'

On Tuesday, December 9, 2014 11:32:23 AM UTC-5, Mathieu Guillaume wrote:
>
> Looks like some kind of parsing issue, if I use the full YAML syntax below 
> it works, but not if I use key=...
>
> Working:
>
> - authorized_key:
> user: bob
> key: "{{lookup('file',item)}}"
>   with_fileglob:
>   - /some/absolute/path/id_*.pub
>
> Not working:
>
> - authorized_key: user=bob key='{{lookup("file", item)}}'
>   with_fileglob:
>   - /some/absolute/path/id_*.pub
>
>
> On Tuesday, December 9, 2014 5:04:00 PM UTC+1, Brian Coca wrote:
>>
>> I did very simple (if contrived) test and this seems to work fine: 
>>
>>
>>- copy: content={{lookup('file',item)}} dest=/tmp/{{item|basename}} 
>>  with_fileglob: 
>> - files/* 
>>
>>
>> -- 
>> 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/b4471431-741a-47d3-8ee9-7c35258be58a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] collecting "items" across roles and then iterating over them in a handler

2015-01-07 Thread Matthew Macdonald-Wallace
Hi all,

We have a number of clients for whom we manage systems using Ansible.  I'm 
fairly new to Ansible however my background is heavy use of Chef and Puppet 
so I understand most of the concepts.

In order to make our lives easier, we have a central "ansible" git repo 
containing generic roles.  This is then cloned as a submodule into each 
client repo where we override variables and config files accordingly to 
make the "generic" roles from the master repo client specific.

One of the roles that we have installs and configures Jenkins CI Server. 
 We have a set of "base" jenkins plugins that we install as part of the 
Jenkins role, however for some clients we will want to install and 
configure additional plugins.

Is there any way within Ansible that I can collect a list of these plugins 
from various roles (git, svn, capistrano etc.) and then have them installed 
by the Jenkins role?

The current approach is to have a "command" task in each role to execute 
the jenkins-cli command to install the plugins which seems like a very 
un-DRY way of doing things.

I'm reasonably happy with Python so I'm happy to write a module if this is 
what is required, however I'm hoping that this is a solved problem!

Thanks in advance for any help,

Matt

P.S. FWIW, it looks like https://github.com/ansible/ansible/pull/6674 might 
solve this for me, but it's not been merged as far as I can tell.

-- 
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/11d7acbe-a4b6-42e4-8aa8-9f5f0f1db680%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] ec2_group_module: No hosts matched

2015-01-07 Thread JJ
Hi,

I'm trying to run the sample as given here 
. I copied and pasted the 
yml file. Though when I run I receive "No hosts matched".

Any ideas?

Thanks,
Josh

-- 
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/fd81ebdd-c3a7-4e4e-ae9d-3116653f20e1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2015-01-07 Thread Patel Parimal
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.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Filter hosts based on facts

2015-01-07 Thread Tom Bamford
Of course, this approach applies to playbooks. I'm not sure how to (best)
accomplish this with the standalone ansible command.

Regards
Tom

On 7 January 2015 at 13:53, Tom Bamford  wrote:

> Hi Vasek
>
> You can declare dynamic groups based on arbitrary facts, and then apply
> tasks or roles to those groups. There is an example at
> http://docs.ansible.com/playbooks_best_practices.html#operating-system-and-distribution-variance
> which seems to do exactly what you want.
>
> Regards
> Tom
>
>
> On 7 January 2015 at 13:43, Vaclav Adamec 
> wrote:
>
>> Hi,
>>  can humbly ask someone to provide me some example how to filter list of
>> servers with facts ? I probably miss something in documentation, I need
>> something like this:
>>
>> ansible -i /usr/local/src/ansible/plugins/inventory/vmware.py '~web.*' -m
>> shell -a 'filter=facter_operatingsystem_CentOS' -a "some fancy command"
>>
>> and in playbook this:
>>
>>   - name: Test
>> script: ./script.sh
>> register: command_result
>> failed_when: "'FAILED' in command_result.stdout"
>> when: facter_operatingsystem|CentOS
>>
>> Thanks a lot
>>
>> Vasek
>>
>>  --
>> 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/fc6d5020-927f-4cf0-a04c-604542b7d952%40googlegroups.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>


-- 
Tom Bamford

*@Planet*
ATPLANET (Pty) Ltd
atpla.net

Cell: +27 (0)79-095-7112
Fax: +27 (0)86-599-1310

-- 
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/CAAnNz0NFdOwVDxGS1ciUqi-2MSs0kwpj%3DYkung7DGC_FQ8Gpvw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Filter hosts based on facts

2015-01-07 Thread Tom Bamford
Hi Vasek

You can declare dynamic groups based on arbitrary facts, and then apply
tasks or roles to those groups. There is an example at
http://docs.ansible.com/playbooks_best_practices.html#operating-system-and-distribution-variance
which seems to do exactly what you want.

Regards
Tom


On 7 January 2015 at 13:43, Vaclav Adamec 
wrote:

> Hi,
>  can humbly ask someone to provide me some example how to filter list of
> servers with facts ? I probably miss something in documentation, I need
> something like this:
>
> ansible -i /usr/local/src/ansible/plugins/inventory/vmware.py '~web.*' -m
> shell -a 'filter=facter_operatingsystem_CentOS' -a "some fancy command"
>
> and in playbook this:
>
>   - name: Test
> script: ./script.sh
> register: command_result
> failed_when: "'FAILED' in command_result.stdout"
> when: facter_operatingsystem|CentOS
>
> Thanks a lot
>
> Vasek
>
>  --
> 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/fc6d5020-927f-4cf0-a04c-604542b7d952%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/CAAnNz0Ngh8994tu_mvzTxh6wF3Vf16WniE76qPjQgU7osTAX%2Bg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Filter hosts based on facts

2015-01-07 Thread Vaclav Adamec
Hi,
 can humbly ask someone to provide me some example how to filter list of 
servers with facts ? I probably miss something in documentation, I need 
something like this:

ansible -i /usr/local/src/ansible/plugins/inventory/vmware.py '~web.*' -m 
shell -a 'filter=facter_operatingsystem_CentOS' -a "some fancy command"

and in playbook this:

  - name: Test
script: ./script.sh
register: command_result
failed_when: "'FAILED' in command_result.stdout"
when: facter_operatingsystem|CentOS

Thanks a lot

Vasek

-- 
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/fc6d5020-927f-4cf0-a04c-604542b7d952%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Fetch list of hosts in cluster and do something with them

2015-01-07 Thread Paul Slootman
I've been wondering what the best way of accomplishing this is:

- We have a number of customers
- Each customer has one or more (Oracle Weblogic) clusters
- Each cluster has an Admin node
- I want to generate an (passphrase-less) ssh key for the "oracle" user on 
each Admin node
- The public key of the Admin node has to be installed on each node in the 
cluster so that the "oracle" user on the Admin node can reach each node 
non-interactively

I have a script that can be run on a host which prints out a list of 
hostnames in the cluster, iff the host is an Admin node:

 ---
 - hosts: APPS
  sudo: yes
  tasks:
  - name: get cluster host list
script: /home/paul/ansible-cfg/etc/check-cluster.bash
register: clusterdata
  - debug: var=clusterdata.stdout_lines

When run, I get the following output:

 TASK: [debug var=clusterdata.stdout_lines] 
 
 ok: [user1.custabc.local] => {
"clusterdata.stdout_lines": [
"user1.custabc.local", 
"user2.custabc.local", 
"user3.custabc.local", 
"user4.custabc.local" 
]
 }
 ok: [user2.custabc.local] => {
"clusterdata.stdout_lines": []
 }
 ok: [user4.custabc.local] => {
"clusterdata.stdout_lines": []
 }
 ok: [user3.custabc.local] => {
"clusterdata.stdout_lines": []
 }

user1.custabc.local is the Admin node here, APPS is the group of 
application hosts (I limited the hosts to just one customer here).

Now I'd want to generate an ssh key on user1.custabc.local, and install the 
public key in authorized_keys on the other hosts (it's not a problem if 
it's also installed on user1.custabc.local as well.

I just have no idea how to realize this. At the moment the inventory only 
lists all the hosts, not what hosts are Admin nodes and what nodes belong 
together in a cluster. We're working on fixing our CMDB to include this 
data, but it's not yet available. I could of course use the script to fetch 
this info and then add that info to the inventory. Any tips on what would 
be the best way to store this info in the inventory? I'm not very at home 
with Ansible yet :-( so any tips gratefully accepted.

thanks,
Paul

-- 
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/fbd6a1e3-89b1-4cf7-9851-b572ba9e127f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Pass dictionary variables to the role does not work

2015-01-07 Thread hce h

Hi Toshio,

 
On Wednesday, January 7, 2015 4:51:57 AM UTC+11, tkuratomi wrote:
>
> Are you able to post a small reproducer?  It would help to determine if 
> this is a bug or not.
>
That problem only occurred on CentOS 6.5, it did not repeat in CentOS 7 and 
Ubuntu 14. I suspect that might be caused by different python version, 
CentOS 6 uses python 2.6, both CentOS 7 and Ubuntu 14 use python 2.7. It 
does not seem the bug in the ansible code, but it is fragile .

Anyway, the original issue still remains in v1.8.2 although Tom said it did 
not break in his site, I still could not get it work. Both CentOS 7 and 
Ubuntu 14 got the same exception at - { role: nfs-client, nfsServer: { 
'ansible_facts': { 'ansible_eth0' : { 'ipv4' : { 'address': 'hce.com' } } } 
} }



Thanks Toshio.

Thanks, Toshio
> On Jan 5, 2015 5:59 PM, "hce h" > wrote:
>
>>
>> I set up ansible_ssh_host=10.1.0.1 in my inventory file, but the function 
>> def _get_host(self, hostname) in inventory __init__.py checks if hostname 
>> == host.name, when the hostname is "ansible_ssh_host", it cannot match 
>> and return None and exception. Is it a bug in 1.8.2?
>>
>>
>> On Tuesday, January 6, 2015 10:28:37 AM UTC+11, hce h wrote:
>>>
>>> After updating to v1.8.2, I've got following error which was running 
>>> fine in v1.7. I've got no idea what it stuck about, there is nothing 
>>> changed except updating to 1.8.2, what could be possible wrong here?
>>>
>>> fatal: [nfsserver -> 127.0.0.1] => {'msg': 'Exception: host not found: 
>>> ansible_ssh_host', 'failed': True}
>>>
>>> Thanks.
>>>
>>> -
>>>
>>> On Monday, January 5, 2015 6:59:25 PM UTC+11, hce h wrote:

 ve1.7, I am going to update to v1.8.2 and will see how it goes.

 Thanks Tom.

 - j

 On Monday, January 5, 2015 3:15:37 PM UTC+11, Tom Bamford wrote:
>
> What version of Ansible are you using? It works for me with v1.8.2. 
> Even when referencing an undefined variable, I don't get an exception.
>
> Can you paste the nfs-client task which fails?
>
> Tom
>
>
> On 5 January 2015 at 05:55, hce h  wrote:
>
>> Hi,
>>
>> I cannot install ansible to one of our NFS server, I tried to fake a 
>> dictionary variable at following playbook:
>>
>> - { role: nfs-client, nfsServer: { 'ansible_facts': { 'ansible_eth0' 
>> : { 'ipv4' : { 'address': 'hce.com' } } } } }
>>
>> The nfs-client tasks uses the variable nfsServer['ansible_facts'], 
>> but I got following error, it cannot find dictionary variable 
>> nfsServer['ansible_facts']:
>>
>> fatal: One or more undefined variables: 'dict' object has no 
>> attribute 'ansible_facts'.
>>
>> What I was missing the syntax here?
>>
>> Thanks.
>>
>> - j
>>
>>
>>
>>
>>
>>
>>
>>
>>  -- 
>> 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/995e60f0-a5f4-4a6c-971f-
>> 5dfd226f61d9%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/4f1fdaf8-f4e5-4404-9f09-0413ce820c52%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/0b916985-a5b5-410c-8f45-afe667b56e3d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.