Convert puppet manifest config into hiera

208 views Asked by At

I installed corosync-pacemaker cluster via puppet. Now I would to like keep my data into hiera file. How should I convert cs_primitive section into yaml file?

cs_primitive { 'nfsshare_fs':
primitive_class => 'ocf',
primitive_type  => 'Filesystem',
provided_by     => 'heartbeat',
parameters      => { 'device' => '/dev/disk/lvname', 'directory' => 
'/share', 'fstype' => 'ext4' },
}->

I tried the below code but it didn't work.

corosync::cs_primitive:
  'nfsshare_fs':
    primitive_class: 'ocf'
    primitive_type: 'Filesystem'
    provided_by: 'heartbeat'
    parameters:
      device: '/dev/disk/by-id/lvname'
      directory: '/share'
      fstype: 'ext4'
1

There are 1 answers

0
AudioBubble On

It won't work because cs_primitive is a resource type, like, for example, File.

If you want to use it from Hiera, then you could create a class that wraps cs_primitive applying and then connect this class with Hiera.

classes:
  - my_class

my_class::param1: value1
my_class::param2: value2

Useful links: