title: How Do I Get Vagrant/Puppet To Add Linux Passwords Correctly?
body: <p>I am trying to use Vagrant to create an Ubuntu VM. My host is Windows7 and my basebox is precise64.
  If I do the recommended way of adding a user in Puppet like this:</p>
  
  <pre><code>    user { "johnboy":
      ensure =&gt; present,
      managehome =&gt; true,
      password =&gt; '$6$ev8faya2$M2pB3YQRpKUJMnJx6LnsyTbDdi.umsEEZttD01pk8ZSfMGrVmlnjoVhIHyuqYt3.yaG1SZjaoSxB39nNgFKb//',
      groups =&gt; ["admin"],
      shell =&gt; "/bin/bash";
   }
  </code></pre>
  
  <p>I log in after vagrant has provisioned my box and the hash is not in /etc/passwd.</p>
  
  <p>If I don't set it with the resource type but use exec and usermod like this</p>
  
  <pre><code>user { "johnboy":
      ensure =&gt; present,
      managehome =&gt; true,
      groups =&gt; ["admin"],
      shell =&gt; "/bin/bash";
  }
  
  exec { 'set password':
      command =&gt; "usermod -p '$6$ev8faya2$M2pB3YQRpKUJMnJx6LnsyTbDdi.umsEEZttD01pk8ZSfMGrVmlnjoVhIHyuqYt3.yaG1SZjaoSxB39nNgFKb//' johnboy",
      require =&gt; User[johnboy];
  }
  </code></pre>
  
  <p>I end up with only part of the hash in /etc/passwd</p>
  
  <pre><code>johnboy:.umsEEZttD01pk8ZSfMGrVmlnjoVhIHyuqYt3.yaG1SZjaoSxB39nNgFKb//:16101:0:99999:7:::
  </code></pre>
  
  <p>Some pages suggest installing ruby-shadow so I tried this:</p>
  
  <pre><code>gem install ruby-shadow
  </code></pre>
  
  <p>However, the install failed, probably because I don't have Ruby installed. Vagrant was a 100 MB download. Is the gem for managing passwords really not included with that?</p>
  
  <p>How do I get Vagrant/Puppet to provision the password correctly?</p>