Update to 2022-08-31 18:00

This commit is contained in:
Daniel Berteaud 2022-08-31 18:00:16 +02:00
parent c10fd506f3
commit 71ef979f8c
10 changed files with 125 additions and 0 deletions

View File

@ -2,3 +2,4 @@
dependencies:
- role: repo_elrepo
- role: drbdtop

View File

@ -0,0 +1,6 @@
---
drbdtop_version: 0.2.2
drbdtop_bin_url: https://github.com/LINBIT/drbdtop/releases/download/v{{ drbdtop_version }}/drbdtop-linux-amd64
drbdtop_bin_sha256: 901b9af50b4491063c9e96d6e14510b119a0bd5c81bd63104f33242fea0c51cb
drbdtop_root_dir: /opt/drbdtop

Binary file not shown.

View File

@ -0,0 +1,15 @@
---
- name: Compress previous version
command: tar cf {{ drbdtop_root_dir }}/archives/{{ drbdtop_current_version }}.tar.zst --use-compress-program=zstd ./
args:
chdir: "{{ drbdtop_root_dir }}/archives/{{ drbdtop_current_version }}"
warn: False
environment:
ZSTD_CLEVEL: 10
tags: drbd
- name: Remove archive dir
file: path={{ drbdtop_root_dir }}/archives/{{ drbdtop_current_version }} state=absent
tags: drbd

View File

@ -0,0 +1,16 @@
---
- name: Create the archive dir
file: path={{ drbdtop_root_dir }}/archives/{{ drbdtop_current_version }} state=directory
tags: drbd
- name: Backup previous version
synchronize:
src: "{{ drbdtop_root_dir }}/{{ item }}"
dest: "{{ drbdtop_root_dir }}/archives/{{ drbdtop_current_version }}/"
compress: False
delegate_to: "{{ inventory_hostname }}"
loop:
- bin
tags: drbd

View File

@ -0,0 +1,9 @@
---
- name: Create needed directories
file: path={{ item.dir }} state=directory
loop:
- dir: "{{ drbdtop_root_dir }}"
- dir: "{{ drbdtop_root_dir }}/bin"
- dir: "{{ drbdtop_root_dir }}/archives"
tags: drbd

View File

@ -0,0 +1,27 @@
---
- set_fact: drbdtop_install_mode='none'
tags: drbd
- name: Detect if drbd is installed
stat: path=/usr/local/bin/drbdtop
register: drbdtop_bin
tags: drbd
- when: not drbdtop_bin.stat.exists
set_fact: drbdtop_install_mode='install'
tags: drbd
- when: drbdtop_bin.stat.exists
block:
- name: Detect installed version
shell: /usr/local/bin/drbdtop -v 2>&1 | perl -pe 's/^[^\d]//'
changed_when: False
register: drbdtop_current_version
- set_fact: drbdtop_current_version={{ drbdtop_current_version.stdout }}
tags: drbd
- when: drbdtop_bin.stat.exists and drbdtop_current_version != drbdtop_version
set_fact: drbdtop_install_mode='upgrade'
tags: drbd

View File

@ -0,0 +1,27 @@
---
- name: Install needed tools
package:
name:
- tar
- zstd
tags: drbd
- when: drbdtop_install_mode != 'none'
block:
- name: Download drbdtop
get_url:
url: "{{ drbdtop_bin_url }}"
dest: "{{ drbdtop_root_dir }}/bin/drbdtop"
checksum: sha256:{{ drbdtop_bin_sha256 }}
mode: 755
tags: drbd
- name: Install wrapper script
copy:
content: |
#!/bin/sh
TERM=xterm {{ drbdtop_root_dir }}/bin/drbdtop "$@"
dest: /usr/local/bin/drbdtop
mode: 755
tags: drbd

View File

@ -0,0 +1,18 @@
---
- include_tasks: directories.yml
tags: always
- include_tasks: facts.yml
tags: always
- include_tasks: archive_pre.yml
when: drbdtop_install_mode | default('none') == 'upgrade'
tags: always
- include_tasks: install.yml
tags: always
- include_tasks: archive_post.yml
when: drbdtop_install_mode | default('none') == 'upgrade'
tags: always

View File

@ -30,11 +30,15 @@ storage "raft" {
performance_multiplier = {{ vault_conf.storage.raft.performance_multiplier }}
{% if vault_conf.storage.raft.retry_join | length > 0 %}
{% for server in vault_conf.storage.raft.retry_join %}
{% if server.leader_api_addr is defined and server.leader_api_addr != vault_conf.api_addr %}
retry_join {
{% for key in server.keys() | list %}
{{ key }} = "{{ server[key] }}"
{% endfor %}
}
{% else %}
# Skipping {{ server.leader_api_addr }} as it's ourself
{% endif %}
{% endfor %}
{% endif %}
}
@ -55,3 +59,5 @@ service_registration "consul" {
{% endif %}
}
{% endif %}
ui = {{ vault_conf.ui | ternary('true', 'false') }}