blob: 85d9dec19f0217e30c8460ab6cddbb2454c37fb0 [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'] -%}
Zack Williamsda063582016-04-12 14:02:47 -070014{% set virt_network = virt_nets[0]['ipv4_prefix'] ~ '.0' -%}
15{% set virt_netmask = "255.255.255.0" -%}
Zack Williams709f11b2016-03-17 14:29:51 -070016
17route add -net {{ virt_network }} netmask {{ virt_netmask }} gw {{ head_ip }} || true
18
19exit 0