[ansible-project] Ansible Tower Job running Error

2015-07-24 Thread Raw A
Hello,

I have done all things properly from our but i regularly get error on 
running Jobs.

Please help me asap.

Please Look Error.

===
Results Traceback
Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/awx/main/tasks.py", line 488, in run
File "/usr/lib/python2.6/site-packages/awx/main/tasks.py", line 677, in 
build_args
File "/usr/lib64/python2.6/distutils/version.py", line 296, in __cmp__
return cmp(self.version, other.version)
AttributeError: LooseVersion instance has no attribute 'version'

Timing Started  07/25/15 11:36:12
 
Finished  07/25/15 11:36:12
 
Elapsed  00:00:00
==
=

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/71ce662b-3faa-4df7-bbb4-62cd4ff85359%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Deleting EC2 instance and termination_list mystery

2015-07-24 Thread Brian Coca
it is the case of the error giving out an internal name, it should be
fixed in the module, but what you are missing in the module is the
instance_ids (which internally gets passed to the boto termination
list).


-- 
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/CAJ5XC8kR%3Du6Eq_LdfzFmNv%2B%2BDr-4A0HKq9CU3DPxpEY5Fqu_Tg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Properly delete Amazon EC@ elastic load balancer

2015-07-24 Thread Brian Coca
it might be something we need to add to the modules, most of them
depend on boto, so if the capability is there it should not be hard to
add

