[ansible-project] Ansible integratión with Jenkins: hudson.AbortException: Ansible playbook execution failed

2018-08-23 Thread Josu Vilda
Hi, 

I have a problem with all playbooks executed from Plugin Ansible in Jenkins.
Jenkins Group, say that this is an ansible runtime issue when running that 
playbook rather than a Jenkins issue.

All jobs, finish with:
PLAY RECAP 
*
localhost  : ok=3changed=0unreachable=0
failed=1   

FATAL: command execution failed
hudson.AbortException: Ansible playbook execution failed
at 
org.jenkinsci.plugins.ansible.AnsiblePlaybookBuilder.perform(AnsiblePlaybookBuilder.java:236)
at 
org.jenkinsci.plugins.ansible.AnsiblePlaybookBuilder.perform(AnsiblePlaybookBuilder.java:207)
at 
hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:81)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at 
hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:735)
at hudson.model.Build$BuildExecution.build(Build.java:206)
at hudson.model.Build$BuildExecution.doRun(Build.java:163)
at 
hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:490)
at hudson.model.Run.execute(Run.java:1735)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:405)
ERROR: Ansible playbook execution failed
Finished: FAILURE

Refer: 
https://groups.google.com/forum/#!searchin/jenkinsci-users/hudson.AbortException$3A$20Ansible$20playbook$20execution$20failed%7Csort:date/jenkinsci-users/tcApylwKUhA/ptnU7F8vBwAJ

Anyone else with this problem?
Any solution?

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


[ansible-project] Re: how to deploy vmware from template with ansible: changing the local user, expanding the disk and identifying when sysprep is completed.

2018-05-23 Thread Josu Vilda

requires GOVC https://github.com/vmware/govmomi/releases

El miércoles, 23 de mayo de 2018, 15:52:40 (UTC+2), Josu Vilda escribió:
>
> After several weeks searching for information and getting it, I give you 
> the playbook.
> Feel free to answer to improve it or show me the faults
>
> After several weeks searching for information and getting it, I give you 
> the playbook.
> Feel free to answer to improve it or show me the faults
>
> ---
> - hosts: "localhost"
>   user: root
>   become: root
>   gather_facts: True
>   tasks:
> - name: DEFINE VARIABLES
>   set_fact:
> MEMORIA_MB: "{{ (MEMORIA | int) * 1024 }}"
>   tags:
> - auto
>
> - name: CHECK FOR REQUIRED VARIABLES
>   fail: msg="Check the parameters passed"
>   when: VCENTER is not defined or 
>  NOMBRE is not defined or 
>  DOMAIN_VCENTER is not definded or 
>  MEMORIA_MB is not definded or 
>  PLANTILLA is not definded or 
>  CLUSTER is not definded or 
> CPU is not definded or
> HDD is not definded or
> REDDATOS is not definded or 
> IPDATOS is not definded or 
> MASKDATOS is not definded or 
> GWDATOS is not definded or 
> REDGESTION is not definded or
> IPGESTION is not definded or 
> MASKGESTION is not definded or 
> GWGESTION is not definded or 
> DATACENTER is not definded   
>
> - name: CREATE A VMWARE FROM TEMPLATE
>   vmware_guest:
> annotation: "This vmware has been deployed by Ansible"
> hostname: '{{ VCENTER }}'
> username: '{{ DOMAIN_VCENTER }}\root'
> password: 'pass'
> validate_certs: no
> datacenter: '{{ DATACENTER }}'
> cluster: '{{ CLUSTER }}'
> name: '{{ NOMBRE }}'
> template: '{{ PLANTILLA }}'
> state: poweredon
> folder: '/{{ DATACENTER }}/vm'
> disk:
> - autoselect_datastore: "True"
>   size_gb: '{{ HDD }}'
>   type: thin
> hardware:
>   memory_mb: '{{ MEMORIA_MB }}'
>   num_cpus: '{{ CPU }}'
>   hotadd_cpu: True
>   hotremove_cpu: True
>   hotadd_memory: True
>   scsi: paravirtual
> networks:
> - name: '{{ REDDATOS }}'
>   ip: '{{ IPDATOS }}'
>   netmask: '{{ MASKDATOS }}'
>   gateway: '{{ GWDATOS }}'
> - name: '{{ REDGESTION }}'
>   ip: '{{ IPGESTION }}'
>   netmask: '{{ MASKGESTION }}'
>   gateway: '{{ GWGESTION }}'
> customization:
>   #ALL
>   domain: '{{ DOMINIO }}.LOCALDOMAIN'
>   hostname: '{{ NOMBRE }}'
>   dns_servers:
>   - 8.8.8.8
>   - 9.9.9.9
>   #WIN
>   orgname: 'EMPRESA'
>   joindomain: '{{ DOMINIO }}.LOCALDOMAIN'
>   domainadmin: 'root'
>   domainadminpassword: "SUPERPASS"
>   password: TEMPORAL
>   autologon: True
>   runonce:
>   - 'C:\Windows\System32\cmd.exe /c "(echo rescan & echo select 
> volume 2 & echo extend ) | diskpart"'
>   - 'c:\windows\system32\wbem\wmic.exe useraccount where 
> name="administrator" rename SUPERUSER'
>   - 'c:\windows\system32\shutdown.exe -r -t 1 -c "deploy"'
>
>   wait_for_ip_address: yes
>   when: not ansible_check_mode
>   async: 1000
>   poll: 0
>   register: deploy
>
> - name: WAIT FOR THE VM {{ NOMBRE }} CREATION TO FINISH
>   async_status: jid={{ deploy.ansible_job_id }}
>   until: deploy_result.finished
>   retries: 60
>   delay: 30
>   delegate_to: localhost
>   register: deploy_result
>
> - name: WAIT CUSTOMIZATION
>   shell: export GOVC_USERNAME='localdomain\root' ; export 
> GOVC_PASSWORD='SUPERPASS'; export GOVC_INSECURE='1'; export GOVC_URL=
> https://VPHERE:443; /usr/local/bin/govc events -type 
> CustomizationSucceeded -l=true /CONPRO/vm/{{ NOMBRE }}
>   register: result
>   until: result.stdout.find("CustomizationSucceeded") != -1
>   retries: 50
>   delay: 10
>   delegate_to: localhost
>
>

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


[ansible-project] how to deploy vmware from template with ansible: changing the local user, expanding the disk and identifying when sysprep is completed.

2018-05-23 Thread Josu Vilda
After several weeks searching for information and getting it, I give you 
the playbook.
Feel free to answer to improve it or show me the faults

After several weeks searching for information and getting it, I give you 
the playbook.
Feel free to answer to improve it or show me the faults

---
- hosts: "localhost"
  user: root
  become: root
  gather_facts: True
  tasks:
- name: DEFINE VARIABLES
  set_fact:
MEMORIA_MB: "{{ (MEMORIA | int) * 1024 }}"
  tags:
- auto

- name: CHECK FOR REQUIRED VARIABLES
  fail: msg="Check the parameters passed"
  when: VCENTER is not defined or 
 NOMBRE is not defined or 
 DOMAIN_VCENTER is not definded or 
 MEMORIA_MB is not definded or 
 PLANTILLA is not definded or 
 CLUSTER is not definded or 
CPU is not definded or
HDD is not definded or
REDDATOS is not definded or 
IPDATOS is not definded or 
MASKDATOS is not definded or 
GWDATOS is not definded or 
REDGESTION is not definded or
IPGESTION is not definded or 
MASKGESTION is not definded or 
GWGESTION is not definded or 
DATACENTER is not definded   

- name: CREATE A VMWARE FROM TEMPLATE
  vmware_guest:
annotation: "This vmware has been deployed by Ansible"
hostname: '{{ VCENTER }}'
username: '{{ DOMAIN_VCENTER }}\root'
password: 'pass'
validate_certs: no
datacenter: '{{ DATACENTER }}'
cluster: '{{ CLUSTER }}'
name: '{{ NOMBRE }}'
template: '{{ PLANTILLA }}'
state: poweredon
folder: '/{{ DATACENTER }}/vm'
disk:
- autoselect_datastore: "True"
  size_gb: '{{ HDD }}'
  type: thin
hardware:
  memory_mb: '{{ MEMORIA_MB }}'
  num_cpus: '{{ CPU }}'
  hotadd_cpu: True
  hotremove_cpu: True
  hotadd_memory: True
  scsi: paravirtual
networks:
- name: '{{ REDDATOS }}'
  ip: '{{ IPDATOS }}'
  netmask: '{{ MASKDATOS }}'
  gateway: '{{ GWDATOS }}'
- name: '{{ REDGESTION }}'
  ip: '{{ IPGESTION }}'
  netmask: '{{ MASKGESTION }}'
  gateway: '{{ GWGESTION }}'
