summaryrefslogtreecommitdiffstats
path: root/xci/playbooks/roles/bootstrap-host/tasks/network_redhat.yml
diff options
context:
space:
mode:
authorMarkos Chandras <mchandras@suse.de>2018-04-25 15:55:10 +0100
committerMarkos Chandras <mchandras@suse.de>2018-04-30 16:09:19 +0100
commit15be5eb8da9881428ea1635a3184c39f63dfaf80 (patch)
tree7e46c3fc275e1ee8222568087999a89bcd153567 /xci/playbooks/roles/bootstrap-host/tasks/network_redhat.yml
parentbe67faf1cfaeb2f0d1ff73c90c8b3996b2b6a506 (diff)
xci: roles: bootstrap-host: Simplify configuration files
We split the networking task on distro specific files to make it easier to read. Moreover, the debian network configuration has been improved by simply sharing a common file across all nodes and also use the 'source' facility in the main /etc/network/interfaces file to use one configuration file per interface. Change-Id: Ic822fe6dc197227e70c0ba7cee812629df287d82 Signed-off-by: Markos Chandras <mchandras@suse.de>
Diffstat (limited to 'xci/playbooks/roles/bootstrap-host/tasks/network_redhat.yml')
-rw-r--r--xci/playbooks/roles/bootstrap-host/tasks/network_redhat.yml37
1 files changed, 37 insertions, 0 deletions
diff --git a/xci/playbooks/roles/bootstrap-host/tasks/network_redhat.yml b/xci/playbooks/roles/bootstrap-host/tasks/network_redhat.yml
new file mode 100644
index 00000000..8c98203a
--- /dev/null
+++ b/xci/playbooks/roles/bootstrap-host/tasks/network_redhat.yml
@@ -0,0 +1,37 @@
+---
+# 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" , ip: "{{ host_info[inventory_hostname].VLAN_IP }}", prefix: 24 }
+ - { name: "br-mgmt" , ip: "{{ host_info[inventory_hostname].MGMT_IP }}", prefix: 22 }
+ - { name: "br-storage", ip: "{{ host_info[inventory_hostname].STORAGE_IP }}", prefix: 22 }
+ - { name: "br-vxlan" , ip: "{{ host_info[inventory_hostname].VXLAN_IP }}", prefix: 22 }
+ loop_control:
+ label: "{{ item.name }}"
+
+- name: Add default route through br-vlan
+ lineinfile:
+ path: "/etc/sysconfig/network-scripts/ifcfg-br-vlan"
+ line: "GATEWAY=192.168.122.1"
+
+- name: restart network service
+ service:
+ name: network
+ state: restarted
+ async: 15
+ poll: 0