On Fri, Jul 24, 2015 at 11:13 PM, Erik Steffl  wrote:
> Deleting the elastic load balancer (ELB) sort of works (using
> http://docs.ansible.com/ansible/ec2_elb_lb_module.html) but it does not
> delete ELB elastic network interfaces (ENI), these are deleted later by
> Amazon background process. This is mostly invisible to the user.
>
> The problem is that the ENI is in the same subnet(s) and uses the same
> security group(s) as the ELB. Which means that deleting of ELB security
> group(s) and subnet(s) somewhat mysteriously fails with error " resource
> sg- has a dependent object". Re-running the delete task later on
> (usually few minutes later) works (ENI is removed by Amazon in the
> meantime).
>
> This is also discussed at http://unrouted.io/2015/04/12/elb-deletion/
>
> Is this a known problem? Any ideas how to handle it now? Any plans to handle
> it by ec2_elb_lb module?
>
> It seems that currently there is no workaround possible (in 1.9.2, I see
> that ec2_eni module is available in 2.0)
>
> Any ideas how to handle it in 2.0? It seems that the only way to figure out
> that the ENI belongs to a particular ELB is the description, I don't see how
> to check if ENI with a given description exists.
>
> Thanks!
>
> erik
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ansible-project+unsubscr...@googlegroups.com.
> To post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/c75596be-d19e-4557-988d-2289308aed11%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/CAJ5XC8k%2B_QJD59acCj9frZAATcT9pqDNfAp-TAZQtf%3DaxULX%3DQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Properly delete Amazon EC@ elastic load balancer

2015-07-24 Thread Erik Steffl
Deleting the elastic load balancer (ELB) sort of works 
(using http://docs.ansible.com/ansible/ec2_elb_lb_module.html) but it does 
not delete ELB elastic network interfaces (ENI), these are deleted later by 
Amazon background process. This is mostly invisible to the user.

The problem is that the ENI is in the same subnet(s) and uses the same 
security group(s) as the ELB. Which means that deleting of ELB security 
group(s) and subnet(s) somewhat mysteriously fails with error " resource 
sg- has a dependent object". Re-running the delete task later on 
(usually few minutes later) works (ENI is removed by Amazon in the 
meantime).

This is also discussed at http://unrouted.io/2015/04/12/elb-deletion/

Is this a known problem? Any ideas how to handle it now? Any plans to 
handle it by ec2_elb_lb module?

It seems that currently there is no workaround possible (in 1.9.2, I see 
that ec2_eni module is available in 2.0)

Any ideas how to handle it in 2.0? It seems that the only way to figure out 
that the ENI belongs to a particular ELB is the description, I don't see 
how to check if ENI with a given description exists.

Thanks!

erik

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/c75596be-d19e-4557-988d-2289308aed11%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: [ansible-devel] Re: Policies for module maintenance

2015-07-24 Thread Brian Coca
tests go in the test/ directory in the main repo, You can find many
tests for modules there as well as for general ansible functionality,
most modules are not covered but the most important core and many
cloud modules are.



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


[ansible-project] Deleting EC2 instance and termination_list mystery

2015-07-24 Thread Erik Steffl
When not including termination_list parameter:

TASK: [Delete template API instance] 
** 
failed: [localhost -> 127.0.0.1] => {"failed": true}
msg: termination_list needs to be a list of instances to terminate

FATAL: all hosts have already failed -- aborting

So I include termination_list and:

TASK: [Delete template API instance] 
** 
failed: [localhost -> 127.0.0.1] => {"failed": true}
msg: unsupported parameter for module: termination_list

FATAL: all hosts have already failed -- aborting

Config is:

{
"name": "Delete template API instance",
"local_action": {
"module": "ec2",
"region": "us-east-1",
"state": "absent",
"wait": "yes",
"assign_public_ip": "no",
"count": 1,
"ebs_optimized": "no",
"image": "ami-f11ac69a",
"instance_tags": {
"Name": "{{ xaos_template_instance_name }}"
},
"instance_type": "t2.micro",
"key_name": "juju-dev",
"monitoring": "yes",
"vpc_subnet_id": "subnet-376d296e"
}
},

Any ideas how to delete instance? Specifically by Name (tag), we create 
instance in one play and want to remove them in another play.

Thanks!

erik

-- 
This IS a signature.

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/d57650a1-33e5-4aa3-829d-8893b12cdf82%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: included handlers in playbook with roles - not firing

2015-07-24 Thread 'rmullinnix' via Ansible Project
Thanks Brian.  I've spent most of the day on that link and similar ones. 
 I'll have to keep tinkering around and learn some more.  Everything else 
has been working well, just got wrapped around the axle with handlers.

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/9153709a-79be-4175-b120-4eb5b6a574b0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: included handlers in playbook with roles - not firing

2015-07-24 Thread Brian Coca
so to clarify:

>  * notify is contained within the scope of a play
correct

>  * a role within a playbook constitutes a single play
incorrect

>  * notify does not propagate outside the play and will not be picked up by
> handlers outside of the play (i.e., role)
correct up to the  i.e, which is wrong

>  * role dependencies will not allow you to propagate the notify across roles
> - it behaves as two separate, autonomous plays
incorrect

>  * handler names are global but the notify to invoke them is local to the
> role
first 1/2 is correct (up to 'but'), the 2nd half is incorrect

So now im just going to mostly repeat data you can find here
(expanding a bit):
http://docs.ansible.com/ansible/playbooks_intro.html#handlers-running-operations-on-change

* roles can only exist INSIDE a play so they are always part of a play
and do not define a play themselves.
* a play can have multiple roles and/or tasks, either directly or
indirectly included, through roles, include directive or role
dependencies.
* in a file (playbook)  you can have several plays, handlers are local
to each play and not notifiable across plays.
* dependencies should include a role in the same play as the dependent
role, which includes it's handlers.
* handler names must be unique in the play, or they will overwrite
each other, meaning you can only execute one of them.
* any task in a play can notify any handler in the play, except a
latter handler at the end of a play.
* notified handlers get processed between ‘pre_tasks’, ‘roles’,
‘tasks’, and ‘post_tasks’ sections or when you invoke them through
"meta: flush_hanlders".
* running a handler clears it from the notification list, but it can
be notified again by any task, except a latter handler at the end of a
play.

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


[ansible-project] Re: Update inventory file

2015-07-24 Thread 'rmullinnix' via Ansible Project
One way is to create a new file with the host name and the ip address, then 
use this to update the hosts file as opposed to updating it in place.  You 
can use the post_tasks: to run the update at the end of the playbook.

You can do this with sed by creating a sed script file with lines of -- 
s/hostname/hostname ansible_ssh_host=ipaddress/g.  You can use lineinfile - 
which will add to the EOF.  call it hosts.update

Then you would have a task that would update the hosts file
  post_tasks:
 - name: update hosts file with ip address
   shell:  sed -i -f hosts.update hosts

I'm sure there is probably a better way to do this

On Friday, July 24, 2015 at 10:20:14 AM UTC-5, Edgardo Vega wrote:
>
> I have a playbook with is creating vms and then i want to add the ip 
> address to the inventory file to when it comes time to provision i can just 
> call the updated inventory file. lineinfile will only add to the found 
> lines at the end of the file. replace will update all the matches. What is 
> the recommended way to do this?
>
>
> ===playbook===
> ---
> - name: create instances
>   hosts: all
>   gather_facts: no
>   connection: local
>   sudo: no
>   tasks:
> - name: "create instance and assign floating-ip (if available)"
>   os_server:
>state: present
>auth:
>  auth_url: http://10.10.81.227:5000/v2.0
>  username: "{{openstack_username | mandatory }}"
>  password: "{{openstack_password | mandatory }}"
>  project_name: cups
>name: "{{ inventory_hostname | mandatory }}"
>image: "{{ openstack_image | mandatory }}"
>key_name:  "{{ openstack_key_name | mandatory }}"
>flavor: "{{ openstack_flavor | mandatory }}"
>   register: result
>   
> - debug: var=result
> 
> - debug: var=inventory_hostname
>
> 
> - lineinfile: backrefs=yes state=present 
>  dest="{{inventory_dir}}/test" regexp='{{inventory_hostname}}\s' 
> line='{{inventory_hostname}} 
> ansible_ssh_host={{result.openstack.accessIPv4}}'
>   
> ===inventory file
> [tomcat]
> tomcat
>
> [jenkins]
> jenkins
>
> [downloads]
> downloads
>
> [project:children]
> tomcat
> jenkins
> downloads
>
> [cups:vars]
> ansible_ssh_user=centos
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/7d7b1f23-3e30-4e80-8a5c-7eb14fa15c75%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: included handlers in playbook with roles - not firing

2015-07-24 Thread 'rmullinnix' via Ansible Project
After playing around some more I'll see if I can answer my own question.

 * notify is contained within the scope of a play
 * a role within a playbook constitutes a single play
 * notify does not propagate outside the play and will not be picked up by 
handlers outside of the play (i.e., role)
 * role dependencies will not allow you to propagate the notify across 
roles - it behaves as two separate, autonomous plays
 * handler names are global but the notify to invoke them is local to the 
role

I can move the handler to the role and it will execute.  I would need to 
copy the handler to each role that could invoke it or include the other 
role handlers file within each role that needs it.  I tried the include 
directive in the handlers file within the role so I didn't have to copy 
code across multiple roles -- didn't work for me, probably a relative path 
issue on my part.

I think my best bet is to use post_tasks: within the playbook and execute 
the refresh regardless of the change state in each respective role.

Please feel free to correct me if I've stated things incorrectly.

On Friday, July 24, 2015 at 2:08:01 PM UTC-5, rmullinnix wrote:
>
> I probably have something structured wrong or it's something simple - but 
> I'm stuck trying to get handlers added to a playbook via include to fire. 
>  The handlers from roles that are listed in the playbook fire correctly, 
> but the include ones do not.  And the task with the notify has a changed: 
> true.
>
> Running ansible-playbook 2.0.0 (last pull on 7/18) on SLES
>
> Here's the playbook
> ---
> # This Playbook deploys the components for the webserver
> #   Apache, consului and kibana
>
> # setup and deploy apache
> - hosts: webservers
>   become: yes
>
>   roles:
> - role: common
> - role: apache
> - role: consului
> - role: kibana
>
>   handlers:
> - include: roles/consul/handlers/main.yml
> - include: roles/consul-template/handlers/main.yml
>
> I'm using consul and consul-template to hold the config variables for the 
> components.  I push a change to a consul-template file and expect the 
> handler 'refresh consultemplate' to run, but it does not.
>
> Here is the roles/consul-template/handlers/main.yml file
> ---
> # file: roles/consul-template/handlers/main.yml
> - name: refresh consultemplate
>   shell: 'kill -1 $(cat /var/run/consul-template.pid)'
>
> - name: install consultemplate
>   command: /sbin/insserv -f consul-template
>
> - name: restart consultemplate
>   service: name=consul-template state=restarted
>
> And the task in the roles/kibana/tasks/main.yml with the notify
>   - name: Add consul-template ctmpl file
> copy: src=kibana.ctmpl dest=/etc/consul-template/ctmpl/kibana.ctmpl
> notify: refresh consultemplate
>
>
> And the run
> TASK [kibana : kibana : Add consul-template ctmpl file] 
> *
> changed: [XX]
>
> TASK [kibana : kibana : Add apache mod_proxy to connect to consul] 
> **
> changed: [XX]
>
> RUNNING HANDLER [apache : restart apache] 
> ***
> changed: [XX]
>
> PLAY RECAP 
> **
> XX : ok=29   changed=8unreachable=0failed=0
>
> So the handler I have in roles/apache/handlers/main.yml works correctly. 
>  It's just the include handlers where the associated role is not in the 
> playbook
>
> Any help would be appreciated.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/c3921721-896d-431a-9e70-3b0d5d44d286%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Running Ansible from RPM

2015-07-24 Thread Samnang Sen
When I run Ansible from source by sourcing the env-setup file under the 
hacking folder, I'm able to run Ansible just fine. So now I want to run it 
via an RPM that i built for my RH5 hosts. When I run "ansible --version" I 
get the following ...

# ansible --version
ansible 1.9.2
  configured module search path = None

So i went digging into the env-setup file and noticed the PYTHONPATH is 
pointed to ~/ansible/lib. The libraries from my RPMs are installed under 
/usr/lib/python2.6/site-packages. If I export PYTHONPATH pointing to that 
path it doesn't appear to be working. What am I doing wrong?

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/0f41b4d7-3e74-48f5-9939-e56eb90bbbd1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] included handlers in playbook with roles - not firing

2015-07-24 Thread 'rmullinnix' via Ansible Project
I probably have something structured wrong or it's something simple - but 
I'm stuck trying to get handlers added to a playbook via include to fire. 
 The handlers from roles that are listed in the playbook fire correctly, 
but the include ones do not.  And the task with the notify has a changed: 
true.

Running ansible-playbook 2.0.0 (last pull on 7/18) on SLES

Here's the playbook
---
# This Playbook deploys the components for the webserver
#   Apache, consului and kibana

# setup and deploy apache
- hosts: webservers
  become: yes

  roles:
- role: common
- role: apache
- role: consului
- role: kibana

  handlers:
- include: roles/consul/handlers/main.yml
- include: roles/consul-template/handlers/main.yml

I'm using consul and consul-template to hold the config variables for the 
components.  I push a change to a consul-template file and expect the 
handler 'refresh consultemplate' to run, but it does not.

Here is the roles/consul-template/handlers/main.yml file
---
# file: roles/consul-template/handlers/main.yml
- name: refresh consultemplate
  shell: 'kill -1 $(cat /var/run/consul-template.pid)'

- name: install consultemplate
  command: /sbin/insserv -f consul-template

- name: restart consultemplate
  service: name=consul-template state=restarted

And the task in the roles/kibana/tasks/main.yml with the notify
  - name: Add consul-template ctmpl file
copy: src=kibana.ctmpl dest=/etc/consul-template/ctmpl/kibana.ctmpl
notify: refresh consultemplate


And the run
TASK [kibana : kibana : Add consul-template ctmpl file] 
*
changed: [XX]

TASK [kibana : kibana : Add apache mod_proxy to connect to consul] 
**
changed: [XX]

RUNNING HANDLER [apache : restart apache] 
***
changed: [XX]

PLAY RECAP 
**
XX : ok=29   changed=8unreachable=0failed=0

So the handler I have in roles/apache/handlers/main.yml works correctly. 
 It's just the include handlers where the associated role is not in the 
playbook

Any help would be appreciated.


-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/623d598c-98c3-468f-9ac6-9b7faef9496e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] group_names to dictionary