customization:
  #ALL
  domain: '{{ DOMINIO }}.LOCALDOMAIN'
  hostname: '{{ NOMBRE }}'
  dns_servers:
  - 8.8.8.8
  - 9.9.9.9
  #WIN
  orgname: 'EMPRESA'
  joindomain: '{{ DOMINIO }}.LOCALDOMAIN'
  domainadmin: 'root'
  domainadminpassword: "SUPERPASS"
  password: TEMPORAL
  autologon: True
  runonce:
  - 'C:\Windows\System32\cmd.exe /c "(echo rescan & echo select 
volume 2 & echo extend ) | diskpart"'
  - 'c:\windows\system32\wbem\wmic.exe useraccount where 
name="administrator" rename SUPERUSER'
  - 'c:\windows\system32\shutdown.exe -r -t 1 -c "deploy"'

  wait_for_ip_address: yes
  when: not ansible_check_mode
  async: 1000
  poll: 0
  register: deploy

- name: WAIT FOR THE VM {{ NOMBRE }} CREATION TO FINISH
  async_status: jid={{ deploy.ansible_job_id }}
  until: deploy_result.finished
  retries: 60
  delay: 30
  delegate_to: localhost
  register: deploy_result

- name: WAIT CUSTOMIZATION
  shell: export GOVC_USERNAME='localdomain\root' ; export 
GOVC_PASSWORD='SUPERPASS'; export GOVC_INSECURE='1'; export 
GOVC_URL=https://VPHERE:443; /usr/local/bin/govc events -type 
CustomizationSucceeded -l=true /CONPRO/vm/{{ NOMBRE }}
  register: result
  until: result.stdout.find("CustomizationSucceeded") != -1
  retries: 50
  delay: 10
  delegate_to: localhost

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


Re: [ansible-project] Re: Help me please. How can I get the output of the command?

2018-05-16 Thread Josu Vilda
thx.
I will be attentive to solution

*Josu Rodriguez Vilda*

Consultant
Skype:jrvilda

P Before printing think about *environment* and *costs*


2018-05-16 15:56 GMT+02:00 Josh Smift <jsm...@care.com>:

