Skip to content

Instantly share code, notes, and snippets.

@eedgar
eedgar / netconf.py
Last active August 29, 2015 14:26 — forked from simon-engledew/netconf.py
snack based ncurses script for configuring ubuntu networking, first pass
from __future__ import with_statement
import snack, ipaddr, optparse, re, shlex
parser = optparse.OptionParser()
parser.add_option('--no-cancel', action='store_true', dest='no_cancel', help='Do not display a cancel button')
parser.add_option('--title', action='store', dest='title', default='Configure Networking', help='set the form title')
parser.add_option('--interface', action='store', dest='interface', default='eth0', help='interface to edit')
parser.add_option('--interfaces-file', action='store', dest='interfaces_file', default='/etc/network/interfaces', help='target interfaces file to edit')
parser.add_option('--dns-file', action='store', dest='dns_file', default='/etc/resolvconf/resolv.conf.d/base', help='target dns file to edit')
#!/bin/bash
##############################################################################
#
# Copyright (C) Zenoss, Inc. 2007, all rights reserved.
#
# This content is made available according to terms specified in
# License.zenoss under the directory where your Zenoss product is installed.
#
##############################################################################
FROM stackbrew/ubuntu:saucy
RUN apt-get update
RUN apt-get install -y --force-yes \
software-properties-common \
pciutils \
debconf-utils
RUN add-apt-repository -y ppa:saltstack/salt
RUN apt-get update
#Knife invocations supply FQDN as the node name at creation time and this becomes hostname( option -N)
#Ensure the hostname of the system is set to knife provided node name
file "/etc/hostname" do
content node.name
notifies :run, resources(:execute => "Configure Hostname"), :immediately
end
#This sets up script which will run whenever eth0 comes up(after reboot) to update /etc/hosts
cookbook_file "/etc/network/if-up.d/update_hosts" do