From 13a1231b91b4ee5b9490787403ad9078a51f9080 Mon Sep 17 00:00:00 2001 From: tiff Date: Thu, 7 Mar 2024 20:07:01 -0500 Subject: [PATCH] Add Ansible section --- ansible/README.md | 12 ++++++++++++ ansible/playbooks/common/auto-mount-nfs.yml | 21 +++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 ansible/README.md create mode 100644 ansible/playbooks/common/auto-mount-nfs.yml diff --git a/ansible/README.md b/ansible/README.md new file mode 100644 index 0000000..e8c34eb --- /dev/null +++ b/ansible/README.md @@ -0,0 +1,12 @@ +# Ansible Playbooks + +> [!NOTE] +> Links to videos and articles about how others have built their home labs, as well as a link to my home lab building series. + +Ansible Playbooks allow us to automate redundant server tasks as code. + +If you're curious about Ansible and how it works, below are some excellent YouTube channels and videos that will give you a better understanding of how to use them. + +- [Automate Everything with Ansible! (Ansible for Beginners)](https://youtu.be/w9eCU4bGgjQ) +- [The Fastest Way to run Kubernetes at Home - k3s Ansible Automation - Kubernetes in your HomeLab](https://youtu.be/CbkEWcUZ7zM) +- [Ansible 101](https://www.youtube.com/playlist?list=PL2_OBreMn7FqZkvMYt6ATmgC0KAGGJNAN) \ No newline at end of file diff --git a/ansible/playbooks/common/auto-mount-nfs.yml b/ansible/playbooks/common/auto-mount-nfs.yml new file mode 100644 index 0000000..e118518 --- /dev/null +++ b/ansible/playbooks/common/auto-mount-nfs.yml @@ -0,0 +1,21 @@ +- hosts: localhost + vars: + nfs_version: 3 # to force nfs version to 3. + roles: + - role: ome.nfs_mount + nfs_share_mounts: + - path: /mnt/remote + location: nfs.example.org:/data + # remove a mount from a server + - path: /mnt/remote_old + location: nfs.example.org:/data1337 + state: absent + - path: /mnt/readonly + location: nfs.example.org:/read-only + opts: "{{ nfs_mount_opts }},ro" + - path: /mnt/ex_passno + location: nfs.example.org:/ex_passno + passno: 0 + - path: /mnt/ex_dump + location: nfs.example.org:/ex_dump + dump: 0 \ No newline at end of file