--- - name: Get mastodon git remote_user: mastodon ansible.builtin.git: repo: "https://github.com/mastodon/mastodon.git" dest: "{{ mastodon_home }}/live" version: "v{{ mastodon_version }}" - name: Exec bundle remote_user: mastodon 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: Install bundle remote_user: mastodon ansible.builtin.command: cmd: | bash -lic "bundle install -j$(getconf _NPROCESSORS_ONLN)" chdir: "{{ mastodon_home }}/live" changed_when: true - name: Install mastodon remote_user: mastodon ansible.builtin.command: cmd: | bash -lic "yarn install --pure-lockfile" chdir: "{{ mastodon_home }}/live" changed_when: true - name: Create bin dir remote_user: mastodon ansible.builtin.file: path: "{{ mastodon_home }}/bin" state: directory mode: '0750' - name: Put template scripts remote_user: mastodon ansible.builtin.template: src: "{{ item }}.j2" dest: "{{ mastodon_home }}/bin/{{ item }}" mode: '0750' loop: - remove_media.sh - remove_preview_cards.sh - 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 ansible.builtin.systemd: name: "{{ item }}" daemon_reload: true state: started enabled: true loop: *mastodon_services