summaryrefslogtreecommitdiffstats
path: root/xci/playbooks/roles/bootstrap-host/tasks/network_redhat.yml
blob: 288fdf65fbe8e925cda8fb0a682da9bd8e35a519 (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
---
# SPDX-license-identifier: Apache-2.0
##############################################################################
# Copyright (c) 2018 SUSE LINUX GmbH.
# 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
##############################################################################

- name: "Configure networking on {{ inventory_hostname }}"
  template:
    src: "{{ installer_type }}/{{ ansible_os_family | lower }}.ifcfg.j2"
    dest: "/etc/sysconfig/network-scripts/ifcfg-{{ item.name }}"
  with_items:
    - { name: "{{ ansible_local.xci.network.xci_interface }}"   , bridge: "br-vlan"                 }
    - { name: "{{ ansible_local.xci.network.xci_interface }}.10", bridge: "br-mgmt"   , vlan_id: 10 }
    - { name: "{{ ansible_local.xci.network.xci_interface }}.20", bridge: "br-storage", vlan_id: 20 }
    - { name: "{{ ansible_local.xci.network.xci_interface }}.30", bridge: "br-vxlan"  , vlan_id: 30 }
    - { name: "br-vlan"   , network: "{{ host_info[inventory_hostname].public }}" }
    - { name: "br-mgmt"   , network: "{{ host_info[inventory_hostname].mgmt }}" }
    - { name: "br-storage", network: "{{ host_info[inventory_hostname].storage }}" }
    - { name: "br-vxlan"  , network: "{{ host_info[inventory_hostname].private }}" }
  loop_control:
    label: "{{ item.name }}"

- name: restart network service
  service:
    name: network
    state: restarted
  async: 15
  poll: 0