2015-07-24 Thread Edgardo Vega
Is there a way to convert an array to a dictionary. I want to use the group 
names as metadata for os_server or ec2 so I can reference them later using 
dynamic inventories.


-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/c498682b-bbb5-47ae-8e01-aa07919e8143%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] ssl issues with hipchat module?

2015-07-24 Thread Samnang Sen
So here's what I did. If I run it from source (source 
ansible/hacking/env-setup) it seems to work. However, I created an RPM for 
my RH5 boxes (don't ask) and installed it across our web servers. I dont 
know if this means anything but I am getting the following message when 
running "ansible --version"

ansible 1.9.2
  configured module search path = None

Now when running my role, everything before it works (installing RPMs) but 
the hipchat part is throwing an error.

failed: [127.0.0.1 -> 127.0.0.1] => {"failed": true, "parsed": false}
Traceback (most recent call last):
  File 
"/home/deployment/.ansible/tmp/ansible-tmp-1437759950.33-224089137808292/hipchat",
 
line 1918, in ?
PROTOCOL = ssl.PROTOCOL_TLSv1
NameError: name 'ssl' is not defined


FATAL: all hosts have already failed -- aborting

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/d941886f-c643-43bb-8741-88f51d4c53a4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Fedora 22: ansible_pkg_mgr: yum vs. dnf

2015-07-24 Thread nusenu
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

> I'd like to get 'dnf' as an answer when asking a F22 system for 
> ansible_pkg_mgr.
> 
> What do you think about it?

Since the ansible module 'yum' fails on F22 (even after 'dnf install
yum'), I'm even considering this a bug:


https://github.com/ansible/ansible-modules-core/issues/1797
-BEGIN PGP SIGNATURE-

iQIcBAEBCgAGBQJVsncnAAoJEFv7XvVCELh0+Z0QALKB82mSUwPHBr6QE3srETy7
q9dVUytnUWM3mjyux7fVGqOoxXae4pxGS49VWxmK2K8N1LSBQbEBd/Bb2LdLgSTq
11DhRkvJTDmR7ogxI2cEySHe5r8zR2fjY3fpTkB4UuiIhAiGFxrBIcOlhQlkduF3
q8AyBhwFx1CNB/u4MYFup+YOKxDIwbmdyIclTLbzXrkG8D2H8iYYo2roo628Kn2s
/4w9KangTKRb3L7x8kB+IRqWt+xTPFvmTkE/c+08XkVUJL8nru4+hUpjuGvDPkn5
R+Ag3SP5YJj/UbFIHsnu3KtTH/ci0PKXp7GP2xEJUNjKaE66dVyS2mOmtWSkB9L+
8/7HbgtnOyVRu1IbEoabmi0aeZVNk59wt/nETThTWXoS69or6pHBuzh0fOC0rh8/
2SDHI1w4rSfLKe/fQP/s8M0O+eGPIJ9byeG1wheYiHUid3RG7/6D3FJ1eyMBF5HK
74z8gfXyB7kEI0JfFUHSrgEOyZ5yQqtqqGQDyjmdEC8KuE/Mlv14SYSIH1uxxFon
vj5QmJ5hRF4B1UsHihNnsilsiFW8fU2Kod7YqWd8uSHdOD/KA39yJSf4Df9HjEYj
aHp8OSVU1v973rMtKIKwh0ITVDE7gOkR1BvgjxFBfEvIq8i47b9e/dR33IcnnOFd
NBVuKkWpSIsc3RTuWRfO
=81bw
-END PGP SIGNATURE-

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/55B27727.5000205%40openmailbox.org.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Error creating RDS instance

2015-07-24 Thread Guy Knights
Bump. Does anyone have any insight into what the issue might be here?

Thanks,
Guy

On Thursday, July 16, 2015 at 2:04:12 PM UTC-7, Guy Knights wrote:
>
> I'm getting the following in a playbook a task to create an RDS instance 
> runs:
>
> msg: failed to create instance: null
>
> This task worked fine yesterday, today I made a minor change to the VPC 
> task (below) by adding another app subnet and specifying availability zones 
> for the 2 app subnets, but this should have no effect on the RDS task. The 
> RDS task itself hasn't been changed.
>
> - name: provision white label vpc
>   ec2_vpc:
> state: present
> cidr_block: "10.{{ wl_vpc_prefix }}.0.0/16"
> resource_tags: { "Name": "{{ wl_name }}-bbe-vpc" }
> region: us-west-1
> subnets:
>   - cidr: "10.{{ wl_vpc_prefix }}.1.0/24"
> resource_tags: { "Name": "{{ wl_name }}-bbe-public" }
>   - cidr: "10.{{ wl_vpc_prefix }}.2.0/24"
> az: us-west-1a
> resource_tags: { "Name": "{{ wl_name }}-bbe-app" }
>   - cidr: "10.{{ wl_vpc_prefix }}.3.0/24"
> az: us-west-1b
> resource_tags: { "Name": "{{ wl_name }}-bbe-app" }
>   - cidr: "10.{{ wl_vpc_prefix }}.4.0/24"
> resource_tags: { "Name": "{{ wl_name }}-bbe-mgmt" }
>   - cidr: "10.{{ wl_vpc_prefix }}.5.0/24"
> az: us-west-1a
> resource_tags: { "Name": "{{ wl_name }}-bbe-db" }
>   - cidr: "10.{{ wl_vpc_prefix }}.6.0/24"
> az: us-west-1b
> resource_tags: { "Name": "{{ wl_name }}-bbe-db" }
> internet_gateway: True
> route_tables:
>   - subnets:
>   - "10.{{ wl_vpc_prefix }}.1.0/24"
> routes:
>   - dest: 0.0.0.0/0
> gw: igw
>   register: vpc
>
> Does anyone have any idea what the problem is here?
>
> Thanks,
> Guy
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/88d3746d-1e13-4155-aebd-80342abfab24%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Fedora 22: ansible_pkg_mgr: yum vs. dnf

2015-07-24 Thread nusenu
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

Hi,

I'd like to get 'dnf' as an answer when asking a F22 system for
ansible_pkg_mgr.

What do you think about it?

thanks,
nusenu
-BEGIN PGP SIGNATURE-

iQIcBAEBCgAGBQJVsmaDAAoJEFv7XvVCELh0gNcP/0dUIMs8AsijvaUbtQpusPOn
hcfcXUhySgMXAbypMgGXg04IIV5/J1B66HsW3JWTUu1VAXXkxk5H7L9fP4IX99jl
I5y6zCcCSkyGuWuJ+y1tBGvSi1doeMsgHfSJdiaeg+UV9C1bFtIYVIUN5jsEt7SB
awIZCOLMgAuYmUoPBXxjyGQHCGBtlpFd+lDaP0pIzkF/FPavasThi9vJ47remkm8
J1k5ocPGw7picfiDOGOhdQMWFUIOTXDWd4SHKWrP8/zrmZHhBwAq3oyWAkbHZoJA
NJ78Mf8wv5KvDj+AFqxAQrZa3vwwL/2KLA7Gnk3ScN0WopneSku4I1aY4NRTWgWO
G5x/hGYCy7Ur34BfCg0IOZT/m33PPzk6QK+H4NxmNDmV3Iqckavg6rzQqUQZHjtf
bRcm/Jf+umcZnM8Obku3aDszkyTCWhhTpQaeX2I7eZgzypnbAxFa9m+VPpc1ocEQ
2ODGzKh+XM4Po4LiwH0ICl+PDodLpohhARKoTwV+JhdQeFywmHarznsr8ACUG0Ap
6xNSOGUJ3X6AyC80fnz7iZI+wyQK8Nu92GTaCR6Mt8aZtBTkrj8NLDIA2THka+wi
r/Y5dQVchWrYHcKs7d6RSYSZC3Uv+qk75wH/y86usaptLj/+kG0nnXY72mzpQM0X
bRlBKeauMVeOUnc2IsIA
=jwBj
-END PGP SIGNATURE-

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/55B26683.1040009%40openmailbox.org.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Update inventory file

2015-07-24 Thread Edgardo Vega
I have a playbook with is creating vms and then i want to add the ip 
address to the inventory file to when it comes time to provision i can just 
call the updated inventory file. lineinfile will only add to the found 
lines at the end of the file. replace will update all the matches. What is 
the recommended way to do this?


===playbook===
---
- name: create instances
  hosts: all
  gather_facts: no
  connection: local
  sudo: no
  tasks:
- name: "create instance and assign floating-ip (if available)"
  os_server:
   state: present
   auth:
 auth_url: http://10.10.81.227:5000/v2.0
 username: "{{openstack_username | mandatory }}"
 password: "{{openstack_password | mandatory }}"
 project_name: cups
   name: "{{ inventory_hostname | mandatory }}"
   image: "{{ openstack_image | mandatory }}"
   key_name:  "{{ openstack_key_name | mandatory }}"
   flavor: "{{ openstack_flavor | mandatory }}"
  register: result
  
- debug: var=result

- debug: var=inventory_hostname


- lineinfile: backrefs=yes state=present  dest="{{inventory_dir}}/test" 
regexp='{{inventory_hostname}}\s' line='{{inventory_hostname}} 
ansible_ssh_host={{result.openstack.accessIPv4}}'
  
===inventory file
[tomcat]
tomcat

[jenkins]
jenkins

[downloads]
downloads

[project:children]
tomcat
jenkins
downloads

[cups:vars]
ansible_ssh_user=centos



-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/dc0ffdd5-4ce6-4254-8284-058d7d6563cd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] extra checking

2015-07-24 Thread Brian Coca
already in there:

if (os.path.exists(path) and not os.access(path, os.W_OK)) and not
os.access(os.path.dirname(path), os.W_OK):

On Fri, Jul 24, 2015 at 4:48 AM, Michael Leer  wrote:
> Hello,
>
> I recently came across an issue that a user was having where the
> /var/log/ansible.log file was not writable, would it be benefical to check
> the log files permissions (if specified within the config) when starting
> Ansible?
>
> Mike
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ansible-project+unsubscr...@googlegroups.com.
> To post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/0ff6f3d7-acf6-47bd-a02a-8fc0a420fd20%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%3Dg5M6TRX8Nw%2BouEYmzBZVvz-Xf4GJ012XMyyFeLzfNUQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: variable set to a default value in play vars unexpectedly becomes not the default value

2015-07-24 Thread Timothy Appnel
If I am following what behavior you are looking for (what you describe is
how includes are intended to work) your playbook includes should be
implemented as a role and then called with parameters. See if the added
namespacing protections roles have, but includes does not kicks in.




On Thu, Jul 23, 2015 at 3:21 PM, Kathy Allen  wrote:

> bump?
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ansible-project+unsubscr...@googlegroups.com.
> To post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/a18a929b-e1bc-4540-8314-2abaee50ed65%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/CAOMCme7xtNdmrrqTf5NkyvuyxrNymA%2Bzov_izrSbLoW-FTfymw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: iterating over data

2015-07-24 Thread Hank Beatty

Yes, adding conditions for each iteration. Exactly.

I can get in there and see if I can modify it.

Are you thinking something like this... :

- debug: msg={{ item.key }}
  with_recursive:
   - { name: dict, args: firmware, conditional: Model }
# where Model was set at some past point

   - { name: dict, args: "{{item.value}}", conditional: 'idrac' }

Or something else.

Thanks,
Hank


On 7/24/15 8:44 AM, Hagai Kariti wrote:


Do you mean add conditions for each iteration? No, you cant do that 
currently. Shouldnt be hard, butnI dont have a lot of time to do it 
myself.



On Fri, Jul 24, 2015, 15:03 Hank Beatty > wrote:


Hello Hagai,

This got me going. Thank you.

Is there a way to match a given model (given that I set the
'Model' var earlier in the playbook)? I need the firmware and that
works perfectly but, I need to limit the firmware that goes to a
certain model of server.

Thanks,
Hank

Something like:

- debug: var=Model

- debug: msg={{ item.key }}
  when: item.key == 'idrac'
  with_recursive:
   - { name: dict, args: firmware, "{{ Model }}" }
   - { name: dict, args: "{{item.value}}" }

Here is the output of the above:

TASK: [idrac-firmware | debug var=Model]
**
ok: [] => {
"var": {
"Model": "PowerEdge_R730xd"
}
}

TASK: [idrac-firmware | debug msg={{ item.key }}]
*
skipping: [] => (item={'key': 'bios', 'value':
{'url':
'http://downloads.dell.com/FOLDER02797483M/1/BIOS_CNN4X_WN64_2.5.2.EXE',
'search': 'none', 'target_version': '2.5.2', 'minimum_version':
'none', 'filename': 'BIOS_CNN4X_WN64_2.5.2.EXE'}})
skipping: [] => (item={'key': 'os_collector',
'value': {'url':

'http://downloads.dell.com/FOLDER02775623M/1/Diagnostics_Application_5W2KP_WN64_OSC_1.1_X10-00.EXE',
'search': 'none', 'target_version': 1.1001,
'minimum_version': 'none', 'filename':
'Diagnostics_Application_5W2KP_WN64_OSC_1.1_X10-00.EXE'}})
skipping: [] => (item={'key': 'bios', 'value':
{'url':
'http://downloads.dell.com/FOLDER02868051M/1/BIOS_XR23Y_WN64_1.2.10.EXE',
'search': 'none', 'target_version': '1.2.10', 'minimum_version':
'none', 'filename': 'BIOS_XR23Y_WN64_1.2.10.EXE'}})
ok: [] => (item={'key': 'idrac', 'value': {'url':

'http://downloads.dell.com/FOLDER02881013M/1/iDRAC-with-Lifecycle-Controller_Firmware_FM1PC_WN64_2.10.10.10_A00.EXE',
'search': 'none', 'target_version': '2.10.10.10',
'minimum_version': 'none', 'filename':
'iDRAC-with-Lifecycle-Controller_Firmware_FM1PC_WN64_2.10.10.10_A00.EXE'}})
=> {
"item": {
"key": "idrac",
"value": {
"filename":
"iDRAC-with-Lifecycle-Controller_Firmware_FM1PC_WN64_2.10.10.10_A00.EXE",

"minimum_version": "none",
"search": "none",
"target_version": "2.10.10.10",
"url":

"http://downloads.dell.com/FOLDER02881013M/1/iDRAC-with-Lifecycle-Controller_Firmware_FM1PC_WN64_2.10.10.10_A00.EXE";


}
},
"msg": "idrac"
}
skipping: [] => (item={'key': 'bios', 'value':
{'url':
'http://downloads.dell.com/FOLDER02868051M/1/BIOS_XR23Y_WN64_1.2.10.EXE',
'search': 'none', 'target_version': '1.2.10', 'minimum_version':
'none', 'filename': 'BIOS_XR23Y_WN64_1.2.10.EXE'}})
ok: [] => (item={'key': 'idrac', 'value': {'url':

'http://downloads.dell.com/FOLDER02881013M/1/iDRAC-with-Lifecycle-Controller_Firmware_FM1PC_WN64_2.10.10.10_A00.EXE',
'search': 'none', 'target_version': '2.10.10.10',
'minimum_version': 'none', 'filename':
'iDRAC-with-Lifecycle-Controller_Firmware_FM1PC_WN64_2.10.10.10_A00.EXE'}})
=> {
"item": {
"key": "idrac",
"value": {
"filename":
"iDRAC-with-Lifecycle-Controller_Firmware_FM1PC_WN64_2.10.10.10_A00.EXE",

"minimum_version": "none",
"search": "none",
"target_version": "2.10.10.10",
"url":

"http://downloads.dell.com/FOLDER02881013M/1/iDRAC-with-Lifecycle-Controller_Firmware_FM1PC_WN64_2.10.10.10_A00.EXE";


}
},
"msg": "idrac"

}



On 6/27/15 7:56 AM, Hagai Kariti wrote:

You can write a small filter plugin that gives you the items of
dicts (something that simply returns an `item.values()` or
something like that). Then you could do:

vars:
# Will create a list of inner dict values inside a list of
parent dict's values
   - firmware_items: "{{ firmware.

[ansible-project] Re: Ansible copy module hangs on CentOS 7

2015-07-24 Thread Martin Ilchev
After a lot of digging I was able to find the source of the problem. There 
was an sshd_config.j2 template that was taken from Debian based system. In 
it the default settings for Subsystem is different than CentOS
# Debian
Subsystem sftp /usr/lib/openssh/sftp-server
#Centos
Subsystem sftp /usr/libexec/openssh/sftp-server

so lib vs libexec after restoring the config file back to normal the 
playbook completes without errors.

Hopefully this will save someone else a couple of days.
M

On Thursday, 16 July 2015 13:07:02 UTC+1, Martin Ilchev wrote:
>
> Hi Guys,
>
> I have a playbook to copy DNS zone files from local directory to a remote 
> one and restart the named service. The playbook is as follows:
> ---
> # This playbook upgrades zone data files from the control machine to all 
> DNS servers 1 machine at a time
>
> - name: Upgrade zone data files. Reload named-chroot if required
>   hosts: dnsservers
>   gather_facts: no
>   sudo: yes
>   serial: 1
>   tasks:
>
> - name: copy dns zone files from control machine to DNS servers
>   copy: src=zones/ dest=/var/named owner=root group=named mode=0440
>   register: namedzones
>
> - name: restart dns service if required
>   service: name=named-chroot state=restarted
>   when: namedzones.changed
>
> I test run the playbook as follows:
>
> ansible-playbook -vv dns-copy-zones.yml --ask-become-pass --check
>
> The output is:
> SUDO password: 
>
> PLAY [Upgrade zone data files. Reload named-chroot if required] *** 
>
> TASK: [copy dns zone files from control machine to DNS servers] ***
> fatal: [192.168.16.195] => ssh connection error while waiting for sudo 
> password prompt
>
> FATAL: all hosts have already failed -- aborting   
> 
> 
>
> PLAY RECAP 
>  
>to retry, use: --limit @/home/martin/dns-copy-zones.retry
>
> 192.168.16.195 : ok=0changed=0unreachable=1failed=0
>
> When I increase the verbosity I can see 5-6 files are copied then copy 
> hangs locally on transferring the next file and eventually times out.
>
> On the remote machine if I tail /var/log/secure I can see all the files up 
> to the last one going through.
>
> The machine I run the playbook from and the destination machine are both 
> CentOS 7. The version is ansible 1.9.2.
>
> Below is the more verbose output I have highlighted what I think are the 
> important messages. I am only including the last file to go through 
> successfully and the next one to hang (let me know if you require the full 
> output):
> ON CONTROL MACHINE:
> <192.168.16.195> EXEC ssh -C -tt -v -o ControlMaster=auto -o 
> ControlPersist=60s -o 
> ControlPath="/home/martin/.ansible/cp/ansible-ssh-%h-%p-%r" -o 
> KbdInteractiveAuthentication=no -o 
> PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey 
> -o PasswordAuthentication=no -o ConnectTimeout=10 192.168.16.195 /bin/sh -c 
> 'sudo -k && sudo -H -S -p "[sudo via ansible, 
> key=zasgrvyvetzjqebxkfgjmaeohbealypu] password: " -u root /bin/sh -c 
> '"'"'echo BECOME-SUCCESS-zasgrvyvetzjqebxkfgjmaeohbealypu; rc=flag; [ -r 
> /var/named/named.empty ] || rc=2; [ -f /var/named/named.empty ] || rc=1; [ 
> -d /var/named/named.empty ] && rc=3; python -V 2>/dev/null || rc=4; [ 
> x"$rc" != "xflag" ] && echo "${rc} "/var/named/named.empty && exit 0; 
> (python -c '"'"'"'"'"'"'"'"'import hashlib; BLOCKSIZE = 65536; hasher = 
> hashlib.sha1(); afile = 
> open("'"'"'"'"'"'"'"'"'/var/named/named.empty'"'"'"'"'"'"'"'"'", "rb") buf 
> = afile.read(BLOCKSIZE) while len(buf) > 0: hasher.update(buf) buf = 
> afile.read(BLOCKSIZE) afile.close() 
> print(hasher.hexdigest())'"'"'"'"'"'"'"'"' 2>/dev/null) || (python -c 
> '"'"'"'"'"'"'"'"'import sha; BLOCKSIZE = 65536; hasher = sha.sha(); afile = 
> open("'"'"'"'"'"'"'"'"'/var/named/named.empty'"'"'"'"'"'"'"'"'", "rb") buf 
> = afile.read(BLOCKSIZE) while len(buf) > 0: hasher.update(buf) buf = 
> afile.read(BLOCKSIZE) afile.close() 
> print(hasher.hexdigest())'"'"'"'"'"'"'"'"' 2>/dev/null) || (echo 
> '"'"'"'"'"'"'"'"'0 '"'"'"'"'"'"'"'"'/var/named/named.empty)'"'"''
> <192.168.16.195> EXEC ssh -C -tt -v -o ControlMaster=auto -o 
> ControlPersist=60s -o 
> ControlPath="/home/martin/.ansible/cp/ansible-ssh-%h-%p-%r" -o 
> KbdInteractiveAuthentication=no -o 
> PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey 
> -o PasswordAuthentication=no -o ConnectTimeout=10 192.168.16.195 /bin/sh -c 
> 'sudo -k && sudo -H -S -p "[sudo via ansible, 
> key=bnbotucjqsepetntcsddztjuluwdvzam] password: " -u root /bin/sh -c 
> '"'"'echo BECOME-SUCCESS-bnbotucjqsepetntcsddztjuluwdvzam; rc=flag; [ -r 
> /var/named/named.localhost ] || rc=2; [ -f /var/named/named.localhost ] || 
> rc=1; [ -d /var/named/named.localhost ] && rc=3; python -V 2>/dev/null || 
> rc=4; [ 

[ansible-project] inventory_file is undefined

2015-07-24 Thread Edgardo Vega
I am currently running on head of the development tree and am getting the 
following error:

"msg": "ERROR! the field 'args' has an invalid value, which appears to 
include a variable that is undefined. The error was: 'inventory_file' is 
undefined"


inventory_directory is working just fine. Did something change or is this a 
bug?


Cheers,

Edgardo

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/803de281-0e6a-4d2a-a4f7-788ce0ee6da0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] ansible pip module and --upgrade

