-
Notifications
You must be signed in to change notification settings - Fork 859
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: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this then better be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also sensible |
||
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 %}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Better use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed. I primarily didn't want to diverge too far from existing statements in e.g. Debian.yml which has the same unnecessary check. But I'll remove it here as it's been discussed (I'm leaving it in Debian.yml for now though as I haven't tested there) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually I've just removed all that and gone with |
||
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