[ansible-project] Having trouble with running commands as pbrun escalation method

2016-03-10 Thread Akash Mondal
anybody had success with running basic commands using pbrun escalation 
method? For example I tried below command but it is not working for me.

ansible testserv -i /etc/ansible/testserv -a "uptime" -u someuser -k 
--become-method=pbrun --become-user='sa -u root' --ask-become-pass -

Any help is really appreciated.

Thanks
Akash 

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


Re: [ansible-project] Ansible script to spin up the VM in virtual box

2016-03-10 Thread Kevin Bullock
Have you looked into Vagrant ? You can create a 
Vagrantfile that sets up the virtual machine and then invokes Ansible to 
provision it with the playbook you specify. Their docs are pretty good on how 
to do this. 

pacem in terris / мир / शान्ति / ‎‫سَلاَم‬ / 平和
Kevin R. Bullock

> On 10 Mar 2016, at 00:38, Ram  wrote:
> 
> Hi, 
> 
> I am new to Ansible, and i am from Microsoft tech background,  
> 
> i want to spin and setup an VM with redhat linux in the Virtual box, after 
> setup the VM, i need to setup tomcat, so have installed the ansible in mac 
> book, but from there how to setup an VM in oracle virtual box is little bit 
> confused with vagrant. 
> 
> please help the steps/article to setup VM with redhat linux in Virtual box 
> using ansible. 
> 
> Thanks
> Ram   
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to ansible-project+unsubscr...@googlegroups.com.
> To post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/ansible-project/6e04b123-071a-4c4e-8242-ac8b7114cc8b%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/4F17EF22-E351-4133-B40A-C7BABB8EC2E8%40softwareforgood.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: Ansible 2.0 VMWare modules

2016-03-10 Thread jonathan frappier
Thanks for the tips Julian! Hoping to show this off at work without any
hacks. Don't want it to come off as glitchy and unsupportable
On Mar 10, 2016 6:08 PM, "Julian Barnett"  wrote:

> I've been struggling with these SSL CERTIFICATE_VERIFY_ISSUES also. I
> can't get validate_certs: false to work, I've even downloaded the unsigned
> cert, converted it to PEM and added it to /usr/local/etc/openssl/certs
> and run /usr/local/opt/openssl/bin/c_rehash to no avail. Something is
> definitely broken with the validate_certs parameter (at least on my OSX
> machine running python 2.7.11 and ansible (2.0.1.0))
>
> The only way I've found to get this working, which might work for you guys
> is to open up the following file:
>
> ./ansible/modules/core/cloud/vmware/vsphere_guest.py  (or whatever module
> vmware module you're using that connects via SSL).
>
> This file is usually located in your /Library/Python/2.7/site-packages/
> folder (OSX)
> or
> /usr/lib/python2.7/site-packages/ (redhat/centos)
>
> And ADD the following lines below the initial comments:
>
> import requests, ssl
> requests.packages.urllib3.disable_warnings()
> try:
>  _create_unverified_https_context = ssl._create_unverified_context
> except AttributeError:
>  pass
> else:
>  ssl._create_default_https_context = _create_unverified_https_context
>
> Also, make sure you have the requests module installed.
>
> Hope this gets fixed soon, but in the meantime that should work to
> completely disable SSL and make everything super unsecure :)
>
> On Wednesday, March 9, 2016 at 7:34:13 AM UTC-8, Larry Smith wrote:
>>
>> So it appears this is still an issue? Would be awesome to get this fixed
>> in the GA release so we can proceed with testing out the modules w/out
>> hacks. Also not assuming that every environment uses self-signed certs
>> should have been considered initially
>>
>> On Saturday, March 5, 2016 at 5:06:17 PM UTC-5, Jonathan Frappier wrote:
>>>
>>> I'll add that I also tried on Ubuntu 15.04 w Python 2.7.10
>>> On Mar 5, 2016 4:52 PM, "Vinson Xing"  wrote:
>>>
 I installed the ansible from devel branch, I got the same issue even
 set validate_certs to false.
 My test environment:

 Ubuntu: 14.04
 Python: 2.7.6
 vSphere 5.5

 --
 You received this message because you are subscribed to a topic in the
 Google Groups "Ansible Project" group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/ansible-project/mvl7dq9nrwQ/unsubscribe
 .
 To unsubscribe from this group and all its topics, send an email to
 ansible-proje...@googlegroups.com.
 To post to this group, send email to ansible...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/5c292513-f39b-48ed-a3c2-7347251788f7%40googlegroups.com
 
 .
 For more options, visit https://groups.google.com/d/optout.

>>> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Ansible Project" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/ansible-project/mvl7dq9nrwQ/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> ansible-project+unsubscr...@googlegroups.com.
> To post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/664781c6-3717-47e4-b5b3-3b8d384f0324%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: [ansible-project] Re: Ansible 2.0 VMWare modules

2016-03-10 Thread Julian Barnett
I've been struggling with these SSL CERTIFICATE_VERIFY_ISSUES also. I can't 
get validate_certs: false to work, I've even downloaded the unsigned cert, 
converted it to PEM and added it to /usr/local/etc/openssl/certs and run /
usr/local/opt/openssl/bin/c_rehash to no avail. Something is definitely 
broken with the validate_certs parameter (at least on my OSX machine 
running python 2.7.11 and ansible (2.0.1.0))

The only way I've found to get this working, which might work for you guys 
is to open up the following file:

./ansible/modules/core/cloud/vmware/vsphere_guest.py  (or whatever module 
vmware module you're using that connects via SSL).

This file is usually located in your /Library/Python/2.7/site-packages/ 
folder (OSX)
or 
/usr/lib/python2.7/site-packages/ (redhat/centos)

And ADD the following lines below the initial comments:

import requests, ssl
requests.packages.urllib3.disable_warnings()
try:
 _create_unverified_https_context = ssl._create_unverified_context
except AttributeError:
 pass
else:
 ssl._create_default_https_context = _create_unverified_https_context

Also, make sure you have the requests module installed.

Hope this gets fixed soon, but in the meantime that should work to 
completely disable SSL and make everything super unsecure :)

