From 1bbbd8a95248dc615c50be4ea1d93db712db7447 Mon Sep 17 00:00:00 2001 From: Pim Kunis Date: Tue, 20 Dec 2022 19:58:47 +0100 Subject: [PATCH] remove literal usernames from config files --- README.md | 2 -- roles/nicotine/templates/config.j2 | 16 ++++++++-------- roles/strawberry/tasks/main.yml | 4 ++-- .../strawberry.conf.j2} | 2 +- roles/syncthing/templates/config.xml.j2 | 4 ++-- 5 files changed, 13 insertions(+), 15 deletions(-) rename roles/strawberry/{files/strawberry.conf => templates/strawberry.conf.j2} (99%) diff --git a/README.md b/README.md index a8e92b4..beaa436 100644 --- a/README.md +++ b/README.md @@ -14,8 +14,6 @@ - fuzzy find - thunderbird config - some kind of tag setup with: bootstrap, update etc -- sync music collection -- nicotine+ Would like Ansible Vault to check in keypair for syncthing. However, then I would need a password to unlock the vault. diff --git a/roles/nicotine/templates/config.j2 b/roles/nicotine/templates/config.j2 index fbb85eb..1db8c5b 100644 --- a/roles/nicotine/templates/config.j2 +++ b/roles/nicotine/templates/config.j2 @@ -22,11 +22,11 @@ private_chatrooms = False command_aliases = {} [transfers] -incompletedir = /home/pim/.local/share/nicotine/incomplete -downloaddir = /home/pim/Music -uploaddir = /home/pim/.local/share/nicotine/received +incompletedir = /home/{{ ansible_user_id }}/.local/share/nicotine/incomplete +downloaddir = /home/{{ ansible_user_id }}/Music +uploaddir = /home/{{ ansible_user_id }}/.local/share/nicotine/received usernamesubfolders = False -shared = [('Music', '/home/pim/Music')] +shared = [('Music', '/home/{{ ansible_user_id }}/Music')] buddyshared = [] uploadbandwidth = 50 uselimit = False @@ -97,9 +97,9 @@ onematch = False [logging] debug = False debugmodes = [] -debuglogsdir = /home/pim/.local/share/nicotine/logs/debug +debuglogsdir = /home/{{ ansible_user_id }}/.local/share/nicotine/logs/debug logcollapsed = True -transferslogsdir = /home/pim/.local/share/nicotine/logs/transfers +transferslogsdir = /home/{{ ansible_user_id }}/.local/share/nicotine/logs/transfers rooms_timestamp = %H:%M:%S private_timestamp = %Y-%m-%d %H:%M:%S log_timestamp = %Y-%m-%d %H:%M:%S @@ -107,8 +107,8 @@ privatechat = True chatrooms = True transfers = False debug_file_output = False -roomlogsdir = /home/pim/.local/share/nicotine/logs/rooms -privatelogsdir = /home/pim/.local/share/nicotine/logs/private +roomlogsdir = /home/{{ ansible_user_id }}/.local/share/nicotine/logs/rooms +privatelogsdir = /home/{{ ansible_user_id }}/.local/share/nicotine/logs/private readroomlogs = True readroomlines = 15 readprivatelines = 15 diff --git a/roles/strawberry/tasks/main.yml b/roles/strawberry/tasks/main.yml index 11ad85b..04c8956 100644 --- a/roles/strawberry/tasks/main.yml +++ b/roles/strawberry/tasks/main.yml @@ -24,6 +24,6 @@ recurse: true state: directory - name: Copy configuration file - copy: - src: "{{ role_path }}/files/strawberry.conf" + template: + src: "{{ role_path }}/templates/strawberry.conf.j2" dest: ~/.config/strawberry/strawberry.conf diff --git a/roles/strawberry/files/strawberry.conf b/roles/strawberry/templates/strawberry.conf.j2 similarity index 99% rename from roles/strawberry/files/strawberry.conf rename to roles/strawberry/templates/strawberry.conf.j2 index 1063cd6..0b146a9 100644 --- a/roles/strawberry/files/strawberry.conf +++ b/roles/strawberry/templates/strawberry.conf.j2 @@ -86,7 +86,7 @@ group_by2=4 group_by3=0 group_by_version=1 io_priority=3 -last_path=/home/pim/Music +last_path=/home/{{ ansible_user_id }}/Music mark_songs_unavailable=true monitor=true overwrite_playcount=false diff --git a/roles/syncthing/templates/config.xml.j2 b/roles/syncthing/templates/config.xml.j2 index c2c8ce7..77b047d 100644 --- a/roles/syncthing/templates/config.xml.j2 +++ b/roles/syncthing/templates/config.xml.j2 @@ -1,5 +1,5 @@ - + basic @@ -43,7 +43,7 @@ 4096 - + basic