Skip to content

Commit

Permalink
Merge pull request #52 from enix/haproxy_pinning
Browse files Browse the repository at this point in the history
Implement haproxy pkg pinning
  • Loading branch information
Zempashi authored Sep 25, 2023
2 parents 9fe2cf8 + 3d8c54c commit 5669f3d
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 2 deletions.
1 change: 1 addition & 0 deletions roles/apiserver_haproxy/meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
dependencies:
- role: packages_common
- role: apiserver_docker_common
- role: common_vars
27 changes: 26 additions & 1 deletion roles/apiserver_haproxy/tasks/pkg_Debian.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,31 @@
---
- name: 'Get version of kubelet package'
package_facts:

- name: 'find version of kubeadm to install'
pkg_version_match:
name: haproxy
version: '{{ _apiserver_proxy_haproxy_version }}'
when:
- not(haproxy_repo_just_added is changed and ansible_check_mode)
- packages.haproxy|default([])|select('match', _apiserver_proxy_haproxy_version)|list|length == 0
register: haproxy_version

- name: "Create pinning files"
copy:
dest: /etc/apt/preferences.d/50-haproxy
content: |
package: haproxy
Pin: version {% if haproxy_version is not skipped -%}
{{ haproxy_version.version }}
{%- else -%}
{{ packages.haproxy.0.version|default('dry-run-unknown') }}
{%- endif %}
Pin-Priority: 1001
- name: 'Install HAProxy package'
apt:
name: 'haproxy={{ _apiserver_proxy_haproxy_version }}'
name: 'haproxy'
state: 'present'
when: not(haproxy_repo_just_added is changed and ansible_check_mode)
3 changes: 2 additions & 1 deletion roles/packages/meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
dependencies: []
dependencies:
- role: packages_common
galaxy_info:
author: Julien Girardin
description: Install kubernetes related packages
Expand Down
File renamed without changes.

0 comments on commit 5669f3d

Please sign in to comment.