On Wednesday, March 9, 2016 at 7:34:13 AM UTC-8, Larry Smith wrote:
>
> So it appears this is still an issue? Would be awesome to get this fixed 
> in the GA release so we can proceed with testing out the modules w/out 
> hacks. Also not assuming that every environment uses self-signed certs 
> should have been considered initially
>
> On Saturday, March 5, 2016 at 5:06:17 PM UTC-5, Jonathan Frappier wrote:
>>
>> I'll add that I also tried on Ubuntu 15.04 w Python 2.7.10
>> On Mar 5, 2016 4:52 PM, "Vinson Xing"  wrote:
>>
>>> I installed the ansible from devel branch, I got the same issue even set 
>>> validate_certs to false.
>>> My test environment:
>>>
>>> Ubuntu: 14.04
>>> Python: 2.7.6
>>> vSphere 5.5
>>>
>>> -- 
>>> You received this message because you are subscribed to a topic in the 
>>> Google Groups "Ansible Project" group.
>>> To unsubscribe from this topic, visit 
>>> https://groups.google.com/d/topic/ansible-project/mvl7dq9nrwQ/unsubscribe
>>> .
>>> To unsubscribe from this group and all its topics, send an email to 
>>> ansible-proje...@googlegroups.com.
>>> To post to this group, send email to ansible...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/ansible-project/5c292513-f39b-48ed-a3c2-7347251788f7%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/664781c6-3717-47e4-b5b3-3b8d384f0324%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Unable to use "os_keypair" module, while "nova keypair-add" works

2016-03-10 Thread Thiago Martins
Thank you!

That explains why it wasn't working, I was using Python Shade 0.6.

I just filled a bug report on Launchpad to upgrade it to the latest stable 
Shade release.


Upgrade to latest stable version 1.5.1 of Python Shade:
https://bugs.launchpad.net/ubuntu/+source/python-shade/+bug/1555819


Right now, Ubuntu 16.04 have Shade 1.3.0, I'll give it another try, maybe 
it will work!

Also, I'm already using OS_* variables via Ansible "environment" feature, 
that's how it works via "shell module" and I'll stick with it by now (i.e., 
I'm not going to use clouds.yaml file yet).

Thanks again David!
Thiago

On Monday, February 29, 2016 at 2:26:30 PM UTC-3, David Shrewsbury wrote:
>
> Hi!
>
> You first need to upgrade your version of shade. The latest version is 
> 1.4.0.
>
> Second, you should not expect a clouds.yaml to be read from the current
> directory because of the way Ansible works (copying modules to temp 
> directories
> on the target host before running them). Instead, place it either in the
> /etc/openstack directory, or in ~/.config/openstack (of the user running 
> the
> task).
>
> Alternatively, you can just use the normal OS_ environment variables, but 
> you
> should not mix use of env vars with clouds.yaml.
>
> -David
>
>
> On Monday, February 29, 2016 at 11:05:21 AM UTC-5, Thiago Martins wrote:
>>
>> Hey guys!
>>
>>  Ansible is AWESOME!:-D
>>
>>  I'm planning to move away from running "shell:" via Ansible, in favor of 
>> native modules, but, it is not working, as follows...
>>
>>  Can someone explain to me, why this task works:
>>
>> ---
>>
>> - name: ubuntu | uploading SSH Keypair into OpenStack
>>   environment: "{{ demo_openrc_env }}"
>>   shell: nova keypair-add --pub-key "/home/{{ubuntu_user}}/.ssh/id_rsa.pub" 
>> default
>>
>> ---
>>
>>  And why this does NOT work:
>>
>> ---
>>
>> - name: ubuntu | uploading SSH Keypair into OpenStack
>>   environment: "{{ demo_openrc_env }}"
>>   os_keypair:
>>   state: present
>>   name: default
>>   public_key_file: "/home/{{ubuntu_user}}/.ssh/id_rsa.pub"---
>>
>> ---
>> ERROR:
>> -
>> TASK [os_user_key : ubuntu | uploading SSH Keypair into OpenStack] 
>> *
>> An exception occurred during task execution. To see the full traceback, use 
>> -vvv. The error was: AttributeError: 'OpenStackCloud' object has no 
>> attribute 'get_keypair'
>> fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "parsed": 
>> false}
>>
>> ---
>>
>>  What am I missing? Appending "-vvv" doesn't help either...
>>
>>  I also tried to use the "clouds:" entry of "os_keypair" but, also, 
>> doesn't work... It doesn't find "mycloud", even if clouds.yml is there on 
>> same dir of task... So, I'll prefer for now, to use "environment:", if 
>> possible...
>>
>>  Any clues?
>>
>>  Thanks in advance!
>>
>> Best,
>> Thiago
>>
>

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


[ansible-project] Ansible 1.9.5 RC1 is available for testing

2016-03-10 Thread James Cammarata
Hi all, Ansible 1.9.5 RC1 is available for testing.

This release to the 1.9.x series addresses several critical bugs for those
who are unable to update to Ansible 2.0. The fixes included are:

* Compatibility fix with docker 1.8.
* Fix a bug with the crypttab module omitting certain characters from the
name of the device
* Fix bug with uri module not handling all binary files
* Fix bug with ini_file not removing options set to an empty string
* Fix bug with script and raw modules not honoring parameters passed via
yaml dict syntax
* Fix bug with plugin loading finding the wrong modules because the suffix
checking was not ordered
* Fix bug in the literal_eval module code used when we need python-2.4
compat
* Added --ignore-certs, -c option to ansible-galaxy. Allows ansible-galaxy
to work behind a proxy
  when the proxy fails to forward server certificates.
* Fixed bug where tasks marked no_log were showing hidden values in output
if
  ansible's --diff option was used.
* Fix bug with non-english locales in git and apt modules
* Compatibility fix for using state=absent with the pip ansible module and
pip-6.1.0+
* Backported support for ansible_winrm_server_cert_validation flag to
disable cert validation on Python 2.7.9+ (and support for other passthru
args to pywinrm transport).
* Backported various updates to user module (prevent accidental OS X group
membership removals, various checkmode fixes).

