diff --git a/host_vars/bowle.binary.kitchen b/host_vars/bowle.binary.kitchen new file mode 100644 index 0000000..a7af3f0 --- /dev/null +++ b/host_vars/bowle.binary.kitchen @@ -0,0 +1,7 @@ +--- + +nfs_exports: +- /exports/backup/bk 172.23.1.60(rw,sync,no_subtree_check) +- /exports/backup/rz 172.23.9.61(rw,sync,no_subtree_check) + +uau_reboot: "false" diff --git a/hosts b/hosts index 667a3c5..9518249 100644 --- a/hosts +++ b/hosts @@ -6,7 +6,7 @@ sulis.binary.kitchen ansible_host=172.23.2.5 nabia.binary.kitchen ansible_host=172.23.2.6 pizza.binary.kitchen ansible_host=172.23.2.33 bob.binary.kitchen ansible_host=172.23.2.37 -bowle.binary.kitchen ansible_host=172.23.2.62 ansible_python_interpreter=/usr/local/bin/python2.7 +bowle.binary.kitchen ansible_host=172.23.2.62 salat.binary.kitchen ansible_host=172.23.9.61 [fan_rz] helium.binary-kitchen.net diff --git a/roles/fileserver/handlers/main.yml b/roles/fileserver/handlers/main.yml new file mode 100644 index 0000000..25ce307 --- /dev/null +++ b/roles/fileserver/handlers/main.yml @@ -0,0 +1,4 @@ +--- + +- name: Reload nfs-server + service: name=nfs-erver state=reloaded diff --git a/roles/fileserver/tasks/main.yml b/roles/fileserver/tasks/main.yml new file mode 100644 index 0000000..39f31f8 --- /dev/null +++ b/roles/fileserver/tasks/main.yml @@ -0,0 +1,24 @@ +--- + +# TODO +# enable non-free and contrib in order to properly install zfs-dkms + +- name: Install ZFS + apt: + name: + - zfs-dkms + +- name: Install NFS and SMB + apt: + name: + - nfs-kernel-server + - samba + +- name: Configure NFS + template: + src: exports.j2 + dest: /etc/exports + notify: Reload nfs-server + +# TODO +# configure SMB diff --git a/roles/fileserver/templates/exports.j2 b/roles/fileserver/templates/exports.j2 new file mode 100644 index 0000000..7852f3d --- /dev/null +++ b/roles/fileserver/templates/exports.j2 @@ -0,0 +1,4 @@ +# {{ ansible_managed }} +{% for item in nfs_exports %} +{{ item }} +{% endfor %} diff --git a/site.yml b/site.yml index a37578a..0c16cc5 100644 --- a/site.yml +++ b/site.yml @@ -8,7 +8,7 @@ - root_keys - name: Setup unattended updates - hosts: [sulis.binary.kitchen, nabia.binary.kitchen, bob.binary.kitchen, beryllium.binary-kitchen.net, boron.binary-kitchen.net, carbon.binary-kitchen.net, nitrogen.binary-kitchen.net, oxygen.binary-kitchen.net, fluorine.binary-kitchen.net, sodium.binary-kitchen.net, krypton.binary-kitchen.net, yttrium.binary-kitchen.net, zirconium.binary-kitchen.net, molybdenum.binary-kitchen.net, technetium.binary-kitchen.net, ruthenium.binary-kitchen.net, barium.binary-kitchen.net] + hosts: [sulis.binary.kitchen, nabia.binary.kitchen, bob.binary.kitchen, bowle.binary.kitchen, beryllium.binary-kitchen.net, boron.binary-kitchen.net, carbon.binary-kitchen.net, nitrogen.binary-kitchen.net, oxygen.binary-kitchen.net, fluorine.binary-kitchen.net, neon.binary-kitchen.net, sodium.binary-kitchen.net, krypton.binary-kitchen.net, yttrium.binary-kitchen.net, zirconium.binary-kitchen.net, molybdenum.binary-kitchen.net, technetium.binary-kitchen.net, ruthenium.binary-kitchen.net, barium.binary-kitchen.net] roles: - uau @@ -43,6 +43,11 @@ roles: - drone_runner +- name: Setup file server + hosts: bowle.binary.kitchen + roles: + - fileserver + - name: Setup ldap server hosts: helium.binary-kitchen.net roles: