mirror of
https://github.com/khuedoan/homelab.git
synced 2024-12-22 21:44:46 +07:00
Add minio for tfstate
This commit is contained in:
parent
2f0bad6533
commit
468aad25db
@ -0,0 +1,43 @@
|
||||
- name: Create a tfstate container
|
||||
delegate_to: localhost
|
||||
lxd_container:
|
||||
name: tfstate
|
||||
state: started
|
||||
source:
|
||||
type: image
|
||||
mode: pull
|
||||
server: https://images.linuxcontainers.org
|
||||
alias: ubuntu/focal/amd64
|
||||
wait_for_ipv4_addresses: yes
|
||||
url: "https://{{ hostvars[groups['metal'][0]]['ansible_host'] }}:8443"
|
||||
|
||||
- name: Download minio
|
||||
delegate_to: tfstate
|
||||
get_url:
|
||||
url: https://dl.min.io/server/minio/release/linux-amd64/minio
|
||||
dest: /usr/bin/minio
|
||||
mode: 0755
|
||||
|
||||
- name: Generate minio config file
|
||||
delegate_to: tfstate
|
||||
template:
|
||||
src: minio.env.j2
|
||||
dest: /etc/default/minio
|
||||
|
||||
- name: Generate minio service file
|
||||
delegate_to: tfstate
|
||||
template:
|
||||
src: minio.service.j2
|
||||
dest: /etc/systemd/system/minio.service
|
||||
|
||||
- name: Enable and start the Minio service
|
||||
delegate_to: tfstate
|
||||
service:
|
||||
name: minio
|
||||
state: started
|
||||
enabled: true
|
||||
|
||||
# - name: Start minio
|
||||
# template:
|
||||
# src: etcd.j2
|
||||
# dest: /etc/default/etcd
|
2
metal/roles/tfstate/templates/minio.env.j2
Normal file
2
metal/roles/tfstate/templates/minio.env.j2
Normal file
@ -0,0 +1,2 @@
|
||||
MINIO_ROOT_USER=admin
|
||||
MINIO_ROOT_PASSWORD=password
|
9
metal/roles/tfstate/templates/minio.service.j2
Normal file
9
metal/roles/tfstate/templates/minio.service.j2
Normal file
@ -0,0 +1,9 @@
|
||||
[Unit]
|
||||
Description=Minio
|
||||
StartLimitIntervalSec=60
|
||||
StartLimitBurst=5
|
||||
|
||||
[Service]
|
||||
EnvironmentFile=/etc/default/minio
|
||||
ExecStart=/usr/bin/minio server server /var/lib/minio/
|
||||
Restart=always
|
@ -8,3 +8,6 @@ metal1 ansible_host=192.168.50.3
|
||||
[metal:vars]
|
||||
ansible_user=root
|
||||
subnet=192.168.50.0/24
|
||||
|
||||
[lxd]
|
||||
tfstate ansible_connection=lxd
|
||||
|
Loading…
Reference in New Issue
Block a user