thias / puppet-sysctl

Puppet module to manage sysctl parameters
Other
35 stars 82 forks source link

Cannot include `sysctl` #36

Closed caarlos0 closed 8 years ago

caarlos0 commented 8 years ago

I'm trying to do this:

class mymodule::sysctl {
  include sysctl
  sysctl { 'kernel.shmmax': value => '26843545600' }
  sysctl { 'kernel.shmall': value => '6553600' }
}

But my tests fail with:

     # ./spec/classes/mymodule_spec.rb:38:in `block (3 levels) in <top (required)>'
     # ------------------
     # --- Caused by: ---
     # Puppet::Error:
     #   Could not find class ::sysctl for carlos-macbook.local
     #   ./spec/classes/mymodule_spec.rb:38:in `block (3 levels) in <top (required)>'

I defined it in fixtures.yml:

repositories:
    sysctl: "https://github.com/thias/puppet-sysctl.git"

what am I doing wrong?

thias commented 8 years ago

Do not 'include sysctl' before using it. It's a definition, not a class (and nothing can ever be both at the same time!).

On 3 February 2016 22:05:38 CET, Carlos Alexandro Becker notifications@github.com wrote:

I'm trying to do this:

class mymodule::sysctl {
 include sysctl
 sysctl { 'kernel.shmmax': value => '26843545600' }
 sysctl { 'kernel.shmall': value => '6553600' }
}

But my tests fail with:

# ./spec/classes/mymodule_spec.rb:38:in `block (3 levels) in <top
(required)>'
    # ------------------
    # --- Caused by: ---
    # Puppet::Error:
    #   Could not find class ::sysctl for carlos-macbook.local
#   ./spec/classes/mymodule_spec.rb:38:in `block (3 levels) in <top
(required)>'

I defined it in fixtures.yml:

repositories:
   sysctl: "https://github.com/thias/puppet-sysctl.git"

what am I doing wrong?


Reply to this email directly or view it on GitHub: https://github.com/thias/puppet-sysctl/issues/36

http://matthias.saou.eu/

caarlos0 commented 8 years ago

@thias so I should just remove the include line, right?

Worked. Thanks