feat: Add hortusfox
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
---
|
||||
# Unable to use ansible.builtin.lineinfile, because we need to run this through the proxmox host (because SSH is not enabled duh)
|
||||
|
||||
- name: Pause for 10 seconds to wait for SSH server
|
||||
ansible.builtin.pause:
|
||||
seconds: 10
|
||||
|
||||
- name: Allow SSH into LXC
|
||||
ansible.builtin.command: lxc-attach -n 652 -- sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
|
||||
|
||||
- name: Restart SSH Service
|
||||
ansible.builtin.command: lxc-attach -n 652 service ssh restart
|
||||
@@ -0,0 +1,20 @@
|
||||
---
|
||||
- name: Create directory for docker-compose
|
||||
ansible.builtin.file:
|
||||
path: /root/docker/
|
||||
state: directory
|
||||
mode: "0755"
|
||||
|
||||
- name: Copy docker-compose file
|
||||
template:
|
||||
src: "docker-compose.yml"
|
||||
dest: /root/docker/docker-compose.yml
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0755
|
||||
|
||||
- name: Run docker-compose
|
||||
ansible.builtin.shell:
|
||||
args:
|
||||
cmd: docker compose up -d
|
||||
chdir: /root/docker/
|
||||
@@ -0,0 +1,36 @@
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
app:
|
||||
image: ghcr.io/danielbrendel/hortusfox-web:latest
|
||||
ports:
|
||||
- "80:80"
|
||||
volumes:
|
||||
- /data/app_images:/var/www/html/public/img
|
||||
- /data/app_logs:/var/www/html/app/logs
|
||||
- /data/app_backup:/var/www/html/public/backup
|
||||
- /data/app_themes:/var/www/html/public/themes
|
||||
- /data/app_migrate:/var/www/html/app/migrations
|
||||
environment:
|
||||
APP_ADMIN_EMAIL: "plants@lino.cooking"
|
||||
APP_ADMIN_PASSWORD: "80743f00-fc3f-4ff9-b579-9ff6423329f6"
|
||||
APP_TIMEZONE: "UTC"
|
||||
DB_HOST: db
|
||||
DB_PORT: 3306
|
||||
DB_DATABASE: 8ed24d6cecb041e39644a97ffe12c9b9
|
||||
DB_USERNAME: 0371adb8a28e440e9099d590174eeea9
|
||||
DB_PASSWORD: 4e58cd57c65a46eebbc9acf6eacef900
|
||||
DB_CHARSET: "utf8mb4"
|
||||
depends_on:
|
||||
- db
|
||||
|
||||
db:
|
||||
image: mariadb
|
||||
restart: always
|
||||
environment:
|
||||
MARIADB_ROOT_PASSWORD: 999b4cc867524b61bbcdc6a3dc809f9b
|
||||
MARIADB_DATABASE: 8ed24d6cecb041e39644a97ffe12c9b9
|
||||
MARIADB_USER: 0371adb8a28e440e9099d590174eeea9
|
||||
MARIADB_PASSWORD: 4e58cd57c65a46eebbc9acf6eacef900
|
||||
volumes:
|
||||
- /data/db:/var/lib/mysql
|
||||
@@ -0,0 +1,27 @@
|
||||
---
|
||||
- name: Get convenience script
|
||||
uri:
|
||||
url: "https://get.docker.com"
|
||||
method: GET
|
||||
dest: /tmp/get-docker.sh
|
||||
mode: a+x
|
||||
creates: /tmp/get-docker.sh
|
||||
|
||||
- name: Execute script
|
||||
ansible.builtin.shell: /tmp/get-docker.sh
|
||||
|
||||
- name: Ensure group "docker" exists
|
||||
ansible.builtin.group:
|
||||
name: docker
|
||||
state: present
|
||||
|
||||
- name: Add root user to docker group
|
||||
ansible.builtin.user:
|
||||
name: root
|
||||
groups: docker
|
||||
append: yes
|
||||
|
||||
- name: Enable docker on startup
|
||||
ansible.builtin.shell: |
|
||||
systemctl enable docker.service
|
||||
systemctl enable containerd.service
|
||||
@@ -0,0 +1,30 @@
|
||||
---
|
||||
- name: Create container
|
||||
community.general.proxmox:
|
||||
vmid: 652
|
||||
node: purah
|
||||
api_user: root@pam
|
||||
api_password: "{{ proxmox_api_password }}"
|
||||
api_host: 10.0.2.2
|
||||
password: "{{ lxc_password }}"
|
||||
hostname: hortusfox
|
||||
ostemplate: "local:vztmpl/debian-12-standard_12.12-1_amd64.tar.zst"
|
||||
netif: "{'net0':'name=eth0,\
|
||||
gw=10.0.0.1,\
|
||||
ip=10.0.2.52/21,\
|
||||
hwaddr=cc:c6:cf:de:20:52,\
|
||||
bridge=vmbr0'}"
|
||||
cores: 2
|
||||
memory: 4196
|
||||
unprivileged: no
|
||||
swap: 0
|
||||
searchdomain: "home"
|
||||
onboot: 1
|
||||
features:
|
||||
- nesting=1
|
||||
- keyctl=1
|
||||
disk: purah-mirror-860gb:20
|
||||
mounts: '{
|
||||
"mp0":"purah-mirror-860gb:10,mp=/data,backup=1"
|
||||
}'
|
||||
force: yes
|
||||
@@ -0,0 +1,27 @@
|
||||
---
|
||||
- name: Stop container
|
||||
community.general.proxmox:
|
||||
vmid: "{{ vmid }}"
|
||||
api_user: root@pam
|
||||
api_password: "{{ proxmox_api_password }}"
|
||||
api_host: 10.0.2.2
|
||||
state: stopped
|
||||
ignore_errors: true
|
||||
timeout: 90
|
||||
|
||||
- name: Remove containers
|
||||
community.general.proxmox:
|
||||
vmid: "{{ vmid }}"
|
||||
api_user: root@pam
|
||||
api_password: "{{ proxmox_api_password }}"
|
||||
api_host: 10.0.2.2
|
||||
state: absent
|
||||
ignore_errors: true
|
||||
timeout: 90
|
||||
|
||||
- name: Remove .ssh/known_hosts lines
|
||||
ansible.builtin.lineinfile:
|
||||
path: /Users/lino.silva/.ssh/known_hosts
|
||||
state: absent
|
||||
regexp: "^10.0.2.52"
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
---
|
||||
- name: Start deployments
|
||||
community.general.proxmox:
|
||||
vmid: "{{ vmid }}"
|
||||
api_user: root@pam
|
||||
api_password: "{{ proxmox_api_password }}"
|
||||
api_host: 10.0.2.2
|
||||
state: started
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
- name: Update all packages to their latest version
|
||||
become: true
|
||||
ansible.builtin.apt:
|
||||
update_cache: yes
|
||||
upgrade: full
|
||||
Reference in New Issue
Block a user