Hi all,
I am pretty new to Ansible and I have been tasked with coming up with a playbook to do the following:
- connect to our various VC’s can create a snapshot of the servers
- check if physical or virtual
- verify which version of Red Hat we are running either 6 or 7
- Patch the server and any issues push the errors out to a file
Sounds pretty easy we have over 1000 Rhel servers in physical and virtual format. I am creating the playbook on a Red Hat 7 Server running Rhel7.3, ansible-.2.0.0.1, python-pysphere-0.1.8.1, python2-pyvmomi-6.5-1.
I already have my inventory of all my servers. Not an Issue
Ansible is running fine. Not an issue
python-pyvomomi. Appears to be running fine with certain mod’s
Python-pysphere. Having issues with.
- is there a way to verify this is working (As I continue to get module required after each run)
- Is there another way to create snapshots of the Virtual Machines ( We are running Vmware 6.2 right now)
Here is a simple script and the results.
- hosts: localhost
tasks: - vsphere_guest:
vcenter_hostname: virtualCenterName
username: someuser
password: somepassword
guest: servername
vmware_guest_facts: yes
This is my results:
fatal: [localhost]: FAILED! => {
“changed”: false,
“failed”: true,
“invocation”: {
“module_args”: {
“cluster”: null,
“esxi”: {},
“force”: false,
“from_template”: null,
“guest”: “soaiatapp01.gartner.com”,
“password”: “VALUE_SPECIFIED_IN_NO_LOG_PARAMETER”,
“power_on_after_clone”: true,
“resource_pool”: null,
“snapshot_to_clone”: null,
“state”: “present”,
“template_src”: null,
“username”: “gartner\rgarrow-admin”,
“validate_certs”: true,
“vcenter_hostname”: “vmwprtvcnp01.gartner.com”,
“vm_disk”: {},
“vm_extra_config”: {},
“vm_hardware”: {},
“vm_hw_version”: null,
“vm_nic”: {},
“vmware_guest_facts”: true
}
},
“msg”: “pysphere module required”
I am at a stand still for this so any help someone could pass on would be greatly appreciated. any references to Ansible and Red Hat would be helpful as well I have no problem reading information and learning new ways. There just does not seem to be a lot. I know if I was running ubuntu I would have not issues, plenty of info… thanks.