Ansible Newbie Calling…
We have Ansible Tower and Satellite.
I’ve been asked to look at Deploying Windows Server using Ansible Tower.
I’ve created a win2019-tmp (template) in VMware
Now I need to look at creating a Role playbook to deploy a Windows system in VMware.
I’ve made a start on the main.yml and vars.yml files but I am not sure they will run on my new pipeline yet.
Is there a way to check if the pipeline is ready to test playbooks on ?
Also, since I will be deploying a Windows Server that has not been created yet, how can I put any info in the Ansible Tower Template Inventory area if it does not exist?
I hope someone can help me with Windows deployements using Ansible. I couldn’t find a suitable Red Hat course for this.
Thanks
Nick
You can use add_host to the playbook that generates In memory hosts during the execution run
Sounds like good use of Tower callback function. That way Tower does not have to know anything about the new host. Just be sure the windows image is configure for ansible, and then use either a cloud_init or or a first run script to execute the callback.
You don’t need the machine added to an inventory and you don’t need ansible tower callbacks. The vmware_guest module doesn’t require either one. You do need to know the name of the new machine in a variable.
We have a very elaborate ServiceNow → Ansible Tower request and deliver workflow. We create the VMs (or EC2s in AWS), then create the DNS record, then do OS level machine customization.
Email be directly and I can set up a TEAMS call to show you our playbook for creating a machine in VMware.
The “secret” to any good provisioning workflow is to parameterize EVERYTHING. We feed user specifications from a ServiceNow request into our Ansible Tower workflow. These specifications include what network, what AD OU to deposit the new computer object we create, what function the server will provide, what OS and version (windows 2016, windows 2019, ubuntu 20, ubuntu22, redhat8, rocky8, debian10, debian11, etc), AWS or VMware, etc. Our playbooks in ansible tower use most of these parameters from the ServiceNow request as keys into dictionaries or as indicators of specific vars files to import that have detailed specifications in YAML format we can use to do all our work for provisioning. We can add new operating system versions, new cloud service providers, new machine purposes and describe all of these in our vars files and parameters from ServiceNow. We have to make few if any changes to the actual playbooks. Even attached storage is described in a JSON list that cleverly has all the disks associated with each machine type for both Windows and Linux. A json_query lets us pull out the records we need from the JSON list.
One more item I will add … in our Customize step of our workflow we do create an in-memory inventory with the new machine name so the steps in that lengthy process have an inventory to work on.
It’s that the add_host directive?
Yes. We use TWO plays in a playbook. The first play uses an extra_var of the hostname to create a new host group. The second play scopes its inventory to that host group.
In our workflow the new machines’ name comes in as an extra var called vm_guest_name.
Ahh yes. So as I suggested. You are using what I suggested to the op before
No. It is not used for creating the machine (vmware_guest module). It is only used for customizing the machine AFTER it is created. In the graphic I provided we do this only for the Customize step in the workflow. In the ‘Create Machine’ step in the workflow we DO NOT do this. It isn’t necessary.
Hello folks,
I am trying to setup the servicenow and ansible awx integration can any one help me.
I have developers snow instance and awx installed on the machine .