Syntax help using Keith Burdis's erwbgy/system module

I'm trying to use Keith Burdis's excellent erwbgy/system module without
Hiera, at least initially.

I cannot determine how call the modules. From what I can tell the
documentation isn't quite correct (or I am reading it wrong). I'm trying
to start with ntp because that's an easy to understand example.

The ntp documentation says

<snip>

Specify a list of time servers to use:

class { 'ntp':
servers => [ 'ntp1.domain.com', 'ntp2.domain.com' ],
}

<endsnip>

If I enter it like this in my manifest, I get errors. I assume the correct
syntax is something more like this

<snip>
system::ntp { 'name':
servers => [ 'ntp1.domain.com', 'ntp2.domain.com' ],
}
<endsnip>

but that syntax gets me this error
Puppet::Parser::AST::Resource failed with error ArgumentError: Invalid
resource type system::ntp at /etc/puppet/manifests/site.pp:36 on node

Any help with this would be appreciated…
thanks!

group…

··· On Thursday, March 21, 2013 1:03:02 PM UTC-7, John Smith wrote: > > I'm trying to use Keith Burdis's excellent erwbgy/system module without > Hiera, at least initially. > > > sorry, this is the wrong group.... i've posted in the puppet-users

I use this module along with Foreman ENC. The NTP module piece is
confusing because there is an included module just called "ntp" which works
as you show - but i don't build a manifest for it, i simply built smart
parameters in foreman and passed my time server to it since i use the same
time servers across every host. (the smart parameter is attached to "ntp"
and i include NTP in my "base_linux" host group from which all other host
groups include it too…)

I also use smart parameters for all the system::components.

Here is an example of how i used system::facts without hiera

– cut here –

I went into foreman scanned puppet classes & found system:facts, assigned
it to my “base” host group, then went into smart class parameter, clicked
"config", set override, set default value to

facility:

  value: Austin 

and saved.

Now the ENC returns:

··· ---

classes:

"system::facts":

  config:

    facility:

      value: Austin

environment: production

parameters:

hostgroup: BASE_LINUX

root_pw: yaddayaddayadda

puppetmaster: ""

foreman_env: production

then when I ran puppet agent –t I saw it updated
/etc/facter/facts.d/system_facts.yaml

as


facility: Austin
— cut here —

BTW, that was from a conversation i was having with the developer of the
mods. I basically shove yaml down through the config variable since that
is sort of his way of abstracting out his classes to work with Hiera as
well as ENC systems. The classes themselves aren’t fully parameterized to
run directly without shoving your data into config. I may submit patches
for the mods to make them parameterized as pushing through to config is
sort of obtuse :slight_smile:

On Thursday, March 21, 2013 3:03:02 PM UTC-5, John Smith wrote:

I’m trying to use Keith Burdis’s excellent erwbgy/system module without
Hiera, at least initially.

http://forge.puppetlabs.com/erwbgy/system

I cannot determine how call the modules. From what I can tell the
documentation isn’t quite correct (or I am reading it wrong). I’m trying
to start with ntp because that’s an easy to understand example.

https://github.com/erwbgy/puppet-ntp

The ntp documentation says

Specify a list of time servers to use:

class { ‘ntp’:
servers => [ ‘ntp1.domain.com’, ‘ntp2.domain.com’ ],
}

If I enter it like this in my manifest, I get errors. I assume the correct
syntax is something more like this

system::ntp { 'name': servers => [ 'ntp1.domain.com', 'ntp2.domain.com' ], }

but that syntax gets me this error
Puppet::Parser::AST::Resource failed with error ArgumentError: Invalid
resource type system::ntp at /etc/puppet/manifests/site.pp:36 on node

Any help with this would be appreciated…
thanks!

I'm not using ENC and unfortunately can't follow much if anthing in your
reply… I'll try to use hiera eventually but that's yet another steep
undocumented learning curve…

I've commented out the system module and am now just trying to use the ntp
module, since it was a dependency anyway. I get the exact same results.

<snip>
ntp { 'name':
servers => [ 'ntp1.domain.com', 'ntp2.domain.com' ],
}
<endsnip>

still gives me
Puppet::Parser::AST::Resource failed with error ArgumentError: Invalid
resource type system::ntp at /etc/puppet/manifests/site.pp:36 on node

Are you saying his modules won't work without hiera (or something similar)
and that my errors are expected?

··· On Thu, Mar 21, 2013 at 1:14 PM, Byron Miller wrote:

I use this module along with Foreman ENC. The NTP module piece is
confusing because there is an included module just called “ntp” which works
as you show - but i don’t build a manifest for it, i simply built smart
parameters in foreman and passed my time server to it since i use the same
time servers across every host. (the smart parameter is attached to "ntp"
and i include NTP in my “base_linux” host group from which all other host
groups include it too…)

