linux user array iteration problem

asked 2015-12-08 04:50:07 -0500

sjwrong gravatar image

Hello, I have problem with user array iteration, I need to use this, but that won't works. I'm using Puppet Parser=Future

    class users::normal {
  $user_array = ['test', 'test2']

  $user_array.each |$user| {
    user { $user:
      ensure     => present,
      managehome => true,
      groups     => 'sudo',
      shell      => '/bin/bash',
    }
    file { "/home/${user}/.ssh":
      ensure  => 'directory',
      require => User["${user}"],
      owner   => $user,
      group   => $user,
      mode    => '0755',
    }
    file { "/home/${user}/.ssh/authorized_keys":
      require => File["/home/${user}/.ssh"],
      source  => "puppet:///modules/user_linux/authorized_keys-${user}",
      owner   => $user,
      group   => $user,
      mode    => '0644',
    }
  }
  User['test'] {
    password  => 'XXSXSXSXbsjusjdbgsbubdusbdusdsz564645444udsuiobsiobdiosdsdsd',
  }
User['test2'] {
    password  => 'XXSXSXSXbsjusjdgdf55645dbgsbubdusbdusdszudsuiobsiobdiosdsdsd',
  }
}

Where is problem? I appreciate every relevant answer.

edit retag flag offensive close merge delete

Comments

Can you describe what the problem is that you're encountering?

GregLarkin gravatar imageGregLarkin ( 2015-12-08 10:29:19 -0500 )edit