vn-ansible/zabbix/agent.yaml

37 lines
1.0 KiB
YAML
Raw Normal View History

2023-07-24 11:17:05 +00:00
# ansible-playbook -i inventory agent.yaml -u centos --key-file=node.pem -b
2023-07-24 12:29:47 +00:00
2023-07-24 12:28:21 +00:00
#- hosts: {"{ hostvars[hostname].ansible_host }"}
2023-07-24 12:29:47 +00:00
---
2023-07-24 12:31:34 +00:00
- hosts: "{{ hostvars['hostname'].ansible_host }}"
2023-07-24 11:17:05 +00:00
gather_facts: false
vars:
ansible_python_interpreter: /usr/bin/python3
tasks:
- name: get zabbix package
get_url:
url: https://repo.zabbix.com/zabbix/6.4/debian/pool/main/z/zabbix/zabbix-agent_6.4.0-1%2Bdebian11_amd64.deb
dest: /tmp
- name: dpkg zabbix
ansible.builtin.dpkg_selections:
name: zabbix-release_6.0-3+ubuntu22.04_all.deb
selection: install
- name: update package index
ansible.builtin.apt:
update_cache: yes
# - name: Copy zabbix_agentd.conf file with owner and permissions
# ansible.builtin.copy:
# src: zabbix_agentd.conf
# dest: /etc/zabbix/zabbix_agentd.conf
- name: install zabbix-agent #Zabbixエージェントをインストールします。
ansible.builtin.apt:
name:
- zabbix-agent
state: present
2023-07-24 11:16:01 +00:00