host-agent 최신화
This commit is contained in:
59
roles/one_agent/tasks/host-agent.yml.bak
Normal file
59
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
|
||||
Reference in New Issue
Block a user