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:

  1. 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.

  2. On the Create Task dialog box, in the Type list, select Ansible.

  3. In the Name field, enter a name for the task.

  4. In the Instance URL field, enter the location of your Ansible installation..

  5. In the Access Token field, paste the token that you generated in your Ansible instance.

  6. In the Job ID field, enter the Ansible job identification number..

  7. 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,

  8. 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