Rework repo - move files around and update play
Updating repo and files to look a bit more on par with the style of ansible I'm used to writing. Removing inventory as it can easily go stale and the homelab env needs to be a bit more dynamic anyway. need to find a good way to manage this but for now, no inventory is better than outdated inv.
This commit is contained in:
@@ -1,11 +1,15 @@
|
||||
- hosts: all
|
||||
---
|
||||
- name: Install and setup Server for media acqusition
|
||||
hosts: all
|
||||
become: true
|
||||
become_user: root
|
||||
vars:
|
||||
pip_install_packages:
|
||||
- name: Docker
|
||||
|
||||
nfs_host: 192.168.0.109
|
||||
nfs_options: "auto,nofail,noatime,nolock,intr,tcp,actimeo=1800"
|
||||
nfs_options:
|
||||
"auto,nofail,noatime,nolock,intr,tcp,actimeo=1800,x-systemd.automount"
|
||||
nfs_mounts:
|
||||
- remote_path: /export/Movies
|
||||
local_path: /mnt/storage/movies
|
||||
@@ -18,7 +22,7 @@
|
||||
- geerlingguy.pip
|
||||
- geerlingguy.docker
|
||||
tasks:
|
||||
- name: Install docker tools
|
||||
- name: Install system packages
|
||||
ansible.builtin.package:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
@@ -54,24 +58,30 @@
|
||||
shell: "{{ item.shell }}"
|
||||
groups: "{{ item.groups }}"
|
||||
loop:
|
||||
- { user: "zware", shell: "/bin/zsh", groups: "sudo,docker" }
|
||||
- { user: "dockeruser", shell: "/bin/bash", groups: "docker" }
|
||||
- {user: "dockeruser",
|
||||
shell: "/bin/bash",
|
||||
groups: "docker"}
|
||||
# zware user should already exist when this is run,
|
||||
# most likely needs ot happen in a cloud init step
|
||||
# - {user: "zware",
|
||||
# shell: "/bin/zsh",
|
||||
# groups: "sudo,docker"}
|
||||
|
||||
- name: Copy docker-compose
|
||||
ansible.builtin.copy:
|
||||
src: docker-compose.yml
|
||||
dest: /opt/docker-compose.yml
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0644"
|
||||
|
||||
- name: Copy env file
|
||||
ansible.builtin.copy:
|
||||
src: environment
|
||||
dest: /opt/environment
|
||||
owner: zware
|
||||
group: zware
|
||||
mode: "0600"
|
||||
src: "{{ item.src }}"
|
||||
dest: "{{ item.dest }}"
|
||||
owner: dockeruser
|
||||
group: dockeruser
|
||||
mode: "{{ item.mode }}"
|
||||
backup: true
|
||||
loop:
|
||||
- {src: "files/docker-compose.yaml",
|
||||
dest: "/opt/docker-compose.yaml",
|
||||
mode: "0644"}
|
||||
- {src: "files/environmnet",
|
||||
dest: "/opt/.env",
|
||||
mode: "0600"}
|
||||
|
||||
- name: Start containers
|
||||
community.docker.docker_compose:
|
||||
|
||||
Reference in New Issue
Block a user