Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Hi, My goal is to display the vars using hiera MODULE level.
- Here is my module structure and code.
- directory/file: /etc/puppetlabs/code/environments/production/modules/sshd/manifests/init.pp
- ===============
- class sshd (
- String $autoupdate,
- String $service_name,
- ) {
- exec { 'print vars on console':
- path => '/bin',
- command => "echo service Name: ${service_name}",
- logoutput => true,
- }
- }
- directory/file: /etc/puppetlabs/code/environments/production/modules/sshd/hiera.yaml
- =================
- ---
- version: 5
- defaults:
- datadir: data
- data_hash: yaml_data
- hierarchy:
- - name: "OS family"
- path: "os/%{facts.os.family}.yaml"
- - name: "common"
- path: "common.yaml"
- directory/file: /etc/puppetlabs/code/environments/production/modules/sshd/hieradata/common.yaml
- =================
- ---
- sshd::autoupdate: false
- sshd::service_name: ntpd
- But when Im running the script from agent, It is displaying error like
- Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Function Call, Class[Sshd]:
- expects a value for parameter 'autoupdate'
- expects a value for parameter 'service_name' at /etc/puppetlabs/code/environments/production/manifests/site.pp:6:3 on node puppetclient.
- file: /etc/puppetlabs/code/environments/production/manifests/site.pp
- =======
- node default {
- include file_test
- include jira
- include profile::hiera_test
- include user::create_user
- include sshd
- }
- Question: why it is taking vars from hiera.yaml which is defined at "/etc/puppetlabs/code/environments/production/hieradata/common.yaml" butnot from "/etc/puppetlabs/code/environments/production/modules/sshd/hieradata/common.yaml"
- file: /etc/puppetlabs/code/environments/production/hieradata/common.yaml
- ===========
- ---
- profile::hiera_test::ssl: false
- profile::hiera_test::backups_enabled: true
- user::create_user::username: sriman
- user::create_user::password: sriman
- #sshd::autoupdate: "false"
- #sshd::service_name: "sshd"
Add Comment
Please, Sign In to add comment