use ansible_processor_count + fix db dump path
gitea/ansible-roles/pipeline/head This commit looks good Details

This commit is contained in:
Mathieu Gauthier-Pilote 2023-01-16 10:42:41 -05:00
parent 6c29a1f6d4
commit d992da0c1e
2 changed files with 11 additions and 11 deletions

View File

@ -1,5 +1,5 @@
---
# tasks file for mastodon
# tasks file for mastodon install
- name: Install main system dependencies
apt:
@ -42,7 +42,7 @@
chdir: "~/mastodon"
executable: /bin/bash # fails with /bin/sh
- name: Install gem dependencies
shell: ". ~/.profile && bundle install --deployment --without development test -j$(getconf _NPROCESSORS_ONLN)"
shell: ". ~/.profile && bundle install --deployment --without development test -j{{ ansible_processor_count }}"
args:
chdir: "~/mastodon"
executable: /bin/bash # fails with /bin/sh

View File

@ -1,11 +1,11 @@
---
# tasks file for mastodon
# tasks file for mastodon upgrade
- name: Dump database to a file with compression
postgresql_db:
name: "{{ service }}_production"
state: dump
target: "{{ service }}_production.sql.gz"
target: "~/{{ service }}_production.sql.gz"
become_user: postgres
- name: Checkout (git)
@ -24,7 +24,7 @@
chdir: "~/mastodon"
executable: /bin/bash # fails with /bin/sh
- name: Install gem dependencies
shell: ". ~/.profile && bundle install --deployment --without development test -j$(getconf _NPROCESSORS_ONLN)"
shell: ". ~/.profile && bundle install --deployment --without development test -j{{ ansible_processor_count }}"
args:
chdir: "~/mastodon"
executable: /bin/bash # fails with /bin/sh
@ -63,23 +63,23 @@
executable: /bin/bash # fails with /bin/sh
become_user: "{{ service }}"
- name: Restart services
service:
name: "{{ service }}.target"
state: restarted
- name: Define variable to skip next task by default
set_fact:
keep_db_dump: true
- name: Remove database dump
file:
path: "{{ service }}_production.sql.gz"
path: "~/{{ service }}_production.sql.gz"
state: absent
become_user: postgres
when: keep_db_dump is undefined
tags: clean
- name: Template conf file for nginx vhost
template:
src: "vhost.j2"
dest: "/etc/nginx/sites-available/{{ service }}"
- name: Reload nginx conf
service:
name: nginx