How do you get it?
--

You can also test this release candidate by cloning the Ansible Github repo
as follows:

$ git clone https://github.com/ansible/ansible.git
$ cd ansible
$ git checkout v1.9.5-0.1.rc1
$ git submodule update --init

You can then source our testing script:

$ . hacking/env-setup

or you can build your own .tar.gz (output will be
dist/ansible-1.9.5.tar.gz):

$ make sdist

You can then use pip to install the above .tar.gz.

If you discover any errors, please open a Github issue and be sure to
mention you're testing against this release candidate.

Thanks!

James Cammarata

Ansible Lead/Sr. Principal Software Engineer
Ansible by Red Hat
twitter: @thejimic, github: jimi-c

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


[ansible-project] delegate_to:127.0.0.1 not working when hosts different than localhost

2016-03-10 Thread alejandro . gandara
Hi,

I'm facing an issue after upgrading to ansible 2.0.1.0 when waiting for ssh 
to come up. This task should be executed as local but It is using ssh to 
connect to the server and been executed from there instead.

Does anybody know if is there is any change in ansible 2.0.1.0 that might 
explain this situation? This was working before in ansible 2.0.0.2.

If I would replace ec2 hosts for localhost the task will be executed 
locally but eventually will fail because I need access to ec2 group.


*My version:*
ansible 2.0.1.0

*This is the playbook:*
- hosts: ec2
  gather_facts: no
  roles:
- post-provision


*This is the task in the role:*

- name: Wait for SSH to come up  {{ ansible_ssh_host }}
  wait_for: host={{ ansible_ssh_host }} port=999 delay=60  timeout=500 
state=started
  delegate_to: 127.0.0.1
  sudo: false


Output:

PLAY [ec2] *

