From 862d70f14c14c3ba2ec40a5f10d1d5aa61eec87c Mon Sep 17 00:00:00 2001 From: staticsafe Date: Sat, 12 Jan 2019 22:18:46 -0500 Subject: [PATCH] Let's try the register method to get latest version automatically --- roles/mastodon-app/tasks/main.yml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/roles/mastodon-app/tasks/main.yml b/roles/mastodon-app/tasks/main.yml index 947c29d..b41d502 100644 --- a/roles/mastodon-app/tasks/main.yml +++ b/roles/mastodon-app/tasks/main.yml @@ -3,11 +3,24 @@ # This role clones the Mastodon GitHub repository and installs # it's node.js and Ruby dependencies -- name: Clone Mastodon git repository +- name: Clone Mastodon git repository [1st clone] git: repo: 'https://github.com/tootsuite/mastodon.git' dest: /home/mastodon/live - version: v2.6.5 + become: true + become_user: mastodon +- name: Get latest version as an Ansible variable + shell: cd /home/mastodon/live && git tag -l | grep -v 'rc[0-9]*$' | sort -V | tail -n 1 + become: true + become_user: mastodon + args: + executable: /bin/bash + register: MASTODON_VERSION +- name: Checkout latest Mastodon version + git: + repo: 'https://github.com/tootsuite/mastodon.git' + dest: /home/mastodon/live + version: {{ MASTODON_VERSION }} become: true become_user: mastodon - name: Install bundler