diff --git a/tasks/docker/docker.yml b/tasks/docker/docker.yml index 3ba24b4..e949530 100644 --- a/tasks/docker/docker.yml +++ b/tasks/docker/docker.yml @@ -39,10 +39,15 @@ register: secret_key_cmd when: mastodon_secret_key_base == '' +- name: Set mastodon_secret_key_base + set_fact: + mastodon_secret_key_base: "{{ secret_key_cmd.stdout }}" + when: mastodon_secret_key_base == '' + - name: Add secret key to Mastodon config lineinfile: path: "{{ mastodon_composer_folder }}/.env.production" - line: "SECRET_KEY_BASE={{ secret_key_cmd.stdout }}" + line: "SECRET_KEY_BASE={{ mastodon_secret_key_base }}" regexp: "^SECRET_KEY_BASE=" backup: yes @@ -53,10 +58,15 @@ register: otp_key_cmd when: mastodon_otp_secret == '' +- name: Set mastodon_otp_secret + set_fact: + mastodon_otp_secret: "{{ otp_key_cmd.stdout }}" + when: mastodon_otp_secret == '' + - name: Add OTP key to Mastodon config lineinfile: path: "{{ mastodon_composer_folder }}/.env.production" - line: "OTP_SECRET={{ otp_key_cmd.stdout }}" + line: "OTP_SECRET={{ mastodon_otp_secret }}" regexp: "^OTP_SECRET=" backup: yes @@ -67,10 +77,15 @@ register: paperclip_key_cmd when: mastodon_paperclip_secret == '' +- name: Set mastodon_paperclip_secret + set_fact: + mastodon_paperclip_secret: "{{ otppaperclip_key_cmd_key_cmd.stdout }}" + when: mastodon_paperclip_secret == '' + - name: Add Paperclip key to Mastodon config lineinfile: path: "{{ mastodon_composer_folder }}/.env.production" - line: "PAPERCLIP_SECRET={{ paperclip_key_cmd.stdout }}" + line: "PAPERCLIP_SECRET={{ mastodon_paperclip_secret }}" regexp: "^PAPERCLIP_SECRET=" backup: yes @@ -81,17 +96,27 @@ register: vapid_key_cmd when: vapid_public_key == '' +- name: Set vapid_public_key + set_fact: + vapid_public_key: "{{ vapid_key_cmd.stdout_lines[1] }}" + when: vapid_public_key == '' + +- name: Set vapid_private_key + set_fact: + vapid_private_key: "{{ vapid_key_cmd.stdout_lines[0] }}" + when: vapid_private_key == '' + - name: Add Paperclip private key to Mastodon config lineinfile: path: "{{ mastodon_composer_folder }}/.env.production" - line: "{{ vapid_key_cmd.stdout_lines[0] }}" + line: "{{ vapid_private_key }}" regexp: "^VAPID_PRIVATE_KEY=" backup: yes - name: Add Paperclip public key to Mastodon config lineinfile: path: "{{ mastodon_composer_folder }}/.env.production" - line: "{{ vapid_key_cmd.stdout_lines[1] }}" + line: "{{ vapid_public_key }}" regexp: "^VAPID_PUBLIC_KEY=" backup: yes