[ansible-project] Re: Ansible 2.1.2 RC5 is ready for testing

2016-09-27 Thread Joaquin Menchaca
Is docker core module now working in this release?  It would be nice to 
have docker functionality.

* https://github.com/ansible/ansible-modules-core/issues/4047
* https://github.com/ansible/ansible-modules-core/pull/4048/commits



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


[ansible-project] Question: with_sequence and registered variables not having anticipated outcome

2016-09-27 Thread Chris Stobie


I have a playbook that creates an ec2 instance and from that creation I 
want to register the output as a var. From there I would use the registered 
var to create and attach an ebs volume. However I'm running into the 
following error.


 - name: Create EC2 instance for zone A
   ec2:
key_name: "{{ keypair }}"
group: "{{ security_groups }}"
image: "{{ ami }}"
instance_type: "{{ instance_type }}"
wait: true
region: "{{ ec2_region }}"
vpc_subnet_id: "{{ subneta }}"
assign_public_ip: "{{ public_choice }}"
zone: "{{ zonea }}"
count: 1
instance_tags:
  Name: "db{{ item }}a.{{ env }}"
  envtype: "{{ envtype }}"
   register: ec2
   with_sequence: "start=1 end={{ num }}"


 - debug:
msg: "{{ ec2 }}"
 - debug:
msg: "{{ ec2.instance_ids }}"


With this I get the following output


dumbledore@ansible1a:/etc/ansible/roles/db_ec2/tasks > ansible-playbook 
db_ec2.yml -e 'env=qa num=1 ebs=true'
 __< PLAY >
 --
\   ^__^
 \  (oo)\___
(__)\   )\/\
||w |
|| ||

 __< TASK [db_ec2 : fail] >
 --
\   ^__^
 \  (oo)\___
(__)\   )\/\
||w |
|| ||

 ___< TASK [db_ec2 : debug] >
 ---
\   ^__^
 \  (oo)\___
(__)\   )\/\
||w |
|| ||

ok: [localhost] => {
"msg": "If you need to change any default variables for this playbook edit 
vars/qa.yml and vars/ebs.yml for ebs configs"}
 _< TASK [db_ec2 : include] >
 -
\   ^__^
 \  (oo)\___
(__)\   )\/\
||w |
|| ||

included: /etc/ansible/roles/db_ec2/tasks/./db_create.yml for localhost
 < TASK [db_ec2 : Create EC2 
instance for zone A] >
 
\   ^__^
 \  (oo)\___
(__)\   )\/\
||w |
|| ||

changed: [localhost] => (item=1)
 ___< TASK [db_ec2 : debug] >
 ---
\   ^__^
 \  (oo)\___
(__)\   )\/\
||w |
|| ||

ok: [localhost] => {
"msg": {
"changed": true,
"msg": "All items completed",
"results": [
{
"_ansible_no_log": false,
"changed": true,
"instance_ids": [
"i-1046c108"
],
"instances": [
{
"ami_launch_index": "0",
"architecture": "x86_64",
"block_device_mapping": {
"/dev/sda1": {
"delete_on_termination": true,
"status": "attached",
"volume_id": "vol-55812edd"
}
},
"dns_name": "",
"ebs_optimized": false,
"groups": {
"sg-749f3c0d": "qa-ssh",
"sg-8f983bf6": "qa-db"
},
"hypervisor": "xen",
"id": "i-1046c108",
"image_id": "ami-55e31a35",
"instance_type": "m4.xlarge",
"kernel": null,
"key_name": "ccpkey",
"launch_time": "2016-09-28T00:28:00.000Z",
"placement": "us-west-2a",
"private_dns_name": 
"ip-10-50-36-201.us-west-2.compute.internal",
"private_ip": "10.50.36.201",
"public_dns_name": "",
"public_ip": null,
"ramdisk": null,
"region": "us-west-2",
"root_device_name": "/dev/sda1",
"root_device_type": "ebs",
"state": "running",
"state_code": 16,
"tags": {
"Name": "db1a.qa",
"envtype": "qa-db"
},
"tenancy": "default",
"virtualization_type": "hvm"
}
],
"invocation": {
"module_args": {
"assign_public_ip": false,
"aws_access_key": null,
"aws_secret_key": null,
"count": 1,
"count_tag": null,

[ansible-project] Question: with_sequence and registered vars when creating ec2 instance

2016-09-27 Thread Christopher Stobie


I have a playbook that creates an ec2 instance and from that creation I 
want to register the output as a var. From there I would use the registered 
var to create and attach an ebs volume. However I'm running into the 
following error.

 - name: Create EC2 instance for zone A
   ec2:
key_name: "{{ keypair }}"
group: "{{ security_groups }}"
image: "{{ ami }}"
instance_type: "{{ instance_type }}"
wait: true
region: "{{ ec2_region }}"
vpc_subnet_id: "{{ subneta }}"
assign_public_ip: "{{ public_choice }}"
zone: "{{ zonea }}"
count: 1
instance_tags:
  Name: "db{{ item }}a.{{ env }}"
  envtype: "{{ envtype }}"
   register: ec2
   with_sequence: "start=1 end={{ num }}"


 - debug:
msg: "{{ ec2 }}"
 - debug:
msg: "{{ ec2.instance_ids }}"

With this I get the following output

dumbledore@ansible1a:/etc/ansible/roles/db_ec2/tasks > ansible-playbook 
db_ec2.yml -e 'env=qa num=1 ebs=true'
 __< PLAY >
 --
\   ^__^
 \  (oo)\___
(__)\   )\/\
||w |
|| ||

 __< TASK [db_ec2 : fail] >
 --
\   ^__^
 \  (oo)\___
(__)\   )\/\
||w |
|| ||

 ___< TASK [db_ec2 : debug] >
 ---
\   ^__^
 \  (oo)\___
(__)\   )\/\
||w |
|| ||

ok: [localhost] => {
"msg": "If you need to change any default variables for this playbook edit 
vars/qa.yml and vars/ebs.yml for ebs configs"}
 _< TASK [db_ec2 : include] >
 -
\   ^__^
 \  (oo)\___
(__)\   )\/\
||w |
|| ||

included: /etc/ansible/roles/db_ec2/tasks/./db_create.yml for localhost
 < TASK [db_ec2 : Create EC2 
instance for zone A] >
 
\   ^__^
 \  (oo)\___
(__)\   )\/\
||w |
|| ||

changed: [localhost] => (item=1)
 ___< TASK [db_ec2 : debug] >
 ---
\   ^__^
 \  (oo)\___
(__)\   )\/\
||w |
|| ||

ok: [localhost] => {
"msg": {
"changed": true,
"msg": "All items completed",
"results": [
{
"_ansible_no_log": false,
"changed": true,
"instance_ids": [
"i-1046c108"
],
"instances": [
{
"ami_launch_index": "0",
"architecture": "x86_64",
"block_device_mapping": {
"/dev/sda1": {
"delete_on_termination": true,
"status": "attached",
"volume_id": "vol-55812edd"
}
},
"dns_name": "",
"ebs_optimized": false,
"groups": {
"sg-749f3c0d": "qa-ssh",
"sg-8f983bf6": "qa-db"
},
"hypervisor": "xen",
"id": "i-1046c108",
"image_id": "ami-55e31a35",
"instance_type": "m4.xlarge",
"kernel": null,
"key_name": "ccpkey",
"launch_time": "2016-09-28T00:28:00.000Z",
"placement": "us-west-2a",
"private_dns_name": 
"ip-10-50-36-201.us-west-2.compute.internal",
"private_ip": "10.50.36.201",
"public_dns_name": "",
"public_ip": null,
"ramdisk": null,
"region": "us-west-2",
"root_device_name": "/dev/sda1",
"root_device_type": "ebs",
"state": "running",
"state_code": 16,
"tags": {
"Name": "db1a.qa",
"envtype": "qa-db"
},
"tenancy": "default",
"virtualization_type": "hvm"
}
],
"invocation": {
"module_args": {
"assign_public_ip": false,
"aws_access_key": null,
"aws_secret_key": null,
"count": 1,
"count_tag": null,

[ansible-project] Beginning Adventures with Docker Module

2016-09-27 Thread Joaquin Menchaca
I created a vagrant environment 
 to rapidly test code, and a 
custom inventory.py.  But alas, *hosts: dockerexp.dev* doesn't work, so 
screw it, *hosts: all*.

Now I have functional environment, time to do some docker stuff, try a 
simple *docker_login:* and find that it doesn't work.  What's this 
docker-py thingy? I have docker-py on my host development system.  From 
Ansible's marketing, I get that Ansible doesn't require any agent, it's 
simple, all that.  So, I am accustom that is a push tech.  Research later, 
find many others confused, find Ansible ticket, and most to their horror or 
chagrin, docker-py needs to be installed on the server.  WHAT?!?!? confused.


   - 
   
http://stackoverflow.com/questions/38181433/ansible-cannot-import-docker-py-even-though-it-is-installed
 
   - https://github.com/ansible/ansible-modules-core/issues/4246

Alright, install pip on Ubuntu.. WTF 26 package dependencies... No way... 
*easy_install 
pip*, *pip install docker-py*.  

Good to go, back to docker fun, *ansible-playbook* ...  

WTF... Minimum version is 1.7.0, which is greater than 1.10.0? or 
something, WTF... google, google, google.   

   - Issue: https://github.com/ansible/ansible-modules-core/issues/4047 
   - PR: https://github.com/ansible/ansible-modules-core/pull/4048/commits

Apparently, there's been a bug there for a while, maybe it only showed up 
at 1.10.0.   Installed 1.7.0, works.  Installed 1.9.0, works.

Finally, now I can do docker... *ansible-playbook* FAIL..  Aah... 
but this time, it's my fault... fixed.

Ultimately, came up with these tasks for anywhere you want to use docker 
module, at least on Ubuntu:

  - name: Install easy_install
apt: name=python-setuptools update_cache=yes
  - name: Install pip
easy_install: name=pip state=latest
  - name: Install docker-py
pip: name=docker-py version=1.9.0

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


[ansible-project] How do I change a vmware VM network after deployment.

2016-09-27 Thread Mike Schlottman
I cloned a vmware VM from a template.   Now I need to change the network to 
a different network port group.  I tried using vsphere_guest to change the 
network, but reconfigure only seems to work for CPU, Memory and CDROM.   Is 
there some other way I should do this?   Being able to set these sorts of 
parameters after cloning a VM is critical to me.  

  tasks:
- vsphere_guest:
vcenter_hostname: "{{ vcenter_hostname }}"
username: "{{ vcenter_user }}"
password: "{{ vcenter_pass }}"
guest: "MYVM"
state: reconfigured
vm_extra_config:
  notes: This is a test VM
vm_nic:
  nic0:
network: QANET
network_type: dvs
esxi:
  datacenter: MYDATACENTER



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


[ansible-project] Ansible Tower skipping valid tasks without even acknowledging they exist.

2016-09-27 Thread Ian Dennison
I am running a playbook that adds a subdirectory on the Ansible Tower host 
(defined as a group of Servers with one entry) for every userid name in a 
variables list. I have integrated the variables and inventories from an 
existing command line playbook into Ansible Tower.

This is the start of playbook
---
- name: SSH Key file location
  hosts: tower_host
  become: yes

  tasks:
  - name: Flag for working indicator
file:
  path: /usr/local/ssh_lib/zaphod
  state: directory
  mode: 0777

  - name: Make sure SSH Library directory exists
file:
  path: /usr/local/ssh_lib/{{ item.name }}
  state: directory
  mode: 0777
with_items: '{{ user_add_ssh }}'
when: usingjumphost is defined and usingjumphost == true

- name: User management SSH - generate ssh keys

This is the results

SSH password: SUDO password[defaults to SSH password]: PLAY [SSH Key file 
location] *** PLAY [User 
management SSH - generate ssh keys] *


So, it skips both the tasks completely. I create a second playbook WITH! 
THE! EXACT! SAME! TEXT! and this is what happens,...


PLAY [SSH Key file location] 
*** TASK [Flag for working 
indicator] ** changed: 
[nextgen-ansible] TASK [Make sure SSH Library directory exists] 
** changed: [nextgen-ansible] => 
(item={u'comment': u'trixie la belle', u'ssh_key_bits': 2048, 
u'update_password': u'on_create', u'group': u'sysadmin', u'uid': 1200, 
u'environments': [u'Prod'], u'ssh_key_file': u'.ssh/id_rsa', u'groups': 
[u'astro', u'burle'], u'generate_ssh_key': True, u'password': 
u'$6$rounds=10$4EFEJzJJbsVutV4P$LellqXZWfsyHCJh8ts/jkd8wySfGk1YDH6ZYphmx1aD4NJXb8KVND/ZEUFsuZzc65KJ9Yw94k5H8TOGldxQ1n0',
 
u'ssh_key_type': u'rsa', u'append': True, u'name': u'trixie1'}) changed: 
[nextgen-ansible] => (item={u'comment': u'baxter morgan', u'ssh_key_bits': 
2048, u'update_password': u'on_create', u'group': u'sysadmin', u'uid': 
1204, u'environments': [u'all'], u'ssh_key_file': u'.ssh/id_rsa', 
u'generate_ssh_key': True, u'password': 
u'$6$rounds=10$4EFEJzJJbsVutV4P$LellqXZWfsyHCJh8ts/jkd8wySfGk1YDH6ZYphmx1aD4NJXb8KVND/ZEUFsuZzc65KJ9Yw94k5H8TOGldxQ1n0',
 
u'ssh_key_type': u'rsa', u'append': True, u'name': u'baxter5'}) 

So, what is different? Inventories are the same, OS file permissions are 
the same, Variables are the same, EVERYTHING ELSE IS THE SAME!. Unless 
Ansible can behave consistently or fail loudly when something is wrongly 
formatted, it's useless to me and my customers as a deployment tool.


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


[ansible-project] ansible hang on setup stage

2016-09-27 Thread William Muriithi
Hello

Sorry for the previous mail, went out accidentally before I had prepared.

ansible 2.1.1.0
centos 6.8 (control machine)
RHEL 6.6 (Managed machine)

I have a role that works fine with all the rest of the systems, but
will hang at setup stage on two systems.  ssh server configuration is
identical to the working systems, selinux is on permissive mode.

What would be other potential causes of such a hang?  And how have you
guys gone about debugging this kind of issues?

Here are the logs when I attempt to play ansible-play against this machine?


TASK [setup] ***
 ESTABLISH SSH CONNECTION FOR USER: root
 SSH: ansible.cfg set ssh_args:
(-o)(ControlMaster=auto)(-o)(ControlPersist=60s)
 SSH: ansible_password/ansible_ssh_pass not
set: 
(-o)(KbdInteractiveAuthentication=no)(-o)(PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey)(-o)(PasswordAuthentication=no)
 SSH:
ANSIBLE_REMOTE_USER/remote_user/ansible_user/user/-u set:
(-o)(User=root)
 SSH: ANSIBLE_TIMEOUT/timeout set:
(-o)(ConnectTimeout=10)
 SSH: PlayContext set ssh_common_args: ()
 SSH: PlayContext set ssh_extra_args: ()
 SSH: found only ControlPersist; added
ControlPath: (-o)(ControlPath=/home/william/.ansible/cp/ansible-ssh-%h-%p-%r)
 SSH: EXEC ssh -C -vvv -o ControlMaster=auto
-o ControlPersist=60s -o KbdInteractiveAuthentication=no -o
PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey
-o PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o
ControlPath=/home/william/.ansible/cp/ansible-ssh-%h-%p-%r
arsenic.eng.example.com '/bin/sh -c '"'"'( umask 77 && mkdir -p "`
echo $HOME/.ansible/tmp/ansible-tmp-1475012538.53-32071443024344 `" &&
echo ansible-tmp-1475012538.53-32071443024344="` echo
$HOME/.ansible/tmp/ansible-tmp-1475012538.53-32071443024344 `" ) &&
sleep 0'"'"''
 PUT /tmp/tmpKnd3x9 TO
/root/.ansible/tmp/ansible-tmp-1475012538.53-32071443024344/setup
 SSH: ansible.cfg set ssh_args:
(-o)(ControlMaster=auto)(-o)(ControlPersist=60s)
 SSH: ansible_password/ansible_ssh_pass not
set: 
(-o)(KbdInteractiveAuthentication=no)(-o)(PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey)(-o)(PasswordAuthentication=no)
 SSH:
ANSIBLE_REMOTE_USER/remote_user/ansible_user/user/-u set:
(-o)(User=root)
 SSH: ANSIBLE_TIMEOUT/timeout set:
(-o)(ConnectTimeout=10)
 SSH: PlayContext set ssh_common_args: ()
 SSH: PlayContext set sftp_extra_args: ()
 SSH: found only ControlPersist; added
ControlPath: (-o)(ControlPath=/home/william/.ansible/cp/ansible-ssh-%h-%p-%r)
 SSH: EXEC sftp -b - -C -vvv -o
ControlMaster=auto -o ControlPersist=60s -o
KbdInteractiveAuthentication=no -o
PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey
-o PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o
ControlPath=/home/william/.ansible/cp/ansible-ssh-%h-%p-%r
'[arsenic.eng.example.com]'
 ESTABLISH SSH CONNECTION FOR USER: root
 SSH: ansible.cfg set ssh_args:
(-o)(ControlMaster=auto)(-o)(ControlPersist=60s)
 SSH: ansible_password/ansible_ssh_pass not
set: 
(-o)(KbdInteractiveAuthentication=no)(-o)(PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey)(-o)(PasswordAuthentication=no)
 SSH:
ANSIBLE_REMOTE_USER/remote_user/ansible_user/user/-u set:
(-o)(User=root)
 SSH: ANSIBLE_TIMEOUT/timeout set:
(-o)(ConnectTimeout=10)
 SSH: PlayContext set ssh_common_args: ()
 SSH: PlayContext set ssh_extra_args: ()
 SSH: found only ControlPersist; added
ControlPath: (-o)(ControlPath=/home/william/.ansible/cp/ansible-ssh-%h-%p-%r)
 SSH: EXEC ssh -C -vvv -o ControlMaster=auto
-o ControlPersist=60s -o KbdInteractiveAuthentication=no -o
PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey
-o PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o
ControlPath=/home/william/.ansible/cp/ansible-ssh-%h-%p-%r -tt
arsenic.eng.example.com '/bin/sh -c '"'"'LANG=en_US.UTF-8
LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python
/root/.ansible/tmp/ansible-tmp-1475012538.53-32071443024344/setup; rm
-rf "/root/.ansible/tmp/ansible-tmp-1475012538.53-32071443024344/" >
/dev/null 2>&1 && sleep 0'"'"''

Regards,
William

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


[ansible-project] ansible hang on setup stage

2016-09-27 Thread William Muriithi
Hello,

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


[ansible-project] Re: os_server fails with "Error in creating instance (Inner Exception: create() takes at least 4 non-keyword arguments (2 given))"

2016-09-27 Thread Richard Eggert
I think I found the problem.

Over time, a line in Shade's openstackcloud.py changed from this (in v1.1 
and v1.2):
server = self.manager.submitTask(_tasks.ServerCreate(
name=name, image=image, flavor=flavor, **kwargs))
to this (in v1.3-v1.11):
server = self.manager.submitTask(_tasks.ServerCreate(
name=name, flavor=flavor, **kwargs))
to this (in v1.12+):
server = self.manager.submit_task(_tasks.ServerCreate(
name=name, **kwargs))
Downgrading to Shade 1.11.1 seems to have fixed the problem. 

I finally managed to create a VM instance. Yay.

~Rich


On Tuesday, September 27, 2016 at 2:54:51 PM UTC-4, Richard Eggert wrote:
>
> After digging through the source code, I believe I've tracked the problem 
> down to the following call in _tasks.py in Shade:
>
> class ServerCreate(task_manager.Task):
> def main(self, client):
> return client.nova_client.servers.create(**self.args)
>
> This appears to be calling the following method from servers.py in 
> novaclient:
>
> def create(self, name, image, flavor, meta=None ... and a bunch more 
> parameters with default values)
>
> I can only assume that self.args is only expanding into two values instead 
> of the expected minimum 4.
>
> I don't know where the value of self.args comes from, however. I'm 
> definitely passing a "name", "flavor", and "image" to the os_server module.
>
>
> Rich
>
>
> On Monday, September 26, 2016 at 6:11:32 PM UTC-4, Richard Eggert wrote:
>>
>> I managed to get the os_server_facts module working, but when I try to 
>> use the os_server module to create a new VM instance, I get the following 
>> error:
>>
>> Error in creating instance (Inner Exception: create() takes at least 4 
>> non-keyword arguments (2 given))
>>
>> No other meaningful diagnostic information is provided (even with "-v -v 
>> -v"), so I have no idea where to look. I couldn't find anything specific to 
>> Ansible when I looked up the error message via Google. I couldn't finding 
>> any direct calls to a method named "create" in os_server.py, either.
>>
>

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


[ansible-project] Re: os_server fails with "Error in creating instance (Inner Exception: create() takes at least 4 non-keyword arguments (2 given))"

2016-09-27 Thread Richard Eggert
After digging through the source code, I believe I've tracked the problem 
down to the following call in _tasks.py in Shade:

class ServerCreate(task_manager.Task):
def main(self, client):
return client.nova_client.servers.create(**self.args)

This appears to be calling the following method from servers.py in 
novaclient:

def create(self, name, image, flavor, meta=None ... and a bunch more 
parameters with default values)

I can only assume that self.args is only expanding into two values instead 
of the expected minimum 4.

I don't know where the value of self.args comes from, however. I'm 
definitely passing a "name", "flavor", and "image" to the os_server module.


Rich


On Monday, September 26, 2016 at 6:11:32 PM UTC-4, Richard Eggert wrote:
>
> I managed to get the os_server_facts module working, but when I try to use 
> the os_server module to create a new VM instance, I get the following error:
>
> Error in creating instance (Inner Exception: create() takes at least 4 
> non-keyword arguments (2 given))
>
> No other meaningful diagnostic information is provided (even with "-v -v 
> -v"), so I have no idea where to look. I couldn't find anything specific to 
> Ansible when I looked up the error message via Google. I couldn't finding 
> any direct calls to a method named "create" in os_server.py, either.
>

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


[ansible-project] Re: Blockinfile indentation

2016-09-27 Thread ZillaYT
This seems to be broken in Ansible 2.1.1.0.

On Thursday, July 28, 2016 at 2:32:40 PM UTC-4, Alli wrote:
>
> You can use a block indentation indicator 
> http://www.yaml.org/spec/1.2/spec.html#id2793979
>
> e.g:
>
> - blockinfile:
> dest: /etc/postfix/master.cf
> insertafter: "^submission inet n   -   n   -   -   
> smtpd$"
> block: |2
> -o syslog_name=postfix/submission
> -o ...
>
> The number specifies how many spaces there are that are meaningful, so 
> there's a total of 8 leading spaces, 6 of which are yaml indentation and 2 
> for the block itself. 
>
> From this excellent answer: http://stackoverflow.com/a/21699210
>
>
> On Friday, 27 May 2016 08:33:15 UTC+12, Joanna Delaporte wrote:
>>
>> I am using blockinfile to write lines to a vars file that includes a few 
>> different layers of indentation. How do I make sure the indentation levels 
>> are maintained correctly using the block | statement?
>>
>> Thanks!
>> Joanna
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/71efd8ce-357f-4a08-8ed8-67eb5c4ecda0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Service Module ERROR : No JSON Could be decoded

2016-09-27 Thread mohan . kaimal
ansible --version
ansible 2.1.1.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = Default w/o overrides


While running the below playbook , i'm getting JSON object error at the 
service stop level . 

---
- hosts: all
  become: yes
  gather_facts: yes

  tasks: 
  
  - name: start conn drain 
command: /etc/init.d/egw drain
ignore_errors: True 

  - uri:
  url: http://{{ ansible_hostname }}:/stats
  return_content: yes  
  register: stats_page
  until: ( "/io/tcp/listening::active = 1"  in stats_page.content ) 
  retries: 60 
  delay: 3 

  - name: Stop the  service 
service: name=egw state=stopped 
ignore_errors: True

===

TASK [Stop the EGW service] **
**
fatal: [xxx.com]: FAILED! => {"changed": false, "failed": true, 
"module_stderr": "", "module_stdout": "\r\nTraceback (most recent call 
last):\r\n  File \"/tmp/ansible_Hg86yp/ansible_module_service.py\", line 
1518, in \r\nmain()\r\n  File 
\"/tmp/ansible_Hg86yp/ansible_module_service.py\", line 1480, in 
main\r\n(rc, out, err) = service.modify_service_state()\r\n  File 
\"/tmp/ansible_Hg86yp/ansible_module_service.py\", line 311, in 
modify_service_state\r\nreturn self.service_control()\r\n  File 
\"/tmp/ansible_Hg86yp/ansible_module_service.py\", line 894, in 
service_control\r\nrc_state, stdout, stderr = self.execute_command(\"%s 
%s %s\" % (svc_cmd, self.action, arguments), daemonize=True)\r\n  File 
\"/tmp/ansible_Hg86yp/ansible_module_service.py\", line 256, in 
execute_command\r\nreturn json.loads(data)\r\n  File 
\"/usr/lib64/python2.6/json/__init__.py\", line 307, in loads\r\nreturn 
_default_decoder.decode(s)\r\n  File 
\"/usr/lib64/python2.6/json/decoder.py\", line 319, in decode\r\nobj, 
end = self.raw_decode(s, idx=_w(s, 0).end())\r\n  File 
\"/usr/lib64/python2.6/json/decoder.py\", line 338, in raw_decode\r\n
raise ValueError(\"No JSON object could be decoded\")\r\nValueError: No 
JSON object could be decoded\r\n", "msg": "MODULE FAILURE", "parsed": false}

Anyone got the same error ? Need help on 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/b92aceb5-fb6b-4378-b19c-e4d855e486b2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Python module import errors on devel, Ubuntu 16.04

2016-09-27 Thread Stephen Granger
I was looking to start work on a new module, start writing tests, after
rebase-ing devel I'm now getting an error when trying to run Ansible from
source on Ubuntu 16.04. This error has only started occurring in the past
week, I've run from devel previously to test other modules on this same
host. I do have a deb install of ansible on this machine also, but haven't
had any problems in the past running a source version of ansible.

stephen@computer:~/workspace/ansible$ git submodule update --init
--recursive
stephen@computer:~/workspace/ansible$ source hacking/env-setup
running egg_info
creating lib/ansible.egg-info
writing requirements to lib/ansible.egg-info/requires.txt
writing lib/ansible.egg-info/PKG-INFO
writing top-level names to lib/ansible.egg-info/top_level.txt
writing dependency_links to lib/ansible.egg-info/dependency_links.txt
writing manifest file 'lib/ansible.egg-info/SOURCES.txt'
reading manifest file 'lib/ansible.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
no previously-included directories found matching 'v2'
no previously-included directories found matching 'docsite'
no previously-included directories found matching 'ticket_stubs'
no previously-included directories found matching 'packaging'
no previously-included directories found matching 'test'
no previously-included directories found matching 'hacking'
no previously-included directories found matching
'lib/ansible/modules/core/.git'
no previously-included directories found matching
'lib/ansible/modules/extras/.git'
writing manifest file 'lib/ansible.egg-info/SOURCES.txt'

Setting up Ansible to run out of checkout...

PATH=/home/stephen/workspace/ansible/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
PYTHONPATH=/home/stephen/workspace/ansible/lib:
MANPATH=/home/stephen/workspace/ansible/docs/man:

Remember, you may wish to specify your host file with -i

Done!

stephen@computer:~/workspace/ansible$ ansible --version
Traceback (most recent call last):
  File "/home/stephen/workspace/ansible/bin/ansible", line 46, in 
from ansible.module_utils._text import to_text
ImportError: No module named _text
stephen@computer:~/workspace/ansible$ which ansible
/home/stephen/workspace/ansible/bin/ansible

stephen@computer:~/workspace/ansible$ echo $PYTHONPATH
/home/stephen/workspace/ansible/lib:

Thanks @agaffney for your help, pity about the freenode ddos.

https://github.com/ansible/ansible/issues/16435 I came across this bug, put
I don't think that's the issue.

line 46 in bin/ansible
from ansible.module_utils._text import to_text

I attempted then to try importing modules from the python interpreter,
stephen@computer:~/workspace/ansible$ python
Python 2.7.12 (default, Jul  1 2016, 15:12:24)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from ansible.utils.display import Display
>>> import itertools
>>> from ansible.module_utils.basic import AnsibleModule
>>> from ansible.module_utils.basic import env_fallback, get_exception
>>> from ansible.module_utils.netcli import Cli, Command
Traceback (most recent call last):
  File "", line 1, in 
ImportError: No module named netcli
>>> from ansible.module_utils.netcfg import Config
Traceback (most recent call last):
  File "", line 1, in 
ImportError: cannot import name Config
>>> from ansible.module_utils.basic import BOOLEANS_TRUE, BOOLEANS_FALSE
>>> from ansible.module_utils.six import string_types, text_type
Traceback (most recent call last):
  File "", line 1, in 
ImportError: No module named six
>>> from ansible.module_utils.six.moves import zip
Traceback (most recent call last):
  File "", line 1, in 
ImportError: No module named six.moves
>>> import operator
>>> import sys
>>> import six
>>> import ansible.module_utils.six
Traceback (most recent call last):
  File "", line 1, in 
ImportError: No module named six
>>> import ansible.module_utils.ec2
>>>

I'm not a python programmer and may just be looking at this the wrong way.
-- 
Steve

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


[ansible-project] Re: os_server fails with "Error in creating instance (Inner Exception: create() takes at least 4 non-keyword arguments (2 given))"

2016-09-27 Thread Richard Eggert
Is there any way to obtain the stack trace of the original exception, so I 
could at least determine where the mismatch is occurring?

Rich

On Monday, September 26, 2016 at 6:11:32 PM UTC-4, Richard Eggert wrote:
>
> I managed to get the os_server_facts module working, but when I try to use 
> the os_server module to create a new VM instance, I get the following error:
>
> Error in creating instance (Inner Exception: create() takes at least 4 
> non-keyword arguments (2 given))
>
> No other meaningful diagnostic information is provided (even with "-v -v 
> -v"), so I have no idea where to look. I couldn't find anything specific to 
> Ansible when I looked up the error message via Google. I couldn't finding 
> any direct calls to a method named "create" in os_server.py, either.
>

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


[ansible-project] aws ec2_key module permission denied error in ANSIBLE TOWER

2016-09-27 Thread pinky
Hi all,

  Iam new bee to Ansible tower, When iam running this module in 
tower it shows me permission denied.My credentials for aws are correct and 
it autheticates successfully in tower .But When loading this module it 
shows something like this :+1: 

---
- name:  keypair creation
  ec2_key:
 name: "jake"
 region: us-west-2
  register: output


Here i exported my aws credentials 

**My result:**

localhost> ESTABLISH LOCAL CONNECTION FOR USER: awx

fatal: [localhost]: FAILED! => {"changed": false, "failed": true, 
"invocation": {"module_name": "ec2_key"}, "module_stderr": "/bin/sh: 
/usr/bin/sudo: Permission denied\n", "module_stdout": "", "msg": "MODULE 
FAILURE", "parsed": false}

NO MORE HOSTS LEFT 
*

EXPECTED RESULTS:

Need to create keypair ..

I have also tried with become, become_user , become_method.But for all of 
that iam getting a same error.Also its a cloud module of ansible only.Then 
why iam facing this issue,whether iam missing any???

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/303e43fc-6669-4144-bf5b-7d4e0c52554a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: os_server fails with "Error in creating instance (Inner Exception: create() takes at least 4 non-keyword arguments (2 given))"

2016-09-27 Thread Richard Eggert
Unfortunately, I don't have a choice in this case.

On Tuesday, September 27, 2016 at 10:29:42 AM UTC-4, David Shrewsbury wrote:
>
> This is likely from the lower level python-novaclient library. Given all 
> of your issues with
> version dependency hell, you've probably got some mix of libraries that 
> just don't gel
> together.  If it's possible, I'd highly recommend against using any 
> Centos-based system.
>
>
>
> On Monday, September 26, 2016 at 6:11:32 PM UTC-4, Richard Eggert wrote:
>>
>> I managed to get the os_server_facts module working, but when I try to 
>> use the os_server module to create a new VM instance, I get the following 
>> error:
>>
>> Error in creating instance (Inner Exception: create() takes at least 4 
>> non-keyword arguments (2 given))
>>
>> No other meaningful diagnostic information is provided (even with "-v -v 
>> -v"), so I have no idea where to look. I couldn't find anything specific to 
>> Ansible when I looked up the error message via Google. I couldn't finding 
>> any direct calls to a method named "create" in os_server.py, either.
>>
>

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


[ansible-project] I can't execute java program

2016-09-27 Thread 刘松
Hi, 
   May I ask for execute java program with ansible?
   I execute a java program (spring boot project, a jar package for java 
web site)
  ansible ofbiz1 -m shell -a "chdir=/opt/CassEC-OrderSupports nohup java 
-jar  product.jar &", it echo success ,but in fact,it do nothing! the java 
program is not been started!
  I'm very sure that I can execute nohup java -jar  product.jar & in the 
machine directly, I can start the java program.

  and I try use this command , 
ansible ofbiz1 -m shell -a "chdir=/opt/CassEC-OrderSupports nohup 
/usr/java/jdk1.8.0_74/java -jar  product.jar &",
as I prefer the java direction, it work!
 
   Can anybody tell me why? and how can I use java -jar direct with ansible?

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/93a1408f-18ab-43b8-8b29-90328899dea1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Ansible 2.1.2 RC5 is ready for testing

2016-09-27 Thread James Cammarata
Hi all, we're happy to announce that RC5 for 2.1.2 is now available for
testing.

This release candidate fixes a bug introduced in the mount module in RC4.

How do you get it?
--

The tar.gz of the release can be found here:

http://releases.ansible.com/ansible/ansible-2.1.2.0-0.5.rc5.tar.gz
SHA256: 7e3cb826d9a115e540646c2436e2c19625ab057b2950560d93c0db915649282e

You can also test against the git repository as follows:

$ git clone https://github.com/ansible/ansible.git
$ cd ansible
$ git checkout v2.1.2.0-0.5.rc5
$ 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-2.1.2.0.tar.gz):

$ make sdist

If you discover any errors, or if you see any regressions from playbooks
which work on 1.9.x and prior, 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/CAMFyvFjSajrg5JO5Vwe7L_F7%3D%3DVz7a%3DnXbTvU21s2rNLNxThWw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: ansible Error while installation

2016-09-27 Thread Ramesh
Thanks, fixed.

On Mon, Sep 19, 2016 at 2:15 PM, engcheng  wrote:

> Hi Rameshs, do you have a ansible.cfg config file ready in /etc/ansible?
>
> On Saturday, September 17, 2016 at 4:52:49 PM UTC+8, SR wrote:
>>
>> Hi Here,
>>
>> While Im installing the ansible on MacOS X EI Capitan, Im getting below
>> one after installation and doing ansible --version
>>
>> Rameshs-MacBook-Pro:~ Ramesh$ ansible --version
>> ansible 2.1.1.0
>>   config file =
>>   configured module search path = Default w/o overrides
>> Rameshs-MacBook-Pro:~ Ramesh$ which ansible
>> /usr/local/bin/ansible
>>
>> ​
>>
>>
>>
>> I can’t get the config file name here
>>
>> Help me on fixing this.
>>
>>
>> Rameshs-MacBook-Pro:~ Ramesh$ which ansible
>> /usr/local/bin/ansible
>> ​
>>
> --
> 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/8dIzP2xcZwk/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/4f8c510b-56e0-467a-b3f3-6697c2321832%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/CABoYeGHhLsAyhffRm0rWCA7qSibgFoR0Q4A1Q0bvMKoMAhY1oQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Service module error : NO JSON object could be decoded

2016-09-27 Thread mohan . kaimal
ansible --version
ansible 2.1.1.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = Default w/o overrides


While running the below playbook , i'm getting JSON object error at the 
service stop level . 

---
- hosts: all
  become: yes
  gather_facts: yes

  tasks: 
  
  - name: start conn drain 
command: /etc/init.d/egw drain
ignore_errors: True 

  - uri:
  url: http://{{ ansible_hostname }}:/stats
  return_content: yes  
  register: stats_page
  until: ( "/io/tcp/listening::active = 1"  in stats_page.content ) 
  retries: 60 
  delay: 3 

  - name: Stop the EGW service 
service: name=egw state=stopped 
ignore_errors: True

===

TASK [Stop the EGW service] 

fatal: [g2axpilotegw1.sba.expertcity.com]: FAILED! => {"changed": false, 
"failed": true, "module_stderr": "", "module_stdout": "\r\nTraceback (most 
recent call last):\r\n  File 
\"/tmp/ansible_Hg86yp/ansible_module_service.py\", line 1518, in 
\r\nmain()\r\n  File 
\"/tmp/ansible_Hg86yp/ansible_module_service.py\", line 1480, in 
main\r\n(rc, out, err) = service.modify_service_state()\r\n  File 
\"/tmp/ansible_Hg86yp/ansible_module_service.py\", line 311, in 
modify_service_state\r\nreturn self.service_control()\r\n  File 
\"/tmp/ansible_Hg86yp/ansible_module_service.py\", line 894, in 
service_control\r\nrc_state, stdout, stderr = self.execute_command(\"%s 
%s %s\" % (svc_cmd, self.action, arguments), daemonize=True)\r\n  File 
\"/tmp/ansible_Hg86yp/ansible_module_service.py\", line 256, in 
execute_command\r\nreturn json.loads(data)\r\n  File 
\"/usr/lib64/python2.6/json/__init__.py\", line 307, in loads\r\nreturn 
_default_decoder.decode(s)\r\n  File 
\"/usr/lib64/python2.6/json/decoder.py\", line 319, in decode\r\nobj, 
end = self.raw_decode(s, idx=_w(s, 0).end())\r\n  File 
\"/usr/lib64/python2.6/json/decoder.py\", line 338, in raw_decode\r\n
raise ValueError(\"No JSON object could be decoded\")\r\nValueError: No 
JSON object could be decoded\r\n", "msg": "MODULE FAILURE", "parsed": false}


Any pointer's on the same ? 

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/dbd04e6d-5980-4f36-b95e-21a62a77c968%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: [ansible-devel] Re: Ansible 2.1.2 RC4 is ready for testing

2016-09-27 Thread James Cammarata
Good catch Jesse, we're looking into it and we'll cut RC5 asap.

James Cammarata

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

On Tue, Sep 27, 2016 at 1:28 AM, Jesse Pretorius 
wrote:

> On Monday, 26 September 2016 20:57:14 UTC+1, James Cammarata wrote:
>>
>> Hi all, we're happy to announce that RC4 for 2.1.2 is now available for
>> testing.
>>
>
> Unfortunately I get a pretty quick fail:
>
> http://logs.openstack.org/65/351165/25/check/gate-
> openstack-ansible-openstack-ansible-aio-ubuntu-trusty/
> 8758449/console.html#_2016-09-27_05_57_48_061918
>
> When executing:
>
> https://github.com/openstack/openstack-ansible/blob/master/
> tests/roles/bootstrap-host/tasks/prepare_data_disk.yml#L63-L73
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ansible-devel+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

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


[ansible-project] Re: Ansible 2.1.2 RC4 is ready for testing

2016-09-27 Thread tkuratomi


On Monday, September 26, 2016 at 11:28:06 PM UTC-7, Jesse Pretorius wrote:
>
> On Monday, 26 September 2016 20:57:14 UTC+1, James Cammarata wrote:
>>
>> Hi all, we're happy to announce that RC4 for 2.1.2 is now available for 
>> testing.
>>
>
> Unfortunately I get a pretty quick fail:
>
>
> http://logs.openstack.org/65/351165/25/check/gate-openstack-ansible-openstack-ansible-aio-ubuntu-trusty/8758449/console.html#_2016-09-27_05_57_48_061918
>
> When executing:
>
>
> https://github.com/openstack/openstack-ansible/blob/master/tests/roles/bootstrap-host/tasks/prepare_data_disk.yml#L63-L73
>

Just pushed a fix to the stable-2.1 branch.  James is working on rc5 now.

-Toshio

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


[ansible-project] Re: os_server fails with "Error in creating instance (Inner Exception: create() takes at least 4 non-keyword arguments (2 given))"

2016-09-27 Thread David Shrewsbury
This is likely from the lower level python-novaclient library. Given all of 
your issues with
version dependency hell, you've probably got some mix of libraries that 
just don't gel
together.  If it's possible, I'd highly recommend against using any 
Centos-based system.



On Monday, September 26, 2016 at 6:11:32 PM UTC-4, Richard Eggert wrote:
>
> I managed to get the os_server_facts module working, but when I try to use 
> the os_server module to create a new VM instance, I get the following error:
>
> Error in creating instance (Inner Exception: create() takes at least 4 
> non-keyword arguments (2 given))
>
> No other meaningful diagnostic information is provided (even with "-v -v 
> -v"), so I have no idea where to look. I couldn't find anything specific to 
> Ansible when I looked up the error message via Google. I couldn't finding 
> any direct calls to a method named "create" in os_server.py, either.
>

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


Re: [ansible-project] How to access a certain element of a register variable in a loop

2016-09-27 Thread ishan jain
If you know what you are looking for, isn't this the simplest solution - when: 
item.item == 'sally'

On Monday, 26 September 2016 19:07:04 UTC+2, ZillaYT wrote:
>
> This gave me a clue. Loop through a registered variable with with_dict in 
> Ansible 
> ,
>  
> so I did this.
>
> - debug: msg='{{ item }} hashed value is {{ hashed_pws.results | 
> selectattr("item","equalto",item) | map(attribute="stdout") | first }}'
>   with_items:
>   - joe
>   - sally
>   - john
>
>
>
> On Monday, September 26, 2016 at 12:34:33 PM UTC-4, ZillaYT wrote:
>>
>> That will list ALL the item.stdout values, not just Sally's.
>>
>> On Monday, September 26, 2016 at 11:46:10 AM UTC-4, Brian Coca wrote:
>>>
>>> I think this is what you want:
>>>
>>> - debug: msg="Sallys hashed pw is {{item.stdout}}"
>>>   with_items: "{{hashed_pws.results}}"
>>>
>>>
>>> -- 
>>> --
>>> 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/077c23e4-7e53-430a-a89d-fa44a197ab5e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: how to verify all parameters are set and different from space in a csv file ?

2016-09-27 Thread fanvalt
I had before counting for the parameters set:
- name: Si les parametres existent mais non renseignes, on les declare empty
  set_fact:
"{{ item }}" : '[]'
  with_items:
- KARAFHTTPTIMEOUT
- dbType
  when: "{{ item }} is none or {{ item }}|trim == ''"


Le mardi 27 septembre 2016 13:57:23 UTC+2, fanvalt a écrit :
>
> Finally this is still not OK as this bypass solution only works for ampty 
> parameters.
> if parameters are set but not intialized, or set to space, this is not ok
>
>
>
>
>
>
> Le mardi 27 septembre 2016 11:44:40 UTC+2, fanvalt a écrit :
>>
>> Hello,
>>
>> I read a csv file with the lookup command with a loop on the items:
>>
>>tasks:
>>  - set_fact:
>>  "{{ item.name }}": "{{ lookup('csvfile', '{{ item.csvvar }} 
>> file=vars/fvaltat.csv delimiter=; col=1') }}"
>>with_items:
>>  - { name: 'KARAFHTTPTIMEOUT', csvvar: 'TOTO' }
>>  - { name: 'dbType', csvvar: 'DBTYPE' }
>>
>> How to check the variable does exist and is different from space
>> I tried without success a fail ... when :
>> when: item.0 is not defined
>> when: item.name is not defined
>> when: item.name =='[]'
>> I tried to use a register variable but I cannot find the way to test the 
>> register variable content.
>>
>> Thanks for your help
>>
>

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


[ansible-project] Re: how to verify all parameters are set and different from space in a csv file ?

2016-09-27 Thread fanvalt
Finally this is still not OK as this bypass solution only works for ampty 
parameters.
if parameters are set but not intialized, or set to space, this is not ok






Le mardi 27 septembre 2016 11:44:40 UTC+2, fanvalt a écrit :
>
> Hello,
>
> I read a csv file with the lookup command with a loop on the items:
>
>tasks:
>  - set_fact:
>  "{{ item.name }}": "{{ lookup('csvfile', '{{ item.csvvar }} 
> file=vars/fvaltat.csv delimiter=; col=1') }}"
>with_items:
>  - { name: 'KARAFHTTPTIMEOUT', csvvar: 'TOTO' }
>  - { name: 'dbType', csvvar: 'DBTYPE' }
>
> How to check the variable does exist and is different from space
> I tried without success a fail ... when :
> when: item.0 is not defined
> when: item.name is not defined
> when: item.name =='[]'
> I tried to use a register variable but I cannot find the way to test the 
> register variable content.
>
> Thanks for your help
>

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


[ansible-project] Re: how to verify all parameters are set and different from space in a csv file ?

2016-09-27 Thread fanvalt
correcting the when clause: 
when: compte|int != 2

Le mardi 27 septembre 2016 13:08:36 UTC+2, fanvalt a écrit :
>
> I found a "bypass" way to proceed, but any suggestion is welcome:
>  - set_fact:
>  compte: "{{ compte|int +1 }} "
>with_items:
>  - "{{ KARAFHTTPTIMEOUT|default([]) }}"
>  - "{{ dbType }}"
>  - fail:
>  msg: "{{ 2 - compte|int}} parameters are missing"
>when: compte != 2
>
>
> Le mardi 27 septembre 2016 12:44:53 UTC+2, fanvalt a écrit :
>>
>> I understand the |default([]) can be used to run a loop only if the item 
>> is not an empty list, 
>> But I can't find a way to proceed to quit the playbook if one parameter 
>> is missing:
>>
>> vars: booleen: False
>> - set_facts:
>>  booleen: True
>>   with_items:
>>  - "{{ KARAFHTTPTIMEOUT|default([]) }}"
>>  - "{{ dbType|default([]) }}"
>>
>> if all parameters are empty, booleen is False and I can use fail: ... 
>> when booleen = False
>> But if only one parameter is missing, booleen is true.
>>
>> Thanks for helping: my purpose is to verify that all parameters are set 
>> in a csv file and to fail of one is missing.
>>
>>
>> Le mardi 27 septembre 2016 12:10:13 UTC+2, fanvalt a écrit :
>>>
>>> The purpose is that the playbook fails if some parameters are not 
>>> defined in the csv file
>>>
>>> Le mardi 27 septembre 2016 11:44:40 UTC+2, fanvalt a écrit :

 Hello,

 I read a csv file with the lookup command with a loop on the items:

tasks:
  - set_fact:
  "{{ item.name }}": "{{ lookup('csvfile', '{{ item.csvvar }} 
 file=vars/fvaltat.csv delimiter=; col=1') }}"
with_items:
  - { name: 'KARAFHTTPTIMEOUT', csvvar: 'TOTO' }
  - { name: 'dbType', csvvar: 'DBTYPE' }

 How to check the variable does exist and is different from space
 I tried without success a fail ... when :
 when: item.0 is not defined
 when: item.name is not defined
 when: item.name =='[]'
 I tried to use a register variable but I cannot find the way to test 
 the register variable content.

 Thanks for your help

>>>

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


[ansible-project] Re: how to verify all parameters are set and different from space in a csv file ?

2016-09-27 Thread fanvalt
I found a "bypass" way to proceed, but any suggestion is welcome:
 - set_fact:
 compte: "{{ compte|int +1 }} "
   with_items:
 - "{{ KARAFHTTPTIMEOUT|default([]) }}"
 - "{{ dbType }}"
 - fail:
 msg: "{{ 2 - compte|int}} parameters are missing"
   when: compte != 2


Le mardi 27 septembre 2016 12:44:53 UTC+2, fanvalt a écrit :
>
> I understand the |default([]) can be used to run a loop only if the item 
> is not an empty list, 
> But I can't find a way to proceed to quit the playbook if one parameter is 
> missing:
>
> vars: booleen: False
> - set_facts:
>  booleen: True
>   with_items:
>  - "{{ KARAFHTTPTIMEOUT|default([]) }}"
>  - "{{ dbType|default([]) }}"
>
> if all parameters are empty, booleen is False and I can use fail: ... when 
> booleen = False
> But if only one parameter is missing, booleen is true.
>
> Thanks for helping: my purpose is to verify that all parameters are set in 
> a csv file and to fail of one is missing.
>
>
> Le mardi 27 septembre 2016 12:10:13 UTC+2, fanvalt a écrit :
>>
>> The purpose is that the playbook fails if some parameters are not defined 
>> in the csv file
>>
>> Le mardi 27 septembre 2016 11:44:40 UTC+2, fanvalt a écrit :
>>>
>>> Hello,
>>>
>>> I read a csv file with the lookup command with a loop on the items:
>>>
>>>tasks:
>>>  - set_fact:
>>>  "{{ item.name }}": "{{ lookup('csvfile', '{{ item.csvvar }} 
>>> file=vars/fvaltat.csv delimiter=; col=1') }}"
>>>with_items:
>>>  - { name: 'KARAFHTTPTIMEOUT', csvvar: 'TOTO' }
>>>  - { name: 'dbType', csvvar: 'DBTYPE' }
>>>
>>> How to check the variable does exist and is different from space
>>> I tried without success a fail ... when :
>>> when: item.0 is not defined
>>> when: item.name is not defined
>>> when: item.name =='[]'
>>> I tried to use a register variable but I cannot find the way to test the 
>>> register variable content.
>>>
>>> Thanks for your help
>>>
>>

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


[ansible-project] Re: how to verify all parameters are set and different from space in a csv file ?

2016-09-27 Thread fanvalt
I understand the |default([]) can be used to run a loop only if the item is 
not an empty list, 
But I can't find a way to proceed to quit the playbook if one parameter is 
missing:

vars: booleen: False
- set_facts:
 booleen: True
  with_items:
 - "{{ KARAFHTTPTIMEOUT|default([]) }}"
 - "{{ dbType|default([]) }}"

if all parameters are empty, booleen is False and I can use fail: ... when 
booleen = False
But if only one parameter is missing, booleen is true.

Thanks for helping: my purpose is to verify that all parameters are set in 
a csv file and to fail of one is missing.


Le mardi 27 septembre 2016 12:10:13 UTC+2, fanvalt a écrit :
>
> The purpose is that the playbook fails if some parameters are not defined 
> in the csv file
>
> Le mardi 27 septembre 2016 11:44:40 UTC+2, fanvalt a écrit :
>>
>> Hello,
>>
>> I read a csv file with the lookup command with a loop on the items:
>>
>>tasks:
>>  - set_fact:
>>  "{{ item.name }}": "{{ lookup('csvfile', '{{ item.csvvar }} 
>> file=vars/fvaltat.csv delimiter=; col=1') }}"
>>with_items:
>>  - { name: 'KARAFHTTPTIMEOUT', csvvar: 'TOTO' }
>>  - { name: 'dbType', csvvar: 'DBTYPE' }
>>
>> How to check the variable does exist and is different from space
>> I tried without success a fail ... when :
>> when: item.0 is not defined
>> when: item.name is not defined
>> when: item.name =='[]'
>> I tried to use a register variable but I cannot find the way to test the 
>> register variable content.
>>
>> Thanks for your help
>>
>

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


[ansible-project] Re: how to verify all parameters are set and different from space in a csv file ?

2016-09-27 Thread fanvalt
The purpose is that the playbook fails if some parameters are not defined 
in the csv file

Le mardi 27 septembre 2016 11:44:40 UTC+2, fanvalt a écrit :
>
> Hello,
>
> I read a csv file with the lookup command with a loop on the items:
>
>tasks:
>  - set_fact:
>  "{{ item.name }}": "{{ lookup('csvfile', '{{ item.csvvar }} 
> file=vars/fvaltat.csv delimiter=; col=1') }}"
>with_items:
>  - { name: 'KARAFHTTPTIMEOUT', csvvar: 'TOTO' }
>  - { name: 'dbType', csvvar: 'DBTYPE' }
>
> How to check the variable does exist and is different from space
> I tried without success a fail ... when :
> when: item.0 is not defined
> when: item.name is not defined
> when: item.name =='[]'
> I tried to use a register variable but I cannot find the way to test the 
> register variable content.
>
> Thanks for your help
>

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


[ansible-project] how to verify all parameters are set and different from space in a csv file ?

2016-09-27 Thread fanvalt
Hello,

I read a csv file with the lookup command with a loop on the items:

   tasks:
 - set_fact:
 "{{ item.name }}": "{{ lookup('csvfile', '{{ item.csvvar }} 
file=vars/fvaltat.csv delimiter=; col=1') }}"
   with_items:
 - { name: 'KARAFHTTPTIMEOUT', csvvar: 'TOTO' }
 - { name: 'dbType', csvvar: 'DBTYPE' }

How to check the variable does exist and is different from space
I tried without success a fail ... when :
when: item.0 is not defined
when: item.name is not defined
when: item.name =='[]'
I tried to use a register variable but I cannot find the way to test the 
register variable content.

Thanks for your help

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