use rules from different git repos/locations

14 views
Skip to first unread message

sanctc

unread,
Feb 12, 2020, 1:57:08 AM2/12/20
to Ansible Project
Hi Folks,
Can I use roles from several different git repos/locations to single ansible?
e.g. 
---
- hosts: myhost
  roles:
    - role1: '/path/to/my/roles/common'
    - role2: '/usr1/to/my/roles/client'
    - role3: '/usrpath/to/my/roles/server'

What would be the best way to use roles from different locations?

Thanks,
Santosh

Dick Visser

unread,
Feb 12, 2020, 7:19:08 AM2/12/20
to ansible...@googlegroups.com
Hi

What do you mean by “a single ansible”?

In any case where a role came from (git, in your case) is not relevant, just make sure they are available locally. 
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/3031f4c9-ea37-4032-b971-4668b5e55e7c%40googlegroups.com.
--
Sent from a mobile device - please excuse the brevity, spelling and punctuation.

sanctc

unread,
Feb 12, 2020, 7:31:39 AM2/12/20
to Ansible Project
Hi,
I used the below option after copying the rules from git and it worked for me.
- hosts: all
  roles:
    - server
    - /path/to/my/roles/common
    - /path/to/my/client_roles/client
My intention was to use roles from different locations in a playbook
On Wednesday, February 12, 2020 at 5:49:08 PM UTC+5:30, Dick Visser wrote:
Hi

What do you mean by “a single ansible”?

In any case where a role came from (git, in your case) is not relevant, just make sure they are available locally. 
On Wed, 12 Feb 2020 at 06:57, sanctc <sanc...@gmail.com> wrote:
Hi Folks,
Can I use roles from several different git repos/locations to single ansible?
e.g. 
---
- hosts: myhost
  roles:
    - role1: '/path/to/my/roles/common'
    - role2: '/usr1/to/my/roles/client'
    - role3: '/usrpath/to/my/roles/server'

What would be the best way to use roles from different locations?

Thanks,
Santosh

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages