homelab/ansible/playbooks/nas.yml

39 lines
960 B
YAML
Raw Normal View History

2022-12-10 10:07:18 +00:00
---
2024-01-13 17:34:04 +00:00
- name: gather all
hosts: all
2024-01-13 17:32:02 +00:00
- name: NAS playbook
hosts: NAS
2022-12-10 10:07:18 +00:00
vars:
# certbot_force: true
2024-01-13 17:32:02 +00:00
pre_tasks:
2024-02-04 20:23:17 +00:00
- name: Ensure base NFS directory exist
ansible.builtin.file:
path: "{{ item }}"
state: directory
2024-02-20 18:31:36 +00:00
loop: "{{ nas_bind_source }}"
2024-02-04 20:23:17 +00:00
become: true
2024-02-20 18:31:36 +00:00
- name: Bind NAS export
2024-01-13 17:32:02 +00:00
ansible.posix.mount:
2024-02-20 18:31:36 +00:00
path: "{{ nas_bind_target }}/{{ item.split('/')[-1] }}"
2024-01-13 17:34:04 +00:00
src: "{{ item }}"
2024-01-13 17:32:02 +00:00
opts: bind
fstype: none
state: mounted
2024-02-20 18:31:36 +00:00
loop: "{{ nas_bind_source }}"
2024-01-13 17:34:04 +00:00
become: true
- name: create nomad folder
2024-02-20 18:31:36 +00:00
ansible.builtin.file:
path: "{{ nas_bind_target }}/nomad/{{ item.name }}"
owner: "{{ item.owner }}"
state: directory
loop: "{{ NAS_nomad_folder }}"
become: true
2022-12-10 10:07:18 +00:00
roles:
2024-01-13 17:32:02 +00:00
- role: ansible-role-nfs
2023-11-15 18:24:32 +00:00
become: true
2024-01-13 17:32:02 +00:00
- role: ansible-role-vsftpd
2023-11-15 18:24:32 +00:00
become: true
2024-02-13 19:31:56 +00:00
- role: vladgh.samba.server
become: true