feat: add minio machine
This commit is contained in:
parent
fd44bd54a5
commit
c48fdfe84f
5 changed files with 54 additions and 7 deletions
BIN
.env.agebox
BIN
.env.agebox
Binary file not shown.
|
|
@ -1,5 +1,6 @@
|
||||||
# Repo management tasks
|
# Repo management tasks
|
||||||
mod repo '.devfiles/justfile'
|
mod repo '.devfiles/justfile'
|
||||||
|
set dotenv-load := true
|
||||||
|
|
||||||
export ANSIBLE_VAULT_PASSWORD_FILE := justfile_directory() + "/.decrypt-pass.txt"
|
export ANSIBLE_VAULT_PASSWORD_FILE := justfile_directory() + "/.decrypt-pass.txt"
|
||||||
export ANSIBLE_BECOME_PASSWORD_FILE := justfile_directory() + "/.become-pass.txt"
|
export ANSIBLE_BECOME_PASSWORD_FILE := justfile_directory() + "/.become-pass.txt"
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,15 @@ homelab:
|
||||||
ansible_become_method: doas
|
ansible_become_method: doas
|
||||||
children:
|
children:
|
||||||
docker:
|
docker:
|
||||||
|
|
||||||
|
storage:
|
||||||
|
children: s3
|
||||||
|
|
||||||
|
s3:
|
||||||
|
vars:
|
||||||
|
ansible_become_method: doas
|
||||||
hosts:
|
hosts:
|
||||||
10.0.10.101:
|
10.0.10.160
|
||||||
|
|
||||||
docker:
|
docker:
|
||||||
vars:
|
vars:
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,15 @@
|
||||||
# docs: https://registry.terraform.io/providers/bpg/proxmox/latest/docs/resources/virtual_environment_container
|
# docs: https://registry.terraform.io/providers/bpg/proxmox/latest/docs/resources/virtual_environment_container
|
||||||
|
|
||||||
resource "proxmox_virtual_environment_container" "banana-hoard" {
|
variable "vm_names" {
|
||||||
vm_id = 160
|
type = list(string)
|
||||||
|
default = ["donkey-kong"]
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "proxmox_virtual_environment_container" "vm" {
|
||||||
|
for_each = toset(var.vm_names)
|
||||||
|
vm_id = 160 + index(var.vm_names, each.key)
|
||||||
node_name = "pve"
|
node_name = "pve"
|
||||||
description = "S3 data storage manager"
|
description = "S3 data storage"
|
||||||
unprivileged = true
|
unprivileged = true
|
||||||
|
|
||||||
start_on_boot = "true"
|
start_on_boot = "true"
|
||||||
|
|
@ -14,17 +20,16 @@ resource "proxmox_virtual_environment_container" "banana-hoard" {
|
||||||
}
|
}
|
||||||
|
|
||||||
initialization {
|
initialization {
|
||||||
hostname = "banana-hoard"
|
hostname = each.key
|
||||||
|
|
||||||
ip_config {
|
ip_config {
|
||||||
ipv4 {
|
ipv4 {
|
||||||
address = "10.0.10.60/24"
|
address = "10.0.10.${160 + index(var.vm_names, each.key)}/24"
|
||||||
gateway = "10.0.0.10"
|
gateway = "10.0.0.10"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
user_account {
|
user_account {
|
||||||
# keys = [data.localfile.aleidk_key_pub.filename."/home/aleidk/Repos/Private/homelab/"]
|
|
||||||
password = var.root_password
|
password = var.root_password
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
34
playbooks/storage/s3.yaml
Normal file
34
playbooks/storage/s3.yaml
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
# yaml-language-server: $schema=https://raw.githubusercontent.com/ansible/ansible-lint/refs/heads/main/src/ansiblelint/schemas/playbook.json
|
||||||
|
|
||||||
|
---
|
||||||
|
- name: Setup S3 storage
|
||||||
|
hosts: s3
|
||||||
|
tasks:
|
||||||
|
- name: Install MinIO
|
||||||
|
become: true
|
||||||
|
apk:
|
||||||
|
name: minio
|
||||||
|
update_cache: yes
|
||||||
|
|
||||||
|
- name: Create MinIO directories
|
||||||
|
become: true
|
||||||
|
file:
|
||||||
|
path: /data/minio
|
||||||
|
state: directory
|
||||||
|
owner: minio
|
||||||
|
group: minio
|
||||||
|
mode: '0755'
|
||||||
|
|
||||||
|
- name: Configure MinIO
|
||||||
|
copy:
|
||||||
|
dest: /etc/default/minio
|
||||||
|
content: |
|
||||||
|
MINIO_VOLUMES="/data/minio/"
|
||||||
|
MINIO_OPTS="--address :9000"
|
||||||
|
|
||||||
|
- name: Enable and start MinIO service
|
||||||
|
service:
|
||||||
|
name: minio
|
||||||
|
enabled: yes
|
||||||
|
state: started
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue