-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsend_remote_offline.yaml
More file actions
37 lines (31 loc) · 898 Bytes
/
Copy pathsend_remote_offline.yaml
File metadata and controls
37 lines (31 loc) · 898 Bytes
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
- name: dns dist
hosts: all
user: root
gather_facts: false
become_user: root
vars_files:
- vars.yaml
tasks:
#发往远端
- name: copy files
copy:
src: '{{ item.src }}'
dest: '{{ item.dest }}'
owner: root
group: root
mode: 0644
with_items:
- { src: '{{ conf_dir }}/dnsdist.conf', dest: '/etc/dnsdist/dnsdist.conf' }
- { src: '{{ conf_dir }}/dnsdist.conf', dest: '/etc/dnsdist/dnsdist.conf_{{ bk_file_name }}' }
#check配置
- name: exec
shell: /usr/bin/dnsdist --check-config
register: result
- name: Show debug info
debug: var=result verbosity=0
#重启
- name: stop for dnsdist
systemd: name=dnsdist state=restarted
register: result
- name: Show debug info
debug: var=result verbosity=0