0

below is my common.yaml file

---
classes:
 - home_setup::falcon_logical_name

home_setup::falcon_logical_name::user: 'falcuat'
home_setup::falcon_logical_name::group: 'falcgrp'
home_setup::falcon_logical_name::env: falcon_env
home_setup::falcon_logical_name::falcon_machine_number: '11'

I am trying to use these variables in my manifest say abc.pp

class home_setup::falcon_logical_name($user, $group, $env){

notify {"falcon environment is : ${env}":}

} 

Now my question is , I want to assign value to env which is in common.yaml using a dynamic variable from hiera yaml file

falcon_env is defined in pqr.yaml file as below.

---
falcon_env: "uat2"

but after executing the above setup , 'env' value comes out to be 'falcon_env' , and not 'uat2'.

I want classes values inside common.yaml to take values from other hiera files (eg pqr.yaml). please help with the example and syntax.

HBruijn
  • 77,029
  • 24
  • 135
  • 201
Sam S
  • 21
  • 1

1 Answers1

0

home_setup::falcon_logical_name::env: "%{hiera('falcon_env')}" this turn out to be solution for my question.

Thanks Chris for reply, but we are not using facters like, ::faclon_env

Sam S
  • 21
  • 1