Ansible role

  • The AnsibleRole component has the same properties as the AnsibleTasks component.
  • But the artifact is a zip file of the CONTENT of the role folder.

1. Examples

1.1. Provide ansible role in a zip file

  • Put an AnsibleRole on a compute.
  • In your local machine, create a folder tasks with one file main.yml.
- debug:
msg:
- "Hello! I am an {{ MY_NAME }}"
- "I am running on {{ HOST }}"
  • Zip the tasks folder as configure.zip and upload.

Fig. Ansible tasks configure

  • Select configure.zip as the artifact configure of the AnsibleRole.

Fig. Ansible tasks configure

1.2. Provide ansible variables

In addition to the env property, users can define ansible variables by providing the artifact ansible_variables as follows:

  • Create an ansible variable for our role (e.g., myvar.yml)
MY_NAME: example
  • Select myvar.yml in the artifact ansible_variables.

2. Expected result

During the deployment, the orchestrator starts an ansible controller (container), unzip the ansible role on the ansible controller, and applies the role on the target compute.

Hello! I am an example
I am running on Compute