Hi,
The requirement is to automate the configurations dynamically in a
serverless manner (without a puppet master), specifically when running
PPaas on docker/kubernetes.
The puppet modules that are currently used (for VM scenario) can be
re-used, with one change. That difference is the need include the nodes
definitions (site.pp) in each puppet module (can skip this it only a single
module is used for a node; currently in the puppet master based deployment
there are several modules referred in a single node definition).
A very basic puppet module can have a structure roughly similar to the
following:
├── files
├── manifests
│ └── site.pp
├── modules
│ └── test
│ └── manifests
│ ├── init.pp
│ └── site.pp
├── puppet.conf
└── templates
This same structure can be re-used in both puppet scenarios; where the
deployment has a master and where it does not have a master.
In the serverless puppet scenario there is a requirement to pass data to
the modules. For this, its possible to use facters (similar to the
deployments that include puppet master). For this, need to do the following:
1. expose the data as a environment variable, with FACTER_ prepended to
the variable name [1]
2. Access the variable in the manifest file [2]
After the data is exposed as environment variables, can run the puppet
apply command pointing to the relevant module [3].
After the configurations is done, its possible to re-use the same approach
that is used currently to push the configured templates to the product with
puppet master based deployment.
[1]. export *FACTER_message*="test puppet apply message"
[2].
class test {
file { "/var/tmp/testfile":
ensure => "present",
owner => "root",
group => "root",
mode => "664",
content => "*$message*"
}
}
[3]. puppet apply --modulepath *<location_of_modules>* -e "include
*<classname>*"
--
Thanks and Regards,
Isuru H.
+94 716 358 048
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev