Ansible role

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

Examples

  • Put an AnsibleRole on a compute node.
  • Create an ansible variable for our role (e.g., myvar.yml)
MY_NAME: example
  • Upload myvar.yml in the artifact ansible_variables.

Fig. Ansible tasks configure

  • Create a folder tasks (in your role directory) 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 to the artifact configure of the AnsibleRole.

Fig. Ansible tasks configure

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

Hello! I am an example
I am running on Compute