update
This commit is contained in:
@@ -7,15 +7,20 @@
|
||||
owner: root
|
||||
group: root
|
||||
with_items:
|
||||
- /etc/datasaker
|
||||
- "{{ datasaker_host_path }}"
|
||||
when:
|
||||
- ansible_facts.os_family in ["Debian", "RedHat"]
|
||||
- datasaker_agents
|
||||
|
||||
- name: "create global-config"
|
||||
ansible.builtin.file:
|
||||
path: "{{ datasaker_host_path }}/global-config.yml"
|
||||
state: touch
|
||||
|
||||
- name: "Setting global-config"
|
||||
template:
|
||||
src: global-config.yml.j2
|
||||
dest: "/etc/datasaker/global-config.yml"
|
||||
dest: "{{ datasaker_host_path }}"/global-config.yml"
|
||||
when:
|
||||
- ansible_facts.os_family in ["Debian", "RedHat"]
|
||||
- datasaker_agents
|
||||
@@ -42,4 +47,5 @@
|
||||
src: global-config.yml.j2
|
||||
dest: "{{ datasaker_docker_global_config }}"
|
||||
when:
|
||||
- datasaker_docker_agents
|
||||
- datasaker_docker_agents
|
||||
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
---
|
||||
- name: "Setting global-config"
|
||||
template:
|
||||
src: global-config.yml.j2
|
||||
dest: "/etc/datasaker/global-config.yml"
|
||||
|
||||
- set_fact:
|
||||
datasaker_agents: "{{ datasaker_agents | reject('equalto', 'dsk-log-agent') | list }}"
|
||||
when: ansible_facts.distribution_version != "18.04"
|
||||
@@ -60,7 +55,7 @@
|
||||
|
||||
- name: Make Datasaker Log Directory
|
||||
ansible.builtin.file:
|
||||
path: "/var/log/datasaker/{{ item }}"
|
||||
path: "{{ datasaker_host_log_path }}/{{ item }}"
|
||||
state: directory
|
||||
recurse: yes
|
||||
owner: root
|
||||
@@ -95,4 +90,4 @@
|
||||
state: restarted
|
||||
with_items:
|
||||
- "{{ datasaker_agents }}"
|
||||
ignore_errors: true
|
||||
ignore_errors: true
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
include_tasks: check-agent.yml
|
||||
when:
|
||||
- uninstall == False
|
||||
- datasaker_docker_agents
|
||||
|
||||
- name: "Include Docker Agent Path Permissions Setting"
|
||||
include_tasks: permissions.yml
|
||||
@@ -43,4 +44,4 @@
|
||||
- name: "Uninstall Datasaker Agent"
|
||||
include_tasks: remove-datasaker.yml
|
||||
when:
|
||||
- uninstall == True
|
||||
- uninstall == True
|
||||
|
||||
43
tasks/vi
Normal file
43
tasks/vi
Normal file
@@ -0,0 +1,43 @@
|
||||
---
|
||||
- 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: "{{ datasaker_host_log_path }}/{{ item }}"
|
||||
state: directory
|
||||
recurse: yes
|
||||
owner: root
|
||||
group: root
|
||||
with_items:
|
||||
- "{{ datasaker_agents }}"
|
||||
|
||||
- name: "Install datasaker log agent"
|
||||
apt:
|
||||
name: "td-agent"
|
||||
state: latest
|
||||
update_cache: yes
|
||||
when: '"dsk-log-agent" in 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
|
||||
ignore_errors: true
|
||||
Reference in New Issue
Block a user