Hi,
I have just started with GCE. I noticed that you can specify certain tags to your instances. I would like that for example all instances that are tagged with the tag "webserver" will get the webserver.yaml file included with hiera. My hiera.yaml looks as follow.
---
:backends:
- yaml
:hierarchy:
- 'fqdn/%{fqdn}'
- 'hostname/%{hostname}'
- 'operatingsystem/%{operatingsystem}/tags/%{gce.instance.tags}'
- 'operatingsystem/%{operatingsystem}/role/%{role}'
- 'operatingsystem/%{operatingsystem}/common'
:yaml:
:datadir: '/path/to/hiera/datadir/'
:merge_behavior: :deeper
----
So if I put a yaml file in the operatingsystem/%{operatingsystem}/tags/%{gce.instance.tags}/ folder called webserver.yaml and I have added the tag webserver to that specific instance it will pick up that yaml file and apply the configuration.
Thanks in advance
- Alexander
↧