Ask Your Question
0

I am getting error Syntax error at end of file in /etc/puppetlabs/code/environments/production/manifests/site.pp on node n9300

asked 2015-09-04 15:36:36 -0500

sanjay gravatar image

updated 2015-09-04 17:15:26 -0500

ramindk gravatar image

folks, I am getting the following error when I run the agent, my device is cisco nexus switch

bash-4.2# sudo puppet agent -t
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not parse for environment production: Syntax error at end of file in /etc/puppetlabs/code/environments/production/manifests/site.pp on node n9300
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
bash-4.2#

My Suite.pp is as follows :

node bigip {
  f5_node { '/Common/Pnode1':
    ensure                   => 'present',
    address                  => '192.168.18.32',
    description              => 'Web Server Node 1',
    availability_requirement => 'all',
    health_monitors          => ['/Common/icmp'],
  }->

  f5_pool { '/Common/puppet_pool':
    ensure                   => 'present',
    members                  => [
      { name => '/Common/Pnode1', port => '80', },
    ],
    availability_requirement => 'all',
    health_monitors          => ['/Common/http_head_f5'],
  } ->

  f5_virtualserver { '/Common/puppet_vs':
    ensure                     => 'present',
    provider                   => 'standard',
    default_pool               => '/Common/puppet_pool',
    destination_address        => '10.168.18.151',
    destination_mask           => '255.255.255.255',
    http_profile               => '/Common/http',
    service_port               => '80',
    protocol                   => 'tcp',
    source                     => '0.0.0.0/0',
    source_address_translation => 'automap'
  }

node n9300 {
  cisco_ospf { "Sample":
    ensure => 'present',
  }

  cisco_ospf_vrf {"Sample default":
    ensure => 'present',
  }
}
edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted
1

answered 2015-09-04 17:14:09 -0500

GregLarkin gravatar image

updated 2015-09-08 12:44:16 -0500

Whenever the parser gives you a "syntax error at the end of file" error, immediately suspect that you are missing a closing "}" somewhere. From the looks of it, the "node bigip" declaration has not been closed. Add that "}" and post back here if it works or not.

UPDATE: It appears that the ciscopuppet module has been installed by a non-root user. Please install it as root and report back here if that fixes the problem or not.

edit flag offensive delete link more

Comments

Thanks Greg, I trimmed the file and just have now n9300 in the site.pp its still complaining Error 400 and invalid resource type cisco_ospf. If someone has a working site.pp for nexus that will help

sanjay gravatar imagesanjay ( 2015-09-04 19:45:19 -0500 )edit

Thanks Greg, I installed the module with root and now its working fine. bash-4.2# sudo puppet agent -t Info: Retrieving pluginfacts Info: Retrieving plugin Info: Loading facts Info: Caching catalog for n9300 Info: Applying configuration version '1441741990' Notice: Applied catalog in 0.07 seconds ba

sanjay gravatar imagesanjay ( 2015-09-08 15:05:27 -0500 )edit
0

answered 2015-09-08 16:15:40 -0500

sanjay gravatar image

I installed cisco module with sudo puppet module install puppetlabs-ciscopuppet and re ran the test from n9300. It worked bash-4.2# sudo puppet agent -t Info: Retrieving pluginfacts Info: Retrieving plugin Info: Loading facts Info: Caching catalog for n9300 Info: Applying configuration version '144

edit flag offensive delete link more
0

answered 2015-09-04 19:17:48 -0500

sanjay gravatar image

updated 2015-09-04 20:09:26 -0500

GregLarkin gravatar image

I trimmed the file and removed F5 part now I just have simple catalog for cisco the error changed

node default {
  # This is where you can declare classes for all nodes.
  # Example:
  #   class { 'my_class': }
}

node n9300 {
   cisco_ospf { 'Sample':
   ensure                          => 'present'
   }
}

bash-4.2# puppet agent --test
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Evaluation Error: Error while evaluating a Resource Statement, Invalid resource type cisco_ospf at /etc/puppetlabs/code/environments/production/manifests/site.pp:45:4 on node n9300
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
bash-4.2# 

bash-4.2#
edit flag offensive delete link more

Comments

If the Puppet master cannot find a resource type, make sure that you have a module installed in your modulepath that implements that type. That resource type comes from the https://forge.puppetlabs.com/puppetlabs/ciscopuppet module. Have you installed that on your Puppet master?

GregLarkin gravatar imageGregLarkin ( 2015-09-04 20:10:36 -0500 )edit

I had installed before scs@master:/etc/puppetlabs/puppet$ puppet module install puppetlabs-ciscopuppet Notice: Preparing to install into /home/scs/.puppetlabs/etc/code/modules ... Notice: Module puppetlabs-ciscopuppet 1.0.0 is already installed. scs@master:/etc/puppetlabs/puppet$

sanjay gravatar imagesanjay ( 2015-09-04 21:21:43 -0500 )edit

Please see my updated answer above

GregLarkin gravatar imageGregLarkin ( 2015-09-08 12:44:30 -0500 )edit

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: 2015-09-04 15:36:36 -0500

Seen: 800 times

Last updated: Sep 08 '15