forked from pdacity/zabbix_nfs_client_iostat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy_userparam.yaml
43 lines (38 loc) · 995 Bytes
/
deploy_userparam.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
---
# run with ansible-playbook -v -i host.linux deploy_userparam.yaml --limit host/group
#
- hosts: all
become: yes
tasks:
- name: Check script folder exists
stat:
path: "{{ zbx_userpar_dir }}"
register: workdir
- name: "echo if directory already existed"
debug:
msg: "folder for userparameters files is already existed"
when: workdir.stat.exists
- name: "Ansible Create directory if not exists"
file:
path: "{{ zbx_userpar_dir }}"
state: directory
mode: 0755
group: root
owner: root
when: workdir.stat.exists == false
- name: Copy file with owner and permissions
copy:
src: "{{ item }}"
dest: "{{ zbx_userpar_dir }}"
owner: root
group: root
mode: '0644'
backup: yes
validate: ls %s
with_items:
- userparameter_nfsio.conf
- userparameterrpc.conf
- name: Restart Zabbix agent on host
systemd:
state: restarted
name: zabbix-agent