From https://www.vagrantup.com/docs/provisioning/chef_solo.html and http://berkshelf.com/, I'm trying to add apt and apache2 recipes.
My settings :
Host OS : Windows 10
vagrant : v1.8.1
Virtualbox : v5.0.14
Guest OS : Ubuntu Precise64 (default vagrant VM)
My different steps:
1) Set up vagrant plug-ins:
vagrant plugin install vagrant-berkshelf
vagrant plugin install vagrant-omnibus
vagrant plugin install vagrant-hostmanager
Installed versions:
$ vagrant plugin list
vagrant-berkshelf (4.1.0)
vagrant-hostmanager (1.8.2)
vagrant-omnibus (1.4.1)
vagrant-share (1.1.5, system)
2) Set up Chef dk 0.15.15 on the host (Necessary to start a vagrant VM with the Berkshelf plugin)
3) Vagrantfile file config
config.vm.network "private_network", ip: "192.168.33.10"
config.omnibus.chef_version = :latest
config.berkshelf.enabled = true
config.vm.provision "chef_solo" do |chef|
chef.add_recipe "apt"
chef.add_recipe "apache2"
end
4) Create manually the Berksfile file (in the same folder as Vagrantfile)
source "https://supermarket.chef.io"
cookbook "apt"
cookbook "apache2"
After doing these settings, I can do the vagrant up to start the machine.
vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Loading Berkshelf datafile...
==> default: Sharing cookbooks with VM
==> default: Checking if box 'hashicorp/precise64' is up to date...
==> default: Clearing any previously set forwarded ports...
==> default: Updating Vagrant's Berkshelf...
==> default: Resolving cookbook dependencies...
==> default: Using apache2 (3.2.2)
==> default: Using apt (4.0.1)
==> default: Using compat_resource (12.10.6)
==> default: Vendoring apache2 (3.2.2) to C:/Users/No/.berkshelf/vagrant-berkshelf/shelves/berkshelf20160630-13400-d00zd2-default/apache2
==> default: Vendoring apt (4.0.1) to C:/Users/No/.berkshelf/vagrant-berkshelf/shelves/berkshelf20160630-13400-d00zd2-default/apt
==> default: Vendoring compat_resource (12.10.6) to C:/Users/No/.berkshelf/vagrant-berkshelf/shelves/berkshelf20160630-13400-d00zd2-default/compat_resource
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: hostonly
==> default: Forwarding ports...
default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2222
default: SSH username: vagrant
default: SSH auth method: private key
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
default: The guest additions on this VM do not match the installed version of
default: VirtualBox! In most cases this is fine, but in rare cases it can
default: prevent things such as shared folders from working properly. If you see
default: shared folder errors, please make sure the guest additions within the
default: virtual machine match the version of VirtualBox you have installed on
default: your host and reload your VM.
default:
default: Guest Additions Version: 4.2.0
default: VirtualBox Version: 5.0
==> default: Configuring and enabling network interfaces...
==> default: Mounting shared folders...
default: /vagrant => D:/Vagrant VMs Files/Linux/Ubuntu Standard/v12.04 LTS Precise/Hashicorp-Precise64 - Template (TUTO)
default: /tmp/vagrant-chef/83b8a9c0ce916541f1e94cb0043abcfa/cookbooks => C:/Users/No/.berkshelf/vagrant-berkshelf/shelves/berkshelf20160630-13400-d00zd2-default
==> default: Machine already provisioned. Run `vagrant provision` or use the `--provision`
==> default: flag to force provisioning. Provisioners marked to run always will still run.
And then doing a vagrant provision
vagrant provision
==> default: Loading Berkshelf datafile...
==> default: Sharing cookbooks with VM
==> default: Updating Vagrant's Berkshelf...
==> default: Resolving cookbook dependencies...
==> default: Using apache2 (3.2.2)
==> default: Using apt (4.0.1)
==> default: Using compat_resource (12.10.6)
==> default: Vendoring apache2 (3.2.2) to C:/Users/No/.berkshelf/vagrant-berkshelf/shelves/berkshelf20160630-13400-d00zd2-default/apache2
==> default: Vendoring apt (4.0.1) to C:/Users/No/.berkshelf/vagrant-berkshelf/shelves/berkshelf20160630-13400-d00zd2-default/apt
==> default: Vendoring compat_resource (12.10.6) to C:/Users/No/.berkshelf/vagrant-berkshelf/shelves/berkshelf20160630-13400-d00zd2-default/compat_resource
==> default: Chef 12.11.18 Omnibus package is already installed.
==> default: Running provisioner: chef_solo...
==> default: Detected Chef (latest) is already installed
==> default: Generating chef JSON and uploading...
==> default: Running chef-solo...
==> default: stdin: is not a tty
==> default: [2016-06-30T07:06:10+00:00] INFO: Started chef-zero at chefzero://localhost:8889 with repository at /tmp/vagrant-chef/83b8a9c0ce916541f1e94cb0043abcfa
==> default: One version per cookbook
==> default: [2016-06-30T07:06:10+00:00] INFO: Forking chef instance to converge...
==> default: Starting Chef Client, version 12.11.18
==> default: [2016-06-30T07:06:10+00:00] INFO: *** Chef 12.11.18 ***
==> default: [2016-06-30T07:06:10+00:00] INFO: Platform: x86_64-linux
==> default: [2016-06-30T07:06:10+00:00] INFO: Chef-client pid: 1377
==> default: [2016-06-30T07:06:13+00:00] INFO: GET /organizations/chef/nodes/vagrant-084b5399
==> default: [2016-06-30T07:06:13+00:00] INFO: #<ChefZero::RestErrorResponse: 404: Object not found: chefzero://localhost:8889/nodes/vagrant-084b5399>
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-zero-4.6.2/lib/chef_zero/rest_base.rb:91:in `rescue in get_data'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-zero-4.6.2/lib/chef_zero/rest_base.rb:83:in `get_data'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-zero-4.6.2/lib/chef_zero/endpoints/rest_object_endpoint.rb:18:in `get'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-zero-4.6.2/lib/chef_zero/rest_base.rb:62:in `call'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-zero-4.6.2/lib/chef_zero/rest_router.rb:24:in `call'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-zero-4.6.2/lib/chef_zero/server.rb:664:in `block in app'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-zero-4.6.2/lib/chef_zero/server.rb:336:in `call'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-zero-4.6.2/lib/chef_zero/server.rb:336:in `handle_socketless_request'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-zero-4.6.2/lib/chef_zero/socketless_server_map.rb:87:in `request'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-zero-4.6.2/lib/chef_zero/socketless_server_map.rb:33:in `request'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/http/socketless_chef_zero_client.rb:154:in `request'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/http.rb:305:in `block in send_http_request'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/http.rb:336:in `block in retrying_http_errors'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/http.rb:334:in `loop'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/http.rb:334:in `retrying_http_errors'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/http.rb:299:in `send_http_request'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/http.rb:144:in `request'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/http.rb:111:in `get'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/node.rb:604:in `load'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/node.rb:588:in `find_or_create'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/policy_builder/dynamic.rb:72:in `load_node'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/client.rb:467:in `load_node'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/client.rb:269:in `run'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/application.rb:286:in `block in fork_chef_client'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/application.rb:274:in `fork'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/application.rb:274:in `fork_chef_client'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/application.rb:239:in `block in run_chef_client'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/local_mode.rb:44:in `with_server_connectivity'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/application.rb:227:in `run_chef_client'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/application/client.rb:456:in `sleep_then_run_chef_client'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/application/client.rb:443:in `block in interval_run_chef_client'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/application/client.rb:442:in `loop'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/application/client.rb:442:in `interval_run_chef_client'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/application/client.rb:426:in `run_application'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/application.rb:59:in `run'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/application/solo.rb:217:in `run'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/bin/chef-solo:25:in `<top (required)>'
==> default: /usr/bin/chef-solo:52:in `load'
==> default: /usr/bin/chef-solo:52:in `<main>'
==> default: [2016-06-30T07:06:13+00:00] INFO: HTTP Request Returned 404 Not Found: Object not found: chefzero://localhost:8889/nodes/vagrant-084b5399
==> default: [2016-06-30T07:06:13+00:00] INFO: POST /organizations/chef/nodes
==> default: --- POST BODY ---
==> default: {"name":"vagrant-084b5399","chef_environment":"_default","json_class":"Chef::Node","automatic":{},"normal":{},"chef_type":"node","default":{},"override":{},"run_list":[]}
==> default: --- END POST BODY ---
==> default: [2016-06-30T07:06:13+00:00] INFO: #<ChefZero::RestErrorResponse: 404: Parent not found: chefzero://localhost:8889/nodes>
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-zero-4.6.2/lib/chef_zero/rest_base.rb:187:in `rescue in create_data'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-zero-4.6.2/lib/chef_zero/rest_base.rb:181:in `create_data'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-zero-4.6.2/lib/chef_zero/endpoints/rest_list_endpoint.rb:31:in `post'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-zero-4.6.2/lib/chef_zero/endpoints/nodes_endpoint.rb:24:in `post'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-zero-4.6.2/lib/chef_zero/rest_base.rb:62:in `call'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-zero-4.6.2/lib/chef_zero/rest_router.rb:24:in `call'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-zero-4.6.2/lib/chef_zero/server.rb:664:in `block in app'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-zero-4.6.2/lib/chef_zero/server.rb:336:in `call'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-zero-4.6.2/lib/chef_zero/server.rb:336:in `handle_socketless_request'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-zero-4.6.2/lib/chef_zero/socketless_server_map.rb:87:in `request'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-zero-4.6.2/lib/chef_zero/socketless_server_map.rb:33:in `request'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/http/socketless_chef_zero_client.rb:154:in `request'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/http.rb:305:in `block in send_http_request'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/http.rb:336:in `block in retrying_http_errors'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/http.rb:334:in `loop'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/http.rb:334:in `retrying_http_errors'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/http.rb:299:in `send_http_request'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/http.rb:144:in `request'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/http.rb:127:in `post'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/node.rb:639:in `create'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/node.rb:592:in `rescue in find_or_create'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/node.rb:588:in `find_or_create'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/policy_builder/dynamic.rb:72:in `load_node'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/client.rb:467:in `load_node'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/client.rb:269:in `run'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/application.rb:286:in `block in fork_chef_client'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/application.rb:274:in `fork'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/application.rb:274:in `fork_chef_client'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/application.rb:239:in `block in run_chef_client'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/local_mode.rb:44:in `with_server_connectivity'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/application.rb:227:in `run_chef_client'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/application/client.rb:456:in `sleep_then_run_chef_client'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/application/client.rb:443:in `block in interval_run_chef_client'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/application/client.rb:442:in `loop'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/application/client.rb:442:in `interval_run_chef_client'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/application/client.rb:426:in `run_application'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/application.rb:59:in `run'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/application/solo.rb:217:in `run'
==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/bin/chef-solo:25:in `<top (required)>'
==> default: /usr/bin/chef-solo:52:in `load'
==> default: /usr/bin/chef-solo:52:in `<main>'
==> default: [2016-06-30T07:06:13+00:00] INFO: HTTP Request Returned 404 Not Found: Parent not found: chefzero://localhost:8889/nodes
==> default: ================================================================================
==> default: Chef encountered an error attempting to load the node data for "vagrant-084b5399"
==> default: ================================================================================
==> default:
==> default: Resource Not Found:
==> default: -------------------
==> default: The server returned a HTTP 404. This usually indicates that your chef_server_url is incorrect.
==> default: Relevant Config Settings:
==> default: -------------------------
==> default: chef_server_url "chefzero://localhost:8889"
==> default: Platform:
==> default: ---------
==> default: x86_64-linux
==> default:
==> default: Running handlers:
==> default: [2016-06-30T07:06:13+00:00] ERROR: Running exception handlers
==> default: Running handlers complete
==> default: [2016-06-30T07:06:13+00:00] ERROR: Exception handlers complete
==> default: Chef Client failed. 0 resources updated in 02 seconds
==> default: [2016-06-30T07:06:13+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
==> default: [2016-06-30T07:06:13+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
==> default: [2016-06-30T07:06:13+00:00] ERROR: 404 "Not Found"
==> default: [2016-06-30T07:06:14+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
Chef never successfully completed! Any errors should be visible in the
output above. Please fix your recipes so that they properly complete.
As you can see, I have some errors (Chef encountered an error attempting to load the node data for "vagrant-084b5399"), please see the chef-stacktrace.out file content below
Generated at 2016-06-30 07:06:13 +0000
Net::HTTPServerException: 404 "Not Found"
/opt/chef/embedded/lib/ruby/2.1.0/net/http/response.rb:119:in `error!'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/http.rb:146:in `request'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/http.rb:127:in `post'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/node.rb:639:in `create'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/node.rb:592:in `rescue in find_or_create'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/node.rb:588:in `find_or_create'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/policy_builder/dynamic.rb:72:in `load_node'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/client.rb:467:in `load_node'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/client.rb:269:in `run'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/application.rb:286:in `block in fork_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/application.rb:274:in `fork'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/application.rb:274:in `fork_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/application.rb:239:in `block in run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/local_mode.rb:44:in `with_server_connectivity'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/application.rb:227:in `run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/application/client.rb:456:in `sleep_then_run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/application/client.rb:443:in `block in interval_run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/application/client.rb:442:in `loop'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/application/client.rb:442:in `interval_run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/application/client.rb:426:in `run_application'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/application.rb:59:in `run'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/application/solo.rb:217:in `run'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/bin/chef-solo:25:in `<top (required)>'
/usr/bin/chef-solo:52:in `load'
/usr/bin/chef-solo:52:in `<main>'
I have verified, apache2 is not installed on the VM.
I don't know what these errors mean, is there a mistake somewhere?
You need to upgrade your Vagrant, the latest is 1.8.4. We made some changes to how chef-solo works internally that Vagrant had to adjust to.
I am running vagrant(1.7.4)-salt on Virtual box 4.3 on a headless ubuntu 14.04. Salt is a standalone one.The reason I am using these version is because the work on my local ubuntu.
On vagrant up I get the following output:
==> default: Importing base box 'phusion/ubuntu-14.04-amd64'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'phusion/ubuntu-14.04-amd64' is up to date...
==> default: Setting the name of the VM: drupal_default_1452863894453_19933
==> default: Clearing any previously set forwarded ports...
==> default: Fixed port collision for 22 => 2222. Now on port 2201.
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: hostonly
==> default: Forwarding ports...
default: 22 => 2201 (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2201
default: SSH username: vagrant
default: SSH auth method: private key
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
vagrant ssh-config gives:
Host default
HostName 127.0.0.1
User vagrant
Port 2201
UserKnownHostsFile /dev/null
StrictHostKeyChecking no
PasswordAuthentication no
IdentityFile /home/user/.vagrant.d/insecure_private_key
IdentitiesOnly yes
LogLevel FATAL
My Vagrantfile is:
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.host_name = "site#{rand(0..999999)}"
config.vm.provider "virtualbox" do |v|
config.ssh.insert_key = false
v.memory = 2048
v.cpus = 1
end
## For masterless, mount your salt file root
config.vm.synced_folder "salt/roots/","/srv/salt/"
# Network
config.vm.network :private_network, ip: "172.16.0.100"
# Server provisioner
config.vm.provision :salt do |salt|
salt.masterless = true
salt.minion_config = "salt/minion"
salt.run_highstate = true
salt.bootstrap_options = "-P"
end
# Provisioning scripts
config.vm.provision "dbsync", type: "shell", path: "provision/db.sh"
end
What could have missed? Any ubuntu network configuration? Any ssh configuration?
I tried with below code in apache cookbook to map default port 80 to 443 however still I get error while running the chef. Can you please suggest on this. I tried to map to other than port # 80 since I have nginx recipe also in my cookbook so would like to set up apache2 to listen on diff port -
* apache/attribute/default.rb
default['apache']['dir'] = '/etc/apache2'
default['apache']['listen_ports'] = [ '80','443' ]
* apache/recipes/default.rb
package "apache2" do
action :install
end
service "apache2" do
action [:enable, :start]
end
template "/var/www/index.html" do
source "index.html.erb"
mode "0644"
end
Vagrant provision error -
================================================================================
==> default:
==> default: Error executing action `start` on resource 'service[apache2]'
==> default:
================================================================================
==> default:
==> default: Mixlib::ShellOut::ShellCommandFailed
==> default:
==> default: ------------------------------------
==> default:
==> default: Expected process to exit with [0], but received '1'
This time I had used ==>
attribute/default.rb with below content but still getting error -
default['apache']['dir'] = '/etc/apache2'
default['apache']['listen_ports'] = [ '81’ ]
Error
==> default: STDOUT: * Starting web server apache2
==> default:
==> default: Action 'start' failed.
==> default: The Apache error log may have more information.
==> default: ...fail!
==> default: STDERR: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
==> default: (98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
listen_ports is not a mapping, it sets which ports to listen on. If you don't want to listen on 80, do not include it in that array.
So after I created a similar vm, Vagrant fails to provision:
vagrant up
...
verbose:
==> default: Info: /Stage[main]/Apache::Mod::Worker/Apache::Mpm[worker]/File[/etc/apache2/mods-enabled/worker.load]: Scheduling refresh of Class[Apache::Service]
==> default: Notice: /Stage[main]/Apache::Mod::Worker/File[/etc/apache2/mods-available/worker.conf]/ensure: defined content as '{md5}59cf27b20f14393692303b41f3071df6'
==> default: Info: /Stage[main]/Apache::Mod::Worker/File[/etc/apache2/mods-available/worker.conf]: Scheduling refresh of Class[Apache::Service]
==> default: Notice: /Stage[main]/Apache::Mod::Worker/Apache::Mpm[worker]/File[/etc/apache2/mods-enabled/worker.conf]/ensure: created
==> default: Info: /Stage[main]/Apache::Mod::Worker/Apache::Mpm[worker]/File[/etc/apache2/mods-enabled/worker.conf]: Scheduling refresh of Class[Apache::Service]
==> default: Info: /Stage[main]/Apache::Mod::Cgid/File[cgid.conf]: Filebucketed /etc/apache2/mods-available/cgid.conf to puppet with sum e8a2836392051bde889cf9c137058273
==> default: Notice: /Stage[main]/Apache::Mod::Cgid/File[cgid.conf]/content: content changed '{md5}e8a2836392051bde889cf9c137058273' to '{md5}7dffbb5823bcbb9ab4d3e67ab14d38a0'
==> default: Info: /Stage[main]/Apache::Mod::Cgid/File[cgid.conf]: Scheduling refresh of Class[Apache::Service]
==> default: Notice: /Stage[main]/Apache::Mod::Cgid/Apache::Mod[cgid]/File[cgid.conf symlink]/ensure: created
==> default: Info: /Stage[main]/Apache::Mod::Cgid/Apache::Mod[cgid]/File[cgid.conf symlink]: Scheduling refresh of Class[Apache::Service]
==> default: Notice: /Stage[main]/Apache::Mod::Cgid/Apache::Mod[cgid]/File[cgid.load symlink]/ensure: created
==> default: Info: /Stage[main]/Apache::Mod::Cgid/Apache::Mod[cgid]/File[cgid.load symlink]: Scheduling refresh of Class[Apache::Service]
==> default: Notice: /Stage[main]/Main/Apache::Vhost[default_vhost_80]/Concat::Fragment[default_vhost_80-directories]/File[/var/lib/puppet/concat/10-default_vhost_80.conf/fragments/60_default_vhost_80-directories]/ensure: defined content as '{md5}c0f5d086c1fb77355364fde626855125'
==> default: Info: /Stage[main]/Main/Apache::Vhost[default_vhost_80]/Concat::Fragment[default_vhost_80-directories]/File[/var/lib/puppet/concat/10-default_vhost_80.conf/fragments/60_default_vhost_80-directories]: Scheduling refresh of Exec[concat_10-default_vhost_80.conf]
==> default: Notice: /Stage[main]/Main/Apache::Vhost[default_vhost_80]/Concat[10-default_vhost_80.conf]/Exec[concat_10-default_vhost_80.conf]/returns: executed successfully
==> default: Notice: /Stage[main]/Main/Apache::Vhost[default_vhost_80]/Concat[10-default_vhost_80.conf]/Exec[concat_10-default_vhost_80.conf]: Triggered 'refresh' from 9 events
==> default: Notice: /Stage[main]/Apache::Default_mods/Apache::Mod[env]/File[env.load symlink]/target: target changed '../mods-available/env.load' to '/etc/apache2/mods-available/env.load'
==> default: Info: /Stage[main]/Apache::Default_mods/Apache::Mod[env]/File[env.load symlink]: Scheduling refresh of Class[Apache::Service]
==> default: Notice: /Stage[main]/Main/Puphpet::Php::Module[intl]/Php::Module[intl]/Package[PhpModule_intl]/ensure: ensure changed 'purged' to 'present'
==> default: Info: /Stage[main]/Main/Puphpet::Php::Module[intl]/Php::Module[intl]/Package[PhpModule_intl]: Scheduling refresh of Service[php5-fpm]
and then it fails somewhere here:
==> default: Notice: /Stage[main]/Main/Service[php5-fpm]: Triggered 'refresh' from 13 events
==> default: Running provisioner: shell...
and an error log is being super general
The provider for this Vagrant-managed machine is reporting that it
is not yet ready for SSH. Depending on your provider this can carry
different meanings. Make sure your machine is created and running and
try again. Additionally, check the output of `vagrant status` to verify
that the machine is in the state that you expect. If you continue to
get this error message, please view the documentation for the provider
you're using.
Machine status:
default aborted (virtualbox)
After I am trying to up it again, the status changes to
default running (virtualbox)
However, an apache2 remains unconfigured.
This exactly machine was working well, up until my computer shut down unexpectedly.
Vagrantfile was configured with puphpet:
vagrantfile:
target: local
vm:
box: puphpet/ubuntu1404-x64
box_url: puphpet/ubuntu1404-x64
hostname: local.puphpet
memory: '4096'
cpus: '1'
chosen_provider: virtualbox
network:
private_network: 192.168.56.101
forwarded_port:
vflnp_s2r52zqm9il5:
host: '5105'
guest: '22'
post_up_message: ''
provider:
virtualbox:
modifyvm:
natdnshostresolver1: on
vmware:
numvcpus: 1
parallels:
cpus: 1
provision:
puppet:
manifests_path: puphpet/puppet
manifest_file: site.pp
module_path: puphpet/puppet/modules
options:
- '--verbose'
- '--hiera_config /vagrant/puphpet/puppet/hiera.yaml'
- '--parser future'
synced_folder:
vflsf_jsyjt6qqjv6g:
source: ./
target: /var/www/some
sync_type: default
rsync:
args:
- '--verbose'
- '--archive'
- '-z'
exclude:
- .vagrant/
- .git/
auto: 'true'
owner: www-data
group: www-data
usable_port_range:
start: 10200
stop: 10500
ssh:
host: null
port: null
private_key_path: null
username: vagrant
guest_port: null
keep_alive: true
forward_agent: false
forward_x11: false
shell: 'bash -l'
vagrant:
host: detect
server:
install: '1'
packages: { }
users_groups:
install: '1'
groups: { }
users: { }
firewall:
install: '1'
rules: { }
cron:
install: '1'
jobs: { }
nginx:
install: '0'
settings:
default_vhost: 1
proxy_buffer_size: 128k
proxy_buffers: '4 256k'
upstreams: { }
vhosts:
nxv_waoqjnfx3bdq:
server_name: awesome.dev
server_aliases:
- www.awesome.dev
www_root: /var/www/awesome
listen_port: '80'
index_files:
- index.html
- index.htm
- index.php
client_max_body_size: 1m
ssl: '0'
ssl_cert: ''
ssl_key: ''
ssl_port: '443'
ssl_protocols: ''
ssl_ciphers: ''
rewrite_to_https: '1'
spdy: '1'
locations:
nxvl_dxl1t6uo4ne5:
location: /
autoindex: off
try_files:
- $uri
- $uri/
- /index.php$is_args$args
fastcgi: ''
fastcgi_index: ''
fastcgi_split_path: ''
nxvl_sz4s0mdyj1l7:
location: '~ \.php$'
autoindex: off
try_files:
- $uri
- $uri/
- /index.php$is_args$args
fastcgi: '127.0.0.1:9000'
fastcgi_index: index.php
fastcgi_split_path: '^(.+\.php)(/.*)$'
fast_cgi_params_extra:
- 'SCRIPT_FILENAME $request_filename'
- 'APP_ENV dev'
proxies: { }
apache:
install: '1'
settings:
user: www-data
group: www-data
default_vhost: true
manage_user: false
manage_group: false
sendfile: 0
modules:
- proxy_fcgi
- rewrite
vhosts:
av_3e4zn3m5qrj8:
servername: rusroads.dev
docroot: /var/www/some
port: '80'
setenv:
- 'APP_ENV dev'
custom_fragment: ''
ssl: '0'
ssl_cert: ''
ssl_key: ''
ssl_chain: ''
ssl_certs_dir: ''
ssl_protocol: ''
ssl_cipher: ''
directories:
avd_wji3ysov16ho:
path: /var/www/some
options:
- Indexes
- FollowSymlinks
- MultiViews
allow_override:
- All
require:
- 'all granted'
custom_fragment: ''
files_match:
avdfm_y8f6jikawjc0:
path: \.php$
sethandler: 'proxy:fcgi://127.0.0.1:9000'
custom_fragment: ''
provider: filesmatch
provider: directory
php:
install: '1'
settings:
version: '56'
modules:
php:
- cli
- intl
- mcrypt
pear: { }
pecl:
- pecl_http
ini:
display_errors: On
error_reporting: '-1'
session.save_path: /var/lib/php/session
date.timezone: UTC
fpm_ini:
error_log: /var/log/php-fpm.log
fpm_pools:
phpfp_ljtz845og4bc:
ini:
prefix: www
listen: '127.0.0.1:9000'
security.limit_extensions: .php
user: www-user
group: www-data
composer: '1'
composer_home: ''
xdebug:
install: '0'
settings:
xdebug.default_enable: '1'
xdebug.remote_autostart: '0'
xdebug.remote_connect_back: '1'
xdebug.remote_enable: '1'
xdebug.remote_handler: dbgp
xdebug.remote_port: '9000'
blackfire:
install: '0'
settings:
server_id: ''
server_token: ''
agent:
http_proxy: ''
https_proxy: ''
log_file: stderr
log_level: '1'
php:
agent_timeout: '0.25'
log_file: ''
log_level: '1'
xhprof:
install: '0'
wpcli:
install: '0'
version: v0.19.0
drush:
install: '0'
version: 6.3.0
ruby:
install: '1'
versions: { }
python:
install: '1'
packages: { }
versions: { }
nodejs:
install: '1'
npm_packages:
- grunt-cli
- bower
hhvm:
install: '0'
nightly: 0
composer: '1'
composer_home: ''
settings: { }
server_ini:
hhvm.server.host: 127.0.0.1
hhvm.server.port: '9000'
hhvm.log.use_log_file: '1'
hhvm.log.file: /var/log/hhvm/error.log
php_ini:
display_errors: On
error_reporting: '-1'
date.timezone: UTC
mysql:
install: '0'
settings:
version: '5.6'
root_password: 'some'
override_options: { }
adminer: 0
users:
mysqlnu_4ljvghhv688f:
name: 123
password: 'some'
databases:
mysqlnd_opuz0wjig2wj:
name: some
sql: ''
grants:
mysqlng_gapwtqorf5s2:
user: dbuser
table: '*.*'
privileges:
- ALL
postgresql:
install: '0'
settings:
global:
encoding: UTF8
version: '9.3'
server:
postgres_password: 'some'
databases: { }
users: { }
grants: { }
adminer: 0
mongodb:
install: '0'
settings:
auth: 1
bind_ip: 127.0.0.1
port: '27017'
databases: { }
redis:
install: '0'
settings:
conf_port: '6379'
sqlite:
install: '0'
adminer: 0
databases: { }
mailcatcher:
install: '0'
settings:
smtp_ip: 0.0.0.0
smtp_port: 1025
http_ip: 0.0.0.0
http_port: '1080'
mailcatcher_path: /usr/local/rvm/wrappers/default
from_email_method: inline
beanstalkd:
install: '0'
settings:
listenaddress: 0.0.0.0
listenport: '13000'
maxjobsize: '65535'
maxconnections: '1024'
binlogdir: /var/lib/beanstalkd/binlog
binlogfsync: null
binlogsize: '10485760'
beanstalk_console: 0
binlogdir: /var/lib/beanstalkd/binlog
rabbitmq:
install: '0'
settings:
port: '5672'
users: { }
vhosts: { }
plugins: { }
elastic_search:
install: '0'
settings:
version: 1.4.1
java_install: true
solr:
install: '0'
settings:
version: 4.10.2
port: '8984'
I had some similar errors about apache install on Vagrant. In my case it was because Apache's document root did not exist (or was a symbolic link) at the time that Apache was being installed by apt-get.
I was provisioning the guest machine using a bash script that messed with Apache's root before installing Apache, something like this:
# Remove /var/www and recreate it as a link to the vagrant root.
rm -rf /var/www
ln -fs /vagrant/sites /var/www
# Install Apache.
apt-get install -y apache2
I was able to fix the problem by reversing the order, installing Apache first then changing it's document root.
Like you, this was on Ubuntu 14.04 and it was also working for me, then suddenly broke.
Sorry I don't know about puphpet. Hope this helps anyway.
I have vagrant/puppet provision script and see there is a problem when my host machine is Windows (when hosting on Ubuntu doesn't seems to have this problem). I can see that apache::concat working with apache ports.conf file have a problem. I'm using guest box same on both places (ubuntu server 14.04). As far as I know puppet is running on guest machine.
My question is why I have this warnings and errors during provisioning?
==> default: Running provisioner: puppet...
==> default: Running Puppet with default.pp...
==> default: stdin: is not a tty
==> default: Notice: Compiled catalog for eclectic.vm in environment production in 7.06 seconds
==> default: Notice: /Stage[main]/Main/Exec[apt-update]/returns: executed successfully
==> default: Notice: /Stage[main]/Main/Exec[git-checkout-drush]/returns: executed successfully
==> default: Notice: /Stage[main]/Main/File[/var/www/vhosts/eclectic.ca]/mode: mode changed '0777' to '0775'
==> default: Notice: /Stage[main]/Main/Apache::Vhost[ca.eclectic.vm]/File[/var/www/vhosts/eclectic.ca/public_html]/owner: owner changed 'www-data' to 'root'
==> default: Notice: /Stage[main]/Main/Apache::Vhost[ca.eclectic.vm]/File[/var/www/vhosts/eclectic.ca/public_html]/group: group changed 'vagrant' to 'root'
==> default: Error: /Stage[main]/Apache/Concat[/etc/apache2/ports.conf]/Exec[concat_/etc/apache2/ports.conf]: Could not evaluate: /usr/bin/env: ruby
: No such file or directory
==> default: Notice: /Stage[main]/Apache/Concat[/etc/apache2/ports.conf]/File[/etc/apache2/ports.conf]: Dependency Exec[concat_/etc/apache2/ports.conf] has failures: true
==> default: Warning: /Stage[main]/Apache/Concat[/etc/apache2/ports.conf]/File[/etc/apache2/ports.conf]: Skipping because of failed dependencies
==> default: Notice: /Stage[main]/Main/Exec[composer-install-drush]/returns: executed successfully
==> default: Error: /Stage[main]/Main/Apache::Vhost[ssl-ca.eclectic.vm]/Concat[25-ssl-ca.eclectic.vm.conf]/Exec[concat_25-ssl-ca.eclectic.vm.conf]: Could not evaluate: /usr/bin/env: ruby
: No such file or directory
==> default: Notice: /Stage[main]/Main/Apache::Vhost[ssl-ca.eclectic.vm]/Concat[25-ssl-ca.eclectic.vm.conf]/File[25-ssl-ca.eclectic.vm.conf]: Dependency Exec[concat_25-ssl-ca.eclectic.vm.conf] has failures: true
==> default: Warning: /Stage[main]/Main/Apache::Vhost[ssl-ca.eclectic.vm]/Concat[25-ssl-ca.eclectic.vm.conf]/File[25-ssl-ca.eclectic.vm.conf]: Skipping because of failed dependencies
==> default: Notice: /Stage[main]/Main/Apache::Vhost[ssl-ca.eclectic.vm]/File[25-ssl-ca.eclectic.vm.conf symlink]: Dependency Exec[concat_25-ssl-ca.eclectic.vm.conf] has failures: true
==> default: Warning: /Stage[main]/Main/Apache::Vhost[ssl-ca.eclectic.vm]/File[25-ssl-ca.eclectic.vm.conf symlink]: Skipping because of failed dependencies
==> default: Error: /Stage[main]/Main/Apache::Vhost[ca.eclectic.vm]/Concat[25-ca.eclectic.vm.conf]/Exec[concat_25-ca.eclectic.vm.conf]: Could not evaluate: /usr/bin/env: ruby
: No such file or directory
==> default: Notice: /Stage[main]/Main/Apache::Vhost[ca.eclectic.vm]/Concat[25-ca.eclectic.vm.conf]/File[25-ca.eclectic.vm.conf]: Dependency Exec[concat_25-ca.eclectic.vm.conf] has failures: true
==> default: Warning: /Stage[main]/Main/Apache::Vhost[ca.eclectic.vm]/Concat[25-ca.eclectic.vm.conf]/File[25-ca.eclectic.vm.conf]: Skipping because of failed dependencies
==> default: Notice: /Stage[main]/Main/Apache::Vhost[ca.eclectic.vm]/File[25-ca.eclectic.vm.conf symlink]: Dependency Exec[concat_25-ca.eclectic.vm.conf] has failures: true
==> default: Warning: /Stage[main]/Main/Apache::Vhost[ca.eclectic.vm]/File[25-ca.eclectic.vm.conf symlink]: Skipping because of failed dependencies
==> default: Notice: /Stage[main]/Apache::Service/Service[httpd]: Dependency Exec[concat_/etc/apache2/ports.conf] has failures: true
==> default: Notice: /Stage[main]/Apache::Service/Service[httpd]: Dependency Exec[concat_25-ca.eclectic.vm.conf] has failures: true
==> default: Notice: /Stage[main]/Apache::Service/Service[httpd]: Dependency Exec[concat_25-ssl-ca.eclectic.vm.conf] has failures: true
==> default: Warning: /Stage[main]/Apache::Service/Service[httpd]: Skipping because of failed dependencies
==> default: Notice: Finished catalog run in 18.24 seconds
My puppet file
# execute 'apt-get update'
exec { 'apt-update':
command => 'apt-get update',
path => ["/usr/bin"],
}
# Install and configure apache2
class { 'apache': # use the "apache" module
default_vhost => false, # don't use the default vhost
default_mods => false, # don't load default mods
mpm_module => 'prefork', # use the "prefork" mpm_module
service_ensure => 'running',
}
include apache::mod::php
include apache::mod::rewrite
# Enable not define apache mods
# https://forge.puppetlabs.com/puppetlabs/apache#defined-type-apachemod
apache::mod { 'access_compat': }
# http eclectic version
apache::vhost { 'com.domain.vm':
port => '80',
docadmin => '/var/www/vhosts/domain.com/public_html',
override => ['all'],
serveraliases => [
'www.com.domain.vm',
],
}
# https eclectic version
apache::vhost { 'ssl-com.domain.vm':
servername => 'com.domain.vm',
port => '443',
docadmin => '/var/www/vhosts/domain.com/public_html',
override => ['all'],
ssl => true,
serveraliases => [
'www.com.domain.vm',
],
}
# Setting up custom web eclectic direcotry
file { [
"/var/www",
"/var/www/vhosts",
"/var/www/vhosts/domain.com"
]:
ensure => "directory",
owner => "www-data",
group => "vagrant",
mode => 775,
}
# Add virtual host domain in /etc/hosts
host { 'com.domain.vm':
ensure => present,
ip => '127.0.0.1',
host_aliases => 'www.com.domain.vm',
}
# install mysql-server package
package { 'mysql-server':
require => Exec['apt-update'], # require 'apt-update' before installing
ensure => installed,
}
# ensure mysql service is running
service { 'mysql':
ensure => running,
require => Package['mysql-server'],
}
$packages = [
'vim',
'nano',
'htop',
'tree',
'pv',
'wget',
'curl',
'git',
'php5',
'php5-cli',
'php5-gd',
'php5-curl',
'php5-mysql',
'php5-mcrypt',
]
package { $packages:
require => Exec['apt-update'], # require 'apt-update' before installing
ensure => installed,
}
exec { 'set-mysql-password':
command => 'mysqladmin -u admin password "admin"',
path => ["/usr/bin"],
logoutput => true,
unless => 'mysqladmin -uadmin -padmin version',
require => Service['mysql'],
}
package { 'php-pear':
require => Exec['apt-update'], # require 'apt-update' before installing
ensure => installed,
notify => [
Exec['pear-discover-channel-phing'],
Exec['pear-install-Console_Table'],
Exec['pear-install-Console_Color2'],
]
}
# http://puppet-php.readthedocs.org/en/latest/composer.html#installation
# Install to different destination
class { 'php::composer':
destination => '/usr/bin/composer',
notify => Exec['composer-install-drush']
}
exec { "pear-discover-channel-phing":
command => "pear channel-discover pear.phing.info",
path => ["/usr/bin"],
logoutput => true,
unless => 'pear channel-info pear.phing.info',
require => Package['php-pear'],
notify => Exec['pear-install-phing'],
}
exec { "pear-install-phing":
command => "pear install phing/phing",
unless => "which phing",
path => ["/usr/bin"],
logoutput => false,
require => Exec['pear-discover-channel-phing'],
}
exec { "pear-install-Console_Table":
command => "pear install Console_Table",
unless => "pear info Console_Table",
path => ["/usr/bin"],
logoutput => true,
}
exec { "pear-install-Console_Color2":
command => "pear install Console_Color2-0.1.2",
unless => "pear info Console_Color2-0.1.2",
path => ["/usr/bin"],
logoutput => true,
}
####################################
# Install drush
exec { "git-clone-drush":
command => "git clone https://github.com/drush-ops/drush.git /usr/local/src/drush",
path => ["/usr/bin"],
unless => 'test -d /usr/local/src/drush',
notify => Exec['git-checkout-drush']
}
exec { "git-checkout-drush":
command => "git checkout 6.6.0",
cwd => "/usr/local/src/drush",
path => ["/usr/bin"],
require => Exec['git-clone-drush'],
notify => File['/usr/bin/drush']
}
file { "/usr/bin/drush":
ensure => 'link',
target => '/usr/local/src/drush/drush',
require => Exec['git-checkout-drush'],
notify => Exec['composer-install-drush']
}
exec { "composer-install-drush":
environment => [ "COMPOSER_HOME=/usr/local/src/drush" ],
command => "composer install",
cwd => "/usr/local/src/drush",
path => ["/usr/bin"],
require => File['/usr/bin/drush']
}
# Copy ssh config vagrant file
file { '/home/vagrant/.ssh/config':
ensure => present,
mode => 600,
source => "puppet:///files/ssh/config/default-config",
}
Your problem is probably the same as mine, on which I spent the last couple of days. In my case the problem was with the windows git program.
When you install git under Windows it asks whether you would like to configure CRLF<->LF conversion - there are 3 options:
default, Checkout Windows-style, commit Unix-style line endings - that means convert LF to CRLF when checking out, and convert CRLF to LF when committing,
Checkout as-is, commit Unix-style line encodings - do not convert on check-out, and convert CRLF to LF when committing,
Checkout as-is, commit as-is - do not convert at all.
At first I chose (1), so git converted LF to CRLF when checking out one of the modules, icinga-vagrant\modules\concat, and specifically the script file icinga-vagrant\modules\concat\files\concatfragments.rb. The script then would be copied (without conversion) to the target Linux virtual machine, and wouldn't run there because /usr/bin/env didn't understand what "ruby<CR>" meant, and that's why the error message had a newline in it:
... Could not evaluate: /usr/bin/env: ruby
: No such file or directory
The resolution was to reinstall git with option nr (2), although it can probably be changed without reinstallation - I was a bit lazy. Now, git checks the script as is, with only LF at line ends, and so runs without problems on Linux.
Did you include module stdlib in puppet? concat is one of functions in it. Can you show me the Puppetfile if you manage forge module by librarian-puppet
Seems the dependence is the issue. Should fix your issue after install with it.