Add backports to apt and update shouter #6

Merged
meaz merged 5 commits from backports_shouter into main 2024-01-05 10:45:30 +01:00
6 changed files with 43 additions and 3 deletions

View File

@ -15,4 +15,13 @@ example playbook:
All configurable variables reside in `defaults/main.yml`. If you wish to modify them per host, add them to your `/etc/ansible/host_vars/yourhostname.yml` of for group of hosts in `/etc/ansible/group_vars/yourgroup/main.yml` etc.
You can deploy only host file with `--tags hosts`.
## Tags
* `apt`: to update packages
* `hosts`: to deploy only host file
* `ssh`: to deploy ssh
* `shouter`: to deploy shouter
## Note
`go-sendxmpp` is now a package on bookworm.

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

@ -7,8 +7,24 @@
owner: root
group: root
mode: 644
tags: apt
- name: '[APT] - Installing some base packages'
apt:
name: "{{ base_apt_list }}"
state: latest
update_cache: yes
tags: apt
- name: '[APT] - Add backports source'
lineinfile:
line: "deb http://deb.debian.org/debian {{ ansible_distribution_release }}-backports main"
dest: "/etc/apt/sources.list"
- name: '[APT] - Update the repository cache and update all packages to latest version using backports'
apt:
name: "*"
state: latest
default_release: "{{ ansible_distribution_release }}-backports"
update_cache: yes
tags: apt

View File

@ -7,3 +7,5 @@
owner: root
group: root
mode: 0644
tags: hosts

View File

@ -1,6 +1,7 @@
---
- include_tasks: apt.yml
tags: apt
- include_tasks: mkdir.yml
@ -20,5 +21,6 @@
- include_tasks: shouter.yml
when: base_shouter is defined
tags: shouter
- include_tasks: configs.yml

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