This repository contains Ansible roles for configuring servers for provisioning and deployment via AWX.
- Ansible
- AWX
- Create source control, make sure to use their respective credential types too
- Create a project and point to your fork and branch
- Create an inventory with the servers you would like to target
- Create a Template and choose Job Type of
run
then select for inventory and project from the dropdowns. Set your playbook as well. You can set your execution environment if you want, but it shouldn't be required. - In the template, set your credentials to log on to the servers (SSH keys recommended).
- Save the template and Launch the job
- Create a service account for the connection from vCenter to Ansible. You can use the administrator@vsphere.local for testing, but this should not be used in production environments
- Create a set of VMware credentials inside VMware. Credentials -> Add -> Credential type -> VMware
This variables are stored in the Variables field in the job template. The can be stored in a vars yaml file as well.
Variable name | Description | Roles |
---|---|---|
cluster_name | The cluster in vCenter that this VM will be placed | Deploy-Server |
folder_path | The folder in vCenter that this VM will be placed | Deploy-Server |
vm_name | The name of the VM | Deploy-Server, Remove-Server |
datacenter_name | The datacenter in vCenter where this VM will be placed | Deploy-Server |
datastore_name | The datastore in vCenter where this VM will be placed | Deploy-Server |
template | The full folder path to the template for the VM to be created from | Deploy-Server |
guest_domain | Domain for the VM | Deploy-Server |
guest_dns_server1 | DNS server | Deploy-Server |
guest_dns_server2 | DNS server | Deploy-Server |
guest_domain_name1 | DNS search domain | Deploy-Server |
guest_domain_name2 | DNS search domain | Deploy-Server |
snap_name | The name of the snapshot to be taken | Create-Snap, Revert-Snap, Remove-Snap |
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch.
- Make your changes.
- Test your changes.
- Submit a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.