diff --git a/host-plumbum.yml b/host-plumbum.yml new file mode 100644 index 0000000..7170280 --- /dev/null +++ b/host-plumbum.yml @@ -0,0 +1,11 @@ +--- +- hosts: plumbum.n39.eu + become: true + + roles: + - role: nfs-host + vars: + nfs_host_exports: + - directory: "/srv/nfs" + hosts: "k3s-w[0-9]+.n39.eu" + options: rw,sync,no_subtree_check diff --git a/host_vars/plumbum.n39.eu/vars.yml b/host_vars/plumbum.n39.eu/vars.yml index 1214d68..af6228c 100644 --- a/host_vars/plumbum.n39.eu/vars.yml +++ b/host_vars/plumbum.n39.eu/vars.yml @@ -1,7 +1,3 @@ --- server_admin: "admin+plumbum@netz39.de" mac: "32:A3:94:A0:23:77" -nfs_host_exports: - - directory: "/srv/nfs" - hosts: "k3s-w[0-9]+.n39.eu" - options: rw,sync,no_subtree_check \ No newline at end of file diff --git a/main.yml b/main.yml index 785175b..5af6b86 100644 --- a/main.yml +++ b/main.yml @@ -39,3 +39,6 @@ - name: Hobbes specific setup import_playbook: host-hobbes.yml + +- name: Plumbum specific setup + import_playbook: host-plumbum.yml diff --git a/roles/nfs-host/tasks/main.yml b/roles/nfs-host/tasks/main.yml index 7ff864c..ebb9145 100644 --- a/roles/nfs-host/tasks/main.yml +++ b/roles/nfs-host/tasks/main.yml @@ -20,7 +20,7 @@ owner: nobody group: nogroup mode: '0000' - loop: "{{ nfs_host_exports | dict2items }}" + with_items: "{{ nfs_host_exports }}" - name: template /etc/exports ansible.builtin.template: @@ -29,5 +29,5 @@ notify: reload nfs - name: Ensure nfs is running. - ansible.builtin.service: "name={{ nfs_server_daemon }} state=started enabled=yes" + ansible.builtin.service: "name=nfs-kernel-server state=started enabled=yes" when: nfs_host_exports|length