developing module for k5login

49 views
Skip to first unread message

Dhaval

unread,
Apr 6, 2015, 11:35:10 AM4/6/15
to puppet...@googlegroups.com
hello,

I am trying to develop puppet module for k5login entries .. now my question is, how do i manage entries for multiple hierarchies ?

currently when i try it, it picks up from where it finds entry first and completes it, how do i get values so it creates an array from all hierachies and then populates the k5login?

i tried "deeper" merging and hiera_array, still not sure why it's not working. anything special i need to do ?

Regards,
Dhaval

Martin Alfke

unread,
Apr 7, 2015, 3:16:54 AM4/7/15
to puppet...@googlegroups.com
Hi Dhaval,

it would be great if you can post the puppet code and your hiera data.
Otherwise people have to guess.

Best,

Martin

Dhaval

unread,
Apr 7, 2015, 6:01:54 AM4/7/15
to puppet...@googlegroups.com
Hello, this is what it looks.

init.pp

class k5login(
  $principles = hiera_array('k5login::principles', [])
){
  validate_array($principles)

  file { '.k5login':
    ensure  => file,
    path    => '/root/.k5login',
    owner   => 'root',
    group   => 'root',
    mode    => '0644',
    content => template('k5login/k5login.erb'),
  }
}


Hierarchies:

:hierarchy:
  - "hosts/%{hostname}"
  - "environments/%{::environment}"
  - "regions/%{datacenter}"
  - global

global.yaml

k5login::principles:
  - user1/ro...@example.com
  - user2/ro...@example.com

environments/development.yaml
k5login::principles:
  - us...@example.com

Now when i do puppet run, i get user3 in k5login, what i want is user1, user2, and user2 all.

Regards,
D

Dhaval

unread,
Apr 7, 2015, 12:18:17 PM4/7/15
to puppet...@googlegroups.com
i changed variable name and it worked now.
Reply all
Reply to author
Forward
0 new messages