Ask Your Question
0

Roles/Profiles

asked 2018-09-03 07:20:30 -0500

dmccabe7 gravatar image

Hi, I am trying to get roles/profiles working for the first time, so any guidance is appreciated

Error:Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Function Call, Could not find class ::role::{::web} for testpuppet.tech.mydomain.com (file: /etc/puppetlabs/code/environments/production/manifests/site.pp, line: 4, column: 3) on node testpuppet.tech.mydomain.com

/etc/puppetlabs/code/environments/production/hiera.html

version: 5 defaults:

hierarchy: - name: "Per-node data (yaml version)" path: "nodes/%{::trusted.certname}" - name: "Per-node roles (yaml version)" path: "roles/%{::role}}" - name: "Common and fallback data" path: "common.yaml"

defaults: data_hash: yaml_data

/etc/puppetlabs/code/environments/production/manifests/site.pp

node default { if $::role { include "role::{::web}"

} else { include profile::base notify { "Node ${::fqdn} has no role set.": } } }

/etc/puppetlabs/code/environments/production/modules/roles/default.pp

role/manifests/default.pp

class role::default { include profile::base }

/etc/puppetlabs/code/environments/production/modules/profile/manifests/web.pp

role/manifests/web.pp

class role::web { include profile::base include profile::lamp }

[root@testpuppet ~]# facter -p role web

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-09-12 05:25:05 -0500

jesse gravatar image

The include function call in your site.pp looks to be the problem:

node default { 
  if $::role {
    include "role::{::web}"

Instead try:

node default { 
  if $::role {
    include "role::${::role}"
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2018-09-03 07:20:30 -0500

Seen: 330 times

Last updated: Sep 03