About | FAQ | Help
Ask Your Question
0

how to update file from different sources

asked 2018-04-25 13:37:50 -0500

Glenn gravatar image

i need to put a different ssl cert on boxes in common enviornment. The target file name is the same between boxes, just need to put the ssl for that host on that system. I have test for sysem but when i add the second manifest, the loader sees the same file name but different sources and exists on error.

Is there a way to select which source file is pushed to the target file with using hostname?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-04-27 08:53:05 -0500

Mr_Sharma gravatar image

Can be done easily with Heira (if you using this). Need to do following: - Define the lookup hierarachy for your host lookup

hiera.yaml
---
:hierarchy:
    - "nodes/%{trusted_certname}"

As yaml file you can have your ssl stored under directory nodes

cat myhostname.yaml
---
key: mysecretsslkey

for another host

cat yourhostname.yaml
---
key: yoursecretkey

In your code you can have a resource looking up your hiera data for key value. the value for the key will be picked up dynamically for the host (trusted_certname) where catalog is complied.

This is just an example to understand. you can make it even simpler way. hope the answer is explanatory enough. Please comment below if it differs from what you looking for.

edit flag offensive delete link more

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-04-25 13:37:50 -0500

Seen: 39 times

Last updated: Apr 27