2015-07-24 Thread Quentin Nerden
I created this issue to track this: for Ansible 1.9.2 
https://github.com/ansible/ansible-modules-core/issues/1792

On Thursday, July 23, 2015 at 8:08:45 PM UTC+2, Quentin Nerden wrote:
>
> I am running into this issue also
> On max OSX with
> ansible 1.9.2
> docker-py
>
> I have upgraded both with:
> pip install docker-py --upgrade
> brew install ansible --upgrade
>
> The playbook has:
> - hosts: testgroup
> #  remote_user: ubuntu
>
>   tasks:
>   - name: start container
> docker:
> name: redacted
> image: redacted/container_redacted
> state: started
>
> And I get:
> TASK: [start redactewd container_redacted] 
> ***
> failed: [server22] => {"failed": true, "parsed": false}
> BECOME-SUCCESS-gfuvfqhggbuflektwrxxarzyhxlmfuba
> Traceback (most recent call last):
>   File 
> "/home/user/.ansible/tmp/ansible-tmp-1437672252.13-215965289016980/docker", 
> line 3132, in 
> main()
>   File 
> "/home/user/.ansible/tmp/ansible-tmp-1437672252.13-215965289016980/docker", 
> line 1436, in main
> docker_api_version = dict(required=False, 
> default=DEFAULT_DOCKER_API_VERSION, type='str'),
> NameError: global name 'DEFAULT_DOCKER_API_VERSION' is not defined
> OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011
> debug1: Reading configuration data /Users/nerdenq/.ssh/config
> debug1: /Users/user/.ssh/config line 3: Applying options for *
> debug1: Reading configuration data /etc/ssh_config
> debug1: /etc/ssh_config line 20: Applying options for *
> debug1: auto-mux: Trying existing master
> debug1: mux_client_request_session: master session id: 2
> Shared connection to server22 closed.
>
>
> FATAL: all hosts have already failed -- aborting
>
> Isn't it normally fixed?
> https://github.com/ansible/ansible-modules-core/issues/683
>
>
> On Wednesday, February 18, 2015 at 3:13:35 PM UTC+1, Matt Martz wrote:
>>
>> I believe what you wanted to do with the pip module is actually provide 
>> state=latest. Omitting state just means state=present which satisfies pip 
>> if any current version is installed.
>>
>> latest invokes pip with -U which is an alias for --upgrade
>>
>> On Tuesday, February 17, 2015, Jilles van Gurp  
>> wrote:
>>
>>> I just ran into an obscure issue where I actually had a version of 
>>> docker-py installed on a target system but not the latest version. Long 
>>> version below but the tldr; is that I eventually solved it with a manual 
>>> pip install --upgrade.
>>>
>>> I was looking at the pip module documentation and there's nothing about 
>>> --upgrade there. I guess I could pass it in via extra_args="--upgrade" but 
>>> this sounds like it deserves a bit more prominent mention. Also it sounds 
>>> like it might actually be a useful default even if the user specifies no 
>>> version (latest is implied) and the installed version is outdated. Either 
>>> that or it should fail because it can't get the latest version installed 
>>> unless you specify --upgrade.
>>>
>>> Long version:
>>>
>>> So, I was getting the error that 
>>>
>>> Traceback (most recent call last):
>>>   File 
>>> "/home/linko/.ansible/tmp/ansible-tmp-1424196296.48-135783178760818/docker",
>>>  
>>> line 2422, in 
>>> main()
>>>   File 
>>> "/home/linko/.ansible/tmp/ansible-tmp-1424196296.48-135783178760818/docker",
>>>  
>>> line 729, in main
>>> docker_api_version = 
>>> dict(default=docker.client.DEFAULT_DOCKER_API_VERSION),
>>> NameError: global name 'docker' is not defined
>>>
>>> When trying to run my ansible playbook that first installs docker and 
>>> then boots up a docker image. Basically it looked like I didn't have 
>>> docker-py installed; except I had.
>>>
>>> Actually I was installing it via a docker role: 
>>>
>>> ---
>>> - name: Install Python Pip
>>>   yum: name=python-pip state=latest
>>>
>>> - name: ensure docker is installed
>>>   yum: name=docker state=latest
>>>
>>> - name: Install Docker-py
>>>   pip: name=docker-py
>>>
>>> - name: Start docker daemon
>>>   service: name=docker state=started enabled=yes sleep=1
>>>
>>>
>>> The problem as it turned out to be, was that pip was basically 
>>> 'succeeding' with the following message:
>>>
>>> ok: [testing.inbot.io] => {"changed": false, "cmd": "/bin/pip install 
>>> docker-py", "name": "docker-py", "requirements": null, "state": "present", 
>>> "stderr": "", "stdout": "Requirement already satisfied (use --upgrade to 
>>> upgrade): docker-py in /usr/lib/python2.7/site-packages\nRequirement 
>>> already satisfied (use --upgrade to upgrade): requests>=2.2.1,<2.5.0 in 
>>> /usr/lib/python2.7/site-packages (from docker-py)\nRequirement already 
>>> satisfied (use --upgrade to upgrade): six>=1.3.0 in 
>>> /usr/lib/python2.7/site-packages (from docker-py)\nRequirement already 
>>> satisfied (use --upgrade to upgrade): websocket-client>=0.11.0 in 
>>> /usr/lib/python2.7/site-packages (from docker-py)\nRequirement already 
>>> satisfied (use --upgrade to upgrade): backports.ssl-match-hostname in 
>>> /usr

Re: [ansible-project] delegate_to does not work for array of hosts passed in to role

2015-07-24 Thread Brian Coca
The connection: local is used when you want a plugin to execute on
master that normally would execute on the target. You normally want to
do this with cloud modules or modules that use some web api. Some
modules always execute on the 'master' as they are meant to just
change the data in the play like, debug, set_fact, add_host, group_by
so these don't need any connection settings.

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


[ansible-project] extra checking

2015-07-24 Thread Michael Leer
Hello,

I recently came across an issue that a user was having where the 
/var/log/ansible.log file was not writable, would it be benefical to check 
the log files permissions (if specified within the config) when starting 
Ansible?

Mike

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/0ff6f3d7-acf6-47bd-a02a-8fc0a420fd20%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Run powershell command as administrator

2015-07-24 Thread easy cure
HI

Did you manage to fix the problem ? 


Cheers
easycure


Le vendredi 19 juin 2015 09:16:23 UTC+2, ale...@pollie.me a écrit :
>
> Both servers are domain members and i am using domain administrator 
> account.
> Following scheme doesn't work neither:
>
> Ansible ---> srv01 ---> srv01   works
>|
>---> srv02  doesn't work
>
> Ansible ---> srv02  ---> srv02  works
> |
> ---> srv01  doesn't work
>
> This issue is quite critical for me as i really need to deploy windows 
> machines the same way i do linux.
>
> On Friday, June 19, 2015 at 2:13:19 AM UTC+2, Trond Hindenes wrote:
>>
>> So just to sum up:
>> Ansible-->srv01: You can list stuff in \\srv01\ but not \\srv02
>>
>> Are you connecting to srv01 from ansible using a domain account or a 
>> local account? If local it's pretty logical that you have this issue: The 
>> user doesn't have any permissions outside srv01, so that's the only thing 
>> you can see.
>>
>> For cross-machine boundaries you need to connect using a domain account. 
>> Or you can write an Ansible module which takes username/password as a 
>> parameter and pass that in (look at the PR for win_package in the 
>> "ansible-modules-extras" repo on githug, it has the functionality to get 
>> files from a unc share using explicitly defined credentials.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/dbfd8a38-c31d-47b6-b39b-3fd0f3029518%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: iterating over data

2015-07-24 Thread Hagai Kariti
Do you mean add conditions for each iteration? No, you cant do that
currently. Shouldnt be hard, butnI dont have a lot of time to do it myself.

On Fri, Jul 24, 2015, 15:03 Hank Beatty  wrote:

>  Hello Hagai,
>
> This got me going. Thank you.
>
> Is there a way to match a given model (given that I set the 'Model' var
> earlier in the playbook)? I need the firmware and that works perfectly but,
> I need to limit the firmware that goes to a certain model of server.
>
> Thanks,
> Hank
>
> Something like:
>
> - debug: var=Model
>
> - debug: msg={{ item.key }}
>   when: item.key == 'idrac'
>   with_recursive:
>- { name: dict, args: firmware, "{{ Model }}" }
>- { name: dict, args: "{{item.value}}" }
>
> Here is the output of the above:
>
> TASK: [idrac-firmware | debug var=Model]
> **
> ok: [] => {
> "var": {
> "Model": "PowerEdge_R730xd"
> }
> }
>
> TASK: [idrac-firmware | debug msg={{ item.key }}]
> *
> skipping: [] => (item={'key': 'bios', 'value': {'url': '
> http://downloads.dell.com/FOLDER02797483M/1/BIOS_CNN4X_WN64_2.5.2.EXE',
> 'search': 'none', 'target_version': '2.5.2', 'minimum_version': 'none',
> 'filename': 'BIOS_CNN4X_WN64_2.5.2.EXE'}})
> skipping: [] => (item={'key': 'os_collector', 'value':
> {'url': '
> http://downloads.dell.com/FOLDER02775623M/1/Diagnostics_Application_5W2KP_WN64_OSC_1.1_X10-00.EXE',
> 'search': 'none', 'target_version': 1.1001, 'minimum_version':
> 'none', 'filename':
> 'Diagnostics_Application_5W2KP_WN64_OSC_1.1_X10-00.EXE'}})
> skipping: [] => (item={'key': 'bios', 'value': {'url': '
> http://downloads.dell.com/FOLDER02868051M/1/BIOS_XR23Y_WN64_1.2.10.EXE',
> 'search': 'none', 'target_version': '1.2.10', 'minimum_version': 'none',
> 'filename': 'BIOS_XR23Y_WN64_1.2.10.EXE'}})
> ok: [] => (item={'key': 'idrac', 'value': {'url': '
> http://downloads.dell.com/FOLDER02881013M/1/iDRAC-with-Lifecycle-Controller_Firmware_FM1PC_WN64_2.10.10.10_A00.EXE',
> 'search': 'none', 'target_version': '2.10.10.10', 'minimum_version':
> 'none', 'filename':
> 'iDRAC-with-Lifecycle-Controller_Firmware_FM1PC_WN64_2.10.10.10_A00.EXE'}})
> => {
> "item": {
> "key": "idrac",
> "value": {
> "filename":
> "iDRAC-with-Lifecycle-Controller_Firmware_FM1PC_WN64_2.10.10.10_A00.EXE",
> "minimum_version": "none",
> "search": "none",
> "target_version": "2.10.10.10",
> "url":
> "http://downloads.dell.com/FOLDER02881013M/1/iDRAC-with-Lifecycle-Controller_Firmware_FM1PC_WN64_2.10.10.10_A00.EXE";
> 
> }
> },
> "msg": "idrac"
> }
> skipping: [] => (item={'key': 'bios', 'value': {'url': '
> http://downloads.dell.com/FOLDER02868051M/1/BIOS_XR23Y_WN64_1.2.10.EXE',
> 'search': 'none', 'target_version': '1.2.10', 'minimum_version': 'none',
> 'filename': 'BIOS_XR23Y_WN64_1.2.10.EXE'}})
> ok: [] => (item={'key': 'idrac', 'value': {'url': '
> http://downloads.dell.com/FOLDER02881013M/1/iDRAC-with-Lifecycle-Controller_Firmware_FM1PC_WN64_2.10.10.10_A00.EXE',
> 'search': 'none', 'target_version': '2.10.10.10', 'minimum_version':
> 'none', 'filename':
> 'iDRAC-with-Lifecycle-Controller_Firmware_FM1PC_WN64_2.10.10.10_A00.EXE'}})
> => {
> "item": {
> "key": "idrac",
> "value": {
> "filename":
> "iDRAC-with-Lifecycle-Controller_Firmware_FM1PC_WN64_2.10.10.10_A00.EXE",
> "minimum_version": "none",
> "search": "none",
> "target_version": "2.10.10.10",
> "url":
> "http://downloads.dell.com/FOLDER02881013M/1/iDRAC-with-Lifecycle-Controller_Firmware_FM1PC_WN64_2.10.10.10_A00.EXE";
> 
> }
> },
> "msg": "idrac"
>
> }
>
>
>
> On 6/27/15 7:56 AM, Hagai Kariti wrote:
>
> You can write a small filter plugin that gives you the items of dicts
> (something that simply returns an `item.values()` or something like that).
> Then you could do:
>
>  vars:
> # Will create a list of inner dict values inside a list of parent
> dict's values
>- firmware_items: "{{ firmware.values() | map('get_dict_values') | list
> }}"
> tasks:
>- debug: var=item.url
>  with_flattened: firmware_items
>
>
> Alternatively, I wrote a lookup plugin that allows you do chain lookups
> and make them iterate on each other. Then you can do this:
>
>  tasks:
>- debug: item.values.url
>  with_recursive:
>- { name: dict, args: firmware }
>- { name: dict, args: "{{item.values}}" }
>
>  Lookup plugin is here:
> https://gist.github.com/hkariti/d07695b4b9c5a68d8c02
>
>
> On Wednesday, June 24, 2015 at 10:37:52 PM UTC+3, Hank Beatty wrote:
>>
>> Hello,
>>
>> Given the data below I would like to create a single task that will
>> p

