refactor: standardize YAML formatting and improve readability in Ansible tasks
Some checks failed
Ansible Lint Check / check-ansible (push) Failing after 18s
Nix Format Check / check-format (push) Successful in 58s
Python Lint Check / check-python (push) Failing after 15s

This commit is contained in:
Menno van Leeuwen 2025-03-24 18:31:46 +01:00
parent 243eb1688d
commit 79909cd3c5
Signed by: vleeuwenmenno
SSH Key Fingerprint: SHA256:OJFmjANpakwD3F2Rsws4GLtbdz1TJ5tkQF0RZmF0TRE
3 changed files with 23 additions and 12 deletions

View File

@ -1,3 +1,4 @@
---
- name: Check if JuiceFS is already installed - name: Check if JuiceFS is already installed
ansible.builtin.command: which juicefs ansible.builtin.command: which juicefs
register: juicefs_check register: juicefs_check
@ -7,7 +8,7 @@
- name: Install JuiceFS using the automatic installer - name: Install JuiceFS using the automatic installer
ansible.builtin.shell: curl -sSL https://d.juicefs.com/install | sh - ansible.builtin.shell: curl -sSL https://d.juicefs.com/install | sh -
args: args:
warn: false # Suppress warnings about using shell/curl warn: false # Suppress warnings about using shell/curl
register: juicefs_installation register: juicefs_installation
when: juicefs_check.rc != 0 when: juicefs_check.rc != 0
become: true become: true
@ -22,20 +23,21 @@
ansible.builtin.file: ansible.builtin.file:
path: /mnt/object_storage path: /mnt/object_storage
state: directory state: directory
mode: '0755' mode: "0755"
become: true become: true
- name: Create cache directory - name: Create cache directory
ansible.builtin.file: ansible.builtin.file:
path: /var/jfsCache path: /var/jfsCache
state: directory state: directory
mode: '0755' mode: "0755"
become: true become: true
- name: Set JuiceFS facts - name: Set JuiceFS facts
ansible.builtin.set_fact: ansible.builtin.set_fact:
hetzner_access_key: "{{ lookup('community.general.onepassword', 'mfk2qgnaplgtk6xmfc3r6w6neq', vault='j7nmhqlsjmp2r6umly5t75hzb4', field='AWS_ACCESS_KEY_ID') }}" hetzner_access_key: "{{ lookup('community.general.onepassword', 'mfk2qgnaplgtk6xmfc3r6w6neq', vault='j7nmhqlsjmp2r6umly5t75hzb4', field='AWS_ACCESS_KEY_ID') }}"
hetzner_secret_key: "{{ lookup('community.general.onepassword', 'mfk2qgnaplgtk6xmfc3r6w6neq', vault='j7nmhqlsjmp2r6umly5t75hzb4', field='AWS_SECRET_ACCESS_KEY') }}" hetzner_secret_key: "{{ lookup('community.general.onepassword', 'mfk2qgnaplgtk6xmfc3r6w6neq', vault='j7nmhqlsjmp2r6umly5t75hzb4', field='AWS_SECRET_ACCESS_KEY')
}}"
redis_password: "{{ lookup('community.general.onepassword', '4cioblm633bdkl6put35lk6ql4', vault='j7nmhqlsjmp2r6umly5t75hzb4', field='password') }}" redis_password: "{{ lookup('community.general.onepassword', '4cioblm633bdkl6put35lk6ql4', vault='j7nmhqlsjmp2r6umly5t75hzb4', field='password') }}"
- name: Include JuiceFS Redis tasks - name: Include JuiceFS Redis tasks
@ -47,7 +49,7 @@
dest: /etc/systemd/system/juicefs.service dest: /etc/systemd/system/juicefs.service
owner: root owner: root
group: root group: root
mode: '0644' mode: "0644"
become: true become: true
- name: Reload systemd daemon - name: Reload systemd daemon

View File

