Creating Ansible tasks#
Create an Ansible task.
In your Ansible instance, create a user token. You use the token to authenticate your UrbanCodeā¢ Velocity user to Ansible.
Create an Ansible task to manage Ansible jobs.
To create an Ansible task, complete the following steps:
-
On the Deployment plan detail page, click Create Task.
If you want to insert a task at a specific position in the plan, select a task before using the Create Task. The new task is inserted above the selected task.
-
On the Create Task dialog box, in the Type list, select Ansible.
-
In the Name field, enter a name for the task.
-
In the Instance URL field, enter the location of your Ansible installation..
-
In the Access Token field, paste the token that you generated in your Ansible instance.
-
In the Job ID field, enter the Ansible job identification number..
-
In the Extra Variables box, enter any parameters that you want to pass to the Ansible job.
The parameter format is JSON. For example:
{ "environment": "DEV" }
example,
-
Click Save.
The task is inserted into the deployment plan.
When you run the task, a webhook is created that uses the Ansible API to run the job. While the job is running, you can accesses Ansible logs by using a link in the deployment plan. When the Ansible job is finished, the UrbanCode Velocity task status is updated.
Parent topic: Tasks