first commit
This commit is contained in:
24
playbooks/upgrade_all_hosts.yml
Normal file
24
playbooks/upgrade_all_hosts.yml
Normal file
@ -0,0 +1,24 @@
|
||||
---
|
||||
- hosts: all
|
||||
become: yes
|
||||
tasks:
|
||||
- name: "Update cache & Full system update"
|
||||
apt:
|
||||
update_cache: true
|
||||
upgrade: dist
|
||||
cache_valid_time: 3600
|
||||
force_apt_get: true
|
||||
- name: "Clean unwanted olderstuff"
|
||||
apt:
|
||||
autoremove: yes
|
||||
purge: yes
|
||||
clean: yes
|
||||
- name: "Fix sysctl file"
|
||||
ansible.builtin.copy:
|
||||
src: ../config/sysctl.conf
|
||||
dest: /etc/sysctl.conf
|
||||
owner: "root"
|
||||
group: "root"
|
||||
mode: 0644
|
||||
- name: "Reboot all machines"
|
||||
ansible.builtin.reboot:
|
49
playbooks/zabbix_agent_install.yml
Normal file
49
playbooks/zabbix_agent_install.yml
Normal file
@ -0,0 +1,49 @@
|
||||
---
|
||||
- name: "Zabbix agent2 installation and setup"
|
||||
hosts: Rack
|
||||
become: yes
|
||||
vars_files:
|
||||
- ../vaults/zabbix.yml
|
||||
vars:
|
||||
- zabbix_version: 6.4
|
||||
- zabbix_server: 192.168.1.161
|
||||
- host_meta: OrangePiZero Rack
|
||||
|
||||
tasks:
|
||||
- name: Upgrade zabbix-release
|
||||
apt:
|
||||
name: zabbix-release
|
||||
state: latest
|
||||
|
||||
- name: uninstall zabbix agent
|
||||
apt:
|
||||
name: zabbix-agent
|
||||
state: absent
|
||||
|
||||
- name: install zabbix agent2
|
||||
apt:
|
||||
name: zabbix-agent2
|
||||
state: latest
|
||||
|
||||
- ansible.builtin.copy: content="{{ psk_key }}" dest=/etc/zabbix/key.psk
|
||||
|
||||
- name: Configure zabbix agent service
|
||||
ansible.builtin.template:
|
||||
src: ../templates/zabbix_agentd2.conf
|
||||
dest: /etc/zabbix/zabbix_agent2.conf
|
||||
owner: zabbix
|
||||
group: zabbix
|
||||
mode: '0644'
|
||||
backup: yes
|
||||
- name: Create a config directory
|
||||
ansible.builtin.file:
|
||||
path: /etc/zabbix/zabbix_agentd.conf.d/
|
||||
state: directory
|
||||
mode: '0755'
|
||||
|
||||
|
||||
- name: Restart zabbix agent
|
||||
ansible.builtin.service:
|
||||
name: zabbix-agent2
|
||||
state: restarted
|
||||
enabled: yes
|
Reference in New Issue
Block a user