infra/playbooks/atlas/init/perma-mount-drives.yml
shockrah 7d6fee4781 Adding first 3 steps/playbooks for setting up atlas
Drives are now mounted and services are ready to be spun up at this point
2022-11-08 22:11:12 -08:00

51 lines
1.3 KiB
YAML

# This ensures that the mount points for our docker volumes are present and
# populated correctly
---
- hosts: atlas
become: yes
vars:
filesystem: ext4
tasks:
- name: Fetch vars for getting mount points
include_vars:
file: ../vars/drives.yml
- name: Creat mountpoints for mounted volumes
file:
path: "{{ item }}"
state: directory
owner: ubuntu
loop:
- "{{ CLIPPABLE_MOUNT_POINT }}"
- "{{ FILEBROWSER_MOUNT_POINT }}"
- name: Partition Devices
community.general.parted:
device: "{{ item }}"
number: 1
label: gpt
part_start: 0%
part_end: 100%
name: data
loop:
- "{{ FILEBROWSER_DRIVE }}"
- "{{ CLIPPABLE_DRIVE }}"
- name: Format the drive for use
community.general.filesystem:
dev: "{{ item }}"
fstype: "{{ filesystem }}"
loop:
- "{{ FILEBROWSER_DRIVE }}"
- "{{ CLIPPABLE_DRIVE }}"
- name: Permanently Mount Drives
mount:
state: mounted
path: "{{ item.dst }}"
src: "{{ item.src }}"
fstype: "{{ filesystem }}"
loop:
- { src: "{{ FILEBROWSER_DRIVE }}", dst: "{{ FILEBROWSER_MOUNT_POINT }}" }
- { src: "{{ CLIPPABLE_DRIVE }}", dst: "{{ CLIPPABLE_MOUNT_POINT }}" }