refactor: prepare peertube installation

This commit is contained in:
VC
2024-07-05 11:53:36 +02:00
parent 476696646f
commit aeaf00a6d0
7 changed files with 17 additions and 15 deletions

View File

@@ -4,4 +4,7 @@
hosts: mastodonservers hosts: mastodonservers
diff: true diff: true
roles: roles:
- nodejs
- yarn
- redis
- mastodon - mastodon

View File

@@ -1,14 +1,5 @@
--- ---
- name: Install nodejs
ansible.builtin.include_tasks: nodejs.yml
- name: Install yarn
ansible.builtin.include_tasks: yarn.yml
- name: Install redis
ansible.builtin.include_tasks: redis.yml
- name: Create mastodon user - name: Create mastodon user
ansible.builtin.user: ansible.builtin.user:
name: mastodon name: mastodon

View File

@@ -2,19 +2,19 @@
- name: Get node source gpg url - name: Get node source gpg url
ansible.builtin.get_url: ansible.builtin.get_url:
url: "{{ mastodon_nodejs_key_url }}" url: "{{ nodejs_key_url }}"
dest: /tmp/nodesource.gpg.key dest: /tmp/nodesource.gpg.key
force: true force: true
mode: 0644 mode: 0644
- name: Dearmor gpg key - name: Dearmor gpg key
ansible.builtin.command: ansible.builtin.command:
cmd: "gpg --dearmor --yes -o {{ mastodon_nodejs_key_path }} /tmp/nodesource.gpg.key" cmd: "gpg --dearmor --yes -o {{ nodejs_key_path }} /tmp/nodesource.gpg.key"
changed_when: true changed_when: true
- name: Set node source repo - name: Set node source repo
ansible.builtin.copy: ansible.builtin.copy:
content: "deb [signed-by={{ mastodon_nodejs_key_path }}] https://deb.nodesource.com/node_16.x {{ ansible_facts['distribution_release'] }} main" content: "deb [signed-by={{ nodejs_key_path }}] https://deb.nodesource.com/node_16.x {{ ansible_facts['distribution_release'] }} main"
dest: /etc/apt/sources.list.d/nodesource.list dest: /etc/apt/sources.list.d/nodesource.list
mode: 0644 mode: 0644

View File

@@ -0,0 +1,4 @@
---
nodejs_key_url: "https://deb.nodesource.com/gpgkey/nodesource.gpg.key"
nodejs_key_path: "/usr/share/keyrings/nodesource.gpg"

View File

@@ -2,19 +2,19 @@
- name: Get yarn gpg url - name: Get yarn gpg url
ansible.builtin.get_url: ansible.builtin.get_url:
url: "{{ mastodon_yarn_key_url }}" url: "{{ yarn_key_url }}"
dest: /tmp/yarn.gpg.key dest: /tmp/yarn.gpg.key
mode: 0644 mode: 0644
force: true force: true
- name: Dearmor gpg key - name: Dearmor gpg key
ansible.builtin.command: ansible.builtin.command:
cmd: "gpg --dearmor --yes -o {{ mastodon_yarn_key_path }} /tmp/yarn.gpg.key" cmd: "gpg --dearmor --yes -o {{ yarn_key_path }} /tmp/yarn.gpg.key"
changed_when: true changed_when: true
- name: Set yarn source repo - name: Set yarn source repo
ansible.builtin.copy: ansible.builtin.copy:
content: "deb [signed-by={{ mastodon_yarn_key_path }}] https://dl.yarnpkg.com/debian stable main" content: "deb [signed-by={{ yarn_key_path }}] https://dl.yarnpkg.com/debian stable main"
dest: /etc/apt/sources.list.d/yarn.list dest: /etc/apt/sources.list.d/yarn.list
mode: 0644 mode: 0644

4
roles/yarn/vars/main.yml Normal file
View File

@@ -0,0 +1,4 @@
---
yarn_key_url: "https://dl.yarnpkg.com/debian/pubkey.gpg"
yarn_key_path: "/usr/share/keyrings/yarnkey.gpg"