Ask Your Question

Error 500 on SERVER: This Name has no effect. A value was produced and then forgotten

asked 2017-12-23 06:21:36 -0600

sjbullock1981 gravatar image

updated 2017-12-23 20:59:12 -0600

Red Cricket gravatar image

Good Afternoon, I am just starting out with Puppet and I've hit an issue with one of my training labs.

When running the following command on my puppet agent:

 puppet agent --test

I get the following error message:

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: This Name has no effect. A value was produced and then forgotten (one or more preceding expressions may have the wrong form) at /etc/puppetlabs/code/environments/production/modules/webserver/manifests/init.pp:11:3 on node centos-agent

The contents of the init.pp file:

class webserver {
        if $::osfamily == 'Redhat' {
                package { 'httpd' :
                        ensure => present
        } elsif $::osfamily == 'Debian' {
                package { 'apache2' :
                        ensure => present
        } else {
                print "This is not a supported distro."

The puppet agent is running centos version 7.4.1708 and puppet agent version 4.10.9

Any assistance would be greatly appreciated. Thanks

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2017-12-23 21:01:24 -0600

Red Cricket gravatar image

There is no print function in puppet. You probably want to use fail ( 'this is not a supported distro.') or at the very least notify { 'This is not a supported distro.':}

edit flag offensive delete link more

answered 2017-12-24 05:50:00 -0600

sjbullock1981 gravatar image

Thanks, I used fail and it worked perfectly.

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


Asked: 2017-12-23 06:21:36 -0600

Seen: 752 times

Last updated: Dec 24 '17