diff options
Diffstat (limited to 'scripts/nfsserver/main.yml')
-rw-r--r-- | scripts/nfsserver/main.yml | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/scripts/nfsserver/main.yml b/scripts/nfsserver/main.yml new file mode 100644 index 0000000..6544bf1 --- /dev/null +++ b/scripts/nfsserver/main.yml @@ -0,0 +1,74 @@ +# Copyright (C) 2015 Kristoffer Gronlund +# +# License: GNU General Public License (GPL) +version: 2.2 +category: NFS +shortdesc: NFS Server +longdesc: | + Configure an NFS server. Requires an existing file system resource, + for example a file system running on LVM on DRBD. + +parameters: + - name: base-id + required: true + shortdesc: Base File System Resource ID + longdesc: The ID of an existing file system resource. + type: resource + value: base-fs + +include: + - name: rootfs + script: exportfs + required: false + shortdesc: NFSv4 Virtual File System Root + parameters: + - name: id + value: exportfs-root + - name: fsid + value: 0 + - name: directory + value: /srv/nfs + - name: options + value: "rw,crossmnt" + + - script: exportfs + required: true + shortdesc: Exported NFS Mount Point + parameters: + - name: id + value: exportfs + - name: directory + value: /srv/nfs/example + - name: options + value: "rw,mountpoint" + - name: wait_for_leasetime_on_stop + value: true + + - script: virtual-ip + required: false + shortdesc: Virtual IP Address Used to Access the NFS Mounts + +actions: + - crm: "configure show {{base-id}}" + shortdesc: Ensure That the File System Resource Exists + - install: nfs-client nfs-kernel-server nfs-utils + shortdesc: Install NFS Packages + - service: + - nfsserver: enable + - nfsserver: start + - include: rootfs + - include: exportfs + - include: virtual-ip + - cib: | + group g-nfs {{exportfs:id}} {{virtual-ip:id}} + order base-then-nfs Mandatory: {{base-id}} g-nfs + colocation nfs-with-base inf: g-nfs {{base-id}} + {{#rootfs}} + clone c-{{rootfs:id}} {{rootfs:id}} + order rootfs-before-nfs Mandatory: c-{{rootfs:id}} g-nfs:start + colocation nfs-with-rootfs inf: g-nfs c-{{rootfs:id}} + {{/rootfs}} + - call: /usr/sbin/exportfs -v + error: Failed to configure NFS exportfs + shortdesc: Check Result of exportfs -v + sudo: true |