fix: correct order of operations in nfs-host role

This commit is contained in:
David Kilias 2023-10-09 23:35:50 +02:00 committed by Stefan Haun
parent 6fc1e80479
commit 764e54f530
2 changed files with 16 additions and 11 deletions

View file

@ -10,7 +10,6 @@ all:
platon.n39.eu: platon.n39.eu:
plumbum.n39.eu: plumbum.n39.eu:
pottwal.n39.eu: pottwal.n39.eu:
plumbum.n39.eu:
radon.n39.eu: radon.n39.eu:
unicorn.n39.eu: unicorn.n39.eu:
k3s-c1.n39.eu: k3s-c1.n39.eu:
@ -35,7 +34,6 @@ all:
oganesson.n39.eu: oganesson.n39.eu:
plumbum.n39.eu: plumbum.n39.eu:
pottwal.n39.eu: pottwal.n39.eu:
plumbum.n39.eu:
radon.n39.eu: radon.n39.eu:
unicorn.n39.eu: unicorn.n39.eu:
k3s-c1.n39.eu: k3s-c1.n39.eu:
@ -54,7 +52,6 @@ all:
platon.n39.eu: platon.n39.eu:
plumbum.n39.eu: plumbum.n39.eu:
pottwal.n39.eu: pottwal.n39.eu:
plumbum.n39.eu:
radon.n39.eu: radon.n39.eu:
wittgenstein.n39.eu: wittgenstein.n39.eu:
unicorn.n39.eu: unicorn.n39.eu:

View file

@ -1,17 +1,18 @@
--- ---
# - name: Create a new ext4 primary partition - name: Install required packages
# community.general.parted:
# device: "{{ nfs_host_storage_device }}"
# number: 1
# state: present
# fs_type: ext4
- name: Install nfs-kernel-server
ansible.builtin.apt: ansible.builtin.apt:
state: present state: present
name: name:
- nfs-kernel-server - nfs-kernel-server
- nfs-common - nfs-common
- parted
- name: Create a new ext4 primary partition
community.general.parted:
device: "{{ nfs_host_storage_device }}"
number: 1
state: present
fs_type: ext4
- name: ensure nfs mountpoints exist - name: ensure nfs mountpoints exist
ansible.builtin.file: ansible.builtin.file:
@ -22,6 +23,13 @@
mode: '0777' mode: '0777'
with_items: "{{ nfs_host_exports }}" with_items: "{{ nfs_host_exports }}"
- name: Mount up device by label
ansible.posix.mount:
path: "{{ nfs_host_exports[0].directory }}"
src: /dev/sdb1
fstype: ext4
state: present
- name: template /etc/exports - name: template /etc/exports
ansible.builtin.template: ansible.builtin.template:
src: templates/exports.j2 src: templates/exports.j2