i'd like to migrate my playbooks into ansible roles. I started but a basic 
question raises.
E.g.
I'd like to implement nfs in a bunch of of linux machines. on one machine 
i've to configure the nfs-sharing and on the other machines I've to implemt 
the link to the nfs-sourcing host.

systemA - configure a share for other hosts
systemB,C,D - use the nfs-sharing from system A

I tried to create a role called nfs where i have to configure a few tasks 
on systemA and the other tasks on systemB,C,D
I've splitted the tasks into 2 vaious task files one for systemA and one 
for systemB and both will be imported into main.yml in tasks.
---
# tasks file for installing nfs
- import_tasks: install_cmp.yml
- import_tasks: install_machines.yml

in the run.yml I tried to call the same role twice where I used tags to 
call the plays for the cmp machine from install_cmp.yml and the tags in 
install_machines for running the plays for the other machines. however this 
doesn't work

- hosts: cmp
  become: true
  tags:
    - create_nfs_cmp
    - config_exports_cmp
    - exportfs_cmp
    - symlink_cmp
    - symlink_hostsini_cmp
  roles:
    - nfs

- hosts:
    - hardware:!cmp
    - vms
  become: true
  tags:
    - create_nfs_machines
    - mnt_nfs_machines
  roles:
    - nfs


is my concept wrong, do I have to configure to roles one for setting up nfs 
on cmp and one for implementing nfs on the machines or is it possible to 
create just one role for installing nfs on with vaious tasks on various 
machines?

Thx


-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/d1042759-27a2-4de3-a81f-23c69703af9an%40googlegroups.com.

Reply via email to