Skip to content

Instantly share code, notes, and snippets.

@rammanokar
Created October 22, 2019 03:13
Show Gist options
  • Save rammanokar/b1ecb09fa35538aaa1dc7d2d5f2f7505 to your computer and use it in GitHub Desktop.
Save rammanokar/b1ecb09fa35538aaa1dc7d2d5f2f7505 to your computer and use it in GitHub Desktop.
Deploay Xen server using ansible
Machines:
Connectors:
- hostname: CCConn-0001
num_cpus: 4
num_cpu_cores_per_socket: 2
memory_mb: 8192
- hostname: CCConn-0002
num_cpus: 4
num_cpu_cores_per_socket: 2
memory_mb: 8192
Storefronts:
- hostname: SFPrinci-0001
num_cpus: 4
num_cpu_cores_per_socket: 2
memory_mb: 8192
tasks:
- name: Create VMs from a template
xenserver_guest:
hostname: 10.8.47.11
username:
password:
validate_certs: no
#folder: /home/testvms
name: '{{ item['hostname'] }}'
state: poweredon
template: W2K16_RTM_64_EN_ans
disks:
- size_gb: 100
name: ''
sr: XenRTVol
linked_clone: yes
hardware:
num_cpus: '{{ item['num_cpus'] }}'
num_cpu_cores_per_socket: '{{ item['num_cpu_cores_per_socket'] }}'
memory_mb: '{{ item['memory_mb'] }}'
cdrom:
type: iso
iso_name: guest-tools.iso
networks:
- name: vlan40
wait_for_ip_address: no
delegate_to: localhost
register: deploy
loop: '{{ Machines['Connectors'] + Machines['Storefronts'] }}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment