51 lines
1.8 KiB
YAML
51 lines
1.8 KiB
YAML
---
|
|
# Copyright 2016, Rackspace US, Inc.
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
|
|
# Note this is a used in an iterable and requires the <item.value.interface> variable
|
|
# The container interface variable is a a default object that assume the
|
|
# Ansible iterator type is `with_dict`.
|
|
lxc_container_interface: |
|
|
### start generated network for [ {{ item.value.interface }} ] ###
|
|
DEVICE={{ item.value.interface }}
|
|
BOOTPROTO=none
|
|
ONBOOT=yes
|
|
NM_CONTROLLED=no
|
|
TYPE=Ethernet
|
|
{% if item.value.address is defined %}
|
|
IPADDR={{ item.value.address }}
|
|
NETMASK={{ item.value.netmask }}
|
|
{% if item.value.gateway is defined %}
|
|
GATEWAY={{ item.value.gateway }}
|
|
{% endif %}
|
|
{% endif %}
|
|
MTU={{ item.value.mtu|default(lxc_container_default_mtu) }}
|
|
DELAY=0
|
|
### end generated network for [ {{ item.value.interface }} ] ###
|
|
|
|
lxc_container_default_route_interfaces:
|
|
route_file: "/etc/sysconfig/network-scripts/route-{{ item.value.interface }}"
|
|
route_setup: |
|
|
{% for route in item.value.static_routes %}
|
|
{{ route['cidr'] }} via {{ route['gateway'] }} dev {{ item.value.interface }}
|
|
{% endfor %}
|
|
|
|
# Note this is a used in an iterable and requires the <item.value.interface> variable
|
|
lxc_container_interface_target: "/etc/sysconfig/network-scripts/ifcfg-{{ item.value.interface }}"
|
|
|
|
lxc_container_map:
|
|
distro: centos
|
|
arch: amd64
|
|
release: 7
|