
{"id":71,"date":"2013-07-24T04:03:04","date_gmt":"2013-07-24T04:03:04","guid":{"rendered":"http:\/\/pages.charlotte.edu\/mark-hamrick\/?p=71"},"modified":"2013-07-23T04:06:26","modified_gmt":"2013-07-23T04:06:26","slug":"71","status":"publish","type":"post","link":"https:\/\/pages.charlotte.edu\/mark-hamrick\/blog\/2013\/07\/24\/71\/","title":{"rendered":""},"content":{"rendered":"<p><!--\nh1,\nh2,\nh3,\nh4,\nh5,\nh6,\np,\nblockquote {\nmargin: 0;\npadding: 0;\n}\nbody {\nfont-family: \"Helvetica Neue\", Helvetica, \"Hiragino Sans GB\", Arial, sans-serif;\nfont-size: 13px;\nline-height: 18px;\ncolor: #737373;\nbackground-color: white;\nmargin: 10px 13px 10px 13px;\n}\ntable {\nmargin: 10px 0 15px 0;\nborder-collapse: collapse;\n}\ntd,th {\nborder: 1px solid #ddd;\npadding: 3px 10px;\n}\nth {\npadding: 5px 10px;\n}\n\na {\ncolor: #0069d6;\n}\na:hover {\ncolor: #0050a3;\ntext-decoration: none;\n}\na img {\nborder: none;\n}\np {\nmargin-bottom: 9px;\n}\nh1,\nh2,\nh3,\nh4,\nh5,\nh6 {\ncolor: #404040;\nline-height: 36px;\n}\nh1 {\nmargin-bottom: 18px;\nfont-size: 30px;\n}\nh2 {\nfont-size: 24px;\n}\nh3 {\nfont-size: 18px;\n}\nh4 {\nfont-size: 16px;\n}\nh5 {\nfont-size: 14px;\n}\nh6 {\nfont-size: 13px;\n}\nhr {\nmargin: 0 0 19px;\nborder: 0;\nborder-bottom: 1px solid #ccc;\n}\nblockquote {\npadding: 13px 13px 21px 15px;\nmargin-bottom: 18px;\nfont-family:georgia,serif;\nfont-style: italic;\n}\nblockquote:before {\ncontent:\"\\201C\";\nfont-size:40px;\nmargin-left:-10px;\nfont-family:georgia,serif;\ncolor:#eee;\n}\nblockquote p {\nfont-size: 14px;\nfont-weight: 300;\nline-height: 18px;\nmargin-bottom: 0;\nfont-style: italic;\n}\ncode, pre {\nfont-family: Monaco, Andale Mono, Courier New, monospace;\n}\ncode {\nbackground-color: #fee9cc;\ncolor: rgba(0, 0, 0, 0.75);\npadding: 1px 3px;\nfont-size: 12px;\n-webkit-border-radius: 3px;\n-moz-border-radius: 3px;\nborder-radius: 3px;\n}\npre {\ndisplay: block;\npadding: 14px;\nmargin: 0 0 18px;\nline-height: 16px;\nfont-size: 11px;\nborder: 1px solid #d9d9d9;\nwhite-space: pre-wrap;\nword-wrap: break-word;\n}\npre code {\nbackground-color: #fff;\ncolor:#737373;\nfont-size: 11px;\npadding: 0;\n}\nsup {\nfont-size: 0.83em;\nvertical-align: super;\nline-height: 0;\n}\n* {\n-webkit-print-color-adjust: exact;\n}\n@media screen and (min-width: 914px) {\nbody {\nwidth: 854px;\nmargin:10px auto;\n}\n}\n@media print {\nbody,code,pre code,h1,h2,h3,h4,h5,h6 {\ncolor: black;\n}\ntable, pre {\npage-break-inside: avoid;\n}\n}\n-->Adopting Hiera means that a user can control the specific data that a module uses<\/p>\n<p>&nbsp;<\/p>\n<p>Adopting Hiera means that a user can control the specific data that a module uses from a seperate config file. The puppet-common module takes this one step further: you can control which modules a node uses from Hiera.<\/p>\n<p>The module is available on GitHub at the link below:<\/p>\n<p>https:\/\/github.com\/ghoneycutt\/puppet-module-common<\/p>\n<p>By default all of the included modules are turned off since you may not have them. If you do the common include at the site level, you then can use Hiera to turn toggle the modules you need.<\/p>\n<p>The base hiere.yaml file that I am using in this example is below. This file is generally located in \/var\/lib\/hiera<\/p>\n<pre><code>---\r\n:backends:\r\n  - yaml\r\n:hierarchy:\r\n  - fqdn\/%{fqdn}\r\n  - %{clientcert}\r\n  - %{environment}\r\n  - common\r\n\r\n:yaml:\r\n# datadir is empty here, so hiera uses its defaults:\r\n# - \/var\/lib\/hiera on *nix\r\n# - %CommonAppData%\\PuppetLabs\\hiera\\var on Windows\r\n# When specifying a datadir, make sure the directory exists.\r\n:datadir:\r\n<\/code><\/pre>\n<p>The line containing fqdn means Hiera will look for a subdirectory in the Hiera configuration directory that contains files in the format of (fully qualified domain name).yaml. The last entry common points to the common.yaml file.<\/p>\n<p>The common.yaml file is listed below.<\/p>\n<pre><code>common::enable_ntp: true\r\ncommon::enable_hosts: false\r\ncommon::enable_dnsclient: false\r\n\r\nntp::servers:\r\n        - timeserver0.noedu.edu\r\n        - timeserver1.noedu.edu\r\n<\/code><\/pre>\n<p>As you can see in it, NTP has been enabled and the NTP servers have been set to timeserver0 and 1.<\/p>\n<p>The machine specialmachine1.noedu.edu needs to use a different set of servers. The file fqdn\/specialmachine1.noedu.edu looks like the following:<\/p>\n<pre><code>common::enable_ntp: true\r\nntp::servers:\r\n        - timeserver2.noedu.edu\r\n        - timeserver3.noded.edu\r\n<\/code><\/pre>\n<p>Since the fqdn is listed before the common, specialmachine1 will use these settings for NTP instead of the common ones.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Adopting Hiera means that a user can control the specific data that a module uses &nbsp; Adopting Hiera means that a user can control the specific data that a module uses from a seperate config file. The puppet-common module takes this one step further: you can control which modules a node uses from Hiera. The [&hellip;]<\/p>\n","protected":false},"author":22,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-71","post","type-post","status-publish","format-standard","hentry","category-updates"],"_links":{"self":[{"href":"https:\/\/pages.charlotte.edu\/mark-hamrick\/wp-json\/wp\/v2\/posts\/71","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pages.charlotte.edu\/mark-hamrick\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pages.charlotte.edu\/mark-hamrick\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pages.charlotte.edu\/mark-hamrick\/wp-json\/wp\/v2\/users\/22"}],"replies":[{"embeddable":true,"href":"https:\/\/pages.charlotte.edu\/mark-hamrick\/wp-json\/wp\/v2\/comments?post=71"}],"version-history":[{"count":2,"href":"https:\/\/pages.charlotte.edu\/mark-hamrick\/wp-json\/wp\/v2\/posts\/71\/revisions"}],"predecessor-version":[{"id":73,"href":"https:\/\/pages.charlotte.edu\/mark-hamrick\/wp-json\/wp\/v2\/posts\/71\/revisions\/73"}],"wp:attachment":[{"href":"https:\/\/pages.charlotte.edu\/mark-hamrick\/wp-json\/wp\/v2\/media?parent=71"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pages.charlotte.edu\/mark-hamrick\/wp-json\/wp\/v2\/categories?post=71"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pages.charlotte.edu\/mark-hamrick\/wp-json\/wp\/v2\/tags?post=71"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}