update
This commit is contained in:
@@ -9,7 +9,8 @@
|
||||
|
||||
- name: "Check dsk-log-agent"
|
||||
include_tasks: dsk-log-agent.yml
|
||||
when: '"dsk-log-agent" in datasaker_agents'
|
||||
when:
|
||||
- '"dsk-log-agent" in datasaker_agents'
|
||||
|
||||
- name: "Check dsk-postgres-agent"
|
||||
include_tasks: dsk-postgres-agent.yml
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
when:
|
||||
- datasaker_docker_agents
|
||||
|
||||
- name: "Touch agent config"
|
||||
- name: "Create agent config"
|
||||
ansible.builtin.file:
|
||||
path: "{{ datasaker_docker_global_config }}"
|
||||
state: touch
|
||||
|
||||
@@ -4,6 +4,10 @@
|
||||
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"
|
||||
|
||||
- name: "Create temporary directory for key manipulation"
|
||||
tempfile:
|
||||
state: directory
|
||||
@@ -67,10 +71,29 @@
|
||||
- name: "Install datasaker agent"
|
||||
apt:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
state: latest
|
||||
update_cache: yes
|
||||
with_items:
|
||||
- "{{ datasaker_agents }}"
|
||||
notify:
|
||||
- Reload systemd configuration
|
||||
- Restart {{ item }} service
|
||||
# - Restart {{ item }} service
|
||||
ignore_errors: true
|
||||
|
||||
- name: "Install datasaker log agent"
|
||||
apt:
|
||||
name: "td-agent"
|
||||
state: latest
|
||||
update_cache: yes
|
||||
when: '"dsk-log-agent" in datasaker_agents'
|
||||
|
||||
- name: Reload systemd configuration
|
||||
ansible.builtin.systemd:
|
||||
daemon_reload: True
|
||||
|
||||
- name: Restart dsk-agent service
|
||||
ansible.builtin.systemd:
|
||||
name: "{{ item }}"
|
||||
enabled: true
|
||||
state: restarted
|
||||
with_items:
|
||||
- "{{ datasaker_agents }}"
|
||||
ignore_errors: true
|
||||
@@ -9,20 +9,20 @@
|
||||
with_items:
|
||||
- "{{ datasaker_docker_path }}/agent/dsk-log-agent"
|
||||
|
||||
- name: "Touch agent config"
|
||||
- name: "create agent config"
|
||||
ansible.builtin.file:
|
||||
path: "{{ datasaker_docker_path }}/log-agent-config.yml"
|
||||
path: "{{ datasaker_docker_path }}/dsk-docker-log-agent-config.yml"
|
||||
state: touch
|
||||
|
||||
- name: "Setting dsk-log-agent config"
|
||||
template:
|
||||
src: log-agent-config.yml.j2
|
||||
dest: "{{ datasaker_docker_path }}/log-agent-config.yml"
|
||||
src: docker-log-agent-config.yml.j2
|
||||
dest: "{{ datasaker_docker_path }}/dsk-docker-log-agent-config.yml"
|
||||
|
||||
- name: Run Datasaker Log Agent
|
||||
docker_container:
|
||||
name: dsk-docker-log-agent
|
||||
image: "datasaker/dsk-log-agent:{{ trace_agent_image_tag }}"
|
||||
image: "datasaker/dsk-log-agent:{{ log_agent_image_tag }}"
|
||||
state: started
|
||||
detach: true
|
||||
restart_policy: "{{ log_agent_restart_policy }}"
|
||||
@@ -32,6 +32,6 @@
|
||||
volumes:
|
||||
- "{{ datasaker_docker_path }}:/var/datasaker/"
|
||||
- "{{ datasaker_docker_global_config }}:/etc/datasaker/global-config.yml:ro"
|
||||
- "{{ datasaker_docker_path }}/log-agent-config.yml:/etc/datasaker/dsk-log-agent/agent-config.yml:ro"
|
||||
- "{{ datasaker_docker_path }}/dsk-docker-log-agent-config.yml:/etc/datasaker/dsk-log-agent/agent-config.yml:ro"
|
||||
- "{{ item }}"
|
||||
loop: "{{ custom_log_volume | default(['{{ docker_default_path }}:/var/log/sample/:ro']) }}"
|
||||
|
||||
@@ -10,20 +10,20 @@
|
||||
- "{{ datasaker_docker_path }}/agent/dsk-postgres-agent"
|
||||
- "{{ datasaker_docker_path }}/agent/dsk-plan-postgres-agent"
|
||||
|
||||
- name: "Touch agent config"
|
||||
- name: "Create agent config"
|
||||
ansible.builtin.file:
|
||||
path: "{{ datasaker_docker_path }}/dsk-postgres-config.yml"
|
||||
path: "{{ datasaker_docker_path }}/dsk-docker-postgres-config.yml"
|
||||
state: touch
|
||||
|
||||
- name: "Setting dsk-postgres-agent config"
|
||||
template:
|
||||
src: docker-postgres-agent-config.yml.j2
|
||||
dest: "{{ datasaker_docker_path }}/dsk-postgres-config.yml"
|
||||
dest: "{{ datasaker_docker_path }}/dsk-docker-postgres-config.yml"
|
||||
|
||||
- name: "Setting plan-dsk-postgres-agent config"
|
||||
template:
|
||||
src: plan-postgres-agent-config.yml.j2
|
||||
dest: "{{ datasaker_docker_path }}/dsk-plan-postgres-config.yml"
|
||||
src: docker-plan-postgres-agent-config.yml.j2
|
||||
dest: "{{ datasaker_docker_path }}/dsk-docker-plan-postgres-config.yml"
|
||||
|
||||
- name: "Run dsk-postgres-agent container"
|
||||
docker_container:
|
||||
@@ -40,7 +40,7 @@
|
||||
volumes:
|
||||
- "{{ datasaker_docker_path }}:/var/datasaker/"
|
||||
- "{{ datasaker_docker_global_config }}:/etc/datasaker/global-config.yml:ro"
|
||||
- "{{ datasaker_docker_path }}/dsk-postgres-config.yml:/etc/datasaker/dsk-postgres-agent/agent-config.yml:ro"
|
||||
- "{{ datasaker_docker_path }}/dsk-docker-postgres-config.yml:/etc/datasaker/dsk-postgres-agent/agent-config.yml:ro"
|
||||
|
||||
- name: "Run dsk-plan-postgres-agent container"
|
||||
docker_container:
|
||||
@@ -54,4 +54,4 @@
|
||||
volumes:
|
||||
- "{{ datasaker_docker_path }}:/var/datasaker/"
|
||||
- "{{ datasaker_docker_global_config }}:/etc/datasaker/global-config.yml:ro"
|
||||
- "{{ datasaker_docker_path }}/dsk-plan-postgres-config.yml:/etc/datasaker/dsk-plan-postgres-agent/agent-config.yml:ro"
|
||||
- "{{ datasaker_docker_path }}/dsk-docker-plan-postgres-config.yml:/etc/datasaker/dsk-plan-postgres-agent/agent-config.yml:ro"
|
||||
|
||||
@@ -9,15 +9,15 @@
|
||||
with_items:
|
||||
- "{{ datasaker_docker_path }}/agent/dsk-trace-agent"
|
||||
|
||||
- name: "Touch agent config"
|
||||
- name: "Create agent config"
|
||||
ansible.builtin.file:
|
||||
path: "{{ datasaker_docker_path }}/trace-agent-config.yml"
|
||||
path: "{{ datasaker_docker_path }}/dsk-docker-trace-agent-config.yml"
|
||||
state: touch
|
||||
|
||||
- name: "Setting dsk-trace-agent config"
|
||||
template:
|
||||
src: trace-agent-config.yml.j2
|
||||
dest: "{{ datasaker_docker_path }}/trace-agent-config.yml"
|
||||
dest: "{{ datasaker_docker_path }}/dsk-docker-trace-agent-config.yml"
|
||||
|
||||
- name: "Run Datasaker trace Agent"
|
||||
ansible.builtin.docker_container:
|
||||
@@ -34,4 +34,4 @@
|
||||
volumes:
|
||||
- "{{ datasaker_docker_path }}:/var/datasaker/"
|
||||
- "{{ datasaker_docker_global_config }}:/etc/datasaker/global-config.yml:ro"
|
||||
- "{{ datasaker_docker_path }}/trace-agent-config.yml:/etc/datasaker/dsk-trace-agent/agent-config.yml:ro"
|
||||
- "{{ datasaker_docker_path }}/dsk-docker-trace-agent-config.yml:/etc/datasaker/dsk-trace-agent/agent-config.yml:ro"
|
||||
|
||||
@@ -28,6 +28,13 @@
|
||||
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 }}"
|
||||
@@ -38,3 +45,4 @@
|
||||
notify:
|
||||
- Reload systemd configuration
|
||||
- Restart {{ item }} service
|
||||
ignore_errors: true
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
- datasaker_agents
|
||||
|
||||
- name: Stop agent service
|
||||
service:
|
||||
ansible.builtin.systemd:
|
||||
name: "{{ item }}"
|
||||
enabled: true
|
||||
state: stopped
|
||||
@@ -35,10 +35,27 @@
|
||||
update_cache: yes
|
||||
with_items:
|
||||
- "{{ datasaker_agents }}"
|
||||
when:
|
||||
when:
|
||||
- ansible_facts.os_family == "Debian"
|
||||
- datasaker_agents
|
||||
notify:
|
||||
- Reload systemd configuration
|
||||
ignore_errors: true
|
||||
|
||||
- name: "Uninstall datasaker agent"
|
||||
yum:
|
||||
name: "{{ item }}"
|
||||
state: absent
|
||||
with_items:
|
||||
- "{{ datasaker_agents }}"
|
||||
when:
|
||||
- ansible_facts.os_family == "RedHat"
|
||||
- datasaker_agents
|
||||
notify:
|
||||
- Reload systemd configuration
|
||||
ignore_errors: true
|
||||
|
||||
|
||||
- name: Stop the Docker container
|
||||
docker_container:
|
||||
name: "{{ item }}"
|
||||
|
||||
Reference in New Issue
Block a user