TASK [post-provision : Wait for SSH to come up  52.30.36.107] **
task path: /main.yml:2
<52.30.36.107> ESTABLISH SSH CONNECTION FOR USER: admin-x
<52.30.36.107> SSH: EXEC ssh -C -q -o ControlMaster=auto -o ControlPersist=60s 
-o StrictHostKeyChecking=no -o Port=999 -o 'IdentityFile="key"' -o 
KbdInteractiveAuthentication=no -o 
PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o 
PasswordAuthentication=no -o User=adminx -o ConnectTimeout=10 -o 
ControlPath=/Users/alejandrog/.ansible/cp/ansible-ssh-%h-%p-%r 52.30.36.107 
'/bin/sh -c '"'"'LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 
/usr/bin/python'"'"''
fatal: [testa-gw-i.domain.com]: UNREACHABLE! => {"changed": false, "msg": "SSH 
Error: data could not be sent to the remote host. Make sure this host can be 
reached over ssh", "unreachable": true}



Thanks for your help and I hope someone can shred some light on this.


Regards,

Alejandro Gandara



-- 
MTT | Hanover Court | Erne Street Lower, Dublin 2, Ireland | T: +353 1 485 
3452 | 

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


Re: [ansible-project] OpenStack Dynamic Inventory Question

2016-03-10 Thread Mike Albert
I updated to shade 1.5.1 and it resolved this issue.

On Wednesday, March 9, 2016 at 4:12:53 PM UTC-5, Mike Albert wrote:
>
> Here's what I'm running locally.
>
> ansible==2.0.1.0
> os-client-config==1.16.0
> shade==1.4.0
>
> On Wednesday, March 9, 2016 at 3:43:42 PM UTC-5, Tim Rupp wrote:
>>
>> I'm also getting this error. Maybe something in shade or os-client-config 
>> changed? Maybe Monty knows?
>>
>> -tim
>> On Mar 9, 2016 12:27 PM, "Mike Albert"  wrote:
>>
>>> Hi,
>>>
>>> I'm trying to configure OpenStack dynamic inventory with Ansible, but I 
>>> keep getting the following error:
>>>
>>> mikealbert@rmbp lab (master) $ ./openstack.py --list
>>> Error fetching server list on envvars:Region1:
>>>
>>> I've defined the variables below in my .bash_profile and I've confirmed 
>>> that "nova list" returns results
>>>
>>> OS_REGION_NAME
>>> OS_PASSWORD
>>> OS_AUTH_URL
>>> OS_USERNAME
>>> OS_TENANT_NAME
>>>
>>> Not sure if it makes a difference but I'm running Ansible 2.0.1.0.
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Ansible Project" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to ansible-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/b811f7e2-ab31-4591-861c-90294cdbc3bf%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/3a3d7f03-8849-498a-97c1-11cad83f9eea%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Create multiple VMware guests with a Playbook?

2016-03-10 Thread Mark Matthews
Hi

Is it at all possible to create multiple VMware VM's using an Ansible 
playbook? Giving each VM a unique name (server1, server2, server3, server4)?

I can see anyway of doing this using the following playbooks, as it keeps 
failing?

---
 - hosts: 127.0.0.1
   connection: local
   user: root
   sudo: false
   gather_facts: false
   serial: 1
   vars:
 vcenter_hostname: UK.server.local
 esxhost: xxx.xxx.xxx.xxx
 datastore: UK1
 network: Web
 vmcluster: UKCLUSTER
 guest_name: server1, server2, server3, server4 
 folder: Utilities
 notes: Created by Ansible

   tasks:
- name: Create VM from template
  vsphere_guest:
vcenter_hostname: "{{ vcenter_hostname }}"
username: "{{ username }}"
password: "{{ password }}"
guest: "{{ guest_name }}"
vm_extra_config:
  notes: "{{ notes }}"
  folder: "{{ folder }}"
from_template: yes
template_src: "{{ vmtemplate }}"
cluster: "{{ vmcluster  }}"
resource_pool: "/Resources"

esxi:
  datacenter: UK
  hostname: "{{ esxhost }}"

Any ideas or suggestions would be really appreciated.

Cheers

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


[ansible-project] Re: how to debug 'ERROR! failed to combine variables, expected dicts but got a 'dict' and a 'AnsibleUnicode''

2016-03-10 Thread 'J Hawkesworth' via Ansible Project
... and to answer my own question...

remember when moving inventory vars, which may be expressed as key=value 
pairs into your host_vars or group_vars, that host_vars and group_vars 
expect proper yaml syntax i.e. key: value

Jon

On Thursday, 10 March 2016 15:44:45 UTC, J Hawkesworth wrote:
>
> Hi,
>
> I've been refactoring an inventory file and moving some things out into 
> group and host vars.
>
> When I try and use debug just to check that the inventory file is ok like 
> this:
>
>
> ansible locahost -i bust_inventory -m debug
>
>  I'm getting
>
> ERROR! failed to combine variables, expected dicts but got a 'dict' and a 
> 'AnsibleUnicode'
>
> I tried running with -v and ANSIBLE_DEBUG=1 but this must be causing a 
> failure pretty early on as the only debug output I get is:
>
>  20111 1457624523.29459: starting run
>
> Does any one have any suggestions on how I can debug whats wrong with my 
> inventory / group / host vars ?
>
> Jon
>
>
>

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


[ansible-project] how to debug 'ERROR! failed to combine variables, expected dicts but got a 'dict' and a 'AnsibleUnicode''

2016-03-10 Thread 'J Hawkesworth' via Ansible Project
Hi,

I've been refactoring an inventory file and moving some things out into 
group and host vars.

When I try and use debug just to check that the inventory file is ok like 
this:


ansible locahost -i bust_inventory -m debug

 I'm getting

ERROR! failed to combine variables, expected dicts but got a 'dict' and a 
'AnsibleUnicode'

I tried running with -v and ANSIBLE_DEBUG=1 but this must be causing a 
failure pretty early on as the only debug output I get is:

 20111 1457624523.29459: starting run

Does any one have any suggestions on how I can debug whats wrong with my 
inventory / group / host vars ?

Jon


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


[ansible-project] Silent pass of missing handler on notify

2016-03-10 Thread Patrick Glomski
With ansible 2.0.1.0, If I call missing handlers / handlers that are not 
defined, they are silently ignored. Is that expected behavior? If so, is 
there any way to check existence and force a failure when a handler I 
declare doesn't exist? I can't think of many situations where I'd like it 
to just keep running and claim success.

- debug: msg="expected behavior to not fail?"
>   changed_when: true
>   notify:
> - nonexistent_handler
>
  

> TASK [debug] 
> ***
> task path: /data/tst.yml:44
> NOTIFIED HANDLER nonexistent_handler
> ok: [testbox] => {
> "msg": "expected behavior to not fail?"
> }
>
> PLAY RECAP 
> *
> testbox : ok=2changed=1unreachable=0
> failed=0   
>

Thanks,
Patrick

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


Re: [ansible-project] Can't Use Standard become_method As Have To Use rootsh. Options?

2016-03-10 Thread Brian Coca
you can try setting the sudo exe to 'sudo rootsh' and add -i as a sudo flag
(though ansible tries to avoid login shells for good reasons).


​Another option would be to set rootsh as the only available shell, then
setting the executable​ setting to rootsh should also work.

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


Re: [ansible-project] Alternative for "command: apt-get autoremove -y"?

2016-03-10 Thread Brian Coca
The apt module has been updated to allow this, it will be available in a
2.1 release

On Thu, Mar 10, 2016 at 6:33 AM, 'Benjamin Loehner' via Ansible Project <
ansible-project@googlegroups.com> wrote:

> Hi,
>
> when you use "command: apt-get autoremove -y" ansible bugs you with
> "[WARNING]: Consider using apt-get module rather than running apt-get".
>
> Is it possible to use something like "apt: package=XYZ state=installed"?
>
> This is the code i want to replace:
>
> - name: Remove unneeded packages.
>   become:  yes
>   command: apt-get autoremove -y
>   register: autoremove_result
>   changed_when: "'0 upgraded' not in autoremove_result.stdout"
>   tags:
> - apt
> - autoremove
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ansible-project+unsubscr...@googlegroups.com.
> To post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/089a6f40-5aab-49fe-9dd1-13fbf32802c9%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/CACVha7dCWNi8LYUK%3DnnS2uzLLxDqEn1DE9i1%2BKwr-EgNHb1HDQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Can't understand Ansible 2.0 paths logic

2016-03-10 Thread Brian Coca
You are conflating 2 different systems for 'relative path resolution':

The first applies to 'remote actions' run from 'cwd' on the target machine,
normally the home dir of the login user. But with local action translates
to the directory from which you invoked Ansible. This is what `file` is
using, it is hard to predict this from the play as I show below.

The second applies only to some plugins that use 'master' as a source (via
action plugins) like template/copy, etc follow a set of paths like this:
( can be files/ vars/ or templates/ depending on plugin)

if inrole:
   role_dir//
   role_dir/tasks/
   role_dir/

play_dir//
play_dir/

In 1.9 this was somewhat broken and it pathed across this tree multiple
times and in 1.9.4 it even included 'cwd', but the above is the way this
was always meant to work as you can execute Ansible from anywhere (i.e
/tmp, /etc/, /dev/) and you cannot construct a playbook predictably that
way.

So I recommend you rewrite the `file` and `fetch` tasks to use role_path or
playbook_dir variables to use a predictable path, otherwise if you execute
from a different directory you will start having issues again.

Relying on cwd makes these all these commands work differently:
ansible-playbook ../path/to/plays/play.yml

ansible-playbook ./play.yml

ansible-playbook plays/play.yml

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


[ansible-project] Re: sudo using local connection

2016-03-10 Thread stephane via Ansible Project
Le jeudi 10 mars 2016 15:21:39 UTC+1, step...@dupille.org a écrit :
>
> Now the questions :
> 1) Why these two plays do not behave the same way ? Is it a bug ?
> 2) Where do this sudo comes from ?
> 3) How can I avoid that sudo ?
>
>  
I have investigated a bit, and found this issue, which seems related :
https://github.com/ansible/ansible/issues/14720

