Add minio for tfstate

This commit is contained in:
Khue Doan 2021-02-22 00:25:06 +07:00
parent 2f0bad6533
commit 468aad25db
4 changed files with 57 additions and 0 deletions

View File

@ -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

View File

@ -0,0 +1,2 @@
MINIO_ROOT_USER=admin
MINIO_ROOT_PASSWORD=password

View 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

View File

@ -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