amazon linux 2023 update
This commit is contained in:
40
tasks/dsk-redhat-pkg.yml
Normal file
40
tasks/dsk-redhat-pkg.yml
Normal file
@@ -0,0 +1,40 @@
|
||||
---
|
||||
- name: "Setting global-config"
|
||||
template:
|
||||
src: global-config.yml.j2
|
||||
dest: "/etc/datasaker/global-config.yml"
|
||||
|
||||
- name: "Add datasaker repository"
|
||||
yum_repository:
|
||||
name: datasaker
|
||||
description: datasaker-repo
|
||||
baseurl: "{{ datasaker_yum_repo }}"
|
||||
enabled: "{{ datasaker_yum_enabled }}"
|
||||
gpgcheck: "{{ datasaker_yum_gpgcheck }}"
|
||||
|
||||
- set_fact:
|
||||
datasaker_agents: "{{ datasaker_agents | reject('equalto', 'dsk-log-agent') | list }}"
|
||||
|
||||
- name: "Check datasaker Agent"
|
||||
include_tasks: check-agent.yml
|
||||
|
||||
- name: Make Datasaker Log Directory
|
||||
ansible.builtin.file:
|
||||
path: "/var/log/datasaker/{{ item }}"
|
||||
state: directory
|
||||
recurse: yes
|
||||
owner: root
|
||||
group: root
|
||||
with_items:
|
||||
- "{{ datasaker_agents }}"
|
||||
|
||||
- name: "Install datasaker agent"
|
||||
yum:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
update_cache: yes
|
||||
with_items:
|
||||
- "{{ datasaker_agents }}"
|
||||
notify:
|
||||
- Reload systemd configuration
|
||||
- Restart {{ item }} service
|
||||
@@ -1,12 +0,0 @@
|
||||
---
|
||||
- name: Include Gather Ansible Facts task on Ansible >= 2.10
|
||||
include_tasks: gather-facts.yml
|
||||
when: ansible_version.major >= 2 and ansible_version.minor >= 10
|
||||
|
||||
- name: Include Datasaker Add Repository
|
||||
include_tasks: dsk-common.yml
|
||||
when: ansible_facts.os_family == "Debian"
|
||||
|
||||
- name: Include Datasaker Host Agent Install
|
||||
include_tasks: dsk-debian-pkg.yml
|
||||
when: ansible_facts.os_family == "Debian"
|
||||
@@ -5,12 +5,16 @@
|
||||
|
||||
- name: Include Datasaker Add Repository
|
||||
include_tasks: dsk-common.yml
|
||||
when: uninstall == False and ansible_facts.os_family == "Debian"
|
||||
when: uninstall == False and ansible_facts.os_family == "Debian" or ansible_facts.os_family == "RedHat"
|
||||
|
||||
- name: Include Datasaker Host Agent Install
|
||||
- name: Include Datasaker Debian Host Agent Install
|
||||
include_tasks: dsk-debian-pkg.yml
|
||||
when: uninstall == False and ansible_facts.os_family == "Debian"
|
||||
|
||||
- name: Include Datasaker RedHat Host Agent Install
|
||||
include_tasks: dsk-redhat-pkg.yml
|
||||
when: uninstall == False and ansible_facts.os_family == "RedHat"
|
||||
|
||||
- name: Uninstall Datasaker Agent
|
||||
include_tasks: remove-datasaker.yml
|
||||
when: uninstall == True
|
||||
when: uninstall == True
|
||||
|
||||
Reference in New Issue
Block a user