miquelMariano.vSphereVM
Role Name
vSphereVM is a role that helps vSphere administrators manage their virtual machines.
Requirements
You need to have pyvmomi installed.
To install it, use:
$ pip install --upgrade pyvmomi
Role Variables
The variables needed to connect to vCenter are defined in vars/main.yml:
vc_hostname: 192.168.6.10
vc_username: [email protected]
vc_password: Secret123!
vm_template: miquel-template-W2012R2-Std-ES
dc_domain: ncoraformacion.local
dc_domainadmin: [email protected]
dc_domainadminpass: Secret123!
localadminpass: Secret123!
For security, it is recommended to encrypt this file with ansible-vault.
Variables for each VM you want to deploy are specified at the end of the deploy-customize-win.yml file:
##
##Insert below the variables for each VM to deploy
##
with_items:
- { vm_name: vm-demo, vm_ip: 10.0.0.100, vc_datacenter: VDC, vc_folder: /MIQUEL, vc_cluster: Cluster-EVC, vc_note: Created by Ansible, vm_datastore: FORM01_R5_LUN75, vm_networkportgroup: VLAN6_Formacion, vm_networkdns1: 192.168.6.100, vm_networkdns2: 192.168.6.101, vm_networkmask: 255.255.255.0, vm_networkgw: 192.168.6.1, vm_memory: 4096, vm_cpu: 4, vm_disksize: 20 }
Dependencies
No dependencies.
Example Playbook
---
###vSphereVM.yml
- hosts: ansible
user: root
tasks:
- name: Ensure that role is up to date
command: ansible-galaxy install --force {{ item }}
with_items:
- miquelMariano.vSphereVM
when:
- update_mode | default(False)
tags: update
ignore_errors: yes
- hosts: ansible
user: root
roles:
- role: miquelMariano.vSphereVM
Execute Playbook
You can run the playbook with the following command:
ansible-playbook playbooks/vSphereVM.yml -i inventory/servers -e "update_mode=true" --tags=update
License
BSD
Author Information
Visit miquelMariano.github.io or Twitter.
Informazioni sul progetto
vSphereVM is a role to help an vSphere administrators to manage your virtual machines
Installa
ansible-galaxy install miquelMariano.vSphereVM
Licenza
Unknown
Download
82
Proprietario