Re: [ansible-project] Re: iterating over data

2015-07-24 Thread Hank Beatty

Hello Hagai,

This got me going. Thank you.

Is there a way to match a given model (given that I set the 'Model' var 
earlier in the playbook)? I need the firmware and that works perfectly 
but, I need to limit the firmware that goes to a certain model of server.


Thanks,
Hank

Something like:

- debug: var=Model

- debug: msg={{ item.key }}
  when: item.key == 'idrac'
  with_recursive:
   - { name: dict, args: firmware, "{{ Model }}" }
   - { name: dict, args: "{{item.value}}" }

Here is the output of the above:

TASK: [idrac-firmware | debug var=Model] 
**

ok: [] => {
"var": {
"Model": "PowerEdge_R730xd"
}
}

TASK: [idrac-firmware | debug msg={{ item.key }}] 
*
skipping: [] => (item={'key': 'bios', 'value': {'url': 
'http://downloads.dell.com/FOLDER02797483M/1/BIOS_CNN4X_WN64_2.5.2.EXE', 
'search': 'none', 'target_version': '2.5.2', 'minimum_version': 'none', 
'filename': 'BIOS_CNN4X_WN64_2.5.2.EXE'}})
skipping: [] => (item={'key': 'os_collector', 'value': 
{'url': 
'http://downloads.dell.com/FOLDER02775623M/1/Diagnostics_Application_5W2KP_WN64_OSC_1.1_X10-00.EXE', 
'search': 'none', 'target_version': 1.1001, 
'minimum_version': 'none', 'filename': 
'Diagnostics_Application_5W2KP_WN64_OSC_1.1_X10-00.EXE'}})
skipping: [] => (item={'key': 'bios', 'value': {'url': 
'http://downloads.dell.com/FOLDER02868051M/1/BIOS_XR23Y_WN64_1.2.10.EXE', 'search': 
'none', 'target_version': '1.2.10', 'minimum_version': 'none', 
'filename': 'BIOS_XR23Y_WN64_1.2.10.EXE'}})
ok: [] => (item={'key': 'idrac', 'value': {'url': 
'http://downloads.dell.com/FOLDER02881013M/1/iDRAC-with-Lifecycle-Controller_Firmware_FM1PC_WN64_2.10.10.10_A00.EXE', 
'search': 'none', 'target_version': '2.10.10.10', 'minimum_version': 
'none', 'filename': 
'iDRAC-with-Lifecycle-Controller_Firmware_FM1PC_WN64_2.10.10.10_A00.EXE'}}) 
=> {

"item": {
"key": "idrac",
"value": {
"filename": 
"iDRAC-with-Lifecycle-Controller_Firmware_FM1PC_WN64_2.10.10.10_A00.EXE",

"minimum_version": "none",
"search": "none",
"target_version": "2.10.10.10",
"url": 
"http://downloads.dell.com/FOLDER02881013M/1/iDRAC-with-Lifecycle-Controller_Firmware_FM1PC_WN64_2.10.10.10_A00.EXE";

}
},
"msg": "idrac"
}
skipping: [] => (item={'key': 'bios', 'value': {'url': 
'http://downloads.dell.com/FOLDER02868051M/1/BIOS_XR23Y_WN64_1.2.10.EXE', 'search': 
'none', 'target_version': '1.2.10', 'minimum_version': 'none', 
'filename': 'BIOS_XR23Y_WN64_1.2.10.EXE'}})
ok: [] => (item={'key': 'idrac', 'value': {'url': 
'http://downloads.dell.com/FOLDER02881013M/1/iDRAC-with-Lifecycle-Controller_Firmware_FM1PC_WN64_2.10.10.10_A00.EXE', 
'search': 'none', 'target_version': '2.10.10.10', 'minimum_version': 
'none', 'filename': 
'iDRAC-with-Lifecycle-Controller_Firmware_FM1PC_WN64_2.10.10.10_A00.EXE'}}) 
=> {

"item": {
"key": "idrac",
"value": {
"filename": 
"iDRAC-with-Lifecycle-Controller_Firmware_FM1PC_WN64_2.10.10.10_A00.EXE",

"minimum_version": "none",
"search": "none",
"target_version": "2.10.10.10",
"url": 
"http://downloads.dell.com/FOLDER02881013M/1/iDRAC-with-Lifecycle-Controller_Firmware_FM1PC_WN64_2.10.10.10_A00.EXE";

}
},
"msg": "idrac"
}



