Ask Your Question
0

Hiera error 400 malformed string in module1/manifests/init.pp

asked 2014-03-11 08:56:29 -0500

wuma1002 gravatar image

updated 2014-03-17 15:10:09 -0500

Stefan gravatar image

I want to deploy my users via hiera and create_resources. The hiera looks like this:

user::myuser:
        user1:
                ensure: present
                home: /home/user1
                uid:666
                comment: user1 SysAd
                ssh_keysource: "enterprise/user_rsa.pub"
                password: NOPW
        user2:
                ensure: present
                home: /home/user2
                uid: 100000001
                comment: user2 SysAd
                ssh_keysource: "enterprise/user2_rsa.pub"
                password: NOPW
        user3:
                ensure: present
                home: /home/user3
                uid: 100000002
                comment: user3 SysAd
                ssh_keysource: "enterprise/user3_rsa.pub"
                password: NOPW

and a module called user, which has a init.pp like this:

class user (
   $myuser
){

  if $::git_installed == true {
    $admin_groups = ['wheel','git']
    $userGit =  {
      'name'          => 'git',
      'name_comment'  => 'Git Version Control',
      'uid'           => 667,
      'gid'           => 667 ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2014-03-17 15:17:27 -0500

Stefan gravatar image

The first thing that I've noticed is you are creating user resources and passing attributes that are not valid for a user resource like name_comment, sshkey_source, manage_group, or group. So this might not work as expected.

The actual error messages indicates an error when hiera tries to load your yaml file. You'll get more detailed output when you run puppet with the --trace flag because it'll give you a stack trace that might show it is indeed the yaml ruby library that is raising the error.

Possible error: Have you used [TAB] instead of [SPACE] to indent ... (more)

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2014-03-11 08:56:29 -0500

Seen: 78 times

Last updated: Mar 17 '14