Fix HATop for haproxy
Readjust hatop installtion method, removed haproxy_hatop_downloader and deployment-host variables. added "haproxy_hatop_install | bool" condition. Change-Id: I51423fff67e6e427f6c7d163d8d1aac6bcd82ca9
This commit is contained in:
parent
ca2c011cf2
commit
0ef22fa4df
@ -117,9 +117,8 @@ haproxy_ssl_letsencrypt_acl:
|
||||
haproxy_hatop_download_url: "https://github.com/jhunt/hatop/archive/v0.8.0.tar.gz"
|
||||
haproxy_hatop_download_checksum: "sha256:bcdab1664358ec83027957df11bbeb322df1a96d414a3ccc4e211532b82c4ad2"
|
||||
|
||||
# Where the extra package download is executed from.
|
||||
# Options are ['deployment-host', 'target-host']
|
||||
haproxy_hatop_downloader: "deployment-host"
|
||||
# Install hatop
|
||||
haproxy_hatop_install: true
|
||||
|
||||
# The location where the extra packages are downloaded to
|
||||
haproxy_hatop_download_path: "/opt/cache/files"
|
||||
|
10
releasenotes/notes/haproxy-hatop-4d6525a52f93a69e.yaml
Normal file
10
releasenotes/notes/haproxy-hatop-4d6525a52f93a69e.yaml
Normal file
@ -0,0 +1,10 @@
|
||||
---
|
||||
upgrade:
|
||||
- |
|
||||
Variable ``haproxy_hatop_downloader`` has been removed, Deployers
|
||||
supposed to use ``haproxy_hatop_download_url`` override if needed
|
||||
to install in deployments with limited internet connection.
|
||||
features:
|
||||
- |
|
||||
Added new variable ``haproxy_hatop_install``, that allows to conditionally
|
||||
enable or disable hatop installation.
|
@ -24,37 +24,39 @@
|
||||
retries: 5
|
||||
delay: 2
|
||||
|
||||
- name: Ensure haproxy_hatop_download_path exists
|
||||
file:
|
||||
path: "{{ haproxy_hatop_download_path }}/{{ haproxy_hatop_download_url | basename | replace('.tar.gz', '') }}"
|
||||
state: directory
|
||||
delegate_to: "{{ (haproxy_hatop_downloader == 'deployment-host') | ternary('localhost', inventory_hostname) }}"
|
||||
- name: Install HATop Utility
|
||||
block:
|
||||
- name: Ensure haproxy_hatop_download_path exists on haproxy
|
||||
file:
|
||||
path: "{{ haproxy_hatop_download_path }}/{{ haproxy_hatop_download_url | basename | replace('.tar.gz', '') }}"
|
||||
state: directory
|
||||
|
||||
- name: Download extra package
|
||||
get_url:
|
||||
url: "{{ haproxy_hatop_download_url }}"
|
||||
dest: "{{ haproxy_hatop_download_path }}/{{ haproxy_hatop_download_url | basename }}"
|
||||
validate_certs: "{{ haproxy_hatop_download_validate_certs }}"
|
||||
checksum: "{{ haproxy_hatop_download_checksum }}"
|
||||
register: fetch_url
|
||||
until: fetch_url is success
|
||||
retries: 3
|
||||
delay: 10
|
||||
delegate_to: "{{ (haproxy_hatop_downloader == 'deployment-host') | ternary('localhost', inventory_hostname) }}"
|
||||
- name: Download hatop package
|
||||
get_url:
|
||||
url: "{{ haproxy_hatop_download_url }}"
|
||||
dest: "{{ haproxy_hatop_download_path }}/{{ haproxy_hatop_download_url | basename }}"
|
||||
validate_certs: "{{ haproxy_hatop_download_validate_certs }}"
|
||||
checksum: "{{ haproxy_hatop_download_checksum }}"
|
||||
register: fetch_url
|
||||
until: fetch_url is success
|
||||
retries: 3
|
||||
delay: 10
|
||||
|
||||
- name: Unarchive HATop
|
||||
unarchive:
|
||||
src: "{{ haproxy_hatop_download_path }}/{{ haproxy_hatop_download_url | basename }}"
|
||||
remote_src: "{{ (haproxy_hatop_downloader == 'deployment-host') | ternary('no', 'yes') }}"
|
||||
dest: "{{ haproxy_hatop_download_path }}/{{ haproxy_hatop_download_url | basename | replace('.tar.gz', '') }}"
|
||||
extra_opts:
|
||||
- --strip-components=1
|
||||
- name: Unarchive HATop
|
||||
unarchive:
|
||||
src: "{{ haproxy_hatop_download_path }}/{{ haproxy_hatop_download_url | basename }}"
|
||||
dest: "{{ haproxy_hatop_download_path }}/{{ haproxy_hatop_download_url | basename | replace('.tar.gz', '') }}"
|
||||
remote_src: yes
|
||||
extra_opts:
|
||||
- --strip-components=1
|
||||
|
||||
- name: Install HATop
|
||||
command: "install -m 755 bin/hatop /usr/local/bin"
|
||||
args:
|
||||
chdir: "{{ haproxy_hatop_download_path }}/{{ haproxy_hatop_download_url | basename | replace('.tar.gz', '') }}"
|
||||
creates: "/usr/local/bin/hatop"
|
||||
- name: Copy HATop binary
|
||||
copy:
|
||||
src: "{{ haproxy_hatop_download_path }}/{{ haproxy_hatop_download_url | basename | replace('.tar.gz', '') }}/bin/hatop"
|
||||
dest: /usr/local/bin/hatop
|
||||
mode: 0755
|
||||
remote_src: yes
|
||||
when: haproxy_hatop_install | bool
|
||||
|
||||
- include_tasks: haproxy_apparmor.yml
|
||||
when: ansible_pkg_mgr == 'zypper'
|
||||
|
Loading…
x
Reference in New Issue
Block a user