Skip to content

Commit

Permalink
Правка возможности установить устаревшую версию pganalyze-collector и…
Browse files Browse the repository at this point in the history
…з deb (в репозитории apt его нет)
  • Loading branch information
M1ha-Shvn committed Oct 11, 2023
1 parent c60365c commit b81ac10
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
1 change: 1 addition & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ dpkg_force_overwrite_configs: false

pganalyze_package: pganalyze-collector
pganalyze_version: latest
pganalyze_deb_url: https://packages.pganalyze.com/{{ ansible_distribution | lower }}/{{ ansible_distribution_release | lower }}/pool/main/p/{{ pganalyze_package }}/{{ pganalyze_package }}_{{ pganalyze_version }}_amd64.deb

pganalyze_user: pganalyze
pganalyze_group: pganalyze
Expand Down
24 changes: 22 additions & 2 deletions tasks/debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,39 @@
when:
- pganalize_apt_key.changed or pganalize_apt_sourcelist.changed

- name: install | install or update packages
- name: install | install or update packages from apt
apt:
name:
- "{{ pganalyze_package }}{% if pganalyze_version != 'latest' %}={{ pganalyze_version }}*{% endif %}"
- "{{ pganalyze_package }}"
state: latest
install_recommends: true
force: true
force_apt_get: true
dpkg_options: "{{ dpkg_force_overwrite_configs | ternary('force-confdef,force-confnew', 'force-confdef,force-confold') }}"
update_cache: true
cache_valid_time: 3600
allow_downgrade: true
environment:
DEBIAN_FRONTEND: noninteractive
RUNLEVEL: 1
notify:
- restart pganalyze-collector
when: pganalyze_version == 'latest'

- name: install | install or update packages from deb
apt:
deb: "{{ pganalyze_deb_url }}"
state: present
install_recommends: true
force: true
force_apt_get: true
dpkg_options: "{{ dpkg_force_overwrite_configs | ternary('force-confdef,force-confnew', 'force-confdef,force-confold') }}"
update_cache: true
cache_valid_time: 3600
allow_downgrade: true
environment:
DEBIAN_FRONTEND: noninteractive
RUNLEVEL: 1
notify:
- restart pganalyze-collector
when: pganalyze_version != 'latest'

0 comments on commit b81ac10

Please sign in to comment.