But what I found is that I can use the same workaround, so this is working :
- hosts: ahost
  gather_facts: false
  tasks:
- name: delegate to local
  file: dest=kikoolol state=touch
  delegate_to: local
  vars:
ansible_become: no

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


[ansible-project] Alternative for "command: apt-get autoremove -y"?

2016-03-10 Thread 'Benjamin Loehner' via Ansible Project
Hi,

when you use "command: apt-get autoremove -y" ansible bugs you with 
"[WARNING]: Consider using apt-get module rather than running apt-get".

Is it possible to use something like "apt: package=XYZ state=installed"?

This is the code i want to replace:

- name: Remove unneeded packages.
  become:  yes
  command: apt-get autoremove -y
  register: autoremove_result
  changed_when: "'0 upgraded' not in autoremove_result.stdout"
  tags:
- apt
- autoremove

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/089a6f40-5aab-49fe-9dd1-13fbf32802c9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Is there a way to user autoremove with "apt:" instead of "command: apt-get autoremove -y"?

2016-03-10 Thread 'Benjamin Loehner' via Ansible Project
Hi,

i already changed all my playbooks from "command: apt-get install..." to 
"apt: package=XYZ state=installed...". Can i do the same with autoremove so 
it stops bugging me with "[WARNING]: Consider using apt-get module rather 
than running apt-get"?

Example:

- name: Remove unneeded packages.
  become:  yes
  command: apt-get autoremove -y
  register: autoremove_result
  changed_when: "'0 upgraded' not in autoremove_result.stdout"
  tags:
- apt
- autoremove

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


[ansible-project] sudo using local connection

2016-03-10 Thread stephane via Ansible Project
Hello,

I've a problem using local connections and delegates.

Let's take that inventory :
[local]
local ansible_connection=local
[remote]
ahost ansible_host=ahost.example.com

Now, if I execute this playbook :
---
- hosts: local
  gather_facts: false
  tasks:
- name: purely local
  file: dest=kikakikoo state=touch
- hosts: ahost
  gather_facts: false
  tasks:
- name: delegate to local
  file: dest=kikoolol state=touch
  delegate_to: local

$ ansible-playbook -i inventory test.yml -vvv
No config file found; using defaults
2 plays in test.yml

PLAY 
***

TASK [purely local] 

