| By example, i have a custom module, by example "thecompany" and have multiple submodules like as helpers for apache:
. |
└── develrox |
└── manifests |
├── httpd |
│ └── vhost.pp |
├── httpd.pp |
└── init.pp
|
Now, call from node like as:
# Install basic requirements |
{ thecompany : } |
|
# Install apache server with custom settings |
{ thecompany::httpd : } |
|
# Made a new vhost with custom modsecurity rules |
{ thecompany::httpd::vhost : |
foo => bar |
}
|
The httpd module have a custom base settings and vhost have a custom settings for all vhosts, files for mod security, etc. The problem is: have a httpd.pp file out of https subfolder, when have multiple submodules is hard manage, have multiple files and multiple folders with same name for other functions. The idea: implement a constructor file for each subdirectory module, by example:
. |
└── thecompany |
└── manifests |
├── httpd |
│ ├── init.pp |
│ └── vhost.pp |
└── init.pp
|
In thecompany/manifests/httpd/init.pp create the constructor class like as
class thecompany::httpd { ... } |
|