Ansible tasks

Properties

The AnsibleTasks component has the same properties as the Bash component but with additional properties:

  • ansible_become: Set to true to run the ansible tasks with root privileges.
  • ignore_errors: Set to true for the orchestrator to ignore any errors during the execution of this ansible tasks and continues in the next steps.

Artifacts

  • AnsibleTasks component has the same artifacts as the Bash component (i.e., configure, post_configure_source, add_source) but in a .yml file.
  • In addition to the env property, users can define ansible variables available in the AnsibleTasks by providing the artifact ansible_variables.

Examples

  • Put an AnsibleTasks on a compute node.
  • Set the port property to 8080.
  • Add an entry in the env property with key FOO value bar.

Fig. Ansible tasks

  • Write an ansible task (e.g., configure.yml) as follows:
- debug:
msg:
- "{{ NODE }} is running on {{ HOST }} on port {{ PORT }}"
- "{{ NODE }} has environment variable FOO with value: {{ FOO }}"
  • Upload configure.yml to the configure artifact of the AnsibleTasks.

Fig. Ansible tasks configure

Expected result

During the deployment, the orchestrator starts an ansible controller (container) and applies the ansible tasks on the target Compute node.

AnsibleTasks is running on Compute on port 8080
AnsibleTasks has environment variable FOO with value: bar