task path: /Users/dust/ansible-encrypt/test.yml:5
ESTABLISH LOCAL CONNECTION FOR USER: dust
local EXEC /bin/sh -c '( umask 22 && mkdir -p "` echo 
$HOME/.ansible/tmp/ansible-tmp-1457605205.13-12915262102059 `" && echo "` 
echo $HOME/.ansible/tmp/ansible-tmp-1457605205.13-12915262102059 `" )'
local PUT /var/folders/9g/4_76mx817zv_dr0s_wtk8v18gn/T/tmp3voD48 TO 
/Users/dust/.ansible/tmp/ansible-tmp-1457605205.13-12915262102059/file
local EXEC /bin/sh -c 'LANG=fr_FR.UTF-8 LC_ALL=fr_FR.UTF-8 
LC_MESSAGES=fr_FR.UTF-8 /usr/bin/python 
/Users/dust/.ansible/tmp/ansible-tmp-1457605205.13-12915262102059/file; rm 
-rf "/Users/dust/.ansible/tmp/ansible-tmp-1457605205.13-12915262102059/" > 
/dev/null 2>&1'
changed: [local] => {"changed": true, "dest": "foobar", "gid": 20, "group": 
"staff", "invocation": {"module_args": {"backup": null, "content": null, 
"delimiter": null, "dest": "foobar", "diff_peek": null, "directory_mode": 
null, "follow": false, "force": false, "group": null, "mode": null, 
"original_basename": null, "owner": null, "path": "foobar", "recurse": 
false, "regexp": null, "remote_src": null, "selevel": null, "serole": null, 
"setype": null, "seuser": null, "src": null, "state": "touch", "validate": 
null}, "module_name": "file"}, "mode": "0644", "owner": "dust", "size": 0, 
"state": "file", "uid": 501}


First play is working fine, a file is touched in the current directory, 
created as the user who launched ansible-playbook. OK, everything works as 
expected.

Now, the second play :
PLAY 
***

TASK [delegate to local] 
***
task path: /Users/dust/ansible-encrypt/test.yml:11
ESTABLISH LOCAL CONNECTION FOR USER: dust
local EXEC /bin/sh -c '( umask 22 && mkdir -p "` echo 
$HOME/.ansible/tmp/ansible-tmp-1457605205.33-20084718120867 `" && echo "` 
echo $HOME/.ansible/tmp/ansible-tmp-1457605205.33-20084718120867 `" )'
local PUT /var/folders/9g/4_76mx817zv_dr0s_wtk8v18gn/T/tmpZKCPnB TO 
/Users/dust/.ansible/tmp/ansible-tmp-1457605205.33-20084718120867/file
local EXEC /bin/sh -c 'sudo -H -S -n -u root /bin/sh -c '"'"'echo 
BECOME-SUCCESS-awfsqcsliubjnjwozhtjcopnnjwmzxno; /bin/sh -c 
'"'"'"'"'"'"'"'"'LANG=fr_FR.UTF-8 LC_ALL=fr_FR.UTF-8 
LC_MESSAGES=fr_FR.UTF-8 /usr/bin/python 
/Users/dust/.ansible/tmp/ansible-tmp-1457605205.33-20084718120867/file; rm 
-rf "/Users/dust/.ansible/tmp/ansible-tmp-1457605205.33-20084718120867/" > 
/dev/null 2>&1'"'"'"'"'"'"'"'"''"'"''
fatal: [ahost -> local]: FAILED! => {"changed": false, "failed": true, 
"invocation": {"module_name": "file"}, "module_stderr": "sudo: a password 
is required\n", "module_stdout": "", "msg": "MODULE FAILURE", "parsed": 
false}


It fails because it wants to sudo root.

Now the questions :
1) Why these two plays do not behave the same way ? Is it a bug ?
2) Where do this sudo comes from ?
3) How can I avoid that sudo ?

And, by the way :
$ ansible --version
ansible 2.0.1.0
  config file =
  configured module search path = Default w/o overrides


Many 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/1e044612-703a-419e-87fd-938ef553a09c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Ansible script to spin up the VM in virtual box

2016-03-10 Thread Ram
Hi, 

I am new to Ansible, and i am from Microsoft tech background,  

i want to spin and setup an VM with redhat linux in the Virtual box, after 
setup the VM, i need to setup tomcat, so have installed the ansible in mac 
book, but from there how to setup an VM in oracle virtual box is little bit 
confused with vagrant. 

please help the steps/article to setup VM with redhat linux in Virtual box 
using ansible. 

Thanks
Ram   

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


Re: [ansible-project] Sorry, user xxxxx is not allowed to execute '/bin/sh -c echo BECOME-SUCCESS

2016-03-10 Thread Mark Janssen
Ansible needs to be able to run 'ALL'  commands...

so:

 ALL=(ALL) ALL

As it doesn't run su or anything directly, but runs python which exec's
stuff later.

Mark

On Thu, Mar 10, 2016 at 1:11 AM, Juan Roman  wrote:

> Sorry is this has been posted and answered by I find nothing while
> searching. I'm attempting to connect to my AIX server but can't sudo.
>
> Here's my sudo setup.
>
> x  ALL=(ALL) /usr/bin/su -,/usr/bin/su -
>
>
>
>
> GATHERING FACTS
> ***
>  ESTABLISH CONNECTION FOR USER: userXX
>  REMOTE_MODULE setup CHECKMODE=True
>  EXEC ssh -C -tt -vvv -o ControlMaster=auto -o
> ControlPersist=60s -o
> ControlPath="/home/userXX/.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 aixserver.com /bin/sh
> -c 'mkdir -p /tmp/ansible-tmp-1457568234.68-267839190034318 && chmod a+rx
> /tmp/ansible-tmp-1457568234.68-267839190034318 && echo
> /tmp/ansible-tmp-1457568234.68-267839190034318'
>  PUT /tmp/tmpMNXTOm TO
> /tmp/ansible-tmp-1457568234.68-267839190034318/setup
>  EXEC ssh -C -tt -vvv -o ControlMaster=auto -o
> ControlPersist=60s -o
> ControlPath="/home/userXX/.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 aixserver.com /bin/sh
> -c 'sudo -k && sudo -H -S -p "[sudo via ansible,
> key=stujpsrxsgjiigrjvzefkwkrkuvaxyhs] password: " -u root /bin/sh -c
> '"'"'echo BECOME-SUCCESS-stujpsrxsgjiigrjvzefkwkrkuvaxyhs; LANG=C
> LC_CTYPE=C /usr/bin/python
> /tmp/ansible-tmp-1457568234.68-267839190034318/setup; rm -rf
> /tmp/ansible-tmp-1457568234.68-267839190034318/ >/dev/null 2>&1'"'"''
> failed: [aixserver.com] => {"failed": true, "parsed": false}
>
> Sorry, user userXX is not allowed to execute '/bin/sh -c echo
> BECOME-SUCCESS-stujpsrxsgjiigrjvzefkwkrkuvaxyhs; LANG=C LC_CTYPE=C
> /usr/bin/python /tmp/ansible-tmp-1457568234.68-267839190034318/setup; rm
> -rf /tmp/ansible-tmp-1457568234.68-267839190034318/ >/dev/null 2>&1' as
> root on ti1wps2.
> debug1: mux_client_request_session: master session id: 2
> debug3: mux_client_read_packet: read header failed: Broken pipe
> debug2: Received exit status from master 1
> Shared connection to aixserver.com closed.
>
>
> TASK: [iib-bin | Change Directory to $IIB_ROOT_INSTALL]
> ***
> FATAL: no hosts matched or all hosts have already failed -- aborting
>
>
> PLAY RECAP
> 
>to retry, use: --limit @/home/userXX/site.retry
>
> aixserver.com  : ok=0changed=0unreachable=0failed=1
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ansible-project+unsubscr...@googlegroups.com.
> To post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/cac9d97c-3cd5-41b4-acfc-68fe75a072ca%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Mark Janssen  --  maniac(at)maniac.nl
Unix / Linux Open-Source and Internet Consultant
Maniac.nl Sig-IO.nl Vps.Stoned-IT.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/CAKs9msjRrwR5hezAVyugup%2BCx7w3D6pqBO36QidpywAdBXMGjQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Use STS Assumed-Role to query EC2 inventory - Does this work?

2016-03-10 Thread Arbab Nazar
Hi, did you manage to make it work? if so please share your experience. 
Thanks

On Tuesday, March 17, 2015 at 11:54:17 PM UTC+5, slikk66 wrote:
>
> Hi guys, don’t kill me.  new-ish, to Ansible.  I've already searched and 
> tried the #irc room, no luck so far.
>
> Trying to run Asgard playbook from 
> https://github.com/Answers4AWS/netflixoss-ansible.  I’ve already gotten 
> ICE working on my own account, but on this one trying to set it up on a 
> cross-account IAM role (my user creating the EC2 on another account over 
> the CLI after assuming a role that gives me the permission to do so!)
>
> I’ve assumed the role from the aws CLI, but running the ec2 inventory 
> script (/etc/ansible/hosts) still shows my account's ec2 servers, not the 
> assumed role.  
>
> Is what I'm trying to do supported?  I want to run the playbook on 
> “tag_Name_Asgard” but on a box on the assumed role.
>
> This is the closet topic I've found: 
> https://github.com/ansible/ansible/issues/9647
>
> - but seems to be talking about the role on an EC2 machine if you're 
> running the inventory from that, so not the same I don't think.
>
> It does mention needing boto 2.5.0 > , I do see that I'm at 2.36.0, but it 
> won't let me upgrade further with pip (python 2.7.5 + centos7)
>
> 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/39f2b470-66f9-416f-9eba-fc57150e1832%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Ansible equivalent for puppet's fqdn_rand()

2016-03-10 Thread Paul Tötterman
Hi,

I'd like for cron entries to be run at different minutes based on e.g. 
hostname (would be nice to be easy to pick the seed). In puppet I would use 
fqdn_rand(). The best I could find for ansible 
is 
https://stackoverflow.com/questions/33379378/idempotence-and-random-variables-in-ansible
 
. Wouldn't it make sense for this to be available as a jinja filter?

Cheers,
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/56803dba-1af0-432c-acf5-17cb17f7f433%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Use custom "ssh" command ?

2016-03-10 Thread Rahul Patil
Hi Florent,

I don't have tried this but you can try, ssh command has been defined in 
`site-packages/ansible/runner/connection_plugins/ssh.py`


ssh_cmd += ["ssh", "-C"]


If autossh accept the same argument as ssh then it will work. 

Best Regards,
Rahul Patil



On Thursday, 10 March 2016 17:04:25 UTC+5:30, Florent B wrote:
>
> Hi, 
>
> I would like my Ansible to use "autossh" command instead of "ssh" to 
> connect to hosts in inventory. 
>
> Is there a way to do this ? 
>
> Thank you. 
>

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


[ansible-project] Ansible ec2 module reboot options

2016-03-10 Thread Rahul Patil
 Hi Team,

When reboot option will be added in ec2 module. 

Best Regards,
Rahul Patil

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


[ansible-project] Re: The term '/bin/sh' is not recognized as the name of a cmdlet - PowerShell

2016-03-10 Thread 'J Hawkesworth' via Ansible Project
Can you share your ansible.cfg differences between a clean ansible.cfg?

Looks like the result of some sudo/become settings are getting added to 
your setup module invocation on the windows box and confusing things.

Jon

On Wednesday, 9 March 2016 14:30:18 UTC, Peter Daniel wrote:
>
> I'm testing managing a windows box from an Ubuntu trusty.
>
> This WORKS!
> ansible windows -i inventory/vagrant.ini -m win_ping -vvv
>
> This WORKS too!
> windows -i inventory/vagrant.ini -m setup -vvv
>
> But when i run the actual play, it fails :(  help please!
>
> ansible-playbook site.yaml -i inventory/vagrant.ini --limit windows --diff 
> -vvv
> Using 
> /home/aomoware/Documents/git_repos/monitoring_environment/ansible.cfg as 
> config file
> 1 plays in site.yaml
>
> PLAY 
> ***
>
> TASK [setup] 
> ***
> <10.12.64.80> ESTABLISH WINRM CONNECTION FOR USER: Administrator on PORT 
> 5986 TO 10.12.64.80
> <10.12.64.80> EXEC Set-StrictMode -Version Latest
> (New-Item -Type Directory -Path $env:temp -Name 
> "ansible-tmp-1457523740.58-78594312158152").FullName | Write-Host 
> -Separator '';
> <10.12.64.80> PUT "/tmp/tmpkiGGuO" TO 
> "C:\Users\Administrator\AppData\Local\Temp\ansible-tmp-1457523740.58-78594312158152\setup.ps1"
> <10.12.64.80> EXEC /bin/sh -c 'sudo -H -S -n -u root /bin/sh -c '"'"'echo 
> BECOME-SUCCESS-nilzukhxwbbvvigfqtfxxfkueclxexhc; PowerShell -NoProfile 
> -NonInteractive -ExecutionPolicy Unrestricted -EncodedCommand 
> UwBlAHQALQBTAHQAcgBpAGMAdABNAG8AZABlACAALQBWAGUAcgBzAGkAbwBuACAATABhAHQAZQBzAHQACgBUAHIAeQAKAHsACgAmACAAIgBDADoAXABVAHMAZQByAHMAXABBAGQAbQBpAG4AaQBzAHQAcgBhAHQAbwByAFwAQQBwAHAARABhAHQAYQBcAEwAbwBjAGEAbABcAFQAZQBtAHAAXABhAG4AcwBpAGIAbABlAC0AdABtAHAALQAxADQANQA3ADUAMgAzADcANAAwAC4ANQA4AC0ANwA4ADUAOQA0ADMAMQAyADEANQA4ADEANQAyAFwAcwBlAHQAdQBwAC4AcABzADEAIgAKAH0ACgBDAGEAdABjAGgACgB7AAoAJABfAG8AYgBqACAAPQAgAEAAewAgAGYAYQBpAGwAZQBkACAAPQAgACQAdAByAHUAZQAgAH0ACgBJAGYAIAAoACQAXwAuAEUAeABjAGUAcAB0AGkAbwBuAC4ARwBlAHQAVAB5AHAAZQApAAoAewAKACQAXwBvAGIAagAuAEEAZABkACgAJwBtAHMAZwAnACwAIAAkAF8ALgBFAHgAYwBlAHAAdABpAG8AbgAuAE0AZQBzAHMAYQBnAGUAKQAKAH0ACgBFAGwAcwBlAAoAewAKACQAXwBvAGIAagAuAEEAZABkACgAJwBtAHMAZwAnACwAIAAkAF8ALgBUAG8AUwB0AHIAaQBuAGcAKAApACkACgB9AAoASQBmACAAKAAkAF8ALgBJAG4AdgBvAGMAYQB0AGkAbwBuAEkAbgBmAG8ALgBQAG8AcwBpAHQAaQBvAG4ATQBlAHMAcwBhAGcAZQApAAoAewAKACQAXwBvAGIAagAuAEEAZABkACgAJwBlAHgAYwBlAHAAdABpAG8AbgAnACwAIAAkAF8ALgBJAG4AdgBvAGMAYQB0AGkAbwBuAEkAbgBmAG8ALgBQAG8AcwBpAHQAaQBvAG4ATQBlAHMAcwBhAGcAZQApAAoAfQAKAEUAbABzAGUASQBmACAAKAAkAF8ALgBTAGMAcgBpAHAAdABTAHQAYQBjAGsAVAByAGEAYwBlACkACgB7AAoAJABfAG8AYgBqAC4AQQBkAGQAKAAnAGUAeABjAGUAcAB0AGkAbwBuACcALAAgACQAXwAuAFMAYwByAGkAcAB0AFMAdABhAGMAawBUAHIAYQBjAGUAKQAKAH0ACgBUAHIAeQAKAHsACgAkAF8AbwBiAGoALgBBAGQAZAAoACcAZQByAHIAbwByAF8AcgBlAGMAbwByAGQAJwAsACAAKAAkAF8AIAB8ACAAQwBvAG4AdgBlAHIAdABUAG8ALQBKAHMAbwBuACAAfAAgAEMAbwBuAHYAZQByAHQARgByAG8AbQAtAEoAcwBvAG4AKQApAAoAfQAKAEMAYQB0AGMAaAAKAHsACgB9AAoARQBjAGgAbwAgACQAXwBvAGIAagAgAHwAIABDAG8AbgB2AGUAcgB0AFQAbwAtAEoAcwBvAG4AIAAtAEMAbwBtAHAAcgBlAHMAcwAgAC0ARABlAHAAdABoACAAOQA5AAoARQB4AGkAdAAgADEACgB9AAoARgBpAG4AYQBsAGwAeQAgAHsAIABSAGUAbQBvAHYAZQAtAEkAdABlAG0AIAAiAEMAOgBcAFUAcwBlAHIAcwBcAEEAZABtAGkAbgBpAHMAdAByAGEAdABvAHIAXABBAHAAcABEAGEAdABhAFwATABvAGMAYQBsAFwAVABlAG0AcABcAGEAbgBzAGkAYgBsAGUALQB0AG0AcAAtADEANAA1ADcANQAyADMANwA0ADAALgA1ADgALQA3ADgANQA5ADQAMwAxADIAMQA1ADgAMQA1ADIAIgAgAC0ARgBvAHIAYwBlACAALQBSAGUAYwB1AHIAcwBlACAALQBFAHIAcgBvAHIAQQBjAHQAaQBvAG4AIABTAGkAbABlAG4AdABsAHkAQwBvAG4AdABpAG4AdQBlACAAfQA='"'"''
> fatal: [netmon-2]: FAILED! => {"changed": false, "failed": true, 
> "invocation": {"module_name": "setup"}, "module_stderr": "#< 
> CLIXML\r\n http://schemas.microsoft.com/powershell/2004/04\";>/bin/sh 
> : The term '/bin/sh' is not recognized as the name of a cmdlet, 
> _x000D__x000A_function, script file, or operable 
> program. Check the spelling of the name, or _x000D__x000A_ S=\"Error\">if a path was included, verify that the path is correct and try 
> again._x000D__x000A_At line:1 char:1_x000D__x000A_ S=\"Error\">+ /bin/sh -c 'sudo -H -S -n -u root /bin/sh -c '\"'\"'echo 
> _x000D__x000A_BECOME-SUCCESS-nilzukhxwb 
> ..._x000D__x000A_+ ~~~_x000D__x000A_ S=\"Error\">+ CategoryInfo  : ObjectNotFound: (/bin/sh:String) 
> [], CommandNotF _x000D__x000A_   
> oundException_x000D__x000A_+ FullyQualifiedErrorId : 
> CommandNotFoundException_x000D__x000A_ 
> _x000D__x000A_", "module_stdout": "", "msg": "MODULE FAILURE", 
> "parsed": false}
>
> NO MORE HOSTS LEFT 
> *
> to retry, use: --limit @site.retry
>
> PLAY RECAP 
> *
> netmon-2   : ok=0changed=0unreachable=0
> failed=1 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsub

[ansible-project] Can't Use Standard become_method As Have To Use rootsh. Options?

2016-03-10 Thread Colin Anderson
Hi,

The central IT function at my company allows developers root access to a 
server for a short period of time to allow us to install any required 
middelware and application software when we are commissioning a server. 
I've been looking at using Ansible to automate this process to prevent user 
errors and make the process more efficient. The problem that I've run into 
is that they only allow root access using the following sudo call:

sudo rootsh -i -u root

This uses a logging shell wrapper, rootsh (man page 
), to log all terminal input and output 
for audit purposes. We can't change this and it means we can't use any of 
the standard become_methods that Ansible uses.

Is there any way of adding a become_method to Ansible that would call the 
above command instead of just sudo? Alternatively, is there anyway of 
getting Ansible to run rootsh when it requests elevated privileges?

I did try the following in the vain hope that it might work, but as I 
feared, it failed:

site.yml:
---
  - hosts: vagrant-servers
become: yes
become_user: root
become_method: sudo rootsh -i -u root

roles:
  - ansible-oracle-java-master


Play output:
vagrant@ansible-master:~$ ansible-playbook -i hosts site.yml

PLAY 
***

TASK [setup] 
***
fatal: [10.10.1.4]: FAILED! => {"failed": true, "msg": "ERROR! Privilege 
escalation method not found: sudo rootsh -i -u root"}
fatal: [10.10.1.5]: FAILED! => {"failed": true, "msg": "ERROR! Privilege 
escalation method not found: sudo rootsh -i -u root"}
fatal: [10.10.1.6]: FAILED! => {"failed": true, "msg": "ERROR! Privilege 
escalation method not found: sudo rootsh -i -u root"}
fatal: [10.10.1.3]: FAILED! => {"failed": true, "msg": "ERROR! Privilege 
escalation method not found: sudo rootsh -i -u root"}

NO MORE HOSTS LEFT 
*

PLAY RECAP 
*
10.10.1.3  : ok=0changed=0unreachable=0failed=1
10.10.1.4  : ok=0changed=0unreachable=0failed=1
10.10.1.5  : ok=0changed=0unreachable=0failed=1
10.10.1.6  : ok=0changed=0unreachable=0failed=1

vagrant@ansible-master:~$

Thanks,
Colin.

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