How to run ansible playbook with multiple files

1

I adapted this playbook for rhel https://github.com/matisku/ansible-teamcity-server

I am familiar with running single yaml file by using ansible-playbook I am not sure how to run this yaml playbook with tasks, handlers, etc Can anyone point me to documentation on running the multiple file playbooks

thanks

Nate

Posted 2019-08-13T21:09:40.440

Reputation: 125

Answers

1

That is not a playbook but a role. It's published at Ansible Galaxy ( docs ): https://galaxy.ansible.com/matisku/teamcity-server

If you use Galaxy to pull in the role you can use it as mentioned in the readme of the GitHub repo under "Example playbook". Just create a file that contains:

- hosts: teamcity-servers
  become: yes 
  roles:
    - matisku.teamcity-server

If instead you pull the code using git place it in a folder in /etc/ansible/roles/ and use the name of that folder in the roles directive:

- hosts: teamcity-servers
  become: yes 
  roles:
    - myownteamcityrolename

HoD

Posted 2019-08-13T21:09:40.440

Reputation: 2 282