diff --git a/playbooks/atlas/init/perma-mount-drives.yml b/playbooks/atlas/init/perma-mount-drives.yml new file mode 100644 index 0000000..34146e3 --- /dev/null +++ b/playbooks/atlas/init/perma-mount-drives.yml @@ -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 }}" } diff --git a/playbooks/atlas/init/system-deps.yml b/playbooks/atlas/init/system-deps.yml new file mode 100644 index 0000000..1305427 --- /dev/null +++ b/playbooks/atlas/init/system-deps.yml @@ -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 + diff --git a/playbooks/atlas/vars/drives.yml b/playbooks/atlas/vars/drives.yml new file mode 100644 index 0000000..24e2ce2 --- /dev/null +++ b/playbooks/atlas/vars/drives.yml @@ -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