From 87a20622103d74eca59003ae2adac81bd6ffee9b Mon Sep 17 00:00:00 2001 From: binary Date: Wed, 3 Mar 2021 14:56:21 +0100 Subject: Start to refactor playbooks with include --- playbooks/all.yml | 12 ++++++++++++ playbooks/network.yml | 15 +++++++-------- playbooks/network/localhost.yml | 12 ++++++++++++ playbooks/network/nfs.yml | 21 +++++++++++++++++++++ 4 files changed, 52 insertions(+), 8 deletions(-) create mode 100644 playbooks/all.yml create mode 100644 playbooks/network/localhost.yml create mode 100644 playbooks/network/nfs.yml diff --git a/playbooks/all.yml b/playbooks/all.yml new file mode 100644 index 0000000..774c2e6 --- /dev/null +++ b/playbooks/all.yml @@ -0,0 +1,12 @@ + +# all ~~ playbooks/all.yml +# play ALL playbooks in the best order + +--- + +- name: import basic playbook for all hosts + import_playbook: all-hosts-basic.yml + +- name: import network playbooks for all hosts + import_playbook: network.yml + diff --git a/playbooks/network.yml b/playbooks/network.yml index 6633480..1b34572 100644 --- a/playbooks/network.yml +++ b/playbooks/network.yml @@ -4,10 +4,11 @@ --- -- hosts: localhost - gather_facts: no - roles: - - { role: sshdns } +- name: import localhost network playbook + import_playbook: network/localhost.yml + +- name: import nfs network playbook + import_playbook: network/nfs.yml - hosts: all gather_facts: no @@ -20,7 +21,5 @@ - { role: sshd } - { role: prometheus } -- hosts: dc0 - roles: - - { role: pf } - - { role: relayd } +- name: import domain controller playbook + import_playbook: dc0.rgoncalves.se diff --git a/playbooks/network/localhost.yml b/playbooks/network/localhost.yml new file mode 100644 index 0000000..4d87654 --- /dev/null +++ b/playbooks/network/localhost.yml @@ -0,0 +1,12 @@ + +# network/localhost ~~ playbooks/network/localhost.yml +# localhost network configuration + +--- + +- hosts: localhost + gather_facts: no + roles: + - { role: sshdns } + + diff --git a/playbooks/network/nfs.yml b/playbooks/network/nfs.yml new file mode 100644 index 0000000..1b8717e --- /dev/null +++ b/playbooks/network/nfs.yml @@ -0,0 +1,21 @@ + +# network/nfs ~~ playbooks/nfs/network.yml +# nfs network playbook + +--- + +- name: ensure installation and configuration on server side + hosts: stack0 + roles: + - role: nfsd + vars: + nfsd_dirs: "{% for vm in vms %}{{ vm.name }} {% endfor %}" + tags: play_network_nfsserver + +- name: ensure installation and configuration on client side + hosts: ~st[0-9].* + roles: + - role: nfsclient + vars: + nfsclient_server_dir: "{{ global.nfs_server_dir }}/{{ ansible_host }}" + tags: play_network_nfsclient -- cgit v1.2.3