> Yeah, looks like not. :^( Searching at https://github.com/ansible/
> ansible/issues for "vmware_vm_shell", https://github.com/ansible/ansible/
> issues/38320 looks like it might be related?
>
> On Wednesday, May 16, 2018 at 8:51:59 AM UTC-4, Josu Vilda wrote:
>>
>> I've tried that, but it gives me back the same information.
>> <>
>> The problem is that vmware_vm_shell module does not return the output of
>> the command.
>>
>>
>>
>> El martes, 15 de mayo de 2018, 3:40:26 (UTC+2), Josh Smift escribió:
>>>
>>> Why are you setting "verbosity: 3"? According to
>>> http://docs.ansible.com/ansible/latest/modules/debug_module.html, that
>>> means "if you set to 3 it will only run debug when -vvv or above". That's
>>> causing Ansible to skip the task, thus the message you're seeing
>>> ("Verbosity threshold not met").
>>>
>>> Remove that, and you should get some better results.
>>>
>>> On Monday, May 14, 2018 at 7:38:22 AM UTC-4, Josu Vilda wrote:
>>>>
>>>> Hi guys,
>>>> I am launching this playbook but it does not give an error and it does
>>>> not do what it is supposed to do.
>>>> How can I debug the error?
>>>>
>>>> - name: Customize Domain
>>>>   vmware_vm_shell:
>>>> hostname: '{{ VCENTER }}'
>>>> username: '{{ DOMAIN_VCENTER }}\user'
>>>> password: '*'
>>>> datacenter: '{{ DATACENTER }}'
>>>> folder: '/{{ DATACENTER }}/vm'
>>>> validate_certs: no
>>>> vm_id: '{{ NOMBRE }}'
>>>> vm_id_type: vm_name
>>>> vm_username: 'adm'
>>>> vm_password: 'temporal'
>>>> vm_shell_cwd: 'c:\temp\'
>>>> vm_shell: 'c:\windows\system32\wbem\wmic.exe'
>>>> vm_shell_args: 'ComputerSystem where name={{ NOMBRE }} call
>>>> joindomainorworkgroup fjoinoptions=3 name={{ DOMINIO }}.$
>>>>   register: value
>>>>   async: 600
>>>>   poll: 5
>>>>   tags:
>>>> - auto
>>>>
>>>> - name : debug
>>>>   debug:
>>>> var: value
>>>> verbosity: 3
>>>>   tags:
>>>> - auto
>>>>
>>>> Return:
>>>>
>>>>
>>>> TASK [Customize Domain username={{ DOMAIN_VCENTER }}\adm, datacenter={{
>>>> DATACENTER }}, vm_password=temporal, vm_shell_cwd=c:\temp\,
>>>> vm_shell_args=ComputerSystem where name={{ NOMBRE }} call
>>>> joindomainorworkgroup fjoinoptions=3 name={{ DOMINIO }}.domain.local
>>>> username={{ DOMINIO }}.domain\adm Password=***, hostname={{ VCENTER }},
>>>> vm_username=adm, vm_shell=c:\windows\system32\wbem\wmic.exe,
>>>> validate_certs=False, vm_id_type=vm_name, folder=/{{ DATACENTER }}/vm,
>>>> password=***, vm_id={{ NOMBRE }}] ***
>>>> task path: /etc/ansible/playbooks/vCenter/Despliegue.yml:148
>>>> changed: [localhost] => {"ansible_job_id": "503299328214.47633",
>>>> "changed": true, "finished": 1, "msg": 2500, "uuid":
>>>> "423c4b0f-3dd5-b3b3-6adc-23314cc4054c"}
>>>>
>>>> TASK [debug var=value, verbosity=3] **
>>>> ***
>>>> task path: /etc/ansible/playbooks/vCenter/Despliegue.yml:169
>>>> skipping: [localhost] => {"skipped_reason": "Verbosity threshold not
>>>> met."}
>>>> META: ran handlers
>>>> META: ran handlers
>>>>
>>>> --
> 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/hXazxf6WjiQ/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/60820823-7335-447d-9a63-2e1b500f3fa7%40googlegroups.
> com
> <https://groups.google.com/d/msgid/ansible-project/60820823-7335-447d-9a63-2e1b500f3fa7%40googlegroups.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


[ansible-project] Re: Waiting for OS customization to complete

2018-05-16 Thread Josu Vilda
Do you know if there is any way to listen to the vmware events in the esx, 
to wait for xxx event?

The events are displayed on the vSphere Client

<https://lh3.googleusercontent.com/-Pm-XKZBd6U8/WvwvdFxfGXI/AAABUiM/oV-JuaW-vIwcSXSHJAfSx3gawPBMa16LgCLcBGAs/s1600/2018-05-16_151858.png>


El martes, 8 de mayo de 2018, 11:42:18 (UTC+2), Josu Vilda escribió:
>
> A question,
>
> We have templates that have been saved with sysprep.
> As I can with Ansible, after deploying the templates, wait for OS 
> customization of sysprep to be completed.
>
> I have seen the following article for powercli, but for Ansible ??
>
>
> https://blogs.vmware.com/PowerCLI/2012/08/waiting-for-os-customization-to-complete.html
>

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


[ansible-project] Re: Help me please. How can I get the output of the command?

2018-05-16 Thread Josu Vilda
I've tried that, but it gives me back the same information.
<>
The problem is that vmware_vm_shell module does not return the output of 
the command.



El martes, 15 de mayo de 2018, 3:40:26 (UTC+2), Josh Smift escribió:
>
> Why are you setting "verbosity: 3"? According to 
> http://docs.ansible.com/ansible/latest/modules/debug_module.html, that 
> means "if you set to 3 it will only run debug when -vvv or above". That's 
> causing Ansible to skip the task, thus the message you're seeing 
> ("Verbosity threshold not met").
>
> Remove that, and you should get some better results.
>
> On Monday, May 14, 2018 at 7:38:22 AM UTC-4, Josu Vilda wrote:
>>
>> Hi guys,
>> I am launching this playbook but it does not give an error and it does 
>> not do what it is supposed to do.
>> How can I debug the error?
>>
>> - name: Customize Domain
>>   vmware_vm_shell:
>> hostname: '{{ VCENTER }}'
>> username: '{{ DOMAIN_VCENTER }}\user'
>> password: '*'
>> datacenter: '{{ DATACENTER }}'
>> folder: '/{{ DATACENTER }}/vm'
>> validate_certs: no
>> vm_id: '{{ NOMBRE }}'
>> vm_id_type: vm_name
>> vm_username: 'adm'
>> vm_password: 'temporal'
>> vm_shell_cwd: 'c:\temp\'
>> vm_shell: 'c:\windows\system32\wbem\wmic.exe'
>> vm_shell_args: 'ComputerSystem where name={{ NOMBRE }} call 
>> joindomainorworkgroup fjoinoptions=3 name={{ DOMINIO }}.$
>>   register: value
>>   async: 600
>>   poll: 5
>>   tags:
>> - auto
>>
>> - name : debug
>>   debug:
>> var: value
>> verbosity: 3
>>   tags:
>> - auto
>>
>> Return:
>>
>>
>> TASK [Customize Domain username={{ DOMAIN_VCENTER }}\adm, datacenter={{ 
>> DATACENTER }}, vm_password=temporal, vm_shell_cwd=c:\temp\, 
>> vm_shell_args=ComputerSystem where name={{ NOMBRE }} call 
>> joindomainorworkgroup fjoinoptions=3 name={{ DOMINIO }}.domain.local 
>> username={{ DOMINIO }}.domain\adm Password=***, hostname={{ VCENTER }}, 
>> vm_username=adm, vm_shell=c:\windows\system32\wbem\wmic.exe, 
>> validate_certs=False, vm_id_type=vm_name, folder=/{{ DATACENTER }}/vm, 
>> password=***, vm_id={{ NOMBRE }}] ***
>> task path: /etc/ansible/playbooks/vCenter/Despliegue.yml:148
>> changed: [localhost] => {"ansible_job_id": "503299328214.47633", 
>> "changed": true, "finished": 1, "msg": 2500, "uuid": 
>> "423c4b0f-3dd5-b3b3-6adc-23314cc4054c"}
>>
>> TASK [debug var=value, verbosity=3] 
>> *
>> task path: /etc/ansible/playbooks/vCenter/Despliegue.yml:169
>> skipping: [localhost] => {"skipped_reason": "Verbosity threshold not 
>> met."}
>> META: ran handlers
>> META: ran handlers
>>
>>

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


Re: [ansible-project] Help me please. How can I get the output of the command?

2018-05-14 Thread Josu Vilda
TASK [debug var=value, verbosity=3] 
*
task path: /etc/ansible/playbooks/vCenter/Despliegue.yml:169
ok: [localhost] => {
"value": {
"ansible_job_id": "971027648920.50828",
"changed": true,
"failed": false,
"finished": 1,
"msg": 1368,
"uuid": "423c4b0f-3dd5-b3b3-6adc-23314cc4054c"
}
}


El lunes, 14 de mayo de 2018, 14:10:02 (UTC+2), Josu Vilda escribió:
>
> The problem is that I do not know where to see the error that the command 
> gives.
>
>
> El lunes, 14 de mayo de 2018, 13:49:17 (UTC+2), Josu Vilda escribió:
>>
>> This module, should launch the following command which join the vmware in 
>> domain.
>>
>> Launch in host vmware  'c:\windows\system32\wbem\wmic.exe ComputerSystem 
>> where name={{ NOMBRE }} call joindomainorworkgroup fjoinoptions=3 name={{ 
>> DOMINIO }}'
>>
>> *Josu Rodriguez Vilda*
>>
>> Consultant
>> Skype:jrvilda 
>>
>> P Before printing think about *environment* and *costs*
>>
>>
>> 2018-05-14 13:40 GMT+02:00 Karl Auer <ka...@2pisoftware.com>:
>>
>>> It would help if you would describe what it is supposed to do...
>>>
>>> On Mon, May 14, 2018 at 9:38 PM, Josu Vilda <jrvi...@gmail.com> wrote:
>>>
>>>> Hi guys,
>>>> I am launching this playbook but it does not give an error and it does 
>>>> not do what it is supposed to do.
>>>> How can I debug the error?
>>>>
>>>> - name: Customize Domain
>>>>   vmware_vm_shell:
>>>> hostname: '{{ VCENTER }}'
>>>> username: '{{ DOMAIN_VCENTER }}\user'
>>>> password: '*'
>>>> datacenter: '{{ DATACENTER }}'
>>>> folder: '/{{ DATACENTER }}/vm'
>>>> validate_certs: no
>>>> vm_id: '{{ NOMBRE }}'
>>>> vm_id_type: vm_name
>>>> vm_username: 'adm'
>>>> vm_password: 'temporal'
>>>> vm_shell_cwd: 'c:\temp\'
>>>> vm_shell: 'c:\windows\system32\wbem\wmic.exe'
>>>> vm_shell_args: 'ComputerSystem where name={{ NOMBRE }} call 
>>>> joindomainorworkgroup fjoinoptions=3 name={{ DOMINIO }}.$
>>>>   register: value
>>>>   async: 600
>>>>   poll: 5
>>>>   tags:
>>>> - auto
>>>>
>>>> - name : debug
>>>>   debug:
>>>> var: value
>>>> verbosity: 3
>>>>   tags:
>>>> - auto
>>>>
>>>> Return:
>>>>
>>>>
>>>> TASK [Customize Domain username={{ DOMAIN_VCENTER }}\adm, datacenter={{ 
>>>> DATACENTER }}, vm_password=temporal, vm_shell_cwd=c:\temp\, 
>>>> vm_shell_args=ComputerSystem where name={{ NOMBRE }} call 
>>>> joindomainorworkgroup fjoinoptions=3 name={{ DOMINIO }}.domain.local 
>>>> username={{ DOMINIO }}.domain\adm Password=***, hostname={{ VCENTER 
>>>> }}, 
>>>> vm_username=adm, vm_shell=c:\windows\system32\wbem\wmic.exe, 
>>>> validate_certs=False, vm_id_type=vm_name, folder=/{{ DATACENTER }}/vm, 
>>>> password=***, vm_id={{ NOMBRE }}] ***
>>>> task path: /etc/ansible/playbooks/vCenter/Despliegue.yml:148
>>>> changed: [localhost] => {"ansible_job_id": "503299328214.47633", 
>>>> "changed": true, "finished": 1, "msg": 2500, "uuid": 
>>>> "423c4b0f-3dd5-b3b3-6adc-23314cc4054c"}
>>>>
>>>> TASK [debug var=value, verbosity=3] 
>>>> *
>>>> task path: /etc/ansible/playbooks/vCenter/Despliegue.yml:169
>>>> skipping: [localhost] => {"skipped_reason": "Verbosity threshold not 
>>>> met."}
>>>> META: ran handlers
>>>> META: ran handlers
>>>>
>>>> -- 
>>>> You received this message because you are subscribed to the Google 
>>>> Groups "Ansible Project" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>> an email to ansible-project+unsubscr...@googlegroups.com.
>>>> To post to this group, send 

Re: [ansible-project] Help me please. How can I get the output of the command?

2018-05-14 Thread Josu Vilda
The problem is that I do not know where to see the error that the command 
gives.


El lunes, 14 de mayo de 2018, 13:49:17 (UTC+2), Josu Vilda escribió:
>
> This module, should launch the following command which join the vmware in 
> domain.
>
> Launch in host vmware  'c:\windows\system32\wbem\wmic.exe ComputerSystem 
> where name={{ NOMBRE }} call joindomainorworkgroup fjoinoptions=3 name={{ 
> DOMINIO }}'
>
> *Josu Rodriguez Vilda*
>
> Consultant
> Skype:jrvilda 
>
> P Before printing think about *environment* and *costs*
>
>
> 2018-05-14 13:40 GMT+02:00 Karl Auer <ka...@2pisoftware.com>:
>
>> It would help if you would describe what it is supposed to do...
>>
>> On Mon, May 14, 2018 at 9:38 PM, Josu Vilda <jrvi...@gmail.com> wrote:
>>
>>> Hi guys,
>>> I am launching this playbook but it does not give an error and it does 
>>> not do what it is supposed to do.
>>> How can I debug the error?
>>>
>>> - name: Customize Domain
>>>   vmware_vm_shell:
>>> hostname: '{{ VCENTER }}'
>>> username: '{{ DOMAIN_VCENTER }}\user'
>>> password: '*'
>>> datacenter: '{{ DATACENTER }}'
>>> folder: '/{{ DATACENTER }}/vm'
>>> validate_certs: no
>>> vm_id: '{{ NOMBRE }}'
>>> vm_id_type: vm_name
>>> vm_username: 'adm'
>>> vm_password: 'temporal'
>>> vm_shell_cwd: 'c:\temp\'
>>> vm_shell: 'c:\windows\system32\wbem\wmic.exe'
>>> vm_shell_args: 'ComputerSystem where name={{ NOMBRE }} call 
>>> joindomainorworkgroup fjoinoptions=3 name={{ DOMINIO }}.$
>>>   register: value
>>>   async: 600
>>>   poll: 5
>>>   tags:
>>> - auto
>>>
>>> - name : debug
>>>   debug:
>>> var: value
>>> verbosity: 3
>>>   tags:
>>> - auto
>>>
>>> Return:
>>>
>>>
>>> TASK [Customize Domain username={{ DOMAIN_VCENTER }}\adm, datacenter={{ 
>>> DATACENTER }}, vm_password=temporal, vm_shell_cwd=c:\temp\, 
>>> vm_shell_args=ComputerSystem where name={{ NOMBRE }} call 
>>> joindomainorworkgroup fjoinoptions=3 name={{ DOMINIO }}.domain.local 
>>> username={{ DOMINIO }}.domain\adm Password=***, hostname={{ VCENTER }}, 
>>> vm_username=adm, vm_shell=c:\windows\system32\wbem\wmic.exe, 
>>> validate_certs=False, vm_id_type=vm_name, folder=/{{ DATACENTER }}/vm, 
>>> password=***, vm_id={{ NOMBRE }}] ***
>>> task path: /etc/ansible/playbooks/vCenter/Despliegue.yml:148
>>> changed: [localhost] => {"ansible_job_id": "503299328214.47633", 
>>> "changed": true, "finished": 1, "msg": 2500, "uuid": 
>>> "423c4b0f-3dd5-b3b3-6adc-23314cc4054c"}
>>>
>>> TASK [debug var=value, verbosity=3] 
>>> *
>>> task path: /etc/ansible/playbooks/vCenter/Despliegue.yml:169
>>> skipping: [localhost] => {"skipped_reason": "Verbosity threshold not 
>>> met."}
>>> META: ran handlers
>>> META: ran handlers
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Ansible Project" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to ansible-project+unsubscr...@googlegroups.com.
>>> To post to this group, send email to ansible-project@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/ansible-project/7ac713f7-e86d-4977-9c90-d406b4a05aa2%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/ansible-project/7ac713f7-e86d-4977-9c90-d406b4a05aa2%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> -- 
>> Karl Auer
>>
>> Email  : ka...@2pisoftware.com
>> Website: http://2pisoftware.com
>>
>> GPG/PGP : 958A 2647 6C44 D376 3D63 86A5 FFB2 20BC 0257 5816
>> Previous: F0AB 6C70 A49D 1927 6E05 81E7 AD95 268F 2AB6 40EA
>>
>> -- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "Ansible Project" group.
>> To unsubscribe from this

Re: [ansible-project] Help me please. How can I get the output of the command?

2018-05-14 Thread Josu Vilda
This module, should launch the following command which join the vmware in
domain.

Launch in host vmware  'c:\windows\system32\wbem\wmic.exe ComputerSystem
where name={{ NOMBRE }} call joindomainorworkgroup fjoinoptions=3 name={{
DOMINIO }}'

*Josu Rodriguez Vilda*

Consultant
Skype:jrvilda

P Before printing think about *environment* and *costs*


2018-05-14 13:40 GMT+02:00 Karl Auer <ka...@2pisoftware.com>:

> It would help if you would describe what it is supposed to do...
>
> On Mon, May 14, 2018 at 9:38 PM, Josu Vilda <jrvi...@gmail.com> wrote:
>
>> Hi guys,
>> I am launching this playbook but it does not give an error and it does
>> not do what it is supposed to do.
>> How can I debug the error?
>>
>> - name: Customize Domain
>>   vmware_vm_shell:
>> hostname: '{{ VCENTER }}'
>> username: '{{ DOMAIN_VCENTER }}\user'
>> password: '*'
>> datacenter: '{{ DATACENTER }}'
>> folder: '/{{ DATACENTER }}/vm'
>> validate_certs: no
>> vm_id: '{{ NOMBRE }}'
>> vm_id_type: vm_name
>> vm_username: 'adm'
>> vm_password: 'temporal'
>> vm_shell_cwd: 'c:\temp\'
>> vm_shell: 'c:\windows\system32\wbem\wmic.exe'
>> vm_shell_args: 'ComputerSystem where name={{ NOMBRE }} call
>> joindomainorworkgroup fjoinoptions=3 name={{ DOMINIO }}.$
>>   register: value
>>   async: 600
>>   poll: 5
>>   tags:
>> - auto
>>
>> - name : debug
>>   debug:
>> var: value
>> verbosity: 3
>>   tags:
>> - auto
>>
>> Return:
>>
>>
>> TASK [Customize Domain username={{ DOMAIN_VCENTER }}\adm, datacenter={{
>> DATACENTER }}, vm_password=temporal, vm_shell_cwd=c:\temp\,
>> vm_shell_args=ComputerSystem where name={{ NOMBRE }} call
>> joindomainorworkgroup fjoinoptions=3 name={{ DOMINIO }}.domain.local
>> username={{ DOMINIO }}.domain\adm Password=***, hostname={{ VCENTER }},
>> vm_username=adm, vm_shell=c:\windows\system32\wbem\wmic.exe,
>> validate_certs=False, vm_id_type=vm_name, folder=/{{ DATACENTER }}/vm,
>> password=***, vm_id={{ NOMBRE }}] ***
>> task path: /etc/ansible/playbooks/vCenter/Despliegue.yml:148
>> changed: [localhost] => {"ansible_job_id": "503299328214.47633",
>> "changed": true, "finished": 1, "msg": 2500, "uuid":
>> "423c4b0f-3dd5-b3b3-6adc-23314cc4054c"}
>>
>> TASK [debug var=value, verbosity=3] **
>> ***
>> task path: /etc/ansible/playbooks/vCenter/Despliegue.yml:169
>> skipping: [localhost] => {"skipped_reason": "Verbosity threshold not
>> met."}
>> META: ran handlers
>> META: ran handlers
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Ansible Project" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to ansible-project+unsubscr...@googlegroups.com.
>> To post to this group, send email to ansible-project@googlegroups.com.
>> To view this discussion on the web visit https://groups.google.com/d/ms
>> gid/ansible-project/7ac713f7-e86d-4977-9c90-d406b4a05aa2%
>> 40googlegroups.com
>> <https://groups.google.com/d/msgid/ansible-project/7ac713f7-e86d-4977-9c90-d406b4a05aa2%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> Karl Auer
>
> Email  : ka...@2pisoftware.com
> Website: http://2pisoftware.com
>
> GPG/PGP : 958A 2647 6C44 D376 3D63 86A5 FFB2 20BC 0257 5816
> Previous: F0AB 6C70 A49D 1927 6E05 81E7 AD95 268F 2AB6 40EA
>
> --
> 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/hXazxf6WjiQ/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> ansible-project+unsubscr...@googlegroups.com.
> To post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/ansible-project/CA%2B%2BT08RXfm2Kg8OF60HBXAaYkfOxjfK
> n11vHcRt23Gs-OdgafA%40mail.gmail.com
> <https://groups.google.com/d/msgid/ansible-project/CA%2B%2BT08RXfm2Kg8OF60HBXAaYkfOxjfKn11vHcRt23Gs-OdgafA%40mail.gmail.com?utm_medium=email_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

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


[ansible-project] Help me please. How can I get the output of the command?

2018-05-14 Thread Josu Vilda
Hi guys,
I am launching this playbook but it does not give an error and it does not 
do what it is supposed to do.
How can I debug the error?

- name: Customize Domain
  vmware_vm_shell:
hostname: '{{ VCENTER }}'
username: '{{ DOMAIN_VCENTER }}\user'
password: '*'
datacenter: '{{ DATACENTER }}'
folder: '/{{ DATACENTER }}/vm'
validate_certs: no
vm_id: '{{ NOMBRE }}'
vm_id_type: vm_name
vm_username: 'adm'
vm_password: 'temporal'
vm_shell_cwd: 'c:\temp\'
vm_shell: 'c:\windows\system32\wbem\wmic.exe'
vm_shell_args: 'ComputerSystem where name={{ NOMBRE }} call 
joindomainorworkgroup fjoinoptions=3 name={{ DOMINIO }}.$
  register: value
  async: 600
  poll: 5
  tags:
- auto

- name : debug
  debug:
var: value
verbosity: 3
  tags:
- auto

Return:


TASK [Customize Domain username={{ DOMAIN_VCENTER }}\adm, datacenter={{ 
DATACENTER }}, vm_password=temporal, vm_shell_cwd=c:\temp\, 
vm_shell_args=ComputerSystem where name={{ NOMBRE }} call 
joindomainorworkgroup fjoinoptions=3 name={{ DOMINIO }}.domain.local 
username={{ DOMINIO }}.domain\adm Password=***, hostname={{ VCENTER }}, 
vm_username=adm, vm_shell=c:\windows\system32\wbem\wmic.exe, 
validate_certs=False, vm_id_type=vm_name, folder=/{{ DATACENTER }}/vm, 
password=***, vm_id={{ NOMBRE }}] ***
task path: /etc/ansible/playbooks/vCenter/Despliegue.yml:148
changed: [localhost] => {"ansible_job_id": "503299328214.47633", "changed": 
true, "finished": 1, "msg": 2500, "uuid": 
"423c4b0f-3dd5-b3b3-6adc-23314cc4054c"}

TASK [debug var=value, verbosity=3] 
*
task path: /etc/ansible/playbooks/vCenter/Despliegue.yml:169
skipping: [localhost] => {"skipped_reason": "Verbosity threshold not met."}
META: ran handlers
META: ran handlers

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


[ansible-project] Waiting for OS customization to complete

2018-05-08 Thread Josu Vilda
A question,

We have templates that have been saved with sysprep.
As I can with Ansible, after deploying the templates, wait for OS 
customization of sysprep to be completed.

I have seen the following article for powercli, but for Ansible ??

https://blogs.vmware.com/PowerCLI/2012/08/waiting-for-os-customization-to-complete.html

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


Re: [ansible-project] Problem with variables variables

2017-11-21 Thread Josu Vilda
Sincerely thanks.

El martes, 21 de noviembre de 2017, 8:32:58 (UTC+1), Pshem Kowalczyk 
escribió:
>
> Hi,
>
> Try this:
>
> {{ vm_list.virtual_machines[vmname].uuid }}
>
> kind regards
> Pshem
>
>
> On Tue, 21 Nov 2017 at 04:11 Josu Vilda <jrv...@gmail.com > 
> wrote:
>
>> Hi, 
>>
>> I have a problem with variables.
>>
>> this is correct:
>> .
>>  - debug:
>> msg: "{{ vm_list.virtual_machines.SRV1.uuid }}"
>> 
>>
>>
>>
>> but, i need:
>>
>> .
>> register: vmname
>>  - debug:
>> msg: "{{ vm_list.virtual_machines.{{ vmname }}.uuid }}"
>>
>> 
>>
>> how do i have to do it?
>>
>> thx
>>
>> -- 
>> You received this message because you are 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/9b587921-51c1-42c0-8684-cb3fed56f454%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/ansible-project/9b587921-51c1-42c0-8684-cb3fed56f454%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

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


[ansible-project] Problem with variables variables

2017-11-20 Thread Josu Vilda
Hi, 

I have a problem with variables.

this is correct:
.
 - debug:
msg: "{{ vm_list.virtual_machines.SRV1.uuid }}"




but, i need:

.
register: vmname
 - debug:
msg: "{{ vm_list.virtual_machines.{{ vmname }}.uuid }}"



how do i have to do it?

thx

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


[ansible-project] Re: module connect_to_api from vmware has no attribute 'SSLContext'

2017-11-17 Thread Josu Vilda
According to the documentation on the 
web http://docs.ansible.com/ansible/latest/vmware_guest_snapshot_module.html 
*vmware_guest_snapshot 
- Manages virtual machines snapshots in vcenter  *Requirements : python >= 
2.6 & *PyVmomi *but ...


 - settings "validate_certs: True" option,  it shows :

pyVim does not support changing verification mode with python < 2.7.9. 
Either update python or or use validate_certs=false"

 - settings "validate_certs: False" option,  it shows : 

AttributeError: 'module' object has no attribute 'SSLContext'


I try with pyvmomi  5.5.0 and 6.0.0

Name: pyvmomi
Version: 6.0.0
Summary: VMware vSphere Python SDK
Home-page: https://github.com/vmware/pyvmomi
Author: VMware, Inc.
Author-email: jhu@***.com
License: License :: OSI Approved :: Apache Software License
Location: /usr/lib/python2.6/site-packages
Requires: requests, six


 
   



El viernes, 17 de noviembre de 2017, 9:38:56 (UTC+1), Josu Vilda escribió:
>
>
> Hello, 
> I'm having problems with module vmware_guest_snapshot. Any solution?
>
>
> [root@ges1ansibledes ansible]# ansible --version
> ansible 2.4.1.0
>   config file = /etc/ansible/ansible.cfg
>   configured module search path = [u'/root/.ansible/plugins/modules', u
> '/usr/share/ansible/plugins/modules']
>   ansible python module location = /usr/lib/python2.6/site-packages/
> ansible
>   executable location = /usr/bin/ansible
>   python version = 2.6.6 (r266:84292, Nov 21 2013, 10:50:32) [GCC 4.4.7 
> 20120313 (Red Hat 4.4.7-4)]
>
>
>
> ---
> - hosts: "localhost"
>   user: *
>   become: root
>   gather_facts: False
>   tasks:
> - name: Create snapshot
>   vmware_guest_snapshot:
> hostname: "{{ vCenter }}"
> username: "**"
> password: "**"
> datacenter: "{{ datacenter_name }}"
> name: "{{ vmw_name }}"
> state: present
> snapshot_name: "{{ snapname }}"
> description: "{{ snapdescript }}"
> validate_certs: false
>
>
>
>
>
> The full traceback is:
> Traceback (most recent call last):
>   File "/tmp/ansible_hwi8NY/ansible_module_vmware_guest_snapshot.py", 
> line 357, in 
> main()
>   File "/tmp/ansible_hwi8NY/ansible_module_vmware_guest_snapshot.py", 
> line 329, in main
> pyv = PyVmomiHelper(module)
>   File "/tmp/ansible_hwi8NY/ansible_module_vmware_guest_snapshot.py", 
> line 211, in __init__
> self.content = connect_to_api(self.module)
>   File 
> "/tmp/ansible_hwi8NY/ansible_modlib.zip/ansible/module_utils/vmware.py", 
> line 398, in connect_to_api
> AttributeError: 'module' object has no attribute 'SSLContext'
>
> fatal: [localhost]: FAILED! => {
> "changed": false,
> "failed": true,
> "module_stderr": "Traceback (most recent call last):\n  File 
> \"/tmp/ansible_hwi8NY/ansible_module_vmware_guest_snapshot.py\", line 357, 
> in \nmain()\n  File 
> \"/tmp/ansible_hwi8NY/ansible_module_vmware_guest_snapshot.py\", line 329, 
> in main\npyv = PyVmomiHelper(module)\n  File 
> \"/tmp/ansible_hwi8NY/ansible_module_vmware_guest_snapshot.py\", line 211, 
> in __init__\nself.content = connect_to_api(self.module)\n  File 
> \"/tmp/ansible_hwi8NY/ansible_modlib.zip/ansible/module_utils/vmware.py\", 
> line 398, in connect_to_api\nAttributeError: 'module' object has no 
> attribute 'SSLContext'\n",
> "module_stdout": "",
> "msg": "MODULE FAILURE",
> "rc": 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/e1f910da-a023-43d0-bc98-042545b26d06%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] module connect_to_api from vmware has no attribute 'SSLContext'

2017-11-17 Thread Josu Vilda

Hello, 
I'm having problems with module vmware_guest_snapshot. Any solution?


[root@ges1ansibledes ansible]# ansible --version
ansible 2.4.1.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/root/.ansible/plugins/modules', u
'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.6/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.6.6 (r266:84292, Nov 21 2013, 10:50:32) [GCC 4.4.7 
20120313 (Red Hat 4.4.7-4)]



---
- hosts: "localhost"
  user: *
  become: root
  gather_facts: False
  tasks:
- name: Create snapshot
  vmware_guest_snapshot:
hostname: "{{ vCenter }}"
username: "**"
password: "**"
datacenter: "{{ datacenter_name }}"
name: "{{ vmw_name }}"
state: present
snapshot_name: "{{ snapname }}"
description: "{{ snapdescript }}"
validate_certs: false





The full traceback is:
Traceback (most recent call last):
  File "/tmp/ansible_hwi8NY/ansible_module_vmware_guest_snapshot.py", line 
357, in 
main()
  File "/tmp/ansible_hwi8NY/ansible_module_vmware_guest_snapshot.py", line 
329, in main
pyv = PyVmomiHelper(module)
  File "/tmp/ansible_hwi8NY/ansible_module_vmware_guest_snapshot.py", line 
211, in __init__
self.content = connect_to_api(self.module)
  File 
"/tmp/ansible_hwi8NY/ansible_modlib.zip/ansible/module_utils/vmware.py", 
line 398, in connect_to_api
AttributeError: 'module' object has no attribute 'SSLContext'

fatal: [localhost]: FAILED! => {
"changed": false,
"failed": true,
"module_stderr": "Traceback (most recent call last):\n  File 
\"/tmp/ansible_hwi8NY/ansible_module_vmware_guest_snapshot.py\", line 357, 
in \nmain()\n  File 
\"/tmp/ansible_hwi8NY/ansible_module_vmware_guest_snapshot.py\", line 329, 
in main\npyv = PyVmomiHelper(module)\n  File 
\"/tmp/ansible_hwi8NY/ansible_module_vmware_guest_snapshot.py\", line 211, 
in __init__\nself.content = connect_to_api(self.module)\n  File 
\"/tmp/ansible_hwi8NY/ansible_modlib.zip/ansible/module_utils/vmware.py\", 
line 398, in connect_to_api\nAttributeError: 'module' object has no 
attribute 'SSLContext'\n",
"module_stdout": "",
"msg": "MODULE FAILURE",
"rc": 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/e59abd3e-e140-49ec-bcf5-f87f7016e7b8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Random var and lenguage reference

2017-10-25 Thread Josu Vilda
Hi, 

I would like to get a 3 digit random number, for example 001.
I have come to get:

  tasks:
 - name: We assign a fixed random variable throughout the execution.
   set_fact:
  Random_Fix: "{{ 100 | random }}"
   run_once: yes

¿Which language uses "{{100 | random}}" or where can I find reference for 
this language?

I have been listening for a long time how easy it is to work with ansible, 
but at the moment it is not being.

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


[ansible-project] get the list of packages to update.

2017-09-07 Thread Josu Vilda
Hi all, 
I would like to automate a task to check the list of packages that need to 
be updated in my server farm with ansible.

Is there any way to do it?

I have seen that the yum module has the option to install the lastest, but 
not to check the packages 
and I have tried it from shell, 
shell 
but it is blocked if it finds a Red Hat with local repository without 
license (should give error and continue , do not?)

thx.

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


Re: [ansible-project] Ansible modifies PYTHONPATH which causes Python commands to fail

2017-07-24 Thread Josu Vilda
Yes but I expected that, ansible only pay attention to 
ansible_python_interpreter = / u sr / bin / python which is what has been 
configured.
Why then, you can not administer all kinds of python applications, if you 
have to install in all versions what you need ansible.

Any solution?


El viernes, 21 de julio de 2017, 22:51:25 (UTC+2), Toshio Kuratomi escribió:
>
> I'm not sure I understand... Are you pointing out the PYTHONHOME 
> environment being set?  If so, that's not something that ansible sets on 
> its own.  It seems like you have it set on the remote host or are telling 
> ansible to set it inside of a playbook or role.  For instance, through the 
> environment: paramter to a task.
>
> -Toshio
>
> On Fri, Jul 21, 2017 at 12:35 AM, Josu Vilda <jrv...@gmail.com 
> > wrote:
>
>> Ansible appears to modify PYTHONPATH internally to vendored versions of 
>> some modules. This causes Python scripts executed within playbooks to 
>> potentially fail if there are module conflicts.
>>
>>
>>
>> []# ansible-playbook -e "*ansible_python_interpreter=/usr/bin/python*" 
>> -vvv test-Sonan3.yml
>> Using /etc/ansible/ansible.cfg as config file
>>
>> PLAYBOOK: test-Sonan3.yml 
>> **
>> 1 plays in test-Sonan3.yml
>>
>> PLAY [fac1apprep] 
>> **
>>
>> *TASK [setup] 
>> 
>> Using module file 
>> /usr/lib/python2.6/site-packages/ansible/modules/core/system/setup.py
>> <9.9.9.9> ESTABLISH SSH CONNECTION FOR USER: arbor
>> <9.9.9.9> SSH: EXEC ssh -o ControlMaster=no -o 
>> KbdInteractiveAuthentication=no -o 
>> PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey 
>> -o PasswordAuthentication=no -o User=arbor -o ConnectTimeout=20 9.9.9.9 
>> '/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo 
>> ~/.ansible/tmp/ansible-tmp-1500558765.89-197955274343710 `" && echo 
>> ansible-tmp-1500558765.89-197955274343710="` echo 
>> ~/.ansible/tmp/ansible-tmp-1500558765.89-197955274343710 `" ) && sleep 
>> 0'"'"''
>> <9.9.9.9> PUT /tmp/tmpuy0cXs TO 
>> ~/.ansible/tmp/ansible-tmp-1500558765.89-197955274343710/setup.py
>> <9.9.9.9> SSH: EXEC sftp -b - -o ControlMaster=no -o 
>> KbdInteractiveAuthentication=no -o 
>> PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey 
>> -o PasswordAuthentication=no -o User=arbor -o ConnectTimeout=20 '[9.9.9.9]'
>> <9.9.9.9> ESTABLISH SSH CONNECTION FOR USER: arbor
>> <9.9.9.9> SSH: EXEC ssh -o ControlMaster=no -o 
>> KbdInteractiveAuthentication=no -o 
>> PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey 
>> -o PasswordAuthentication=no -o User=arbor -o ConnectTimeout=20 9.9.9.9 
>> '/bin/sh -c '"'"'chmod u+x 
>> '"'"'"'"'"'"'"'"'~/.ansible/tmp/ansible-tmp-1500558765.89-197955274343710/'"'"'"'"'"'"'"'"'
>>  
>> '"'"'"'"'"'"'"'"'~/.ansible/tmp/ansible-tmp-1500558765.89-197955274343710/setup.py'"'"'"'"'"'"'"'"'
>>  
>> && sleep 0'"'"''
>> <9.9.9.9> ESTABLISH SSH CONNECTION FOR USER: arbor
>> <9.9.9.9> SSH: EXEC ssh -o ControlMaster=no -o 
>> KbdInteractiveAuthentication=no -o 
>> PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey 
>> -o PasswordAuthentication=no -o User=arbor -o ConnectTimeout=20 -tt 9.9.9.9 
>> '/bin/sh -c '"'"'/usr/bin/python 
>> '"'"'"'"'"'"'"'"'~/.ansible/tmp/ansible-tmp-1500558765.89-197955274343710/setup.py'"'"'"'"'"'"'"'"';
>>  
>> rm -rf "~/.ansible/tmp/ansible-tmp-1500558765.89-197955274343710/" > 
>> /dev/null 2>&1 && sleep 0'"'"''
>> ok: [9.9.9.9]
>>
>> *TASK [Incluye variables del fichero minimo como kenan_env] 
>> **
>> task path: /etc/ansible/playbooks/test-Sonan3.yml:8
>> ok: [9.9.9.9] => {
>> "ansible_facts": {
>> "sonan_env3": {
>> "*PYTHONHOME": "/opt2/arbor/Sonan_INT/3P/python*"
>> }
>> },
>> "changed": false,
>> "invocation": {
>> "module_args": {
>> &

[ansible-project] Ansible modifies PYTHONPATH which causes Python commands to fail

2017-07-21 Thread Josu Vilda
Ansible appears to modify PYTHONPATH internally to vendored versions of 
some modules. This causes Python scripts executed within playbooks to 
potentially fail if there are module conflicts.



[]# ansible-playbook -e "*ansible_python_interpreter=/usr/bin/python*" -vvv 
test-Sonan3.yml
Using /etc/ansible/ansible.cfg as config file

PLAYBOOK: test-Sonan3.yml 
**
1 plays in test-Sonan3.yml

PLAY [fac1apprep] 
**

*TASK [setup] 

Using module file 
/usr/lib/python2.6/site-packages/ansible/modules/core/system/setup.py
<9.9.9.9> ESTABLISH SSH CONNECTION FOR USER: arbor
<9.9.9.9> SSH: EXEC ssh -o ControlMaster=no -o 
KbdInteractiveAuthentication=no -o 
PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey 
-o PasswordAuthentication=no -o User=arbor -o ConnectTimeout=20 9.9.9.9 
'/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo 
~/.ansible/tmp/ansible-tmp-1500558765.89-197955274343710 `" && echo 
ansible-tmp-1500558765.89-197955274343710="` echo 
~/.ansible/tmp/ansible-tmp-1500558765.89-197955274343710 `" ) && sleep 
0'"'"''
<9.9.9.9> PUT /tmp/tmpuy0cXs TO 
~/.ansible/tmp/ansible-tmp-1500558765.89-197955274343710/setup.py
<9.9.9.9> SSH: EXEC sftp -b - -o ControlMaster=no -o 
KbdInteractiveAuthentication=no -o 
PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey 
-o PasswordAuthentication=no -o User=arbor -o ConnectTimeout=20 '[9.9.9.9]'
<9.9.9.9> ESTABLISH SSH CONNECTION FOR USER: arbor
<9.9.9.9> SSH: EXEC ssh -o ControlMaster=no -o 
KbdInteractiveAuthentication=no -o 
PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey 
-o PasswordAuthentication=no -o User=arbor -o ConnectTimeout=20 9.9.9.9 
'/bin/sh -c '"'"'chmod u+x 
'"'"'"'"'"'"'"'"'~/.ansible/tmp/ansible-tmp-1500558765.89-197955274343710/'"'"'"'"'"'"'"'"'
 
'"'"'"'"'"'"'"'"'~/.ansible/tmp/ansible-tmp-1500558765.89-197955274343710/setup.py'"'"'"'"'"'"'"'"'
 
&& sleep 0'"'"''
<9.9.9.9> ESTABLISH SSH CONNECTION FOR USER: arbor
<9.9.9.9> SSH: EXEC ssh -o ControlMaster=no -o 
KbdInteractiveAuthentication=no -o 
PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey 
-o PasswordAuthentication=no -o User=arbor -o ConnectTimeout=20 -tt 9.9.9.9 
'/bin/sh -c '"'"'/usr/bin/python 
'"'"'"'"'"'"'"'"'~/.ansible/tmp/ansible-tmp-1500558765.89-197955274343710/setup.py'"'"'"'"'"'"'"'"';
 
rm -rf "~/.ansible/tmp/ansible-tmp-1500558765.89-197955274343710/" > 
/dev/null 2>&1 && sleep 0'"'"''
ok: [9.9.9.9]

*TASK [Incluye variables del fichero minimo como kenan_env] 
**
task path: /etc/ansible/playbooks/test-Sonan3.yml:8
ok: [9.9.9.9] => {
"ansible_facts": {
"sonan_env3": {
"*PYTHONHOME": "/opt2/arbor/Sonan_INT/3P/python*"
}
},
"changed": false,
"invocation": {
"module_args": {
"file": "/etc/ansible/vars_files/sonan_env3.yml",
"name": "sonan_env3"
},
"module_name": "include_vars"
}
}

*TASK [comprueba variable] 
***
task path: /etc/ansible/playbooks/test-sonan3.yml:13
[DEPRECATION WARNING]: Using bare variables is deprecated. Update your 
playbooks so that the environment value uses the
full variable syntax ('{{sonan_env3}}').
This feature will be removed in a future release. Deprecation warnings can 
be
disabled by setting deprecation_warnings=False in ansible.cfg.
Using module file 
/usr/lib/python2.6/site-packages/ansible/modules/core/commands/command.py
<9.9.9.9> ESTABLISH SSH CONNECTION FOR USER: arbor
<9.9.9.9> SSH: EXEC ssh -o ControlMaster=no -o 
KbdInteractiveAuthentication=no -o 
PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey 
-o PasswordAuthentication=no -o User=arbor -o ConnectTimeout=20 9.9.9.9 
'/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo 
~/.ansible/tmp/ansible-tmp-1500558767.68-174841249651867 `" && echo 
ansible-tmp-1500558767.68-174841249651867="` echo 
~/.ansible/tmp/ansible-tmp-1500558767.68-174841249651867 `" ) && sleep 
0'"'"''
<9.9.9.9> PUT /tmp/tmpuy0cXs TO 
~/.ansible/tmp/ansible-tmp-1500558767.68-174841249651867/command.py
<9.9.9.9> SSH: EXEC sftp -b - -o ControlMaster=no -o 
KbdInteractiveAuthentication=no -o 
PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey 
-o PasswordAuthentication=no -o User=arbor -o ConnectTimeout=20 '[9.9.9.9]'
<9.9.9.9> ESTABLISH SSH CONNECTION FOR USER: arbor
<9.9.9.9> SSH: EXEC ssh -o ControlMaster=no -o 
KbdInteractiveAuthentication=no -o 
PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey 
-o PasswordAuthentication=no -o User=arbor -o ConnectTimeout=20 9.9.9.9 
'/bin/sh -c '"'"'chmod u+x 
'"'"'"'"'"'"'"'"'~/.ansible/tmp/ansible-tmp-1500558767.68-174841249651867/'"'"'"'"'"'"'"'"'
 

[ansible-project] Re: problem with pythonpath and ansible_python_interpreter

2017-07-20 Thread Josu Vilda
I think It should not change the execution path, right?

El jueves, 20 de julio de 2017, 16:04:16 (UTC+2), Josu Vilda escribió:
>
> []# ansible-playbook -e "ansible_python_interpreter=/usr/bin/python" -vvv 
> test-Sonan3.yml
> Using /etc/ansible/ansible.cfg as config file
>
> PLAYBOOK: test-Sonan3.yml 
> **
> 1 plays in test-Sonan3.yml
>
> PLAY [fac1apprep] 
> **
>
> TASK [setup] 
> ***
> Using module file 
> /usr/lib/python2.6/site-packages/ansible/modules/core/system/setup.py
> <9.9.9.9> ESTABLISH SSH CONNECTION FOR USER: arbor
> <9.9.9.9> SSH: EXEC ssh -o ControlMaster=no -o 
> KbdInteractiveAuthentication=no -o 
> PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey 
> -o PasswordAuthentication=no -o User=arbor -o ConnectTimeout=20 9.9.9.9 
> '/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo 
> ~/.ansible/tmp/ansible-tmp-1500558765.89-197955274343710 `" && echo 
> ansible-tmp-1500558765.89-197955274343710="` echo 
> ~/.ansible/tmp/ansible-tmp-1500558765.89-197955274343710 `" ) && sleep 
> 0'"'"''
> <9.9.9.9> PUT /tmp/tmpuy0cXs TO 
> ~/.ansible/tmp/ansible-tmp-1500558765.89-197955274343710/setup.py
> <9.9.9.9> SSH: EXEC sftp -b - -o ControlMaster=no -o 
> KbdInteractiveAuthentication=no -o 
> PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey 
> -o PasswordAuthentication=no -o User=arbor -o ConnectTimeout=20 '[9.9.9.9]'
> <9.9.9.9> ESTABLISH SSH CONNECTION FOR USER: arbor
> <9.9.9.9> SSH: EXEC ssh -o ControlMaster=no -o 
> KbdInteractiveAuthentication=no -o 
> PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey 
> -o PasswordAuthentication=no -o User=arbor -o ConnectTimeout=20 9.9.9.9 
> '/bin/sh -c '"'"'chmod u+x 
> '"'"'"'"'"'"'"'"'~/.ansible/tmp/ansible-tmp-1500558765.89-197955274343710/'"'"'"'"'"'"'"'"'
>  
> '"'"'"'"'"'"'"'"'~/.ansible/tmp/ansible-tmp-1500558765.89-197955274343710/setup.py'"'"'"'"'"'"'"'"'
>  
> && sleep 0'"'"''
> <9.9.9.9> ESTABLISH SSH CONNECTION FOR USER: arbor
> <9.9.9.9> SSH: EXEC ssh -o ControlMaster=no -o 
> KbdInteractiveAuthentication=no -o 
> PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey 
> -o PasswordAuthentication=no -o User=arbor -o ConnectTimeout=20 -tt 9.9.9.9 
> '/bin/sh -c '"'"'/usr/bin/python 
> '"'"'"'"'"'"'"'"'~/.ansible/tmp/ansible-tmp-1500558765.89-197955274343710/setup.py'"'"'"'"'"'"'"'"';
>  
> rm -rf "~/.ansible/tmp/ansible-tmp-1500558765.89-197955274343710/" > 
> /dev/null 2>&1 && sleep 0'"'"''
> ok: [9.9.9.9]
>
> TASK [Incluye variables del fichero minimo como kenan_env] 
> *
> task path: /etc/ansible/playbooks/test-Sonan3.yml:8
> ok: [9.9.9.9] => {
> "ansible_facts": {
> "sonan_env3": {
> "*PYTHONHOME": "/opt2/arbor/Sonan_INT/3P/python*"
> }
> },
> "changed": false,
> "invocation": {
> "module_args": {
> "file": "/etc/ansible/vars_files/sonan_env3.yml",
> "name": "sonan_env3"
> },
> "module_name": "include_vars"
> }
> }
>
> TASK [comprueba variable] 
> **
> task path: /etc/ansible/playbooks/test-sonan3.yml:13
> [DEPRECATION WARNING]: Using bare variables is deprecated. Update your 
> playbooks so that the environment value uses the
> full variable syntax ('{{sonan_env3}}').
> This feature will be removed in a future release. Deprecation warnings can 
> be
> disabled by setting deprecation_warnings=False in ansible.cfg.
> Using module file 
> /usr/lib/python2.6/site-packages/ansible/modules/core/commands/command.py
> <9.9.9.9> ESTABLISH SSH CONNECTION FOR USER: arbor
> <9.9.9.9> SSH: EXEC ssh -o ControlMaster=no -o 
> KbdInteractiveAuthentication=no -o 
> PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey 
> -o PasswordAuthentication=no -o User=arbor -o ConnectTimeout=20 9.9.9.9 
> '/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo 
>

[ansible-project] problem with pythonpath and ansible_python_interpreter

2017-07-20 Thread Josu Vilda
[]# ansible-playbook -e "ansible_python_interpreter=/usr/bin/python" -vvv 
test-Sonan3.yml
Using /etc/ansible/ansible.cfg as config file

PLAYBOOK: test-Sonan3.yml 
**
1 plays in test-Sonan3.yml

PLAY [fac1apprep] 
**

TASK [setup] 
***
Using module file 
/usr/lib/python2.6/site-packages/ansible/modules/core/system/setup.py
<9.9.9.9> ESTABLISH SSH CONNECTION FOR USER: arbor
<9.9.9.9> SSH: EXEC ssh -o ControlMaster=no -o 
KbdInteractiveAuthentication=no -o 
PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey 
-o PasswordAuthentication=no -o User=arbor -o ConnectTimeout=20 9.9.9.9 
'/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo 
~/.ansible/tmp/ansible-tmp-1500558765.89-197955274343710 `" && echo 
ansible-tmp-1500558765.89-197955274343710="` echo 
~/.ansible/tmp/ansible-tmp-1500558765.89-197955274343710 `" ) && sleep 
0'"'"''
<9.9.9.9> PUT /tmp/tmpuy0cXs TO 
~/.ansible/tmp/ansible-tmp-1500558765.89-197955274343710/setup.py
<9.9.9.9> SSH: EXEC sftp -b - -o ControlMaster=no -o 
KbdInteractiveAuthentication=no -o 
PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey 
-o PasswordAuthentication=no -o User=arbor -o ConnectTimeout=20 '[9.9.9.9]'
<9.9.9.9> ESTABLISH SSH CONNECTION FOR USER: arbor
<9.9.9.9> SSH: EXEC ssh -o ControlMaster=no -o 
KbdInteractiveAuthentication=no -o 
PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey 
-o PasswordAuthentication=no -o User=arbor -o ConnectTimeout=20 9.9.9.9 
'/bin/sh -c '"'"'chmod u+x 
'"'"'"'"'"'"'"'"'~/.ansible/tmp/ansible-tmp-1500558765.89-197955274343710/'"'"'"'"'"'"'"'"'
 
'"'"'"'"'"'"'"'"'~/.ansible/tmp/ansible-tmp-1500558765.89-197955274343710/setup.py'"'"'"'"'"'"'"'"'
 
&& sleep 0'"'"''
<9.9.9.9> ESTABLISH SSH CONNECTION FOR USER: arbor
<9.9.9.9> SSH: EXEC ssh -o ControlMaster=no -o 
KbdInteractiveAuthentication=no -o 
PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey 
-o PasswordAuthentication=no -o User=arbor -o ConnectTimeout=20 -tt 9.9.9.9 
'/bin/sh -c '"'"'/usr/bin/python 
'"'"'"'"'"'"'"'"'~/.ansible/tmp/ansible-tmp-1500558765.89-197955274343710/setup.py'"'"'"'"'"'"'"'"';
 
rm -rf "~/.ansible/tmp/ansible-tmp-1500558765.89-197955274343710/" > 
/dev/null 2>&1 && sleep 0'"'"''
ok: [9.9.9.9]

TASK [Incluye variables del fichero minimo como kenan_env] 
*
task path: /etc/ansible/playbooks/test-Sonan3.yml:8
ok: [9.9.9.9] => {
"ansible_facts": {
"sonan_env3": {
"*PYTHONHOME": "/opt2/arbor/Sonan_INT/3P/python*"
}
},
"changed": false,
"invocation": {
"module_args": {
"file": "/etc/ansible/vars_files/sonan_env3.yml",
"name": "sonan_env3"
},
"module_name": "include_vars"
}
}

TASK [comprueba variable] 
**
task path: /etc/ansible/playbooks/test-sonan3.yml:13
[DEPRECATION WARNING]: Using bare variables is deprecated. Update your 
playbooks so that the environment value uses the
full variable syntax ('{{sonan_env3}}').
This feature will be removed in a future release. Deprecation warnings can 
be
disabled by setting deprecation_warnings=False in ansible.cfg.
Using module file 
/usr/lib/python2.6/site-packages/ansible/modules/core/commands/command.py
<9.9.9.9> ESTABLISH SSH CONNECTION FOR USER: arbor
<9.9.9.9> SSH: EXEC ssh -o ControlMaster=no -o 
KbdInteractiveAuthentication=no -o 
PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey 
-o PasswordAuthentication=no -o User=arbor -o ConnectTimeout=20 9.9.9.9 
'/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo 
~/.ansible/tmp/ansible-tmp-1500558767.68-174841249651867 `" && echo 
ansible-tmp-1500558767.68-174841249651867="` echo 
~/.ansible/tmp/ansible-tmp-1500558767.68-174841249651867 `" ) && sleep 
0'"'"''
<9.9.9.9> PUT /tmp/tmpuy0cXs TO 
~/.ansible/tmp/ansible-tmp-1500558767.68-174841249651867/command.py
<9.9.9.9> SSH: EXEC sftp -b - -o ControlMaster=no -o 
KbdInteractiveAuthentication=no -o 
PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey 
-o PasswordAuthentication=no -o User=arbor -o ConnectTimeout=20 '[9.9.9.9]'
<9.9.9.9> ESTABLISH SSH CONNECTION FOR USER: arbor
<9.9.9.9> SSH: EXEC ssh -o ControlMaster=no -o 
KbdInteractiveAuthentication=no -o 
PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey 
-o PasswordAuthentication=no -o User=arbor -o ConnectTimeout=20 9.9.9.9 
'/bin/sh -c '"'"'chmod u+x 
'"'"'"'"'"'"'"'"'~/.ansible/tmp/ansible-tmp-1500558767.68-174841249651867/'"'"'"'"'"'"'"'"'
 
'"'"'"'"'"'"'"'"'~/.ansible/tmp/ansible-tmp-1500558767.68-174841249651867/command.py'"'"'"'"'"'"'"'"'
 
&& sleep 0'"'"''
<9.9.9.9> ESTABLISH SSH CONNECTION FOR USER: arbor
<9.9.9.9> SSH: EXEC ssh -o ControlMaster=no -o 

[ansible-project] Re: Error assigning variables with Conditionals

2017-06-30 Thread Josu Vilda
Ok,
This would be the right way, right?


---
- hosts: hostwin

  vars:
 # definimos variables de ejemplo
 - site: localhost

  tasks:
 - name: Definimos variables para Red Hat.
   set_fact:
  package_name: "httpd"
   when:
  ansible_os_family == "Red Hat"

 - name: Definimos variables para Debian.
   set_fact:
  package_name: "apache2"
   when:
  ansible_os_family == "Debian"

 - name: Definimos variables para Windows.
   set_fact:
  package_name: "www"
   when:
  ansible_os_family == "Windows"


 # Consultamos al usuario si quiere actuar con dicho paquete.
 - name: Consulta sobre la instalacion del paquete {{package_name}} en 
{{ansible_os_family}}.
   pause: prompt="Acepta la instalacion del paquete {{package_name}} en 
{{ansible_os_family}} "
   register: confirmación

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


[ansible-project] Re: Error assigning variables with Conditionals

2017-06-30 Thread Josu Vilda
ansible 2.2.1.0
Linux  2.6.32-504.el6.x86_64 #1 SMP Tue Sep 16 01:56:35 EDT 2014 x86_64 
x86_64 x86_64 GNU/Linux


El viernes, 30 de junio de 2017, 14:24:13 (UTC+2), Josu Vilda escribió:

When assigning variables under certain conditions, if there is no match, 
> the last condition is erroneously assigned.
>
> Ej:
>
> ---
> - hosts: hostwin
>   vars:
>  # Definimos el paquete a instalar según el sistema operativo.
>  - package_name: httpd
>when: ansible_os_family == "Red Hat"
>  - package_name: apache2
>when: ansible_os_family == "Debian"
>
>   tasks:
>
>  # Consultamos al usuario si quiere actuar con dicho paquete.
>  - name: Consulta sobre la instalacion del paquete {{package_name}} en 
> {{ansible_os_family}}
>pause: prompt="Acepta la instalacion del paquete {{package_name}} en 
> {{ansible_os_family}} "
>register: confirmación
>
>
>
> # ansible-playbook playbooks/test-httpd.yml
> PLAY [hostwin] ***
> TASK [setup] 
> ***
> ok: [hostwin]
> TASK [Consulta sobre la instalacion del paquete apache2 en *Windows*] 
> 
> [Consulta sobre la instalacion del paquete apache2 en *Windows*]
> Acepta la instalacion del paquete apache2 en *Windows* :
> ok: [hostwin]
> PLAY RECAP 
> *
> hostwin : ok=2changed=0unreachable=0failed=0
>
>
>
> This should be null or return error, but do not assign any one.
>
>
>

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


[ansible-project] Error assigning variables with Conditionals

2017-06-30 Thread Josu Vilda
When assigning variables under certain conditions, if there is no match, 
the last condition is erroneously assigned.

Ej:

---
- hosts: hostwin
  vars:
 # Definimos el paquete a instalar según el sistema operativo.
 - package_name: httpd
   when: ansible_os_family == "Red Hat"
 - package_name: apache2
   when: ansible_os_family == "Debian"

  tasks:

 # Consultamos al usuario si quiere actuar con dicho paquete.
 - name: Consulta sobre la instalacion del paquete {{package_name}} en 
{{ansible_os_family}}
   pause: prompt="Acepta la instalacion del paquete {{package_name}} en 
{{ansible_os_family}} "
   register: confirmación



# ansible-playbook playbooks/test-httpd.yml
PLAY [hostwin] ***
TASK [setup] ***
ok: [hostwin]
TASK [Consulta sobre la instalacion del paquete apache2 en *Windows*] 

[Consulta sobre la instalacion del paquete apache2 en *Windows*]
Acepta la instalacion del paquete apache2 en *Windows* :
ok: [hostwin]
PLAY RECAP *
hostwin : ok=2changed=0unreachable=0failed=0



This should be null or return error, but do not assign any one.


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