Setup nfs shares
Ubuntu
nfs
Try this cookbook with drupal-lamp https://github.com/newmediadenver/drupal-lamp
To get it working with drupal-lamp:
- Open Berksfile in your drupal-lamp directory and place the following line in there
cookbook "drupal-nfs", git: "https://github.com/arknoll/drupal-nfs", branch: "master"
-
Open chef/roles/drupal_lamp.rb in your drupal-lamp directory and add "recipe[drupal-nfs]", to the env_run_lists run list array
-
run either 'vagrant up' or 'vagrant provision'
This example will open up an nfs share:
- for the folder located at /srv/www/example/current
- it will be writeable
- when written to from the mount it will act as if you are user www-data and group www-data
"nfs_exports": {
"/srv/www/example/current": {
"clients": {
"*": {
"writeable": true,
"sync": false,
"options": [
"no_subtree_check",
"all_squash",
"async"
],
"anon_user_name": "www-data",
"anon_group_name": "www-data"
}
}
}
}
sudo mount -o resvport [server ip]:/srv/www/example/current test
"nfs_exports": {
"[share directory]": { # directory to share
"clients": { # who can access
"[ip address or *]": {
"writeable": true, # true or false
"sync": , # true or false
"options": [], # array of nfs exports options. See nfs cookbook for options
"user_map": "www-data", # this sets the anon user by name
"group_map": "www-data" # this sets the anon group by name
}
}
}
}
Adds a mountable nfs share
The cookbook provides the following Rake tasks for testing:
rake foodcritic # Lint Chef cookbooks
rake integration # Alias for kitchen:all
rake kitchen:all # Run all test instances
rake kitchen:default-centos-64 # Run default-centos-64 test instance
rake kitchen:default-ubuntu-1204 # Run default-ubuntu-1204 test instance
rake rubocop # Run RuboCop style and lint checks
rake spec # Run ChefSpec examples
rake test # Run all tests
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.
We welcome contributed improvements and bug fixes via the usual workflow:
- Fork this repository
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new pull request