blob: 73b12fb41c1f381914499a97b2182aec074e2e24 [file] [log] [blame]
Zack Williams709f11b2016-03-17 14:29:51 -07001#!/bin/sh -e
2#
3# rc.local
4#
5# This script is executed at the end of each multiuser runlevel.
6# Make sure that the script will "exit 0" on success or any other
7# value on error.
8#
9# In order to enable or disable this script just change the execution
10# bits.
11
12{% set head_host = groups['head'][0] -%}
13{% set head_ip = hostvars[head_host]['ansible_default_ipv4']['address'] -%}
14{% set virt_network = hostvars[head_host]['ansible_virbr0']['ipv4']['network'] -%}
15{% set virt_netmask = hostvars[head_host]['ansible_virbr0']['ipv4']['netmask'] -%}
16
17route add -net {{ virt_network }} netmask {{ virt_netmask }} gw {{ head_ip }} || true
18
19exit 0