2026-SEP-16
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
---
|
||||
- name: Create rustfs directory
|
||||
ansible.builtin.file:
|
||||
path: "{{ node['home_path'] }}/{{ item }}"
|
||||
state: "directory"
|
||||
owner: "{{ services['rustfs']['subuid'] }}"
|
||||
group: "{{ node['group'] }}"
|
||||
mode: "0770"
|
||||
loop:
|
||||
- "data/containers/rustfs"
|
||||
- "data/containers/rustfs/data"
|
||||
become: true
|
||||
|
||||
- name: Register secret value to podman secret
|
||||
containers.podman.podman_secret:
|
||||
name: "RUSTFS_SECRET_KEY"
|
||||
data: "{{ hostvars['console']['rustfs']['password']['rustfs'] }}"
|
||||
state: "present"
|
||||
force: true
|
||||
notify: "notification_restart_rustfs"
|
||||
no_log: true
|
||||
|
||||
- name: Pull image
|
||||
containers.podman.podman_image:
|
||||
name: "docker.io/rustfs/rustfs"
|
||||
tag: "{{ version['containers']['rustfs'] }}"
|
||||
state: "present"
|
||||
pull: true
|
||||
|
||||
- name: Deploy container file
|
||||
ansible.builtin.template:
|
||||
src: "{{ hostvars['console']['node']['config_path'] }}/services/containers/infra/rustfs/rustfs.container.j2"
|
||||
dest: "{{ node['home_path'] }}/.config/containers/systemd/rustfs.container"
|
||||
owner: "{{ ansible_user }}"
|
||||
group: "{{ node['group'] }}"
|
||||
mode: "0644"
|
||||
notify: "notification_restart_rustfs"
|
||||
|
||||
- name: Enable rustfs
|
||||
ansible.builtin.systemd:
|
||||
name: "rustfs.service"
|
||||
state: "started"
|
||||
enabled: true
|
||||
daemon_reload: true
|
||||
scope: "user"
|
||||
|
||||
- name: Check container archive images
|
||||
ansible.builtin.stat:
|
||||
path: "{{ node['home_path'] }}/archives/containers/docker.io_rustfs_rustfs_{{ version['containers']['rustfs'] }}.tar"
|
||||
register: container_archive_images
|
||||
|
||||
- name: Save container archive images
|
||||
containers.podman.podman_save:
|
||||
image:
|
||||
- "docker.io/rustfs/rustfs:{{ version['containers']['rustfs'] }}"
|
||||
dest: "{{ node['home_path'] }}/archives/containers/docker.io_rustfs_rustfs_{{ version['containers']['rustfs'] }}.tar"
|
||||
format: "oci-archive"
|
||||
force: false
|
||||
when: not container_archive_images.stat.exists
|
||||
|
||||
- name: Fetch container archive images
|
||||
ansible.builtin.fetch:
|
||||
src: "{{ node['home_path'] }}/archives/containers/docker.io_rustfs_rustfs_{{ version['containers']['rustfs'] }}.tar"
|
||||
dest: "{{ hostvars['console']['node']['data_path'] }}/images/containers/"
|
||||
flat: true
|
||||
Reference in New Issue
Block a user