aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools/testbed-setup/playbooks/files/salt
diff options
context:
space:
mode:
Diffstat (limited to 'resources/tools/testbed-setup/playbooks/files/salt')
-rw-r--r--resources/tools/testbed-setup/playbooks/files/salt/etc/salt/minion.d/testlocal.conf3
-rw-r--r--resources/tools/testbed-setup/playbooks/files/salt/srv/salt/ckoester/nfs-server.sls3
-rw-r--r--resources/tools/testbed-setup/playbooks/files/salt/srv/salt/ckoester/nfs-server/configure.sls31
-rw-r--r--resources/tools/testbed-setup/playbooks/files/salt/srv/salt/ckoester/nfs-server/files/exports12
-rw-r--r--resources/tools/testbed-setup/playbooks/files/salt/srv/salt/ckoester/nfs-server/install.sls5
5 files changed, 54 insertions, 0 deletions
diff --git a/resources/tools/testbed-setup/playbooks/files/salt/etc/salt/minion.d/testlocal.conf b/resources/tools/testbed-setup/playbooks/files/salt/etc/salt/minion.d/testlocal.conf
new file mode 100644
index 0000000000..fce910cc0b
--- /dev/null
+++ b/resources/tools/testbed-setup/playbooks/files/salt/etc/salt/minion.d/testlocal.conf
@@ -0,0 +1,3 @@
+file_roots:
+ base:
+ - /srv/salt/
diff --git a/resources/tools/testbed-setup/playbooks/files/salt/srv/salt/ckoester/nfs-server.sls b/resources/tools/testbed-setup/playbooks/files/salt/srv/salt/ckoester/nfs-server.sls
new file mode 100644
index 0000000000..bf3e47f9b3
--- /dev/null
+++ b/resources/tools/testbed-setup/playbooks/files/salt/srv/salt/ckoester/nfs-server.sls
@@ -0,0 +1,3 @@
+include:
+ - ckoester.nfs-server.install
+ - ckoester.nfs-server.configure
diff --git a/resources/tools/testbed-setup/playbooks/files/salt/srv/salt/ckoester/nfs-server/configure.sls b/resources/tools/testbed-setup/playbooks/files/salt/srv/salt/ckoester/nfs-server/configure.sls
new file mode 100644
index 0000000000..ce362a38b2
--- /dev/null
+++ b/resources/tools/testbed-setup/playbooks/files/salt/srv/salt/ckoester/nfs-server/configure.sls
@@ -0,0 +1,31 @@
+/nfs:
+ file.directory:
+ - user: root
+ - group: root
+ - mode: 755
+
+/nfs/scratch:
+ file.directory:
+ - user: root
+ - group: root
+ - mode: 1777
+
+/nfs/ro:
+ file.directory:
+ - user: virl
+ - group: virl
+ - mode: 755
+
+/etc/exports:
+ file.managed:
+ - mode: 644
+ - template: jinja
+ - source: "salt://ckoester/nfs-server/files/exports"
+
+nfs_server_running:
+ service.running:
+ - name: nfs-kernel-server
+
+update_exports:
+ cmd.run:
+ - name: exportfs -ra
diff --git a/resources/tools/testbed-setup/playbooks/files/salt/srv/salt/ckoester/nfs-server/files/exports b/resources/tools/testbed-setup/playbooks/files/salt/srv/salt/ckoester/nfs-server/files/exports
new file mode 100644
index 0000000000..23802be486
--- /dev/null
+++ b/resources/tools/testbed-setup/playbooks/files/salt/srv/salt/ckoester/nfs-server/files/exports
@@ -0,0 +1,12 @@
+# /etc/exports: the access control list for filesystems which may be exported
+# to NFS clients. See exports(5).
+#
+# Example for NFSv2 and NFSv3:
+# /srv/homes hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_subtree_check)
+#
+# Example for NFSv4:
+# /srv/nfs4 gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check)
+# /srv/nfs4/homes gss/krb5i(rw,sync,no_subtree_check)
+#
+/nfs/scratch {{ salt['pillar.get']('virl:l2_network', salt['grains.get']('l2_network', '172.16.1.0/24' )) }}(rw,no_root_squash,no_subtree_check) {{ salt['pillar.get']('virl:l2_network2', salt['grains.get']('l2_network2', '172.16.2.0/24' )) }}(rw,no_root_squash,no_subtree_check) {{ salt['pillar.get']('virl:l3_network', salt['grains.get']('l3_network', '172.16.3.0/24' )) }}(rw,no_root_squash,no_subtree_check)
+/nfs/ro *(ro,no_root_squash,no_subtree_check)
diff --git a/resources/tools/testbed-setup/playbooks/files/salt/srv/salt/ckoester/nfs-server/install.sls b/resources/tools/testbed-setup/playbooks/files/salt/srv/salt/ckoester/nfs-server/install.sls
new file mode 100644
index 0000000000..0f136346f8
--- /dev/null
+++ b/resources/tools/testbed-setup/playbooks/files/salt/srv/salt/ckoester/nfs-server/install.sls
@@ -0,0 +1,5 @@
+nfs-kernel-server install:
+ pkg.installed:
+ - skip_verify: True
+ - refresh: False
+ - name: nfs-kernel-server