style: make ansible-lint happier
This commit is contained in:
@@ -1,39 +1,41 @@
|
||||
---
|
||||
|
||||
- name: install nodejs
|
||||
include_tasks: nodejs.yml
|
||||
- name: Install nodejs
|
||||
ansible.builtin.include_tasks: nodejs.yml
|
||||
|
||||
- name: install yarn
|
||||
include_tasks: yarn.yml
|
||||
- name: Install yarn
|
||||
ansible.builtin.include_tasks: yarn.yml
|
||||
|
||||
- name: install redis
|
||||
include_tasks: redis.yml
|
||||
- name: Install redis
|
||||
ansible.builtin.include_tasks: redis.yml
|
||||
|
||||
- name: mastodon user
|
||||
user:
|
||||
- name: Mastodon user
|
||||
ansible.builtin.user:
|
||||
name: mastodon
|
||||
comment: "John Mastodon"
|
||||
password: '!'
|
||||
shell: /bin/bash
|
||||
home: "{{ mastodon_home }}"
|
||||
|
||||
- name: mastodon .ssh dir
|
||||
file:
|
||||
- name: Mastodon .ssh dir
|
||||
ansible.builtin.file:
|
||||
state: directory
|
||||
path: "{{ mastodon_home }}/.ssh"
|
||||
mode: 0755
|
||||
owner: mastodon
|
||||
group: mastodon
|
||||
|
||||
- name: ssh for mastodon user
|
||||
copy:
|
||||
- name: Ssh for mastodon user
|
||||
ansible.builtin.copy:
|
||||
remote_src: true
|
||||
src: /root/.ssh/authorized_keys
|
||||
dest: "{{ mastodon_home }}/.ssh/authorized_keys"
|
||||
mode: 0644
|
||||
owner: mastodon
|
||||
group: mastodon
|
||||
|
||||
- name: install prereq
|
||||
apt:
|
||||
- name: Install prereq
|
||||
ansible.builtin.apt:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
loop:
|
||||
@@ -64,8 +66,8 @@
|
||||
- libicu-dev
|
||||
- libjemalloc-dev
|
||||
|
||||
- name: install rbenv
|
||||
include_tasks: rbenv.yml
|
||||
- name: Install rbenv
|
||||
ansible.builtin.include_tasks: rbenv.yml
|
||||
|
||||
- name: install mastodon
|
||||
include_tasks: mastodon.yml
|
||||
- name: Install mastodon
|
||||
ansible.builtin.include_tasks: mastodon.yml
|
||||
|
@@ -1,44 +1,46 @@
|
||||
---
|
||||
|
||||
- name: git mastodon
|
||||
- name: Git mastodon
|
||||
remote_user: mastodon
|
||||
git:
|
||||
ansible.builtin.git:
|
||||
repo: "https://github.com/mastodon/mastodon.git"
|
||||
dest: "{{ mastodon_home }}/live"
|
||||
version: "v{{ mastodon_version }}"
|
||||
|
||||
- name: bundle config command
|
||||
- name: Bundle config command
|
||||
remote_user: mastodon
|
||||
shell: |
|
||||
bash -lic "bundle config deployment 'true' && bundle config without 'development test'"
|
||||
args:
|
||||
ansible.builtin.command:
|
||||
cmd: |
|
||||
bash -lic "bundle config deployment 'true' && bundle config without 'development test'"
|
||||
creates: "{{ mastodon_home }}/.bundle/config"
|
||||
chdir: "{{ mastodon_home }}/live"
|
||||
|
||||
- name: bundle install
|
||||
- name: Bundle install
|
||||
remote_user: mastodon
|
||||
shell: |
|
||||
bash -lic "bundle install -j$(getconf _NPROCESSORS_ONLN)"
|
||||
args:
|
||||
ansible.builtin.command:
|
||||
cmd: |
|
||||
bash -lic "bundle install -j$(getconf _NPROCESSORS_ONLN)"
|
||||
chdir: "{{ mastodon_home }}/live"
|
||||
changed_when: true
|
||||
|
||||
- name: yarn install
|
||||
- name: Yarn install
|
||||
remote_user: mastodon
|
||||
shell: |
|
||||
bash -lic "yarn install --pure-lockfile"
|
||||
args:
|
||||
ansible.builtin.command:
|
||||
cmd: |
|
||||
bash -lic "yarn install --pure-lockfile"
|
||||
chdir: "{{ mastodon_home }}/live"
|
||||
changed_when: true
|
||||
|
||||
- name: create bin dir
|
||||
- name: Create bin dir
|
||||
remote_user: mastodon
|
||||
file:
|
||||
ansible.builtin.file:
|
||||
path: "{{ mastodon_home }}/bin"
|
||||
state: directory
|
||||
mode: '0750'
|
||||
|
||||
- name: template scripts
|
||||
- name: Template scripts
|
||||
remote_user: mastodon
|
||||
template:
|
||||
ansible.builtin.template:
|
||||
src: "{{ item }}.j2"
|
||||
dest: "{{ mastodon_home }}/bin/{{ item }}"
|
||||
mode: '0750'
|
||||
@@ -46,17 +48,18 @@
|
||||
- remove_media.sh
|
||||
- remove_preview_cards.sh
|
||||
|
||||
- name: install services
|
||||
template:
|
||||
- name: Install services
|
||||
ansible.builtin.template:
|
||||
src: "{{ item }}.j2"
|
||||
dest: "/etc/systemd/system/{{ item }}"
|
||||
mode: 0644
|
||||
loop: &mastodon_services
|
||||
- "mastodon-sidekiq.service"
|
||||
- "mastodon-streaming.service"
|
||||
- "mastodon-web.service"
|
||||
|
||||
- name: run services
|
||||
systemd:
|
||||
- name: Run services
|
||||
ansible.builtin.systemd:
|
||||
name: "{{ item }}"
|
||||
daemon_reload: true
|
||||
state: started
|
||||
|
@@ -1,21 +1,25 @@
|
||||
---
|
||||
|
||||
- name: get node source gpg url
|
||||
get_url:
|
||||
- name: Get node source gpg url
|
||||
ansible.builtin.get_url:
|
||||
url: "{{ mastodon_nodejs_key_url }}"
|
||||
dest: /tmp/nodesource.gpg.key
|
||||
force: true
|
||||
mode: 0644
|
||||
|
||||
- name: gpg dearmor key
|
||||
shell: "gpg --dearmor --yes -o {{ mastodon_nodejs_key_path }} /tmp/nodesource.gpg.key"
|
||||
- name: Gpg dearmor key
|
||||
ansible.builtin.command:
|
||||
cmd: "gpg --dearmor --yes -o {{ mastodon_nodejs_key_path }} /tmp/nodesource.gpg.key"
|
||||
changed_when: true
|
||||
|
||||
- name: node source repo
|
||||
copy:
|
||||
- name: Node source repo
|
||||
ansible.builtin.copy:
|
||||
content: "deb [signed-by={{ mastodon_nodejs_key_path }}] https://deb.nodesource.com/node_16.x {{ ansible_facts['distribution_release'] }} main"
|
||||
dest: /etc/apt/sources.list.d/nodesource.list
|
||||
mode: 0644
|
||||
|
||||
- name: install nodejs
|
||||
apt:
|
||||
- name: Install nodejs
|
||||
ansible.builtin.apt:
|
||||
name: nodejs
|
||||
state: present
|
||||
update_cache: true
|
||||
|
@@ -1,38 +1,39 @@
|
||||
---
|
||||
|
||||
- name: git rbenv
|
||||
- name: Git rbenv
|
||||
remote_user: mastodon
|
||||
git:
|
||||
ansible.builtin.git:
|
||||
repo: "https://github.com/rbenv/rbenv.git"
|
||||
dest: "{{ mastodon_home }}/.rbenv"
|
||||
single_branch: true
|
||||
version: master
|
||||
|
||||
- name: git ruby-build
|
||||
- name: Git ruby-build
|
||||
remote_user: mastodon
|
||||
git:
|
||||
ansible.builtin.git:
|
||||
repo: https://github.com/rbenv/ruby-build.git
|
||||
dest: "{{ mastodon_home }}/.rbenv/plugins/ruby-build"
|
||||
single_branch: true
|
||||
version: master
|
||||
|
||||
- name: append env to mastodon bashrc
|
||||
- name: Append env to mastodon bashrc
|
||||
remote_user: mastodon
|
||||
lineinfile:
|
||||
ansible.builtin.lineinfile:
|
||||
path: "{{ mastodon_home }}/.bashrc"
|
||||
line: "eval \"$({{ mastodon_home }}/.rbenv/bin/rbenv init - bash)\""
|
||||
|
||||
- name: install ruby version
|
||||
- name: Install ruby version
|
||||
remote_user: mastodon
|
||||
shell: "bash -lic 'rbenv install {{ mastodon_ruby_version }}'"
|
||||
ansible.builtin.shell: "bash -lic 'rbenv install {{ mastodon_ruby_version }}'"
|
||||
args:
|
||||
executable: /bin/bash
|
||||
creates: "~/.rbenv/versions/{{ mastodon_ruby_version }}/bin/ruby"
|
||||
environment:
|
||||
RUBY_CONFIGURE_OPTS: "--with-jemalloc"
|
||||
|
||||
- name: install bundler for ruby
|
||||
- name: Install bundler for ruby
|
||||
remote_user: mastodon
|
||||
shell: "bash -lic 'rbenv global {{ mastodon_ruby_version }} && ruby --version && gem install bundler --no-document'"
|
||||
ansible.builtin.shell: "bash -lic 'rbenv global {{ mastodon_ruby_version }} && ruby --version && gem install bundler --no-document'"
|
||||
changed_when: true
|
||||
args:
|
||||
executable: /bin/bash
|
||||
|
@@ -1,12 +1,12 @@
|
||||
---
|
||||
|
||||
- name: install redis
|
||||
apt:
|
||||
- name: Install redis
|
||||
ansible.builtin.apt:
|
||||
name: redis
|
||||
state: present
|
||||
update_cache: true
|
||||
|
||||
- name: start redis service
|
||||
service:
|
||||
- name: Start redis service
|
||||
ansible.builtin.service:
|
||||
name: redis
|
||||
state: started
|
||||
|
@@ -1,21 +1,25 @@
|
||||
---
|
||||
|
||||
- name: get yarn gpg url
|
||||
get_url:
|
||||
- name: Get yarn gpg url
|
||||
ansible.builtin.get_url:
|
||||
url: "{{ mastodon_yarn_key_url }}"
|
||||
dest: /tmp/yarn.gpg.key
|
||||
mode: 0644
|
||||
force: true
|
||||
|
||||
- name: gpg dearmor key
|
||||
shell: "gpg --dearmor --yes -o {{ mastodon_yarn_key_path }} /tmp/yarn.gpg.key"
|
||||
- name: Gpg dearmor key
|
||||
ansible.builtin.command:
|
||||
cmd: "gpg --dearmor --yes -o {{ mastodon_yarn_key_path }} /tmp/yarn.gpg.key"
|
||||
changed_when: true
|
||||
|
||||
- name: yarn source repo
|
||||
copy:
|
||||
- name: Yarn source repo
|
||||
ansible.builtin.copy:
|
||||
content: "deb [signed-by={{ mastodon_yarn_key_path }}] https://dl.yarnpkg.com/debian stable main"
|
||||
dest: /etc/apt/sources.list.d/yarn.list
|
||||
mode: 0644
|
||||
|
||||
- name: install yarn
|
||||
apt:
|
||||
- name: Install yarn
|
||||
ansible.builtin.apt:
|
||||
name: yarn
|
||||
state: present
|
||||
update_cache: true
|
||||
|
Reference in New Issue
Block a user