This commit is contained in:
havelight-ee
2023-04-27 12:39:14 +09:00
parent d74721cb2c
commit a794f85f96
7 changed files with 167 additions and 28 deletions

View File

@@ -7,4 +7,9 @@
owner: root
group: root
with_items:
- /etc/datasaker
- /etc/datasaker
- name: "Setting global-config"
template:
src: global-config.yml.j2
dest: "/etc/datasaker/global-config.yml"

View File

@@ -40,6 +40,22 @@
- name: "Check datasaker Agent"
include_tasks: check-agent.yml
- name: "Install metric sidecar"
apt:
name: "dsk-metric-sidecar"
state: present
update_cache: yes
- 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"
apt:
name: "{{ item }}"
@@ -48,6 +64,7 @@
with_items:
- "{{ datasaker_agents }}"
notify:
- Reload systemd configuration
- Restart {{ item }} service
# - name: "Ensure datasaker agent is running"

View File

@@ -5,8 +5,12 @@
- name: Include Datasaker Add Repository
include_tasks: dsk-common.yml
when: ansible_facts.os_family == "Debian"
when: uninstall == False and ansible_facts.os_family == "Debian"
- name: Include Datasaker Host Agent Install
include_tasks: dsk-debian-pkg.yml
when: ansible_facts.os_family == "Debian"
when: uninstall == False and ansible_facts.os_family == "Debian"
- name: Uninstall Datasaker Agent
include_tasks: remove-datasaker.yml
when: uninstall == True

View File

@@ -0,0 +1,54 @@
---
# - name: "Install metric sidecar"
# apt:
# name: "dsk-metric-sidecar"
# state: present
# update_cache: yes
- name: Remove Datasaker Log Directory
ansible.builtin.file:
path: "/var/log/datasaker/{{ item }}"
state: absent
with_items:
- "{{ datasaker_agents }}"
- name: Remove Datasaker Agent Directory
ansible.builtin.file:
path: "/etc/datasaker/{{ item }}"
state: absent
with_items:
- "{{ datasaker_agents }}"
- name: Stop agent service
service:
name: "{{ item }}"
enabled: true
state: stopped
with_items:
- "{{ datasaker_agents }}"
ignore_errors: true
- name: "Uninstall datasaker agent"
apt:
name: "{{ item }}"
state: absent
update_cache: yes
with_items:
- "{{ datasaker_agents }}"
ignore_errors: true
- name: Remove Datasaker Agent Directory
ansible.builtin.file:
path: "/etc/datasaker/{{ item }}"
state: absent
with_items:
- "{{ datasaker_agents }}"
- name: Remove Datasaker All Directory
ansible.builtin.file:
path: "{{ item }}"
state: absent
with_items:
- /etc/datasaker
- /var/log/datasaker
when: datasaker_clean == True