I also use smart parameters for all the system::components.

Here is an example of how i used system::facts without hiera

– cut here –

I went into foreman scanned puppet classes & found system:facts, assigned
it to my “base” host group, then went into smart class parameter, clicked
"config", set override, set default value to

facility:

  value: Austin

and saved.

Now the ENC returns:


classes:

"system::facts":

  config:

    facility:

      value: Austin

environment: production

parameters:

hostgroup: BASE_LINUX

root_pw: yaddayaddayadda

puppetmaster: ""

foreman_env: production

then when I ran puppet agent –t I saw it updated
/etc/facter/facts.d/system_facts.yaml

as


facility: Austin
— cut here —

BTW, that was from a conversation i was having with the developer of the
mods. I basically shove yaml down through the config variable since that
is sort of his way of abstracting out his classes to work with Hiera as
well as ENC systems. The classes themselves aren’t fully parameterized to
run directly without shoving your data into config. I may submit patches
for the mods to make them parameterized as pushing through to config is
sort of obtuse :slight_smile:

On Thursday, March 21, 2013 3:03:02 PM UTC-5, John Smith wrote:

I’m trying to use Keith Burdis’s excellent erwbgy/system module without
Hiera, at least initially.

http://forge.puppetlabs.com/**erwbgy/systemhttp://forge.puppetlabs.com/erwbgy/system

I cannot determine how call the modules. From what I can tell the
documentation isn’t quite correct (or I am reading it wrong). I’m trying
to start with ntp because that’s an easy to understand example.

https://github.com/erwbgy/**puppet-ntphttps://github.com/erwbgy/puppet-ntp

The ntp documentation says

Specify a list of time servers to use:

class { ‘ntp’:
servers => [ ‘ntp1.domain.com’, ‘ntp2.domain.com’ ],
}

If I enter it like this in my manifest, I get errors. I assume the
correct syntax is something more like this

system::ntp { 'name': servers => [ 'ntp1.domain.com', 'ntp2.domain.com' ], }

but that syntax gets me this error
Puppet::Parser::AST::Resource failed with error ArgumentError: Invalid
resource type system::ntp at /etc/puppet/manifests/site.pp:**36 on node

Any help with this would be appreciated…
thanks!


You received this message because you are subscribed to a topic in the
Google Groups “Foreman users” group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/foreman-users/EreGXOgGzak/unsubscribe?hl=en
.
To unsubscribe from this group and all its topics, send an email to
foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at http://groups.google.com/group/foreman-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

I saw your 'trying to wrap my head around hiera' post, unfortunately I
can't follow it very well either…assume I know almost nothing about
puppet

maybe you just need to include the module then?

include ntp

