Ansible Script 추가

This commit is contained in:
ByeonJungHun
2023-12-19 13:36:16 +09:00
parent 0273450ff6
commit 05cb8d9269
2610 changed files with 281893 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
---
- name: Converge
hosts: all:!zabbix_server
pre_tasks:
- name: "Get IP Server"
ansible.builtin.shell: grep $(hostname) /etc/hosts | awk '{ print $1 }' | tail -n 1
register: ip_address
delegate_to: zabbix-server-centos
changed_when: false
tags:
- skip_ansible_lint
- name: "Get IP hosts"
ansible.builtin.shell: grep $(hostname) /etc/hosts | awk '{ print $1 }' | tail -n 1
register: ip_address_host
changed_when: false
tags:
- skip_ansible_lint
roles:
- role: zabbix_agent
zabbix_agent_ip: "{{ ip_address_host.stdout }}"
zabbix_agent_server: "{{ ip_address.stdout }}"
zabbix_agent_serveractive: "{{ ip_address.stdout }}"