Ask Your Question
0

file permissions using vagrant

asked 2016-03-11 14:22:34 -0500

dogfish182 gravatar image

updated 2016-03-12 10:24:37 -0500

I've just spent a good deal of time setting up a puppet vagrant environment that works with r10k for testing my dev branch. everything is working and paths are fine but I declare 2 classes which are

class helloworld{                                       
  notify {'its best to test while wearing a vest':}     
}

and

class helloworld::motd{
  file {'/etc/motd':
    owner => 'root',
    group => 'root',
    mode => '0644',
    content => "Hello mike, that's a nice trike!\n",
  }
}

then run 'vagrant provision' after modifying site.pp to include them. my output is this

λ vagrant provision
==> default: vagrant-r10k: Puppet provisioner module_path is nil, assuming puppet4 environment mode
==> default: vagrant-r10k: Puppet provisioner module_path is nil, assuming puppet4 environment mode
==> default: vagrant-r10k: Puppet provisioner module_path is nil, assuming puppet4 environment mode
==> default: vagrant-r10k: Beginning r10k deploy of puppet modules into C:/scratch/test/environments/dev/modules using C:/scratch/test/environments/dev/Puppetfile
INFO     -> Loading modules from Puppetfile into queue
INFO     -> Deploying sssd into C:/scratch/test/environments/dev/modules
INFO     -> Deploying ssh into C:/scratch/test/environments/dev/modules
INFO     -> Deploying firewall into C:/scratch/test/environments/dev/modules
INFO     -> Deploying concat into C:/scratch/test/environments/dev/modules
INFO     -> Deploying stdlib into C:/scratch/test/environments/dev/modules
INFO     -> Deploying resolv_conf into C:/scratch/test/environments/dev/modules
INFO     -> Deploying mysql into C:/scratch/test/environments/dev/modules
INFO     -> Deploying apache into C:/scratch/test/environments/dev/modules
INFO     -> Deploying ntp into C:/scratch/test/environments/dev/modules
INFO     -> Deploying helloworld into C:/scratch/test/environments/dev/modules
==> default: vagrant-r10k: Deploy finished
==> default: Running provisioner: puppet...
==> default: Running Puppet with environment dev...
==> default: Notice: Compiled catalog for devbox-vagrant.domain.com in environment dev in 0.37 seconds
==> default: Notice: its best to test while wearing a vest
==> default: Notice: /Stage[main]/Helloworld/Notify[its best to test while wearing a vest]/message: defined 'message' as 'its best to test while wearing a vest'
==> default: Error: Could not back up /etc/motd: Error 403 on SERVER: Forbidden
==> default: Error: Could not back up /etc/motd: Error 403 on SERVER: Forbidden
==> default: Error: /Stage[main]/Helloworld::Motd/File[/etc/motd]/content: change from {md5}d41d8cd98f00b204e9800998ecf8427e to {md5}7456822482f83301f8a4ad785e710898 failed: Could not back up /etc/motd: Error 403 on SERVER: Forbidden
==> default: Notice: Applied catalog in 5.13 seconds
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.

I'm confused. seems like a rights issue? the trouble is this all works swimmingly in my test/uat/live environments. I'm specifically trying to get vagrant to work, but this is a vagrant box that I'm not even sshing into to run the provisioner. it's just a vagrant function. does anyone know what I'm doing wrong here?

I realise this is probably something of a vagrant question rather than a puppet question, but I'm using

puppetlabs/centos-7.0-64-puppet ... (more)

edit retag flag offensive close merge delete

Comments

Not sure exactly how your vagrant stuff is working, but it appears that the issue is puppet agent attempting to backup the file it's modifying to the filebucket on a puppet master.

lavaman gravatar imagelavaman ( 2016-03-11 18:41:09 -0500 )edit

thats it! thansk a bunch. specifiically what happened here is that my dev environment is just a branch of production and I use the filebucket features. turned them off in site.pp for dev and straight away working. Can you add your comment as answer?

dogfish182 gravatar imagedogfish182 ( 2016-03-12 10:39:12 -0500 )edit

1 Answer

Sort by » oldest newest most voted
1

answered 2016-03-12 19:12:19 -0500

lavaman gravatar image

The agent is throwing that error because it cannot access the filebucket on the puppetmaster to back up the file it is modifying.

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: 2016-03-11 14:22:34 -0500

Seen: 231 times

Last updated: Mar 12 '16