Ask Your Question
0

puppet-module-getting-syntax-error-at-expected

asked 2015-08-17 08:00:14 -0500

iron_michael86 gravatar image

I am trying to implement this https://github.com/andytinycat/puppet-rhnsatellite. I have configured the username and password under the module/rhnsatellite/manifest/init.pp

class rhnsatellite(
$server_url  = "https://test.example.com/XMLRPC",
$username = "testuserver",
$password = "test@123"
)

{ file {'/etc/puppetlabs/puppet/rhn.conf': owner => root, group => root, mode => 0600, content => template('rhnsatellite/rhn.conf.erb') } }`

I am new to puppet and I dont know to how to call the satelliterepo in site.pp , I get a syntax error when I run it on the client machine

node 'client' {
include vmware
class { rhnsatellite :
satelliterepo {channel => 'base-stash-el6',
}
include sudo
include sssd
include hardening
include base-httpd
include hpom
class { sshd: }
}

I get the following error when I run in client

[root@client puppet]# puppet agent --test --noop  --environment=test
Info: Retrieving plugin
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/tenant.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/puppet_vardir.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/windows.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/log_exists_jbossecaps.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/custom_auth_conf.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/concat_basedir.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/cluster.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/postgres_default_version.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/dtap.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/puppetdb_server_status.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/ip6tables_version.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/pe_version.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/root_home.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/log_exists_jbosshouse.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/iptables_persistent_version.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/gateway.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/iptables_version.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/facter_dot_d.rb
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not parse for environment test: Syntax error at '{'; expected '}' at /etc/puppetlabs/puppet/environments/test/manifests/site.pp:1157 on node client
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
[root@client puppet]#`
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-08-17 14:58:19 -0500

cbarbour gravatar image

updated 2015-08-17 14:58:48 -0500

You probably shouldn't edit the init.pp manifest directly. Instead, you can pass your channel, username and password as parameters to the module.

In site.pp, you would add this code:

class { 'rhnsatellite':
  server_url => 'https://test.example.com/XMLRPC',
  username => 'testuserver',
  password => 'test@123',
}

Puppet throws an error because the systax for your resource type declaration is wrong. You're trying to pass a hash, and not using the => rocket seperator needed with resource parameters. You're also trying to nest the resource declaration inside the class declaration. This is the correct syntax:

satelliterepo { 'base-stash-el6':
  ensure => 'present',
}

Try this in site.pp:

include vmware

class { rhnsatellite:
  server_url => 'https://test.example.com/XMLRPC',
  username => 'testuserver',
  password => 'test@123',
}

satelliterepo { 'base-stash-el6':
  ensure => 'present',
}

include sudo
include sssd
include hardening
include base-httpd
include hpom
include sshd
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: 2015-08-17 08:00:14 -0500

Seen: 416 times

Last updated: Aug 17 '15