Problem with rsync when vagrant sync chef-solo folders

182 views
Skip to first unread message

Moshe Zuisman

unread,
Sep 29, 2015, 6:58:49 AM9/29/15
to Vagrant

Hi.
I am working on provisioning of Linux (RHEL) boxes at AWS , using Vagrant with chef-solo provisioner.
Problem occurs at step, when Vagrant attempts to sync chef cookbooks folder.


Host path: /c/DevOps/cookbooks/
Guest path: /tmp/vagrant-chef/f8fe0df38f5a1a717e0cad4d37d84de3/cookbooks
Command: rsync --verbose --archive --delete -z --copy-links --chmod=ugo=rwX --no-perms --no-owner --no-group --rsync-pat
h sudo rsync -e ssh -p 22 -o StrictHostKeyChecking=no -o IdentitiesOnly=true -o UserKnownHostsFile=/dev/null -i 'c:/DevO
ps/.vagrant/machines/dummy_l/aws/private_key' --exclude .vagrant/ /c/DevOps/cookbooks/ vagrant@:/tmp/vagran
t-chef/f8fe0df38f5a1a717e0cad4d37d84de3/cookbooks
Error:
There was an error when attempting to rsync a synced folder.
Please inspect the error message below for more info.


When I drilled down to source of problem with our IT - it seems to be in option, that Vagrant passes to rsync:
-i 'c:/DevOps/.vagrant/machines/dummy_l/aws/private_key'
Problem is - that our corporate brandmauer prohibit outgoing SSL connections with private key. Only permited connections are - with user/password.
I have customized my base AMI And it accepts SSH connections with user/password.So - it is not a problem. But , it seems that Vagrant aws plugin always build rsync command line - to connect with private key. And I do not find any option to change it... Is there any way to bypass those issue , without intervening in aws plugin source code?

Moshe Zuisman

unread,
Sep 29, 2015, 10:45:12 AM9/29/15
to Vagrant
Additional question.
I thought to bypass those mess by pushing cookbooks to guest machine through sftp(instead of using synced chef folder).
But - I simply can not prevent Vagrant from attempting to sync chef cookbooks folder...
When I try to add at chef-solo provisioning "disable chef sync folders:
__________________________________________________________
    config.vm.provision :chef_solo do |chef|
#       chef.cookbooks_path = "cookbooks"  
        chef
.synced_folder_type = "rsync"
    chef
.synced_folder , :disabled true
        chef
.install = "false"
        chef
.add_recipe("mfweb")
   
end    
__________________________________________________________
I get:

c:/DevOps/Vagrantfile:36: syntax error, unexpected keyword_true, expecting :: or '[' or '.'
    chef.synced_folder , :disabled true
                                       ^
There is a syntax error in the following Vagrantfile. The syntax error
message is reproduced below for convenience:

c:/DevOps/Vagrantfile:36: syntax error, unexpected keyword_true, expecting :: or '[' or '.'
    chef.synced_folder , :disabled true
                                       ^
 INFO interface: Machine: error-exit ["Vagrant::Errors::VagrantfileSyntaxError", "There is a syntax error in the followi
ng Vagrantfile. The syntax error\nmessage is reproduced below for convenience:\n\nc:/DevOps/Vagrantfile:36: syntax error
, unexpected keyword_true, expecting :: or '[' or '.'\n    chef.synced_folder , :disabled true \r\n
                  ^"]
Is it possible at all to disable sync of chef cookbooks and copy them to guest machine manually?

Alvaro Miranda Aguilera

unread,
Oct 6, 2015, 6:03:51 AM10/6/15
to vagra...@googlegroups.com
Seems you want to avoid vagrant-chef due those restrictions

if that's the case, I would recommend

rsync provisioner to put the files where you need them
shell script to run chef command manually.

Not ideal, but seems you can't use the default chef provisioner.

Alvaro.
> --
> This mailing list is governed under the HashiCorp Community Guidelines -
> https://www.hashicorp.com/community-guidelines.html. Behavior in violation
> of those guidelines may result in your removal from this mailing list.
>
> GitHub Issues: https://github.com/mitchellh/vagrant/issues
> IRC: #vagrant on Freenode
> ---
> You received this message because you are subscribed to the Google Groups
> "Vagrant" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to vagrant-up+...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/vagrant-up/4d9d0e9b-9b94-4b85-b832-2ce6ad299fbb%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.

Moshe Zuisman

unread,
Oct 8, 2015, 4:30:59 AM10/8/15
to Vagrant
Hi.
I understand - that I can run chef as command from shell provisionser... Actually - I even succeed to to run chef as chef_client provisioner.(since it download cookbooks from chef_server and not uses synchronized folders... ) But - I want to figure out if I can in some way to get sync folders working in my network configuration... That means - if I can some how to control flags - vargant passes to command line of rsync binary..
вторник, 6 октября 2015 г., 13:03:51 UTC+3 пользователь Alvaro Miranda Aguilera написал:
Reply all
Reply to author
Forward
0 new messages