This repository has been archived by the owner on Apr 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Timur Gadiev <Timur_Gadiev@epam.com>
- Loading branch information
Showing
3 changed files
with
46 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,52 @@ | ||
--- | ||
|
||
- name: Ensure libselinux-python on CentOS 6.x | ||
yum: name=libselinux-python state=present update_cache=yes | ||
when: ( ansible_distribution == "CentOS" ) and ( ansible_distribution_major_version == "6" ) | ||
yum: | ||
name: libselinux-python | ||
state: present | ||
update_cache: true | ||
register: libselinux_install | ||
until: libselinux_install is succeeded | ||
when: | ||
- ansible_distribution == "CentOS" | ||
- ansible_distribution_major_version == "6" | ||
|
||
- name: Redhat - add beats repository | ||
template: src=beats.repo.j2 dest=/etc/yum.repos.d/beats.repo | ||
template: | ||
src: beats.repo.j2 | ||
dest: /etc/yum.repos.d/beats.repo | ||
when: use_repository | ||
|
||
- name: RedHat - install yum-version-lock | ||
yum: name=yum-plugin-versionlock state=present update_cache=yes | ||
yum: | ||
name: yum-plugin-versionlock | ||
state: present | ||
update_cache: true | ||
|
||
- name: RedHat - unlock {{beat}} for install | ||
shell: yum versionlock delete {{beat}} || true | ||
changed_when: False | ||
- name: RedHat - unlock {{ beat }} for install | ||
shell: yum versionlock delete {{ beat }} || true | ||
changed_when: false | ||
|
||
- name: RedHat - Ensure {{beat}} is installed | ||
- name: RedHat - Ensure {{ beat }} is installed | ||
yum: | ||
name: >- | ||
{{beat}}{% if beats_version is defined and beats_version != "" %}-{{ beats_version }}{% endif %} | ||
{{ beat }}{% if beats_version is defined and beats_version != "" %}-{{ beats_version }}{% endif %} | ||
state: present | ||
update_cache: true | ||
when: use_repository | ||
notify: restart {{beat}} | ||
notify: restart {{ beat }} | ||
|
||
- name: RedHat - lock {{beat}} version | ||
- name: RedHat - lock {{ beat }} version | ||
shell: >- | ||
yum versionlock add | ||
{{beat}}{% if beats_version is defined and beats_version != "" %}-{{ beats_version }}{% endif %} | ||
{{ beat }}{% if beats_version is defined and beats_version != "" %}-{{ beats_version }}{% endif %} | ||
when: version_lock | ||
changed_when: False | ||
changed_when: false | ||
|
||
- name: RedHat - Install {{beat}} from url | ||
- name: RedHat - Install {{ beat }} from url | ||
yum: | ||
name: >- | ||
{% if custom_package_url is defined %}{{ custom_package_url }}{% | ||
else %}{{ beats_package_url }}/{{beat}}-{{ beats_version }}-{{ansible_architecture}}.rpm{% endif %} | ||
else %}{{ beats_package_url }}/{{ beat }}-{{ beats_version }}-{{ ansible_architecture }}.rpm{% endif %} | ||
state: present | ||
when: not use_repository | ||
notify: restart {{beat}} | ||
notify: restart {{ beat }} |