Ask Your Question
0

Singlenode & Same instllations & configurations in a node but in different folder structure

asked 2018-09-09 14:23:00 -0600

updated 2018-09-10 08:59:37 -0600

DarylW gravatar image

Hello,

I am using Yaml file which is basically called hiera data in puppet for managing the environment in a node. For example Now I have websphere application installation in /company/WAS/. Now I want to install web-sphere application in /company/WAS1 , /company/WAS2, /company/WAS3 in the same node and same configuration. This should be managed by hiera data. If I have given installation path as /company/WAS1 and now I want to over ride it as /company/WAS2 at some point in hiera data. The total management should be done by hiera data. Is there any option in puppet to do like my mentioned requirement.

for example:

version5:

comapany:
    folderpath: '/company/was1'

At some case this should be override as

folderpath: '/company/was2'

Is is possible to manage this with hiera???????

Can any one help me on it????

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2018-09-10 09:01:25 -0600

DarylW gravatar image

updated 2018-09-10 19:05:16 -0600

binford2k gravatar image

That is exactly what you would use heira for... you would need to set up the hiera hierarchy to have some kind of discriminator (node, role, env, etc), and in a corresponding folder for the discriminator higher in the hierarchy, you specify the yaml file with the different 'overridden' value that you wish to use in place of the default. This is basic hiera 101, which can be found at https://puppet.com/docs/puppet/5.5/hi..., the example given there is the 'per node' and 'per OS' values, but you can create your own level/tier beyond that. For example, we have a 'network' tier since we have different networks that our software can get sent to, which is independent from what software we want to put on those systems (you could run the 'test' software on the 'dev' network, etc.)

The only wrinkle is it seems like you want multiple different installation paths for the same node, is that correct? If so, you would probably need to construct your own roles/profiles that could take a structure of values and use those to call multiple underlying entities of the module the main problem with that is you would need to be all defines, no classes, because if your modules installs things with a 'class', there can only be one invocation of a single class in a catalog.

edit flag offensive delete link more

Comments

Ya I have used define instead of class. But the thing is that i can change the mount point but everywhere the lookup is test:;mountpoint: %{lookup(mountpoint)}. I want to override this in hiera. because I want to install in /test/comp1 /test/comp2 but the installation is same but the path is diffe

sreepadhchitti gravatar imagesreepadhchitti ( 2018-09-11 00:22:00 -0600 )edit

And I am using roles and profile model I can define the class. But i need to change the lookup only for mountpoint. but some applixcations need mount point in bash profile and in service. I want to override this in hiera

sreepadhchitti gravatar imagesreepadhchitti ( 2018-09-11 00:24:46 -0600 )edit

What you need to do is change the shape of the data to accept multiole things (array) instead of a single thing, I’m not sure if you want to have an identical configuration in different places (mountpoint would be your array), or you replicate the entire hash of inputs to your define in an array...

DarylW gravatar imageDarylW ( 2018-09-12 06:39:41 -0600 )edit

... A pattern I have seen is to have a ‘defaults’ entry in your hash, and then pass in either a hash with the ‘name’ being a key, or an array of hashes that get looped over and passed as parameters to your define

DarylW gravatar imageDarylW ( 2018-09-12 06:41:21 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2018-09-09 14:23:00 -0600

Seen: 26 times

Last updated: Sep 10