@ -21,19 +21,27 @@
# Database settings # Database settings
seafile_mysql_db_host: "db" seafile_mysql_db_host: "db"
seafile_mysql_root_password: "{{ lookup('community.general.onepassword', 'bbzudwdo3byqs4pscd2wy7qsn4', vault='j7nmhqlsjmp2r6umly5t75hzb4', field='MYSQL_ROOT_PASSWORD') }}" seafile_mysql_root_password: >
{{ lookup('community.general.onepassword', 'bbzudwdo3byqs4pscd2wy7qsn4',
vault='j7nmhqlsjmp2r6umly5t75hzb4', field='MYSQL_ROOT_PASSWORD') }}
seafile_mysql_db_user: "seafile" seafile_mysql_db_user: "seafile"
seafile_mysql_db_password: "{{ lookup('community.general.onepassword', 'bbzudwdo3byqs4pscd2wy7qsn4', vault='j7nmhqlsjmp2r6umly5t75hzb4', field='MYSQL_PASSWORD') }}" seafile_mysql_db_password: >
{{ lookup('community.general.onepassword', 'bbzudwdo3byqs4pscd2wy7qsn4',
vault='j7nmhqlsjmp2r6umly5t75hzb4', field='MYSQL_PASSWORD') }}
# Server settings # Server settings
time_zone: "Europe/Amsterdam" time_zone: "Europe/Amsterdam"
jwt_private_key: "{{ lookup('community.general.onepassword', 'bbzudwdo3byqs4pscd2wy7qsn4', vault='j7nmhqlsjmp2r6umly5t75hzb4', field='jwt_private_key') }}" jwt_private_key: >
{{ lookup('community.general.onepassword', 'bbzudwdo3byqs4pscd2wy7qsn4',
vault='j7nmhqlsjmp2r6umly5t75hzb4', field='jwt_private_key') }}
seafile_server_hostname: "sf.mvl.sh" seafile_server_hostname: "sf.mvl.sh"
seafile_server_protocol: "https" seafile_server_protocol: "https"
# Admin credentials # Admin credentials
seafile_admin_email: "menno@vleeuwen.me" seafile_admin_email: "menno@vleeuwen.me"
seafile_admin_password: "{{ lookup('community.general.onepassword', 'bbzudwdo3byqs4pscd2wy7qsn4', vault='j7nmhqlsjmp2r6umly5t75hzb4', field='password') }}" seafile_admin_password: >
{{ lookup('community.general.onepassword', 'bbzudwdo3byqs4pscd2wy7qsn4',
vault='j7nmhqlsjmp2r6umly5t75hzb4', field='password') }}
- name: Create Seafile directories - name: Create Seafile directories
ansible.builtin.file: ansible.builtin.file:

View File

@ -11,14 +11,14 @@
ansible.builtin.file: ansible.builtin.file:
path: /etc/apt/keyrings path: /etc/apt/keyrings
state: directory state: directory
mode: '0755' mode: "0755"
become: true become: true
- name: Import Mozilla APT repo signing key - name: Import Mozilla APT repo signing key
ansible.builtin.get_url: ansible.builtin.get_url:
url: https://packages.mozilla.org/apt/repo-signing-key.gpg url: https://packages.mozilla.org/apt/repo-signing-key.gpg
dest: /etc/apt/keyrings/packages.mozilla.org.asc dest: /etc/apt/keyrings/packages.mozilla.org.asc
mode: '0644' mode: "0644"
become: true become: true
- name: Add Mozilla APT repository - name: Add Mozilla APT repository
@ -26,6 +26,7 @@
path: /etc/apt/sources.list.d/mozilla.list path: /etc/apt/sources.list.d/mozilla.list
line: "deb [signed-by=/etc/apt/keyrings/packages.mozilla.org.asc] https://packages.mozilla.org/apt mozilla main" line: "deb [signed-by=/etc/apt/keyrings/packages.mozilla.org.asc] https://packages.mozilla.org/apt mozilla main"
create: true create: true
mode: "0644"
become: true become: true
- name: Set Firefox package priority - name: Set Firefox package priority
@ -39,7 +40,7 @@
Package: firefox* Package: firefox*
Pin: release o=Ubuntu Pin: release o=Ubuntu
Pin-Priority: -1 Pin-Priority: -1
mode: '0644' mode: "0644"
become: true become: true
- name: Update apt cache - name: Update apt cache