diff --git a/Makefile b/Makefile index 10ea603..d6b32da 100644 --- a/Makefile +++ b/Makefile @@ -3,28 +3,28 @@ install: git submodule update --init --recursive upgrade: - ansible-playbook upgrade.yml + ansible-playbook upgrade-playbook.yml mastodon-first-install: - ansible-playbook mastodon.yml --tags install,configure --extra-vars "first_install=True" + ansible-playbook mastodon-playbook.yml --tags install,configure --extra-vars "first_install=True" mastodon: - ansible-playbook mastodon.yml --tags install,configure + ansible-playbook mastodon-playbook.yml --tags install,configure mastodon-config: # Used for updating the .env.production settings - ansible-playbook mastodon.yml --tags configure + ansible-playbook mastodon-playbook.yml --tags configure frontend: - ansible-playbook mastodon.yml --tags install,configure --limit 'frontend' --extra-vars "install_frontend=True" + ansible-playbook mastodon-playbook.yml --tags install,configure --limit 'frontend' --extra-vars "install_frontend=True" frontend-config: - ansible-playbook mastodon.yml --tags configure --limit 'frontend' --extra-vars "install_frontend=True" + ansible-playbook mastodon-playbook.yml --tags configure --limit 'frontend' --extra-vars "install_frontend=True" webapp: - ansible-playbook mastodon.yml --tags install,configure --limit 'webapp' --extra-vars "install_webapp=True" + ansible-playbook mastodon-playbook.yml --tags install,configure --limit 'webapp' --extra-vars "install_webapp=True" webapp-config: - ansible-playbook mastodon.yml --tags configure --limit 'webapp' --extra-vars "install_webapp=True" + ansible-playbook mastodon-playbook.yml --tags configure --limit 'webapp' --extra-vars "install_webapp=True" sidekiq: - ansible-playbook mastodon.yml --tags install,configure --limit 'sidekiq' --extra-vars "install_sidekiq=True" + ansible-playbook mastodon-playbook.yml --tags install,configure --limit 'sidekiq' --extra-vars "install_sidekiq=True" sidekiq-config: - ansible-playbook mastodon.yml --tags configure --limit 'sidekiq' --extra-vars "install_sidekiq=True" + ansible-playbook mastodon-playbook.yml --tags configure --limit 'sidekiq' --extra-vars "install_sidekiq=True" diff --git a/mastodon-playbook.yml b/mastodon-playbook.yml new file mode 100644 index 0000000..2d7ae5f --- /dev/null +++ b/mastodon-playbook.yml @@ -0,0 +1,30 @@ +--- +- name: Configure yttrx mastodon server + hosts: [mastodon] + vars: + first_install: False + install_sidekiq: False + install_webapp: False + install_frontend: False + + roles: + - when: first_install | bool + role: yttrx + tags: + - firstinstall + + - role: mastodon + + - when: install_sidekiq| bool + role: sidekiq + - when: install_webapp | bool + role: webapp + - when: install_frontend | bool + role: frontend + + handlers: + - name: Re-up docker containers + command: /usr/local/bin/docker-compose.sh + args: + chdir: /home/mastodon/live + listen: "docker-compose up" diff --git a/roles/mastodon/templates/docker-compose.sidekiq-default.yml.j2 b/roles/mastodon/templates/docker-compose.sidekiq-default.yml.j2 index 4e9638b..8e2e63f 100644 --- a/roles/mastodon/templates/docker-compose.sidekiq-default.yml.j2 +++ b/roles/mastodon/templates/docker-compose.sidekiq-default.yml.j2 @@ -1,5 +1,7 @@ sidekiq-default: + logging: + driver: journald image: tootsuite/mastodon:{{ MASTODON_VERSION }} restart: always env_file: .env.production diff --git a/roles/mastodon/templates/docker-compose.sidekiq.yml.j2 b/roles/mastodon/templates/docker-compose.sidekiq.yml.j2 index b658a9b..020503b 100644 --- a/roles/mastodon/templates/docker-compose.sidekiq.yml.j2 +++ b/roles/mastodon/templates/docker-compose.sidekiq.yml.j2 @@ -1,4 +1,6 @@ sidekiq: + logging: + driver: journald image: tootsuite/mastodon:{{ MASTODON_VERSION }} restart: always env_file: .env.production diff --git a/upgrade.yml b/upgrade-playbook.yml similarity index 100% rename from upgrade.yml rename to upgrade-playbook.yml