-
Notifications
You must be signed in to change notification settings - Fork 0
/
inetRouter.yml
46 lines (40 loc) · 993 Bytes
/
inetRouter.yml
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
44
45
46
---
- name: Otus ansible
hosts: all
become: true
tasks:
- name: provisioner info
ansible.builtin.debug:
msg: "Hi otus -task 18 {{ inventory_hostname }}"
- name: install iptables service
yum:
name:
- iptables
- iptables-services
state: present
update_cache: true
- name: copy iptables config to InetRouter
template:
src: inetRouter/internetRouter.iptables.conf.j2
dest: /etc/sysconfig/iptables
owner: root
group: root
mode: 0600
- name: add routes
template:
src: "inetRouter/{{ item }}"
dest: /etc/sysconfig/network-scripts/
loop:
- route-eth1
notify:
- restart network
- name: start and enable iptables service
service:
name: iptables
state: restarted
enabled: true
handlers:
- name: restart network
service:
name: network
state: restarted