From 11dbe27afb96c5b54b9f4f0a1c8b21194f59dc7b Mon Sep 17 00:00:00 2001 From: Jonas Bjurel Date: Sat, 3 Oct 2015 16:54:43 +0200 Subject: Moving tag arno.2015.1.0 from genesis to fuel/stable/arno Change-Id: I8bb3e28a814e04ad15e8a4b24b40bd7685600f46 Signed-off-by: Jonas Bjurel --- common/puppet-opnfv/manifests/resolver.pp | 62 +++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 common/puppet-opnfv/manifests/resolver.pp (limited to 'common/puppet-opnfv/manifests/resolver.pp') diff --git a/common/puppet-opnfv/manifests/resolver.pp b/common/puppet-opnfv/manifests/resolver.pp new file mode 100644 index 000000000..2951f7e1f --- /dev/null +++ b/common/puppet-opnfv/manifests/resolver.pp @@ -0,0 +1,62 @@ +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# stefan.k.berg@ericsson.com +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +# Class: opnfv::resolver +# +# Add resolver content passed through astute.yaml into resolv.conf +# depending on the role +# +# Suitable yaml content: +# +# opnfv: +# dns: +# compute: +# - 100.100.100.2 +# - 100.100.100.3 +# controller: +# - 100.100.100.102 +# - 100.100.100.104 +# +# +# +# + +class opnfv::resolver() +{ + if $::fuel_settings['role'] { + if $::fuel_settings['role'] == 'primary-controller' { + $role = 'controller' + } else { + $role = $::fuel_settings['role'] + } + + if ($::fuel_settings['opnfv'] + and $::fuel_settings['opnfv']['dns'] + and $::fuel_settings['opnfv']['dns'][$role]) { + $nameservers=$::fuel_settings['opnfv']['dns'][$role] + + file { '/etc/resolv.conf': + owner => root, + group => root, + mode => '0644', + content => template('opnfv/resolv.conf.erb'), + } +# /etc/resolv.conf is re-generated at each boot by resolvconf, so we +# need to store there as well. + file { '/etc/resolvconf/resolv.conf.d/head': + owner => root, + group => root, + mode => '0644', + content => template('opnfv/resolv.conf.erb'), + } + } + } +} + -- cgit 1.2.3-korg