X Tutup
Skip to content
This repository was archived by the owner on Mar 7, 2025. It is now read-only.

Commit c14d0b5

Browse files
committed
Settings: Settings Migrator - Replace {{ user }} with {{ user.name }}
1 parent 9588b35 commit c14d0b5

File tree

3 files changed

+33
-2
lines changed

3 files changed

+33
-2
lines changed

roles/settings/tasks/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838
include_tasks: "subtasks/settings_migrator.yml"
3939
with_items:
4040
- "accounts.yml"
41+
- "settings.yml"
42+
- "adv_settings.yml"
4143
- "backup_config.yml"
4244

4345
- name: Initialize empty lists and vars

roles/settings/tasks/subtasks/settings_migrator.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,21 @@
2828
become_user: "{{ cloudbox_yml.stat.pw_name }}"
2929
when: file_is_encrypted
3030

31+
- name: Settings Migrator | Global Migrations for all files
32+
block:
33+
34+
# Replace {{ user }} with {{ user.name }}
35+
- name: Settings Migrator | Global | Migration 01
36+
include_tasks: "settings_migrator/global/migration_01.yml"
37+
3138
- name: Settings Migrator | Migrations for 'accounts.yml'
3239
block:
3340

34-
# Move 'user,passwd,domain,email' to 'user' key
41+
# Move 'user,passwd,domain,email' to 'user' key
3542
- name: Settings Migrator | accounts.yml | Migration 01
3643
include_tasks: "settings_migrator/accounts_yml/migration_01.yml"
3744

38-
# Move 'cloudflare_api_token' to 'cloudflare' key
45+
# Move 'cloudflare_api_token' to 'cloudflare' key
3946
- name: Settings Migrator | accounts.yml | Migration 02
4047
include_tasks: "settings_migrator/accounts_yml/migration_02.yml"
4148

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#########################################################################
2+
# Title: Settings Migrator | Global | Migration 01 #
3+
# Author(s): desimaniac #
4+
# URL: https://github.com/cloudbox/cloudbox #
5+
# -- #
6+
# Part of the Cloudbox project: https://cloudbox.works #
7+
#########################################################################
8+
# GNU General Public License v3.0 #
9+
#########################################################################
10+
---
11+
- name: Settings Migrator | Global | Migration 01 |
12+
Replace '{% raw -%}{{ user }}{%- endraw %}' with '{% raw -%}{{ user.name }}{%- endraw %}'
13+
replace:
14+
path: "{{ playbook_dir }}/{{ item }}"
15+
regexp: '{% raw -%}{{\s*user\s*}}{%- endraw %}'
16+
replace: '{% raw -%}{{ user.name }}{%- endraw %}'
17+
owner: "{{ cloudbox_yml.stat.uid }}"
18+
group: "{{ cloudbox_yml.stat.gid }}"
19+
mode: 0664
20+
21+
- name: Settings Migrator | Global | Migration 01 | Re-import Variables
22+
include_vars: "{{ playbook_dir }}/{{ item }}"

0 commit comments

Comments
 (0)
X Tutup