On 6/27/15 7:56 AM, Hagai Kariti wrote:
You can write a small filter plugin that gives you the items of dicts 
(something that simply returns an `item.values()` or something like 
that). Then you could do:


vars:
# Will create a list of inner dict values inside a list of parent 
dict's values
   - firmware_items: "{{ firmware.values() | map('get_dict_values') | 
list }}"

tasks:
   - debug: var=item.url
 with_flattened: firmware_items


Alternatively, I wrote a lookup plugin that allows you do chain 
lookups and make them iterate on each other. Then you can do this:


tasks:
   - debug: item.values.url
 with_recursive:
   - { name: dict, args: firmware }
   - { name: dict, args: "{{item.values}}" }

Lookup plugin is 
here: https://gist.github.com/hkariti/d07695b4b9c5a68d8c02



On Wednesday, June 24, 2015 at 10:37:52 PM UTC+3, Hank Beatty wrote:

Hello,

Given the data below I would like to create a single task that will
print the url or the filename without having to specify the hardware
(PowerEdge_x) or the firmware (bios, idrac, etc.).

Any ideas would be very much appreciated.

Thanks,
Hank

Something like:

   - name: Print firmfware info
 debug: msg="item0 {{ item.0 }} item1 {{ item.1.url }}"
 with_indexed_items: "{{firmware}}"

