From a3f14e61d5ba5fa3e9164cae0b777ddd7433f688 Mon Sep 17 00:00:00 2001 From: Simon Cornet Date: Tue, 21 Apr 2026 17:20:24 +0200 Subject: [PATCH] feat: initial commit --- .gitignore | 1 + meta/main.yaml | 12 +++++++++++ readme.md | 3 +++ renovate.json | 4 ++++ tasks/cleanup.yaml | 14 +++++++++++++ tasks/main.yaml | 9 +++++++++ tasks/rustfs.yaml | 50 ++++++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 93 insertions(+) create mode 100644 .gitignore create mode 100644 meta/main.yaml create mode 100644 readme.md create mode 100644 renovate.json create mode 100644 tasks/cleanup.yaml create mode 100644 tasks/main.yaml create mode 100644 tasks/rustfs.yaml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..904cae8 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.ansible diff --git a/meta/main.yaml b/meta/main.yaml new file mode 100644 index 0000000..88dd9d3 --- /dev/null +++ b/meta/main.yaml @@ -0,0 +1,12 @@ +--- + +galaxy_info: + author: "siempie" + description: "install and configure rustfs server" + license: "MIT" + role_name: "rustfs" +dependencies: + - name: "docker" + src: "https://gitlab.simoncor.net/ansible/ans-docker.git" + scm: "git" + version: "main" diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..ec08d91 --- /dev/null +++ b/readme.md @@ -0,0 +1,3 @@ +# Ansible Role: RustFS + +Install and configure [RustFS](https://github.com/your-rustfs-repo) - a filesystem service. diff --git a/renovate.json b/renovate.json new file mode 100644 index 0000000..91260cb --- /dev/null +++ b/renovate.json @@ -0,0 +1,4 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": [ "local>cicd/renovate:ansible" ] +} diff --git a/tasks/cleanup.yaml b/tasks/cleanup.yaml new file mode 100644 index 0000000..d2d89f5 --- /dev/null +++ b/tasks/cleanup.yaml @@ -0,0 +1,14 @@ +--- + +# cleanup +- name: "docker - prune all" + community.docker.docker_prune: + containers: true + images: true + networks: true + volumes: true + builder_cache: true + +- name: "docker - force prune" + ansible.builtin.command: "docker system prune --all --force --volumes" + changed_when: false diff --git a/tasks/main.yaml b/tasks/main.yaml new file mode 100644 index 0000000..afe7a7f --- /dev/null +++ b/tasks/main.yaml @@ -0,0 +1,9 @@ +--- + +# install rustfs +- name: "install rustfs" + ansible.builtin.import_tasks: "rustfs.yaml" + +# cleanup docker +- name: "cleanup docker" + ansible.builtin.import_tasks: "cleanup.yaml" diff --git a/tasks/rustfs.yaml b/tasks/rustfs.yaml new file mode 100644 index 0000000..87284b2 --- /dev/null +++ b/tasks/rustfs.yaml @@ -0,0 +1,50 @@ +--- + +# create directories +- name: "create rustfs directories" + ansible.builtin.file: + path: "{{ item }}" + state: "directory" + mode: "0755" + loop: + - "/mnt/rustfs/data" + +# run rustfs +- name: "run rustfs" + community.docker.docker_container: + + # docker defaults + auto_remove: "no" + container_default_behavior: "no_defaults" + detach: "yes" + init: "no" + interactive: "no" + log_driver: "json-file" + log_options: + max-size: "10m" + max-file: "3" + memory: "0" + paused: "no" + privileged: "no" + pull: "always" + read_only: "no" + state: "started" + tty: "no" + + # rustfs + name: "rustfs" + image: "docker.io/fosrl/rustfs:1.0.0-alpha.97" + image_name_mismatch: "recreate" + restart_policy: "unless-stopped" + network_mode: "host" + volumes: + - "/mnt/rustfs/data:/data" + + ports: + - "9000:9000/tcp" + - "9001:9001/tcp" + + env: + + # global + TZ: "{{ timezone }}"