aboutsummaryrefslogtreecommitdiffstats
path: root/deploy/adapters/ansible/roles/config-controller/tasks/RedHat.yml
blob: cc14347af7889f91ee0a69d253a1304cb839afe5 (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
##############################################################################
# Copyright (c) 2017 HUAWEI TECHNOLOGIES CO.,LTD and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
---
# yamllint disable rule:line-length
- name: generate tenant vlan ifcfg-if script
  template:
    src: ifcfg-if.tenant
    dest: /etc/sysconfig/network-scripts/ifcfg-{{contr_sys_mappings["tenant"]["interface"]}}.{{contr_sys_mappings["tenant"]["vlan_tag"]}}

- name: generate storage vlan ifcfg-if script
  template:
    src: ifcfg-if.storage
    dest: /etc/sysconfig/network-scripts/ifcfg-{{contr_sys_mappings["storage"]["interface"]}}.{{contr_sys_mappings["storage"]["vlan_tag"]}}

- name: add br-external to interface script
  lineinfile:
    dest: /etc/sysconfig/network-scripts/ifcfg-{{contr_sys_mappings["external"]["interface"]}}
    line: "BRIDGE=br-external"

- name: add br-storage to interface script
  lineinfile:
    dest: /etc/sysconfig/network-scripts/ifcfg-{{contr_sys_mappings["storage"]["interface"]}}.{{contr_sys_mappings["storage"]["vlan_tag"]}}
    line: "BRIDGE=br-storage"

- name: add br-tenant to interface script
  lineinfile:
    dest: /etc/sysconfig/network-scripts/ifcfg-{{contr_sys_mappings["tenant"]["interface"]}}.{{contr_sys_mappings["tenant"]["vlan_tag"]}}
    line: "BRIDGE=br-tenant"
# yamllint enable rule:line-length

- name: remove eth0 ip addresss
  lineinfile:
    dest: /etc/sysconfig/network-scripts/ifcfg-eth0
    regexp: "^IPADDR=*"
    state: absent

- name: remove eth0 netmask
  lineinfile:
    dest: /etc/sysconfig/network-scripts/ifcfg-eth0
    regexp: "^NETMASK=*"
    state: absent

- name: add br-mgmt to eth0 script
  lineinfile:
    dest: /etc/sysconfig/network-scripts/ifcfg-eth0
    line: "BRIDGE=br-mgmt"

- name: generate ifcfg-br-mgmt script
  template:
    src: ifcfg-br-mgmt
    dest: /etc/sysconfig/network-scripts/

- name: generate ifcfg-br-external script
  template:
    src: ifcfg-br-external
    dest: /etc/sysconfig/network-scripts/

- name: generate ifcfg-br-storag script
  template:
    src: ifcfg-br-storage
    dest: /etc/sysconfig/network-scripts/

- name: generate ifcfg-br-tenant script
  template:
    src: ifcfg-br-tenant
    dest: /etc/sysconfig/network-scripts/

- name: restart the network
  shell: systemctl restart network