diff --git a/roles/mastodon/tasks/system_setup/mastodon.yml b/roles/mastodon/tasks/system_setup/mastodon.yml index ef867d9..d698791 100644 --- a/roles/mastodon/tasks/system_setup/mastodon.yml +++ b/roles/mastodon/tasks/system_setup/mastodon.yml @@ -10,6 +10,9 @@ args: chdir: "{{ mastodon_home }}/{{ mastodon_path }}" + - stat: path={{ mastodon_home }}/{{ mastodon_path }}/.env.production + register: production_config + - name: Bundle install shell: | {{ mastodon_home }}/.rbenv/shims/bundle config set --local deployment 'true' && \ @@ -18,11 +21,13 @@ {{ mastodon_home }}/.rbenv/shims/bundle install -j$(getconf _NPROCESSORS_ONLN) args: chdir: "{{ mastodon_home }}/{{ mastodon_path }}" + when: not production_config.stat.exists - name: Yarn install command: yarn install --pure-lockfile args: chdir: "{{ mastodon_home }}/{{ mastodon_path }}" + when: not production_config.stat.exists - name: Media cleanup cronjob cron: @@ -30,9 +35,7 @@ minute: "15" hour: "1" job: '/bin/bash -c ''export PATH="$HOME/.rbenv/bin:$PATH"; eval "$(rbenv init -)"; cd {{ mastodon_home }}/{{ mastodon_path }} && RAILS_ENV=production ./bin/tootctl media remove''' - - - stat: path={{ mastodon_home }}/{{ mastodon_path }}/.env.production - register: production_config + when: not production_config.stat.exists - name: Migrate database shell: "RAILS_ENV=production {{ mastodon_home }}/.rbenv/shims/bundle exec rails db:migrate"