summaryrefslogtreecommitdiff
path: root/roles/mrzcpd/tasks/main.yml
blob: 0b3f7082468278fc3a31ad5b2d0c6af2b4833c83 (plain)
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
---
- name: "copy mrzcpd to destination server"
  synchronize:
    src: "{{ role_path }}/files/"
    dest: "/tmp/ansible_deploy/"

- name: "install mrzcpd"
  yum:
    name: /tmp/ansible_deploy/mrzcpd-4.3.30.4627eb7-1.el7.x86_64.rpm
    state: present

- name: "update sysconfig/mrzcpd"
  template:
    src: "{{ role_path }}/templates/mrzcpd.j2"
    dest: /etc/sysconfig/mrzcpd

- name: "update mrglobal.conf - traffic_mirror"
  template:
    src: "{{ role_path }}/templates/traffic_mirror/mrglobal.conf.traffic_mirror.j2"
    dest: /opt/mrzcpd/etc/mrglobal.conf
  when: nic_traffic_mirror is defined


- name: "copy mrapp.sapp4.conf to destination server"
  template:
    src: "{{ role_path }}/templates/mrapp.sapp4.conf "
    dest: /opt/mrzcpd/etc/mrapp.sapp4.conf 
  when: 
    - tsg_access_type == 4

- name: "update mrglobal.conf.adc_inline"
  template:
    src: "{{ role_path }}/templates/adc_inline/mrglobal.conf.adc_inline.j2"
    dest: /opt/mrzcpd/etc/mrglobal.conf
  when: 
    - nic_traffic_mirror is not defined
    - tsg_access_type == 1
    - tsg_running_type == 2

- name: "update mrglobal.conf.server_inline"
  template:
    src: "{{ role_path }}/templates/server_inline/mrglobal.conf.server_inline.j2"
    dest: /opt/mrzcpd/etc/mrglobal.conf
  when: 
    - nic_traffic_mirror is not defined
    - tsg_access_type == 1
    - tsg_running_type != 2

- name: "update mrglobal.conf.allot - mcn0"
  template:
    src: "{{ role_path }}/templates/allot_access/mrglobal.conf.allot_access.j2"
    dest: /opt/mrzcpd/etc/mrglobal.conf
  when: 
    - nic_traffic_mirror is not defined
    - tsg_access_type == 2

- name: "update mrglobal.conf.adc_tun_mode - mcn0"
  template:
    src: "{{ role_path }}/templates/adc_tun_mode/mrglobal.conf.adc_tun_mode.j2"
    dest: /opt/mrzcpd/etc/mrglobal.conf
  when: 
    - nic_traffic_mirror is not defined
    - tsg_access_type == 3


- name: "update mrglobal.conf.ATCA_Vlan_Flipping"
  template:
    src: "{{ role_path }}/templates/ATCA_Vlan_Flipping/mrglobal.conf.ATCA_Vlan_Flipping.j2"
    dest: /opt/mrzcpd/etc/mrglobal.conf
  when: 
    - nic_traffic_mirror is not defined
    - tsg_access_type == 4

- name: "update mrglobal.conf.ATCA_VXLAN"
  template:
    src: "{{ role_path }}/templates/ATCA_VXLAN/mrglobal.conf.ATCA_VXLAN.j2"
    dest: /opt/mrzcpd/etc/mrglobal.conf
  when:
    - nic_traffic_mirror is not defined
    - tsg_access_type == 5

- name: "update mrtunnat.conf.adc_inline"
  template:
    src: "{{ role_path }}/templates/adc_inline/mrtunnat.conf.adc_inline.j2"
    dest: /opt/mrzcpd/etc/mrtunnat.conf
  when: 
    - nic_traffic_mirror is not defined
    - tsg_access_type == 1
    - tsg_running_type == 2 

- name: "update mrtunnat.conf.server_inline"
  template:
    src: "{{ role_path }}/templates/server_inline/mrtunnat.conf.server_inline.j2"
    dest: /opt/mrzcpd/etc/mrtunnat.conf
  when: 
    - nic_traffic_mirror is not defined
    - tsg_access_type == 1
    - tsg_running_type != 2 

- name: "update mrtunnat.conf.allot_access - mcn0"
  template:
    src: "{{ role_path }}/templates/allot_access/mrtunnat.conf.allot_access.j2"
    dest: /opt/mrzcpd/etc/mrtunnat.conf
  when: 
    - nic_traffic_mirror is not defined
    - tsg_access_type == 2

- name: "update mrtunnat.conf.adc_tun_mode - mcn0"
  template:
    src: "{{ role_path }}/templates/adc_tun_mode/mrtunnat.conf.adc_tun_mode.j2"
    dest: /opt/mrzcpd/etc/mrtunnat.conf
  when: 
    - nic_traffic_mirror is not defined
    - tsg_access_type == 3

- name: "update mrtunnat.conf.ATCA_Vlan_Flipping"
  template:
    src: "{{ role_path }}/templates/ATCA_Vlan_Flipping/mrtunnat.conf.ATCA_Vlan_Flipping.j2"
    dest: /opt/mrzcpd/etc/mrtunnat.conf
  when: 
    - nic_traffic_mirror is not defined
    - tsg_access_type == 4

- name: "update mrtunnat.conf.ATCA_VXLAN"
  template:
    src: "{{ role_path }}/templates/ATCA_VXLAN/mrtunnat.conf.ATCA_VXLAN.j2"
    dest: /opt/mrzcpd/etc/mrtunnat.conf
  when:
    - nic_traffic_mirror is not defined
    - tsg_access_type == 5

- name: "enable mrenv"
  systemd:
    name: mrenv
    enabled: yes
    daemon_reload: yes
  when: 
    - tsg_access_type != 0

- name: "enable mrzcpd"
  systemd:
    name: mrzcpd
    enabled: yes
    daemon_reload: yes
  when: 
    - tsg_access_type != 0

- name: "enable prometheus output - monit_device"
  systemd:
    name: mrapm_device
    enabled: yes
    daemon_reload: yes

- name: "enable prometheus output - monit_stream"
  systemd:
    name: mrapm_stream
    enabled: yes
    daemon_reload: yes

- name: "enable mrtunnat on master"
  systemd:
    name: mrtunnat
    enabled: no
    daemon_reload: yes
  when: 
    - nic_traffic_mirror is not defined
    - tsg_access_type != 0

- name: "disable mrtunnat on slave"
  systemd:
    name: mrtunnat
    enabled: no
    daemon_reload: yes
  when: nic_traffic_mirror is defined

- name: "mask mrzcpd on server_tun_mode"
  systemd:
    name: mrzcpd
    enabled: no
    masked: yes
    daemon_reload: yes
  when: 
    - tsg_access_type == 0

- name: "mask mrtunnat on server_tun_mode"
  systemd:
    name: mrtunnat
    enabled: no
    masked: yes
    daemon_reload: yes
  when: 
    - tsg_access_type == 0