install golang from backport + install only if version changed

This commit is contained in:
meaz 2024-01-04 16:52:23 +01:00
parent dc0d68cf45
commit 98873cc745
Signed by: meaz
GPG Key ID: CD7A47B2F1ED43B4
2 changed files with 13 additions and 2 deletions

View File

@ -41,6 +41,7 @@ base_ssh_known_hosts:
- ''
base_shouter: 'false' # set it to true to deploy xmpp shouter
base_shouter_version: '0.7.0'
base_journald_conf: 'true'
base_journald_items:

View File

@ -1,15 +1,25 @@
---
- name: '[SHOUTER] - Check go-sendxmpp version'
shell: '/opt/go/bin/go-sendxmpp --version | grep xmpp | cut -d " " -f2'
register: version_installed
tags: shouter
- name: '[SHOUTER] - Install golang'
apt:
name: "golang"
state: 'present'
state: latest
default_release: "{{ ansible_distribution_release }}-backports"
update_cache: yes
tags: shouter
- name: '[SHOUTER] - Export gopath'
lineinfile:
path: /root/.profile
line: 'export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin'
tags: shouter
- name: '[SHOUTER] - Install go-sendxmpp'
shell: 'export GOPATH=/opt/go; go install salsa.debian.org/mdosch/go-sendxmpp@latest'
when: base_shouter_version != version_installed.stdout
tags: shouter