exemONE Host Agent Installer Container Image
This commit is contained in:
24
installer/roles/one_agent/tasks/container-agent.yml
Normal file
24
installer/roles/one_agent/tasks/container-agent.yml
Normal file
@@ -0,0 +1,24 @@
|
||||
---
|
||||
- name: Create exemONE Agent Directory
|
||||
ansible.builtin.file:
|
||||
path: "{{ EXEM_HOME }}"
|
||||
state: directory
|
||||
mode: '0755'
|
||||
|
||||
- name: Copy exemONE Container-Agent File
|
||||
# ansible.posix.synchronize:
|
||||
ansible.builtin.copy:
|
||||
src: "{{ role_path }}/files/container"
|
||||
dest: "{{ EXEM_HOME }}"
|
||||
|
||||
- name: Create Agent Script
|
||||
ansible.builtin.template:
|
||||
src: "{{ item }}.j2"
|
||||
dest: "{{ EXEM_HOME }}/container/script/binary_mode/{{ item }}"
|
||||
mode: '0755'
|
||||
with_items:
|
||||
- start.sh
|
||||
- stop.sh
|
||||
|
||||
- name: exem-container-agent start
|
||||
ansible.builtin.shell: "nohup {{ EXEM_HOME }}/container/script/binary_mode/start.sh"
|
||||
22
installer/roles/one_agent/tasks/host-agent.yml
Normal file
22
installer/roles/one_agent/tasks/host-agent.yml
Normal file
@@ -0,0 +1,22 @@
|
||||
---
|
||||
- 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 }}"
|
||||
mode: '0755'
|
||||
|
||||
- name: Install Start exemONE Host-Agent
|
||||
ansible.builtin.shell: |
|
||||
{{ EXEM_HOME }}/host/setup_exem-host-agent_1.2.10.1.bin {{ RECEIVER_ADDR }} {{ RECEIVER_PORT | default('9010') }}
|
||||
args:
|
||||
chdir: "{{ EXEM_HOME }}/host"
|
||||
|
||||
- name: exem-host-agent start and enable
|
||||
ansible.builtin.shell: |
|
||||
{{ EXEM_HOME }}/host/exem/host/start.sh
|
||||
59
installer/roles/one_agent/tasks/host-agent.yml.bak
Normal file
59
installer/roles/one_agent/tasks/host-agent.yml.bak
Normal 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
|
||||
18
installer/roles/one_agent/tasks/main.yml
Normal file
18
installer/roles/one_agent/tasks/main.yml
Normal file
@@ -0,0 +1,18 @@
|
||||
---
|
||||
# - include_tasks: rsync.yml
|
||||
# 더이상 사용하지 않는 task, 기존 synchronize 모듈을 copy 모듈로 변경
|
||||
|
||||
- include_tasks: host-agent.yml
|
||||
when:
|
||||
- agent_list | select('search', 'host-agent') | list | count > 0
|
||||
- "'host_agent' in group_names"
|
||||
|
||||
- include_tasks: container-agent.yml
|
||||
when:
|
||||
- agent_list | select('search', 'container-agent') | list | count > 0
|
||||
- "'container_agent' in group_names"
|
||||
|
||||
- include_tasks: ndm-agent.yml
|
||||
when:
|
||||
- agent_list | select('search', 'ndm-agent') | list | count > 0
|
||||
- "'ndm_agent' in group_names"
|
||||
38
installer/roles/one_agent/tasks/ndm-agent.yml
Normal file
38
installer/roles/one_agent/tasks/ndm-agent.yml
Normal file
@@ -0,0 +1,38 @@
|
||||
---
|
||||
- name: Create exemONE Agent Directory
|
||||
ansible.builtin.file:
|
||||
path: "{{ EXEM_HOME }}"
|
||||
state: directory
|
||||
mode: '0755'
|
||||
|
||||
- name: Copy exemONE NDM-Agent File
|
||||
# ansible.posix.synchronize:
|
||||
ansible.builtin.copy:
|
||||
src: "{{ role_path }}/files/ndm"
|
||||
dest: "{{ EXEM_HOME }}"
|
||||
|
||||
- name: Create Agent Script
|
||||
ansible.builtin.template:
|
||||
src: "{{ item }}.j2"
|
||||
dest: "{{ EXEM_HOME }}/ndm/bin/{{ item }}"
|
||||
mode: '0740'
|
||||
with_items:
|
||||
- ndm-ctl
|
||||
- ndm-svc
|
||||
- reg.env
|
||||
- start
|
||||
- stop
|
||||
|
||||
- name: Create Agent Conf
|
||||
ansible.builtin.template:
|
||||
src: "{{ item }}.j2"
|
||||
dest: "{{ EXEM_HOME }}/ndm/conf/{{ item }}"
|
||||
mode: '0755'
|
||||
with_items:
|
||||
- ndm.conf
|
||||
|
||||
- name: chmod change
|
||||
ansible.builtin.shell: "chmod -R 740 {{ EXEM_HOME }}/ndm"
|
||||
|
||||
- name: exem-ndm-agent start
|
||||
ansible.builtin.shell: "nohup {{ EXEM_HOME }}/ndm/bin/start"
|
||||
39
installer/roles/one_agent/tasks/rsync.yml
Normal file
39
installer/roles/one_agent/tasks/rsync.yml
Normal file
@@ -0,0 +1,39 @@
|
||||
---
|
||||
- name: Create exemONE Agent Directory
|
||||
ansible.builtin.file:
|
||||
path: "{{ EXEM_HOME }}"
|
||||
state: directory
|
||||
mode: '0755'
|
||||
|
||||
- name: Copy rsync install rpm OS - 7
|
||||
ansible.builtin.copy:
|
||||
src: "{{ role_path }}/files/rpm/rhel7.rpm"
|
||||
dest: "{{ EXEM_HOME }}/rhel7.rpm"
|
||||
mode: '0755'
|
||||
when: ansible_distribution_major_version == '7'
|
||||
|
||||
- name: install rsync os version 7
|
||||
ansible.builtin.shell: "yum localinstall -y {{ EXEM_HOME }}/rhel7.rpm"
|
||||
when: ansible_distribution_major_version == '7'
|
||||
|
||||
- name: Copy rsync install rpm OS - 8
|
||||
ansible.builtin.copy:
|
||||
src: "{{ role_path }}/files/rpm/rhel8.rpm"
|
||||
dest: "{{ EXEM_HOME }}/rhel8.rpm"
|
||||
mode: '0755'
|
||||
when: ansible_distribution_major_version == '8'
|
||||
|
||||
- name: install rsync os version 8
|
||||
ansible.builtin.shell: "yum localinstall -y {{ EXEM_HOME }}/rhel8.rpm"
|
||||
when: ansible_distribution_major_version == '8'
|
||||
|
||||
- name: Copy rsync install rpm OS - 9
|
||||
ansible.builtin.copy:
|
||||
src: "{{ role_path }}/files/rpm/rhel9.rpm"
|
||||
dest: "{{ EXEM_HOME }}/rhel9.rpm"
|
||||
mode: '0755'
|
||||
when: ansible_distribution_major_version == '9'
|
||||
|
||||
- name: install rsync os version 9
|
||||
ansible.builtin.shell: "yum localinstall -y {{ EXEM_HOME }}/rhel9.rpm"
|
||||
when: ansible_distribution_major_version == '9'
|
||||
Reference in New Issue
Block a user