host-agent 최신화

This commit is contained in:
ByeonJungHun
2024-08-06 16:35:47 +09:00
parent c907af9e98
commit 2fc6bc7cd2
17 changed files with 3709 additions and 48 deletions

View File

@@ -5,10 +5,10 @@
roles: roles:
- role: one_agent - role: one_agent
vars: vars:
EXEM_HOME: /home/exem EXEM_HOME: /tmp
RECEIVER_ADDR: 10.10.54.150 RECEIVER_ADDR: 10.10.55.109
#RECEIVER_PORT: 9010 #RECEIVER_PORT: 9010
#RECEIVER_CONTAINER_PORT: 9009 #RECEIVER_CONTAINER_PORT: 9009
# port 설정이 필요할 경우 위 주석을 해제하고 설정 # port 설정이 필요할 경우 위 주석을 해제하고 설정
# RECEIVER_PORT 와 RECEIVER_CONTAINER_PORT 같은 경우 변수를 설정하지 않을 경우 default 값으로 각각 9010 , 9009 으로 설정 됨 # RECEIVER_PORT 와 RECEIVER_CONTAINER_PORT 같은 경우 변수를 설정하지 않을 경우 default 값으로 각각 9010 , 9009 으로 설정 됨
agent_list: ['container-agent'] agent_list: ['host-agent']

View File

@@ -3,9 +3,8 @@ host_agent
container_agent container_agent
[host_agent] [host_agent]
10.10.55.102
[container_agent] [container_agent]
10.10.54.105
10.10.54.150
[ndm_agent] [ndm_agent]

File diff suppressed because it is too large Load Diff

View File

@@ -9,51 +9,14 @@
ansible.builtin.copy: ansible.builtin.copy:
src: "{{ role_path }}/files/host" src: "{{ role_path }}/files/host"
dest: "{{ EXEM_HOME }}" dest: "{{ EXEM_HOME }}"
- name: Create Agent Script
ansible.builtin.template:
src: "{{ item }}.j2"
dest: "{{ EXEM_HOME }}/host/script/{{ item }}"
mode: '0755'
with_items:
- binary_start.sh
- binary_stop.sh
- systemctl_stop.sh
- systemctl_enable.sh
- name: Create Service Script
ansible.builtin.template:
src: "{{ item }}.j2"
dest: "{{ EXEM_HOME }}/host/service/{{ item }}"
mode: '0755'
with_items:
- exem-host-agent
- exem-host-agent.service
- name: Move exem-host-agent Binary
ansible.builtin.copy:
src: "{{ EXEM_HOME }}/host/os_binary/exem-host-agent_linux-2.6-x86_64-64"
dest: "{{ EXEM_HOME }}/host/bin/exem-host-agent"
remote_src: yes
mode: '0755' mode: '0755'
- name: Setting SELinux - name: Install Start exemONE Host-Agent
ansible.builtin.shell: | ansible.builtin.shell: |
chcon -t bin_t {{ EXEM_HOME }}/host/script/binary_start.sh {{ EXEM_HOME }}/host/setup_exem-host-agent_1.2.10.1.bin {{ RECEIVER_ADDR }} {{ RECEIVER_PORT | default('9010') }}
chcon -R -t var_run_t {{ EXEM_HOME }}/host/data/ args:
chcon -R -t var_run_t {{ EXEM_HOME }}/host/service/ chdir: "{{ EXEM_HOME }}/host"
- name: Create Symbolic link
ansible.builtin.file:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
state: link
loop:
- { src: "{{ EXEM_HOME }}/host/service/exem-host-agent.service", dest: /etc/systemd/system/exem-host-agent.service }
- { src: "{{ EXEM_HOME }}/host/service/exem-host-agent", dest: /usr/bin/exem-host-agent }
- name: exem-host-agent start and enable - name: exem-host-agent start and enable
ansible.builtin.service: ansible.builtin.shell: |
name: exem-host-agent {{ EXEM_HOME }}/host/exem/host/start.sh
state: started
enabled: yes

View File

@@ -0,0 +1,59 @@
---
- name: Create exemONE Agent Directory
ansible.builtin.file:
path: "{{ EXEM_HOME }}"
state: directory
mode: '0755'
- name: Copy exemONE Host-Agent File
ansible.builtin.copy:
src: "{{ role_path }}/files/host"
dest: "{{ EXEM_HOME }}"
- name: Create Agent Script
ansible.builtin.template:
src: "{{ item }}.j2"
dest: "{{ EXEM_HOME }}/host/script/{{ item }}"
mode: '0755'
with_items:
- binary_start.sh
- binary_stop.sh
- systemctl_stop.sh
- systemctl_enable.sh
- name: Create Service Script
ansible.builtin.template:
src: "{{ item }}.j2"
dest: "{{ EXEM_HOME }}/host/service/{{ item }}"
mode: '0755'
with_items:
- exem-host-agent
- exem-host-agent.service
- name: Move exem-host-agent Binary
ansible.builtin.copy:
src: "{{ EXEM_HOME }}/host/os_binary/exem-host-agent_linux-2.6-x86_64-64"
dest: "{{ EXEM_HOME }}/host/bin/exem-host-agent"
remote_src: yes
mode: '0755'
- name: Setting SELinux
ansible.builtin.shell: |
chcon -t bin_t {{ EXEM_HOME }}/host/script/binary_start.sh
chcon -R -t var_run_t {{ EXEM_HOME }}/host/data/
chcon -R -t var_run_t {{ EXEM_HOME }}/host/service/
- name: Create Symbolic link
ansible.builtin.file:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
state: link
loop:
- { src: "{{ EXEM_HOME }}/host/service/exem-host-agent.service", dest: /etc/systemd/system/exem-host-agent.service }
- { src: "{{ EXEM_HOME }}/host/service/exem-host-agent", dest: /usr/bin/exem-host-agent }
- name: exem-host-agent start and enable
ansible.builtin.service:
name: exem-host-agent
state: started
enabled: yes