-
Notifications
You must be signed in to change notification settings - Fork 855
Fix versionlock centos 8 #797
base: main
Are you sure you want to change the base?
Changes from 4 commits
fc8831a
60eb4cc
45fe5ad
22b8e8c
188a00a
32af3d4
6bb8495
99a129a
ac59b51
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,13 +2,13 @@ | |
- name: RedHat - install yum-version-lock | ||
become: yes | ||
yum: | ||
|
||
name: yum-plugin-versionlock | ||
name: "{{ versionlock_plugin_package }}" | ||
state: present | ||
update_cache: yes | ||
|
||
- name: RedHat - check if requested elasticsearch version lock exists | ||
become: yes | ||
shell: 'yum versionlock list | grep {{es_package_name}} | grep -c "{{es_version}}"' | ||
shell: '{{ package_manager }} versionlock list | grep {{ es_package_name }} | grep -c "{{ es_version }}"' | ||
register: es_requested_version_locked | ||
args: | ||
warn: false | ||
|
@@ -18,7 +18,7 @@ | |
|
||
- name: RedHat - lock elasticsearch version | ||
become: yes | ||
shell: yum versionlock delete 0:elasticsearch* ; yum versionlock add {{ es_package_name }}-{{ es_version }} | ||
command: '"{{ package_manager }}" versionlock delete 0:elasticsearch* ; "{{ package_manager }}" versionlock add {{ es_package_name }}-{{ es_version }}' | ||
args: | ||
warn: false | ||
when: | ||
|
@@ -28,7 +28,7 @@ | |
|
||
- name: RedHat - check if any elasticsearch version lock exists | ||
become: yes | ||
shell: yum versionlock list | grep -c elasticsearch | ||
shell: '"{{ package_manager }}" versionlock list | grep -c elasticsearch' | ||
register: es_version_locked | ||
args: | ||
warn: false | ||
|
@@ -38,7 +38,7 @@ | |
|
||
- name: RedHat - unlock elasticsearch version | ||
become: yes | ||
shell: yum versionlock delete 0:elasticsearch* | ||
shell: '"{{ package_manager }}" versionlock delete 0:elasticsearch*' | ||
args: | ||
warn: false | ||
when: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,5 @@ | |
java: "{{ es_java | default('java-1.8.0-openjdk.x86_64') }}" | ||
default_file: "/etc/sysconfig/elasticsearch" | ||
es_home: "/usr/share/elasticsearch" | ||
package_manager: "{% if ansible_os_family == 'RedHat' and ansible_distribution_major_version >= '8' %}dnf{% else %}yum{% endif %}" | ||
|
||
versionlock_plugin_package: "{% if ansible_os_family == 'RedHat' and ansible_distribution_major_version >= '8' %}python3-dnf-plugin-versionlock{% else %}yum-plugin-versionlock{% endif %}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yum-version-lock
should also be replaced here with{{ versionlock_plugin_package }}
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call, fixed