hiera

How can I split my hiera config by role?

爷,独闯天下 提交于 2019-12-09 11:52:57
问题 I'm using hiera to assign classes like webserver or dbserver to my nodes. The webserver class just includes apache and sets some config on it (e.g. port). Obviously I don't want to replicate this config for every node, so I put it in common.yaml. However, my common.yaml is getting big, so I want to split it up. I'd like to have one file containing the config for the webserver role, another for the dbserver role etc. I'm imagining my hiera.yaml to look something like this: :hierarchy: - "fqdn/

How to config timezone with Vagrant, Puppet and Hiera?

五迷三道 提交于 2019-12-07 16:40:51
问题 I'm using PuPHPet for my testing environments, which is based on Vagrant/Puppet+Hiera. In the config.yml (Hiera config file) I would like to add section for my timezone and with command vagrant provision setup it properly. It's that possible? 回答1: Just add your timezone to whatever key you want in your hiera file, let's call it timezone . The value for which and the puppet code you'd need to set that timezone depends on the system you're firing up, but I'll assume RedHat flavor of unix. I

Iterate over a deeply nested hiera hash in puppet manifest

☆樱花仙子☆ 提交于 2019-12-06 04:11:54
问题 I'm working on building a structure for my webservers. I have my setup in hiera, but I can't seem to get puppet to give back the correct types. In common.yaml vhosts: hostname: sitename: app_url: value app_type: value I have multiple sites per vhost and multiple vhosts. In my manifest I'm going to be creating the folder structure and other setup tasks, but for for now I can't even get it to iterate over the sites. Current manifest: define application($app_name, $app_url) { notice("App Type: $

Puppet - set defaults in manifest if not present in hiera when iterating over hash

只谈情不闲聊 提交于 2019-12-05 21:49:37
I am iterating over many entries in a hiera hash, and wish to remove identical duplicate lines from hiera by setting defaults in the manifest (such as ensure , groups , managehome etc), and have the defaults overridden IF the duplicate key/value pair exists in hiera. To date, everything I have tried fails to get the default values. I get the idea that I need to declare a resource, but am uncertain. I have tried setting "default_values_hash" in the lookup and other methods, but nothing appears to pass defaults into the iteration and --debug output This is a (pseudo) example of my manifest and

How to config timezone with Vagrant, Puppet and Hiera?

蓝咒 提交于 2019-12-05 20:52:50
I'm using PuPHPet for my testing environments, which is based on Vagrant/Puppet+Hiera. In the config.yml (Hiera config file) I would like to add section for my timezone and with command vagrant provision setup it properly. It's that possible? Just add your timezone to whatever key you want in your hiera file, let's call it timezone . The value for which and the puppet code you'd need to set that timezone depends on the system you're firing up, but I'll assume RedHat flavor of unix. I recommend setting that to any valid value you'd see under /usr/share/zoneinfo . As an example your key may look

Iterate over a deeply nested hiera hash in puppet manifest

十年热恋 提交于 2019-12-05 19:46:27
I'm working on building a structure for my webservers. I have my setup in hiera, but I can't seem to get puppet to give back the correct types. In common.yaml vhosts: hostname: sitename: app_url: value app_type: value I have multiple sites per vhost and multiple vhosts. In my manifest I'm going to be creating the folder structure and other setup tasks, but for for now I can't even get it to iterate over the sites. Current manifest: define application($app_name, $app_url) { notice("App Type: ${app_type}") notice("App Url: ${app_url}") } $vhosts = hiera('vhosts') $vhosts.each |$vhost| { create

How can I split my hiera config by role?

▼魔方 西西 提交于 2019-12-03 14:26:56
I'm using hiera to assign classes like webserver or dbserver to my nodes. The webserver class just includes apache and sets some config on it (e.g. port). Obviously I don't want to replicate this config for every node, so I put it in common.yaml. However, my common.yaml is getting big, so I want to split it up. I'd like to have one file containing the config for the webserver role, another for the dbserver role etc. I'm imagining my hiera.yaml to look something like this: :hierarchy: - "fqdn/%{::fqdn}" - "role/%{ROLE}" - common Where the role folder would contain files like webserver.yaml ,

Using hiera to set class parameters?

杀马特。学长 韩版系。学妹 提交于 2019-12-02 18:25:29
问题 I am trying to figure out how to use hiera for setting the values for class parameters. I am testing things out with two simple classes: testhiera and testhiera2 Here are those classes: [root@puppet-el7-001 modules]# cat testhiera/manifests/init.pp class testhiera ( $haproxy_cert_content = 'unknown' , ) { notify {"cert is $haproxy_cert_content":} } [root@-puppet-el7-001 modules]# cat testhiera2/manifests/init.pp class testhiera2 ( $haproxy_cert_content = 'unknown' , ) { notify {"number two

Puppet 6 and module puppetlabs/accounts does not create user account in Hiera YAML format

天大地大妈咪最大 提交于 2019-12-02 09:24:52
When I run puppet agent --test I have no errors output but the user did not create. My puppet hira.yaml configuration is: --- version: 5 datadir: "/etc/puppetlabs/code/environments" data_hash: yaml_data hierarchy: - name: "Per-node data (yaml version)" path: "%{::environment}/nodes/%{::trusted.certname}.yaml" - name: "Common YAML hierarchy levels" paths: - "defaults/common.yaml" - "defaults/users.yaml" users.yaml is: accounts::user: joed: locked: false comment: System Operator uid: '1700' gid: '1700' groups: - admin - sudonopw sshkeys: - ssh-rsa ...Hw== sysop+moduledevkey@puppetlabs.com I use