The bootstrap-host role has a ton of skipped tasks that cause delays in the gate jobs. This patch allows us to do a dynamic include and only run the tasks that are needed for each distribution. Change-Id: I783cdcd2223d8eca574f8f1d30e18d76e5710dac
53 lines
1.9 KiB
YAML
53 lines
1.9 KiB
YAML
---
|
|
# Copyright 2015, 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.
|
|
|
|
- name: Copy network configuration
|
|
template:
|
|
src: "redhat_interface_{{ item.type | default('default') }}.cfg.j2"
|
|
dest: "/etc/sysconfig/network-scripts/ifcfg-{{ item.name | default('br-mgmt') }}"
|
|
with_items: "{{ bridges }}"
|
|
register: network_interfaces
|
|
|
|
- name: Create alias file when required
|
|
template:
|
|
src: "redhat_interface_alias.cfg.j2"
|
|
dest: "/etc/sysconfig/network-scripts/ifcfg-{{ item.name | default('br-mgmt')}}:0"
|
|
with_items: "{{ bridges }}"
|
|
when:
|
|
- item.alias is defined
|
|
|
|
- name: Put down post-up script for veth-peer interfaces
|
|
template:
|
|
src: "rpm_interface_{{ item[0] }}.cfg.j2"
|
|
dest: "/etc/sysconfig/network-scripts/{{ item[0] }}-veth-{{ item[1].name | default('br-mgmt') }}-2-{{ item[1].veth_peer | default('eth1') }}"
|
|
mode: "0755"
|
|
with_nested:
|
|
- [ "ifup-post", "ifdown-post" ]
|
|
- "{{ bridges }}"
|
|
when:
|
|
- item[1].veth_peer is defined
|
|
|
|
|
|
- name: Ensure the postup/postdown scripts are loaded
|
|
lineinfile:
|
|
dest: "/etc/sysconfig/network-scripts/{{ item[0] }}"
|
|
line: ". /etc/sysconfig/network-scripts/{{ item[0] }}-veth-{{ item[1].name | default('br-mgmt') }}-2-{{ item[1].veth_peer | default('eth1') }}"
|
|
insertbefore: "^exit 0"
|
|
with_nested:
|
|
- [ "ifup-post", "ifdown-post" ]
|
|
- "{{ bridges }}"
|
|
when:
|
|
- item[1].veth_peer is defined
|