* "puppet module generate" is deprecated and does not provide you with the
full set of tools and practices you could be using. Have a look at the PDK
<https://puppet.com/docs/pdk/1.x/pdk.html> instead.

* All the classes in a module need to have the module name as base name.
i.e. when your module is called "test", the classes need to be called
"test::install", and "test::config". `pkd new class` does that
automatically for you.

* Each class needs to go into its own file. e.g. the "test::config" class
goes into "manifests/config.pp". Especially with bigger modules, this
allows for a much better navigation in the source. Again, `pkd new class`
does that automatically for you.

Cheers, David

On Wed, May 9, 2018 at 6:56 PM Alessandro Ciappei <[email protected]>
wrote:

> Hello all,
>
> I'm new on puppet, and i try to create one deployment for my company by
> satellite 6 and puppet.
> I would like to create a module, with single manifest, and inside multiple
> classes.
> I need to choose each class separately, because will be installed in
> different server for same application
>
> then i created module with
>
> puppet module generate
> i fill all metadata.json
>
> Inside in manifest
> i create init.pp and some other files called test-install.pp and
> test-config.pp
>
> #init.pp
>
> class test {
>
>           include redis::install
>
>           include redis::config
>
>         }
>
>
> #test-install
>
>
> class redis::install inherits test{
>
>
>
>                 exec {
>
>                 "Disable Transparent Huge Pages":
>
>                 command => '/usr/bin/echo never >
> /sys/kernel/mm/transparent_hugepage/enabled',
>
>                 onlyif =>  '/usr/bin/test -f
> /sys/kernel/mm/transparent_hugepage/enabled',
>
>                 }
>
>
>
>                 package { ['redis','filebeat-5.3.2']:
>
>                 ensure   => present,
>
>                 provider => yum,
>
>                 #install_option => ['--enablerepo=R_EPEL_RHEL7_Yum']
>
>                 #source   => File['nameofrpm_rpm']['path'],
>
>                 #require  => File['nameofrpm_rpm'],
>
>                 }
>
>         }
>
>
> #test-config
>
>
> class redis::config inherits test {
>
>
>
>                 exec {
>
>                "Move FILEXXX to right path in PATHXXXX":
>
>                 command => '/usr/bin/mv
> /cs/ecommint/etc/systemd/system/*.service /etc/systemd/system/',
>
> #               onlyif =>  "test -e /cs/ecommint/systemd/system/*.service",
>
> #               require => File["/cs/eccomint/systemd/system/*service"]
>
>                 }
>
>                 exec {
>
>                 "Reload System Control Deamon":
>
>                 command => '/usr/bin/systemctl deamon-reload',
>
>                 }
>
>         }
>
>
>
>
> But it's not working
>
>
> Some one can help me?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/f07dd07c-3fef-410d-99ad-0e7a0c310615%40googlegroups.com
> <https://groups.google.com/d/msgid/puppet-users/f07dd07c-3fef-410d-99ad-0e7a0c310615%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
-- 
Cheers, David

https://twitter.com/dev_el_ops

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CALF7fHY9-7G-cmqVHz0Wj%2BxEgXxN09ZrMt0vkYpPhMVc0x9y4Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to