Adding first 3 steps/playbooks for setting up atlas

Drives are now mounted and services are ready to be spun up at this point
This commit is contained in:
shockrah 2022-11-08 22:11:12 -08:00
parent 3ef52017c1
commit 7d6fee4781
3 changed files with 94 additions and 0 deletions

View File

@ -0,0 +1,50 @@
# 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 }}" }

View File

@ -0,0 +1,39 @@
# This playbook downloads all the basic requirements to give containers
# an environment where they can be brought up safely. We focus primarily
# on the host with this playbook
---
- hosts: atlas
become: yes
become_method: sudo
tasks:
- name: Install docker dependencies
apt:
name: "{{item}}"
update_cache: yes
loop:
- apt-transport-https
- ca-certificates
- curl
- gnupg
- software-properties-common
- lsb-release
- name: Install docker GPG key
apt_key:
url: https://download.docker.com/linux/ubuntu/gpg
state: present
- name: Add Docker Apt Repo
apt_repository:
repo: deb https://download.docker.com/linux/ubuntu impish stable
state: present
- name: Install Docker components
apt:
name: "{{item}}"
update_cache: yes
loop:
- docker-ce
- docker-ce-cli
- containerd.io

View File

@ -0,0 +1,5 @@
# These vars are really only used to configure the host for the first time
CLIPPABLE_MOUNT_POINT: /mnt/clippable
CLIPPABLE_DRIVE: /dev/nvme1n1
FILEBROWSER_DRIVE: /dev/nvme2n1
FILEBROWSER_MOUNT_POINT: /mnt/filebrowser