class { &#39;ntp&#39;:
  servers =&gt; [ &#39;ntp1.domain.com&#39;, &#39;ntp2.domain.com&#39; ],
}
··· On Thursday, March 21, 2013 3:58:34 PM UTC-5, John Smith wrote: > > I'm not using ENC and unfortunately can't follow much if anthing in your > reply... I'll try to use hiera eventually but that's yet another steep > undocumented learning curve... > > I've commented out the system module and am now just trying to use the ntp > module, since it was a dependency anyway. I get the exact same results. > > > ntp { 'name': > servers => [ 'ntp1.domain.com', 'ntp2.domain.com' ], > } > > > still gives me > Puppet::Parser::AST::Resource failed with error ArgumentError: Invalid > resource type system::ntp at /etc/puppet/manifests/site.pp:36 on node > > Are you saying his modules won't work without hiera (or something similar) > and that my errors are expected? > > > > On Thu, Mar 21, 2013 at 1:14 PM, Byron Miller <byr...@gmail.com > > wrote: > >> I use this module along with Foreman ENC. The NTP module piece is >> confusing because there is an included module just called "ntp" which works >> as you show - but i don't build a manifest for it, i simply built smart >> parameters in foreman and passed my time server to it since i use the same >> time servers across every host. (the smart parameter is attached to "ntp" >> and i include NTP in my "base_linux" host group from which all other host >> groups include it too..) >> >> I also use smart parameters for all the system::components. >> >> Here is an example of how i used system::facts without hiera >> >> -- cut here -- >> >> I went into foreman scanned puppet classes & found system:facts, >> assigned it to my “base” host group, then went into smart class parameter, >> clicked "config", set override, set default value to >> >> facility: >> >> value: Austin >> >> and saved. >> >> Now the ENC returns: >> >> --- >> >> classes: >> >> "system::facts": >> >> config: >> >> facility: >> >> value: Austin >> >> environment: production >> >> parameters: >> >> hostgroup: BASE_LINUX >> >> root_pw: yaddayaddayadda >> >> puppetmaster: "" >> >> foreman_env: production >> >> >> >> then when I ran puppet agent –t I saw it updated >> /etc/facter/facts.d/system_facts.yaml >> >> >> >> as >> >> >> >> --- >> >> facility: Austin >> --- cut here --- >> >> BTW, that was from a conversation i was having with the developer of the >> mods. I basically shove yaml down through the config variable since that >> is sort of his way of abstracting out his classes to work with Hiera as >> well as ENC systems. The classes themselves aren't fully parameterized to >> run directly without shoving your data into config. I may submit patches >> for the mods to make them parameterized as pushing through to config is >> sort of obtuse :) >> >> >> On Thursday, March 21, 2013 3:03:02 PM UTC-5, John Smith wrote: >>> >>> I'm trying to use Keith Burdis's excellent erwbgy/system module without >>> Hiera, at least initially. >>> >>> http://forge.puppetlabs.com/**erwbgy/system >>> >>> I cannot determine how call the modules. From what I can tell the >>> documentation isn't quite correct (or I am reading it wrong). I'm trying >>> to start with ntp because that's an easy to understand example. >>> >>> https://github.com/erwbgy/**puppet-ntp >>> >>> The ntp documentation says >>> >>> >>> >>> Specify a list of time servers to use: >>> >>> class { 'ntp': >>> servers => [ 'ntp1.domain.com', 'ntp2.domain.com' ], >>> } >>> >>> >>> >>> If I enter it like this in my manifest, I get errors. I assume the >>> correct syntax is something more like this >>> >>> >>> system::ntp { 'name': >>> servers => [ 'ntp1.domain.com', 'ntp2.domain.com' ], >>> } >>> >>> >>> but that syntax gets me this error >>> Puppet::Parser::AST::Resource failed with error ArgumentError: Invalid >>> resource type system::ntp at /etc/puppet/manifests/site.pp:**36 on node >>> >>> Any help with this would be appreciated.. >>> thanks! >>> >>> -- >> You received this message because you are subscribed to a topic in the >> Google Groups "Foreman users" group. >> To unsubscribe from this topic, visit >> https://groups.google.com/d/topic/foreman-users/EreGXOgGzak/unsubscribe?hl=en >> . >> To unsubscribe from this group and all its topics, send an email to >> foreman-user...@googlegroups.com . >> To post to this group, send email to forema...@googlegroups.com >> . >> Visit this group at http://groups.google.com/group/foreman-users?hl=en. >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> > >

reasonably sure of.

here's my code

<snip>
include ntp

class ntp { 'myntp':
servers => [ 'ntp1.domain.com', 'ntp2.domain.com' ],
}
<endsnip>
and here's my error
Could not parse for environment dev: Syntax error at ':'; expected '}' at
/etc/puppet/manifests/site.pp:35

if I remove the word 'class' from my code so it looks like this
<snip>
include ntp

ntp { 'myntp':
servers => [ 'ntp1.domain.com', 'ntp2.domain.com' ],
}
<endsnip>
here's my new different error
Puppet::Parser::AST::Resource failed with error ArgumentError: Invalid
resource type ntp at /etc/puppet/manifests/site.pp:37

still very very confused…
thanks!

··· On Thursday, March 21, 2013 2:06:42 PM UTC-7, Byron Miller wrote:

maybe you just need to include the module then?

I’ve included the module correctly, that’s about the only thing I’m

The first line isn't quite right, it should be:

class { 'ntp':
servers => [ 'ntp1.domain.com', 'ntp2.domain.com' ],
}

You don't need to "include ntp", as that does the same thing as the
above class code. I think you're getting confused on the syntax, as
it's slightly different for two very different purposes:

  1. class foo { … is used to create/define a new class, which you'd do
    in your own modules
  2. class { 'foo': … is used to include an existing class on your
    system and works like the normal resource syntax - this is the one you want

"include class" is an alternative to #2 for including classes, there's a
bit more on the differences here, but essentially it's whether you want
to pass parameters or not:
http://docs.puppetlabs.com/puppet/3/reference/lang_classes.html#declaring-classes

··· On 21/03/13 21:22, John Smith wrote: > On Thursday, March 21, 2013 2:06:42 PM UTC-7, Byron Miller wrote: > > maybe you just need to include the module then? > > I've included the module correctly, that's about the only thing I'm > reasonably sure of. > > here's my code > > > include ntp > > class ntp { 'myntp': > servers => [ 'ntp1.domain.com', 'ntp2.domain.com' ], > } > > and here's my error > Could not parse for environment dev: Syntax error at ':'; expected '}' > at /etc/puppet/manifests/site.pp:35


Dominic Cleal
Red Hat Engineering

thank you very much!!!
working much better now :slight_smile: