added sshpass_cron, updates, secrets

This commit is contained in:
Bastian de Byl
2023-07-21 17:54:58 -04:00
parent 34a6a7f7ae
commit 71e9f4590b
8 changed files with 75 additions and 2 deletions

3
.vscode/settings.json vendored Normal file
View File

@@ -0,0 +1,3 @@
{
"ansible.python.interpreterPath": "/home/bastian/src/deploy_home/.venv/bin/python"
}

View File

@@ -11,6 +11,7 @@ photos_path: "{{ podman_volumes }}/photos"
pihole_path: "{{ podman_volumes }}/pihole"
factorio_path: "{{ podman_volumes }}/factorio"
fulfillr_path: "{{ podman_volumes }}/fulfillr"
sshpass_cron_path: "{{ podman_volumes }}/sshpass_cron"
drone_server_proto: "http"
drone_runner_capacity: "8"

View File

@@ -0,0 +1,4 @@
0 5 * * * sshpass -f /mnt/unifi-pass ssh -o 'StrictHostKeyChecking=no' ubnt@Garage.localdomain 'reboot'
15 5 * * * sshpass -f /mnt/unifi-pass ssh -o 'StrictHostKeyChecking=no' ubnt@LivingRoom.localdomain 'reboot'
30 5 * * * sshpass -f /mnt/unifi-pass ssh -o 'StrictHostKeyChecking=no' ubnt@FrontYard.localdomain 'reboot'
45 5 * * * sshpass -f /mnt/unifi-pass ssh -o 'StrictHostKeyChecking=no' ubnt@Office.localdomain 'reboot'

View File

@@ -59,7 +59,7 @@
become_user: "{{ podman_user }}"
containers.podman.podman_container:
name: bookstack
image: docker.io/solidnerd/bookstack:22.11.1
image: docker.io/solidnerd/bookstack:23.6
recreate: true
restart: false
restart_policy: on-failure:3

View File

@@ -37,7 +37,7 @@
become_user: "{{ podman_user }}"
containers.podman.podman_container:
name: fulfillr
image: "{{ aws_ecr_endpoint }}/fulfillr:20230710.1937"
image: "{{ aws_ecr_endpoint }}/fulfillr:20230711.1654"
image_strict: true
command: --config /config/production.json
recreate: true

View File

@@ -0,0 +1,64 @@
---
- name: create sshpass_cron host directory volumes
become: true
ansible.builtin.file:
path: "{{ item }}"
state: directory
owner: "{{ podman_user }}"
group: "{{ podman_user }}"
mode: 0755
notify: restorecon podman
loop:
- "{{ sshpass_cron_path }}"
tags: sshpass_cron
- name: copy sshpass_cron crontab
become: true
ansible.builtin.template:
src: "files/sshpass_cron/{{ item }}"
dest: "{{ sshpass_cron_path }}/{{ item }}"
owner: "{{ podman_user }}"
group: "{{ podman_user }}"
mode: 0644
loop:
- crontab
notify:
- restorecon podman
tags: sshpass_cron
- name: create sshpass_cron password file
become: true
ansible.builtin.copy:
dest: "{{ sshpass_cron_path }}/unifi-pass"
content: "{{ unifi_ssh_password }}"
owner: "{{ podman_user }}"
group: "{{ podman_user }}"
mode: 0400
notify:
- restorecon podman
tags: sshpass_cron
- name: flush handlers
ansible.builtin.meta: flush_handlers
tags: sshpass_cron
- name: create sshpass_cron container
become: true
become_user: "{{ podman_user }}"
containers.podman.podman_container:
name: sshpass_cron
image: docker.io/bdebyl/sshpass-cron:1.0.9
image_strict: true
recreate: true
restart: true
restart_policy: on-failure:3
log_driver: journald
volumes:
- "{{ sshpass_cron_path }}:/mnt"
tags: sshpass_cron
- name: create systemd startup job for sshpass_cron
include_tasks: systemd-generate.yml
vars:
container_name: sshpass_cron
tags: sshpass_cron

View File

@@ -14,3 +14,4 @@
- import_tasks: container-fulfillr.yml
- import_tasks: container-nginx.yml
- import_tasks: container-factorio.yml
- import_tasks: container-sshpass-cron.yml

Binary file not shown.