#!/usr/bin/env python3 # -*- coding: utf-8 -*- import utils def setup(interactive=True): dir_path = utils.get_dir(__file__) cmds = [ # NTP 'echo "Replacing /etc/ntp.conf"', dict(line='write', template='%s/ntp.conf' % dir_path, target='/etc/ntp.conf', params=( ('{{ NTP_SERVER }}', utils.get_conf('NTP_SERVER') or utils.get_conf('NTP_SERVER1') or 'ntp.ubuntu.com'), )), 'service ntp restart', ] utils.run_commands(cmds)