51 lines
1.2 KiB
YAML
Executable File
51 lines
1.2 KiB
YAML
Executable File
---
|
|
- hosts: localhost
|
|
become: true
|
|
|
|
tasks:
|
|
- name: mount data nfs
|
|
ansible.posix.mount:
|
|
path: /mnt/share
|
|
src: 192.168.0.20:/mnt/pool/data
|
|
fstype: nfs
|
|
opts: defaults,auto,rw
|
|
state: present
|
|
- name: mount media nfs
|
|
ansible.posix.mount:
|
|
path: /mnt/media
|
|
src: 192.168.0.20:/mnt/pool/media
|
|
fstype: nfs
|
|
opts: defaults,auto,rw
|
|
state: present
|
|
- name: Update apt and install gui apps
|
|
apt:
|
|
pkg:
|
|
- ansible
|
|
- curl
|
|
- git
|
|
- tmux
|
|
- docker
|
|
- docker-compose
|
|
- neovim
|
|
- fzf
|
|
state: latest
|
|
update_cache: true
|
|
- name: setup backup
|
|
ansible.builtin.cron:
|
|
minute: "0"
|
|
hour: "4"
|
|
name: "backup"
|
|
user: "root"
|
|
job: "/bin/bash '/mnt/share/services/scripts/backup.sh'"
|
|
cron_file: backup
|
|
- name: start docker main
|
|
become: true
|
|
ansible.builtin.shell:
|
|
cmd: "docker-compose -f docker-compose.yml up -d"
|
|
chdir: /mnt/share/services/docker/
|
|
- name: delay startup of machine by 30 secs
|
|
ansible.builtin.shell: |
|
|
echo '[Service]
|
|
ExecStartPre/bin/sleep 30' > /etc/systemd/system/docker.service.d/override.conf # syemctl edit docker.server
|
|
|