OR:

   - name: Print firmfware info
 debug: msg="item0 {{ item.0 }} item1 {{ item.1.url }}"
 with_dict: "{{firmware}}"



---
firmware:
   PowerEdge_730xd:
 bios:
   type: bios
   url:
http://dow

[ansible-project] Re: How to manage authorized_keys?

2015-07-24 Thread Eugene Knoxville
Found solution in Doc:

- user: name={{ item.name }} state=present generate_ssh_key=yes
  with_items: "{{users}}"

- authorized_key: "user={{ item.0.name }} key='{{ lookup('file', item.1) }}'"
  with_subelements:
 - users
 - authorized

And somewhere define:

users:

- name: test1
authorized:
  - "{{ user1_key }}"
  - "{{ user2_key }}"


But, when I decide to remove user2_key, It still persists in authorized_key 
file! It's unacceptable!


-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/340284fc-afb9-4298-ae11-a3a804cee1d2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] How to manage authorized_keys?

2015-07-24 Thread Eugene Knoxville
Hello,

I'm using authorized_keys core module for managing the same name files. So, 
what I need? 

I have a role, and var file with all ssh-keys. For exmpl:

user1_key: SSH PUB KEY HERE
user2_key: SSH PUB KEY HERE

I want to define which users I can put to authorized_keys. For example, I 
use in a playbook:

roles:
 - { role: ssh.role, ssh_user: test1, ssh_user_key: "{{ user1_key }}", 
"{{ user2_key }}" }

But... I need to define a list of values, separated with a "new line". 
Using line above I'm getting authorized_keys file with 2 SSH keys, 
separated with comma. 

In role:

- name: Manage authorized_keys 
  authorized_key: user="{{ ssh_user }}" key="{{ ssh_user_key }}"


Please suggest! 

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/8822031b-52d2-4b93-b540-37edbd4cf07b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.