Re: [ansible-project] Creating VM from Template is Failing

2018-05-23 Thread BIJAY PARIDA
Please check the indentation after the line "ip" - 28 and 29

-Bijay

On Wed, May 23, 2018 at 9:39 AM, Gowtham Nakulan 
wrote:

> SUMMARY
>
> We are trying to create VM from template.
> I am facing issue at assigning ip line.
> ISSUE TYPE
>
>- Documentation Report
>
> COMPONENT NAME
>
> vsphere_guest:
> ANSIBLE VERSION
>
> ansible 2.5.2
>
> CONFIGURATIONOS / ENVIRONMENT
>
> Ubuntu
> STEPS TO REPRODUCE
>
> ---
>
> - hosts: 127.0.0.1
>   connection: local
>   user: root
>   sudo: false
>   gather_facts: false
>   serial: 1
>
>   tasks:
>   - name: Importing Variables
> include_vars: main.yml
>   - debug: var=hostname_var
>   - debug: var=username_var
>   - debug: var=password_var
>
>   - vsphere_guest:
>vcenter_hostname: "{{hostname_var}}"
>username: "{{username_var}}"
>password: "{{password_var}}"
>guest: vmfromtemplate
>from_template: yes
>template_src: Ubuntu VM
>cluster: t1k1-cluster
> networks:
>   - name: "vcesys_esx_mgmt"
>  ip: "10.1.1.10"
> netmask: "255.255.255.0"
> gateway: "10.0.0.1"
> wait_for_ip_address: yes~
>
> EXPECTED RESULTS
>
> VMshould be created from template and assigned the ip for the interface
> which i am giving at the ntework line.
> ACTUAL RESULTS
>
> ERROR! Syntax Error while loading YAML.
>   did not find expected key
>
> The error appears to have been in 
> '/opt/work/ansible/playbooks/gowtham/vmfromtem
>  
> plate.yml': line 27, column 10, but may
> be elsewhere in the file depending on the exact syntax problem.
>
> The offending line appears to be:
>
>   - name: "vcesys_esx_mgmt"
>  ip: "10.1.1.10"
>  ^ here
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ansible-project+unsubscr...@googlegroups.com.
> To post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/ansible-project/09298fdf-b5d7-4c59-8a42-da17e31bce4d%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/CAMj7Bib74VBesYe_N7wUQ%2B9w29t5OkyZDSsdLQGWaX0GFkk21A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Creating VM from Template is Failing

2018-05-22 Thread Gowtham Nakulan
SUMMARY

We are trying to create VM from template.
I am facing issue at assigning ip line.
ISSUE TYPE
   
   - Documentation Report

COMPONENT NAME

vsphere_guest:
ANSIBLE VERSION

ansible 2.5.2

CONFIGURATIONOS / ENVIRONMENT

Ubuntu
STEPS TO REPRODUCE

---

- hosts: 127.0.0.1
  connection: local
  user: root
  sudo: false
  gather_facts: false
  serial: 1

  tasks:
  - name: Importing Variables
include_vars: main.yml
  - debug: var=hostname_var
  - debug: var=username_var
  - debug: var=password_var

  - vsphere_guest:
   vcenter_hostname: "{{hostname_var}}"
   username: "{{username_var}}"
   password: "{{password_var}}"
   guest: vmfromtemplate
   from_template: yes
   template_src: Ubuntu VM
   cluster: t1k1-cluster
networks:
  - name: "vcesys_esx_mgmt"
 ip: "10.1.1.10"
netmask: "255.255.255.0"
gateway: "10.0.0.1"
wait_for_ip_address: yes~

EXPECTED RESULTS

VMshould be created from template and assigned the ip for the interface 
which i am giving at the ntework line.
ACTUAL RESULTS

ERROR! Syntax Error while loading YAML.
  did not find expected key

The error appears to have been in 
'/opt/work/ansible/playbooks/gowtham/vmfromtem  
   
plate.yml': line 27, column 10, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

  - name: "vcesys_esx_mgmt"
 ip: "10.1.1.10"
 ^ here


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