This cookbook installs the php dependency manager composer
if and only if php
is already installed.
- Ubuntu
To install composer with keys for the vagrant
user, your cookbook should have:
$ cat Berksfile
source 'https://supermarket.chef.io'
metadata
cookbook "composer", :github => 'apaxsoftware/composer'
$ cat attributes/default.rb
node.default['composer']['keys_user'] = 'vagrant'
$ cat recipes/system.rb
# Install php WITHOUT apache
apt_repository 'php7.2' do
uri 'ppa:ondrej/php'
end
apt_package 'php7.2-fpm'
# Install composer
include_recipe 'composer'
node['composer']['keys_user']
- The username of the user to install public keys for. Defaults toroot
default
- Installscomposer
and checks its validity.
When running kitchen converge
or kitchen verify
with vagrant, prefix them with the following:
$ COMPOSER_USER=vagrant kitchen verify
Author:: Chris Allen chris@apaxsoftware.com
Copyright:: 2018, APAX Software
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.