1 ##############################################################################
2 # Copyright (c) 2015 Ericsson AB and others.
3 # stefan.k.berg@ericsson.com
4 # jonas.bjurel@ericsson.com
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9 ##############################################################################
11 # Class: opnfv::resolver
13 # Add resolver content passed through astute.yaml into resolv.conf
14 # depending on the role
16 # Suitable yaml content:
31 class opnfv::resolver()
33 if $::fuel_settings['role'] {
34 if $::fuel_settings['role'] == 'primary-controller' {
37 $role = $::fuel_settings['role']
40 if ($::fuel_settings['opnfv']
41 and $::fuel_settings['opnfv']['dns']
42 and $::fuel_settings['opnfv']['dns'][$role]) {
43 $nameservers=$::fuel_settings['opnfv']['dns'][$role]
45 file { '/etc/resolv.conf':
49 content => template('opnfv/resolv.conf.erb'),
51 # /etc/resolv.conf is re-generated at each boot by resolvconf, so we
52 # need to store there as well.
53 file { '/etc/resolvconf/resolv.conf.d/head':
57 content => template('opnfv/resolv.conf.erb'),