Can i use the roles from Ansible in Ansible Tower

ansibleansible-tower

I have created about 30 roles in ansible. Do i have to manually convert those in single playbooks to use them in Ansible Tower?

Best Answer

Yes, you may use roles in Tower. We do something like the following, grouping related roles into a playbook (playbook.yml in this example) then calling that from a Tower job.

playbook.yml

---
- name: Example playbook
  hosts: '{{ target }}'
  roles:
    - { role: init }
    - { role: deploy }
    - { role: cleanup }

Directory tree

roles/
  init/
    ...
    tasks/
      main.yml
    ...
  deploy/
    ...
    tasks/
      main.yml
    ...
  cleanup/
    ...
    tasks/
      main.yml
  ...

Then from the Tower job, you can either supply {{ target }} or use a survey to prompt the user.

Related Topic