diff --git a/ansible.cfg b/ansible.cfg index c4ec182..5a85958 100644 --- a/ansible.cfg +++ b/ansible.cfg @@ -1,4 +1,5 @@ [defaults] +inject_facts_as_vars = false inventory = hosts transport = ssh diff --git a/roles/dav/tasks/main.yml b/roles/dav/tasks/main.yml index fa714cf..d87d9a3 100644 --- a/roles/dav/tasks/main.yml +++ b/roles/dav/tasks/main.yml @@ -8,7 +8,7 @@ - name: Copy config to home directory copy: src: home/ - dest: "{{ ansible_env.HOME }}/" + dest: "{{ ansible_facts.env.HOME }}/" mode: preserve tags: radicale-update notify: Restart Radicale @@ -16,13 +16,13 @@ - name: Copy service config template: src: service.ini.j2 - dest: "{{ ansible_env.HOME }}/etc/services.d/radicale.ini" + dest: "{{ ansible_facts.env.HOME }}/etc/services.d/radicale.ini" notify: Reread service config - name: Copy app config template: src: config.j2 - dest: "{{ ansible_env.HOME }}/radicale/config" + dest: "{{ ansible_facts.env.HOME }}/radicale/config" tags: radicale-update notify: Restart Radicale @@ -52,12 +52,12 @@ - name: Initialize storage repository command: - chdir: "{{ ansible_env.HOME }}/radicale/storage" + chdir: "{{ ansible_facts.env.HOME }}/radicale/storage" cmd: git init - creates: "{{ ansible_env.HOME }}/radicale/storage/.git" + creates: "{{ ansible_facts.env.HOME }}/radicale/storage/.git" - name: Set up garbage collection cronjob cron: name: "Garbage-collection" special_time: weekly - job: git --git-dir {{ ansible_env.HOME }}/radicale/storage/.git gc + job: git --git-dir {{ ansible_facts.env.HOME }}/radicale/storage/.git gc diff --git a/roles/dav/templates/config.j2 b/roles/dav/templates/config.j2 index 44d4f70..33834de 100644 --- a/roles/dav/templates/config.j2 +++ b/roles/dav/templates/config.j2 @@ -3,14 +3,14 @@ hosts = 0.0.0.0:8080 [auth] type = htpasswd -htpasswd_filename = {{ ansible_env.HOME }}/radicale/users +htpasswd_filename = {{ ansible_facts.env.HOME }}/radicale/users htpasswd_encryption = bcrypt realm = bstl DAV - Password Required [rights] type = from_file -file = {{ ansible_env.HOME }}/radicale/rights +file = {{ ansible_facts.env.HOME }}/radicale/rights [storage] -filesystem_folder = {{ ansible_env.HOME }}/radicale/storage +filesystem_folder = {{ ansible_facts.env.HOME }}/radicale/storage hook = git add -A && (git diff --cached --quiet || git commit -m "Changes by "%(user)s) diff --git a/roles/dav/templates/service.ini.j2 b/roles/dav/templates/service.ini.j2 index 25d013c..ca7806d 100644 --- a/roles/dav/templates/service.ini.j2 +++ b/roles/dav/templates/service.ini.j2 @@ -1,4 +1,4 @@ [program:radicale] -command={{ ansible_env.HOME }}/.local/bin/radicale --config {{ ansible_env.HOME }}/radicale/config +command={{ ansible_facts.env.HOME }}/.local/bin/radicale --config {{ ansible_facts.env.HOME }}/radicale/config autostart=yes autorestart=yes diff --git a/roles/git/tasks/main.yml b/roles/git/tasks/main.yml index 798f8b3..43f23af 100644 --- a/roles/git/tasks/main.yml +++ b/roles/git/tasks/main.yml @@ -8,7 +8,7 @@ - name: Copy config to home directory copy: src: home/ - dest: "{{ ansible_env.HOME }}/" + dest: "{{ ansible_facts.env.HOME }}/" mode: preserve tags: gitea-update notify: Restart Gitea @@ -16,13 +16,13 @@ - name: Copy service config template: src: service.ini.j2 - dest: "{{ ansible_env.HOME }}/etc/services.d/gitea.ini" + dest: "{{ ansible_facts.env.HOME }}/etc/services.d/gitea.ini" notify: Reread service config - name: Copy app config template: src: app.ini.j2 - dest: "{{ ansible_env.HOME }}/gitea/custom/conf/app.ini" + dest: "{{ ansible_facts.env.HOME }}/gitea/custom/conf/app.ini" tags: gitea-update notify: Restart Gitea diff --git a/roles/git/templates/app.ini.j2 b/roles/git/templates/app.ini.j2 index 86c1d14..9d7d033 100644 --- a/roles/git/templates/app.ini.j2 +++ b/roles/git/templates/app.ini.j2 @@ -3,7 +3,7 @@ ; date: 2020-01-19 APP_NAME = codesignd Git -RUN_USER = {{ ansible_user_id }} +RUN_USER = {{ ansible_facts.user_id }} RUN_MODE = prod ; Server settings diff --git a/roles/git/templates/service.ini.j2 b/roles/git/templates/service.ini.j2 index d52bc9c..4d7acc8 100644 --- a/roles/git/templates/service.ini.j2 +++ b/roles/git/templates/service.ini.j2 @@ -1,5 +1,5 @@ [program:gitea] -command={{ ansible_env.HOME }}/.linuxbrew/bin/gitea web -environment=GITEA_WORK_DIR={{ ansible_env.HOME }}/gitea +command={{ ansible_facts.env.HOME }}/.linuxbrew/bin/gitea web +environment=GITEA_WORK_DIR={{ ansible_facts.env.HOME }}/gitea autostart=yes autorestart=yes diff --git a/roles/homebrew/tasks/main.yml b/roles/homebrew/tasks/main.yml index a321297..10abc81 100644 --- a/roles/homebrew/tasks/main.yml +++ b/roles/homebrew/tasks/main.yml @@ -3,12 +3,12 @@ git: repo: "https://github.com/Homebrew/brew.git" version: master - dest: "{{ ansible_env.HOME }}/.linuxbrew" + dest: "{{ ansible_facts.env.HOME }}/.linuxbrew" notify: Opt out from Homebrew analytics - name: Install Homebrew formulae homebrew: name: "{{ homebrew_formulae }}" state: latest - path: "{{ ansible_env.HOME}}/.linuxbrew/bin" + path: "{{ ansible_facts.env.HOME}}/.linuxbrew/bin" update_homebrew: yes diff --git a/roles/host-site/tasks/main.yml b/roles/host-site/tasks/main.yml index 16bec7d..3e58074 100644 --- a/roles/host-site/tasks/main.yml +++ b/roles/host-site/tasks/main.yml @@ -3,9 +3,9 @@ import_role: name: snapstromegon.uberspace_web_domain vars: - domain: kodos-{{ ansible_user_id }}.codesignd.net + domain: kodos-{{ ansible_facts.user_id }}.codesignd.net - name: Set up host site template: src: index.html.j2 - dest: /var/www/virtual/{{ ansible_user_id }}/html/index.html + dest: /var/www/virtual/{{ ansible_facts.user_id }}/html/index.html diff --git a/roles/host-site/templates/index.html.j2 b/roles/host-site/templates/index.html.j2 index db899f6..5795672 100644 --- a/roles/host-site/templates/index.html.j2 +++ b/roles/host-site/templates/index.html.j2 @@ -4,7 +4,7 @@ -