vagrant-conductor 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +11 -0
  3. data/.rspec +2 -0
  4. data/.travis.yml +4 -0
  5. data/CODE_OF_CONDUCT.md +13 -0
  6. data/Gemfile +12 -0
  7. data/LICENSE.txt +21 -0
  8. data/README.md +41 -0
  9. data/Rakefile +6 -0
  10. data/Vagrantfile +10 -0
  11. data/bin/console +14 -0
  12. data/bin/setup +7 -0
  13. data/config.yml +20 -0
  14. data/lib/vagrant/conductor/configure.rb +97 -0
  15. data/lib/vagrant/conductor/modules/_base/_base.rb +38 -0
  16. data/lib/vagrant/conductor/modules/_base/config.yml +3 -0
  17. data/lib/vagrant/conductor/modules/_base/scripts/beanstalkd.sh +8 -0
  18. data/lib/vagrant/conductor/modules/_base/scripts/composer.sh +8 -0
  19. data/lib/vagrant/conductor/modules/_base/scripts/grub.sh +10 -0
  20. data/lib/vagrant/conductor/modules/_base/scripts/memcache.sh +4 -0
  21. data/lib/vagrant/conductor/modules/_base/scripts/mysql.sh +21 -0
  22. data/lib/vagrant/conductor/modules/_base/scripts/nginx.sh +45 -0
  23. data/lib/vagrant/conductor/modules/_base/scripts/nodejs.sh +14 -0
  24. data/lib/vagrant/conductor/modules/_base/scripts/php.sh +52 -0
  25. data/lib/vagrant/conductor/modules/_base/scripts/postgresql.sh +21 -0
  26. data/lib/vagrant/conductor/modules/_base/scripts/python-pip.sh +7 -0
  27. data/lib/vagrant/conductor/modules/_base/scripts/redis.sh +14 -0
  28. data/lib/vagrant/conductor/modules/_base/scripts/sqlite.sh +4 -0
  29. data/lib/vagrant/conductor/modules/_base/scripts/system.sh +48 -0
  30. data/lib/vagrant/conductor/modules/_base/scripts/xdebug.sh +22 -0
  31. data/lib/vagrant/conductor/modules/aws/aws.rb +38 -0
  32. data/lib/vagrant/conductor/modules/aws/config.yml +10 -0
  33. data/lib/vagrant/conductor/modules/aws/scripts/awscli.sh +16 -0
  34. data/lib/vagrant/conductor/modules/aws/scripts/awsconfig.sh +11 -0
  35. data/lib/vagrant/conductor/modules/aws/scripts/elasticbeanstalk.sh +8 -0
  36. data/lib/vagrant/conductor/modules/aws/templates/config.erb +5 -0
  37. data/lib/vagrant/conductor/modules/aws/templates/credentials.erb +5 -0
  38. data/lib/vagrant/conductor/modules/docker/config.yml +2 -0
  39. data/lib/vagrant/conductor/modules/docker/docker.rb +13 -0
  40. data/lib/vagrant/conductor/modules/docker/scripts/install.sh +3 -0
  41. data/lib/vagrant/conductor/modules/folders/config.yml +2 -0
  42. data/lib/vagrant/conductor/modules/folders/folders.rb +14 -0
  43. data/lib/vagrant/conductor/modules/git-config/config.yml +5 -0
  44. data/lib/vagrant/conductor/modules/git-config/git-config.rb +42 -0
  45. data/lib/vagrant/conductor/modules/known-hosts/config.yml +6 -0
  46. data/lib/vagrant/conductor/modules/known-hosts/known-hosts.rb +14 -0
  47. data/lib/vagrant/conductor/modules/known-hosts/scripts/add-domain.sh +8 -0
  48. data/lib/vagrant/conductor/modules/module.rb +31 -0
  49. data/lib/vagrant/conductor/modules/modules.rb +58 -0
  50. data/lib/vagrant/conductor/modules/oh-my-zsh/config.yml +6 -0
  51. data/lib/vagrant/conductor/modules/oh-my-zsh/oh-my-zsh.rb +27 -0
  52. data/lib/vagrant/conductor/modules/oh-my-zsh/scripts/install-oh-my-zsh.sh +19 -0
  53. data/lib/vagrant/conductor/modules/sites/config.yml +20 -0
  54. data/lib/vagrant/conductor/modules/sites/scripts/clone.sh +35 -0
  55. data/lib/vagrant/conductor/modules/sites/scripts/dotenv.sh +12 -0
  56. data/lib/vagrant/conductor/modules/sites/scripts/server.sh +8 -0
  57. data/lib/vagrant/conductor/modules/sites/sites.rb +193 -0
  58. data/lib/vagrant/conductor/modules/sites/templates/dotenv-array.erb +7 -0
  59. data/lib/vagrant/conductor/modules/sites/templates/server.erb +53 -0
  60. data/lib/vagrant/conductor/modules/ssh/config.yml +2 -0
  61. data/lib/vagrant/conductor/modules/ssh/ssh.rb +29 -0
  62. data/lib/vagrant/conductor/plugin.rb +14 -0
  63. data/lib/vagrant/conductor/provisioner.rb +48 -0
  64. data/lib/vagrant/conductor/util/hash.rb +19 -0
  65. data/lib/vagrant/conductor/version.rb +5 -0
  66. data/lib/vagrant/conductor.rb +48 -0
  67. data/vagrant-conductor.gemspec +33 -0
  68. metadata +152 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 99c233ed92663d483db2732a88123040ee2898d8
4
+ data.tar.gz: 6792eedcb1d35f9ea56328faa9bb6fbf9a7a2f00
5
+ SHA512:
6
+ metadata.gz: b9748de7d43a9c5afe3ce397b29fa91a8673cd9fe8faf4d88d2974381c9ba7a3049c7e099a1e11efd4c2dd9c70aa202c151e47bc0d9bc79ca2a4f695dbdeddff
7
+ data.tar.gz: 40439775b48b886ea9935402c723adf50ececce840f27a6e966f139a146a50d009b607a59600c8f19feb09222939686277d00b16c4e69bef4cf91088b6ed67b6
data/.gitignore ADDED
@@ -0,0 +1,11 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ /.vagrant
11
+ /.idea
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
data/.travis.yml ADDED
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.0.0
4
+ before_install: gem install bundler -v 1.10.5
@@ -0,0 +1,13 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
4
+
5
+ We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
6
+
7
+ Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
8
+
9
+ Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
10
+
11
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
12
+
13
+ This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
data/Gemfile ADDED
@@ -0,0 +1,12 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in vagrant-conductor.gemspec
4
+ gemspec
5
+
6
+ group :development do
7
+ gem "vagrant", git: "https://github.com/mitchellh/vagrant.git"
8
+ end
9
+
10
+ group :plugins do
11
+ gem "vagrant-conductor", path: "."
12
+ end
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 Matthew Cuyar
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,41 @@
1
+ # Vagrant::Conductor
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/vagrant/conductor`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'vagrant-conductor'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install vagrant-conductor
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Development
28
+
29
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake rspec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
+
31
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
+
33
+ ## Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/vagrant-conductor. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
36
+
37
+
38
+ ## License
39
+
40
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
41
+
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
data/Vagrantfile ADDED
@@ -0,0 +1,10 @@
1
+
2
+ Vagrant.configure('2') do |config|
3
+
4
+ default = File.expand_path('config-default.yml', __dir__)
5
+ custom = File.expand_path('config.yml', __dir__)
6
+
7
+ conductor = VagrantConductor.new(config)
8
+ conductor.init(custom, default)
9
+
10
+ end
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "vagrant/conductor"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
data/bin/setup ADDED
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here
data/config.yml ADDED
@@ -0,0 +1,20 @@
1
+ ---
2
+ hostname: "conductor"
3
+ box: bento/ubuntu-14.04
4
+ ip: "192.168.10.10"
5
+ memory: 2048
6
+ cpus: 1
7
+
8
+ forward_ports:
9
+ http: 80:8000
10
+ mysql: 3306:33060
11
+ postgresql: 5432:54320
12
+
13
+ _base:
14
+ install: true
15
+
16
+ # ------------------------------------------------------
17
+ # AWS CLI
18
+ # ------------------------------------------------------
19
+ aws:
20
+ install: false
@@ -0,0 +1,97 @@
1
+ module VagrantPlugins
2
+ module Conductor
3
+
4
+ # This class will configure a vagrant environment.
5
+ class Configure
6
+
7
+ attr_accessor :config
8
+
9
+ def initialize(config)
10
+ @config = config
11
+ end
12
+
13
+ def configure(args)
14
+
15
+ # Configure The Box
16
+ set_box(
17
+ args.find?('box', 'bento/ubuntu-14.04'),
18
+ args.find?('box_version', nil)
19
+ )
20
+
21
+ # Set the environments hostname
22
+ set_hostname(args.find?('hostname', 'conductor'))
23
+
24
+ # Configure A Private Network IP
25
+ set_private_ip(args.find?('ip', '192.168.10.10'))
26
+
27
+ # Configure A Few VirtualBox Settings
28
+ set_provider_config(
29
+ args.find?('memory', '2048'),
30
+ args.find?('cpus', '1')
31
+ )
32
+
33
+ # Configure Port Forwarding
34
+ set_forwarded_ports(args.find?('forward_ports', []))
35
+
36
+ end
37
+
38
+ # Set the vagrant box and version
39
+ def set_box(box, version = nil)
40
+ @config.vm.box = box
41
+ unless version.nil?
42
+ @config.vm.box_version = version
43
+ end
44
+ end
45
+
46
+ # Set the vagrant hostname
47
+ def set_hostname(hostname)
48
+ @config.vm.hostname = hostname;
49
+ end
50
+
51
+ # Configure A Private Network IP
52
+ def set_private_ip(ip)
53
+ @config.vm.network :private_network, ip: ip
54
+ end
55
+
56
+ def set_provider_config(memory, cpus)
57
+ @config.vm.provider "virtualbox" do |vb|
58
+ vb.customize ["modifyvm", :id, "--memory", memory]
59
+ vb.customize ["modifyvm", :id, "--cpus", cpus]
60
+ vb.customize ["modifyvm", :id, "--natdnsproxy1", "on"]
61
+ vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
62
+ end
63
+ end
64
+
65
+ # Forward an array or hash of ports
66
+ def set_forwarded_ports(ports)
67
+ if ports.is_a?(Array)
68
+ set_forwarded_ports_from_array(ports)
69
+ elsif ports.is_a?(Hash)
70
+ set_forwarded_ports_from_hash(ports)
71
+ end
72
+ end
73
+
74
+ # set forwarded ports from an array
75
+ def set_forwarded_ports_from_array(ports)
76
+ ports.each { |val|
77
+ guest, host = val.split(':', 2)
78
+ forward_port(guest, host)
79
+ }
80
+ end
81
+
82
+ # Set forwarded ports from a hash
83
+ def set_forwarded_ports_from_hash(ports)
84
+ ports.each do |key, val|
85
+ guest, host = val.split(':', 2)
86
+ forward_port(guest, host)
87
+ end
88
+ end
89
+
90
+ # Forwad port from guest/host
91
+ def forward_port(guest, host)
92
+ @config.vm.network "forwarded_port", guest: guest, host: host
93
+ end
94
+
95
+ end
96
+ end
97
+ end
@@ -0,0 +1,38 @@
1
+ class BaseProvisioner
2
+
3
+ include VagrantPlugins::Conductor::Module
4
+
5
+ def provision
6
+
7
+ unless args.find?('install', false)
8
+ return
9
+ end
10
+
11
+ shell_provision(%{
12
+ # bash #{@scripts}/system.sh
13
+ # bash #{@scripts}/grub.sh
14
+ # bash #{@scripts}/python-pip.sh
15
+ # bash #{@scripts}/mysql.sh
16
+ # bash #{@scripts}/postgresql.sh
17
+ bash #{@scripts}/php.sh
18
+ # bash #{@scripts}/nginx.sh
19
+ # bash #{@scripts}/composer.sh
20
+ # bash #{@scripts}/redis.sh
21
+ # bash #{@scripts}/memcache.sh
22
+ # bash #{@scripts}/sqlite.sh
23
+ # bash #{@scripts}/nodejs.sh
24
+ # bash #{@scripts}/beanstalkd.sh
25
+ #bash #{@scripts}/xdebug.sh
26
+ }, nil, true)
27
+
28
+ # Minimize The Disk Image
29
+ shell_provision(%{
30
+ echo 'Minimizing disk image...'
31
+ dd if=/dev/zero of=/EMPTY bs=1M
32
+ rm -f /EMPTY
33
+ sync
34
+ }, nil, true)
35
+
36
+ end
37
+
38
+ end
@@ -0,0 +1,3 @@
1
+ classname: BaseProvisioner
2
+
3
+ install: false
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+
3
+ # Install Beanstalkd
4
+ apt-get install -y beanstalkd
5
+
6
+ # Configure Beanstalkd
7
+ sed -i "s/#START=yes/START=yes/" /etc/default/beanstalkd
8
+ /etc/init.d/beanstalkd start
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+
3
+ # Install Composer
4
+ curl -sS https://getcomposer.org/installer | php
5
+ mv composer.phar /usr/local/bin/composer
6
+
7
+ # Add Composer Global Bin To Path
8
+ printf "\nPATH=\"/home/vagrant/.composer/vendor/bin:\$PATH\"\n" | tee -a /home/vagrant/.profile
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env bash
2
+
3
+ # Update Grub Bootloader
4
+ echo "set grub-pc/install_devices /dev/sda" | debconf-communicate
5
+ apt-get -y remove grub-pc
6
+ apt-get -y install grub-pc
7
+ grub-install /dev/sda
8
+ update-grub
9
+
10
+ export DEBIAN_FRONTEND=noninteractive
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env bash
2
+
3
+ # Install
4
+ apt-get install -y memcached
@@ -0,0 +1,21 @@
1
+ #!/usr/bin/env bash
2
+
3
+ # Install MySQL
4
+ debconf-set-selections <<< "mysql-server mysql-server/root_password password secret"
5
+ debconf-set-selections <<< "mysql-server mysql-server/root_password_again password secret"
6
+ apt-get install -y mysql-server-5.6
7
+
8
+ # Configure MySQL Remote Access
9
+ sed -i '/^bind-address/s/bind-address.*=.*/bind-address = 0.0.0.0/' /etc/mysql/my.cnf
10
+ mysql --user="root" --password="secret" -e "GRANT ALL ON *.* TO root@'0.0.0.0' IDENTIFIED BY 'secret' WITH GRANT OPTION;"
11
+ service mysql restart
12
+
13
+ mysql --user="root" --password="secret" -e "CREATE USER 'homestead'@'0.0.0.0' IDENTIFIED BY 'secret';"
14
+ mysql --user="root" --password="secret" -e "GRANT ALL ON *.* TO 'homestead'@'0.0.0.0' IDENTIFIED BY 'secret' WITH GRANT OPTION;"
15
+ mysql --user="root" --password="secret" -e "GRANT ALL ON *.* TO 'homestead'@'%' IDENTIFIED BY 'secret' WITH GRANT OPTION;"
16
+ mysql --user="root" --password="secret" -e "FLUSH PRIVILEGES;"
17
+ mysql --user="root" --password="secret" -e "CREATE DATABASE homestead;"
18
+ service mysql restart
19
+
20
+ # Add Timezone Support To MySQL
21
+ mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql --user=root --password=secret mysql
@@ -0,0 +1,45 @@
1
+ #!/usr/bin/env bash
2
+
3
+ # Update Package List
4
+ apt-get update
5
+
6
+ apt-add-repository ppa:nginx/development -y
7
+
8
+ # Update Package Lists
9
+ apt-get update
10
+
11
+ # Install Nginx
12
+ apt-get install -y --force-yes nginx
13
+
14
+ rm /etc/nginx/sites-enabled/default
15
+ rm /etc/nginx/sites-available/default
16
+ service nginx restart
17
+
18
+ # Copy fastcgi_params to Nginx because they broke it on the PPA
19
+ cat > /etc/nginx/fastcgi_params << EOF
20
+ fastcgi_param QUERY_STRING \$query_string;
21
+ fastcgi_param REQUEST_METHOD \$request_method;
22
+ fastcgi_param CONTENT_TYPE \$content_type;
23
+ fastcgi_param CONTENT_LENGTH \$content_length;
24
+ fastcgi_param SCRIPT_FILENAME \$request_filename;
25
+ fastcgi_param SCRIPT_NAME \$fastcgi_script_name;
26
+ fastcgi_param REQUEST_URI \$request_uri;
27
+ fastcgi_param DOCUMENT_URI \$document_uri;
28
+ fastcgi_param DOCUMENT_ROOT \$document_root;
29
+ fastcgi_param SERVER_PROTOCOL \$server_protocol;
30
+ fastcgi_param GATEWAY_INTERFACE CGI/1.1;
31
+ fastcgi_param SERVER_SOFTWARE nginx/\$nginx_version;
32
+ fastcgi_param REMOTE_ADDR \$remote_addr;
33
+ fastcgi_param REMOTE_PORT \$remote_port;
34
+ fastcgi_param SERVER_ADDR \$server_addr;
35
+ fastcgi_param SERVER_PORT \$server_port;
36
+ fastcgi_param SERVER_NAME \$server_name;
37
+ fastcgi_param HTTPS \$https if_not_empty;
38
+ fastcgi_param REDIRECT_STATUS 200;
39
+ EOF
40
+
41
+ # Set The Nginx User
42
+ sed -i "s/user www-data;/user vagrant;/" /etc/nginx/nginx.conf
43
+ sed -i "s/# server_names_hash_bucket_size.*/server_names_hash_bucket_size 64;/" /etc/nginx/nginx.conf
44
+
45
+ service nginx restart
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env bash
2
+
3
+ # Update Package List
4
+ apt-get update
5
+
6
+ curl --silent --location https://deb.nodesource.com/setup_5.x | bash -
7
+
8
+ # Update Package Lists
9
+ apt-get update
10
+
11
+ # Install Node
12
+ apt-get install -y nodejs
13
+ /usr/bin/npm install -g gulp
14
+ /usr/bin/npm install -g bower
@@ -0,0 +1,52 @@
1
+ #!/usr/bin/env bash
2
+
3
+ # Update Package List
4
+ apt-get update
5
+
6
+ apt-add-repository ppa:ondrej/php-7.0 -y
7
+
8
+ # Update Package Lists
9
+ apt-get update
10
+
11
+ # Install PHP
12
+ apt-get install -y --force-yes \
13
+ php7.0-dev \
14
+ php7.0-cli \
15
+ php7.0-fpm \
16
+ php-pgsql \
17
+ php-sqlite3 \
18
+ php-gd \
19
+ php-apcu \
20
+ php-curl \
21
+ php-imap \
22
+ php-mysql \
23
+ php-memcached \
24
+ php7.0-readline
25
+
26
+ # Set Some PHP CLI Settings
27
+ sudo sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/7.0/cli/php.ini
28
+ sudo sed -i "s/display_errors = .*/display_errors = On/" /etc/php/7.0/cli/php.ini
29
+ sudo sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/7.0/cli/php.ini
30
+ sudo sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/7.0/cli/php.ini
31
+
32
+ # Setup Some PHP-FPM Options
33
+ sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/7.0/fpm/php.ini
34
+ sed -i "s/display_errors = .*/display_errors = On/" /etc/php/7.0/fpm/php.ini
35
+ sed -i "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/" /etc/php/7.0/fpm/php.ini
36
+ sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/7.0/fpm/php.ini
37
+ sed -i "s/upload_max_filesize = .*/upload_max_filesize = 100M/" /etc/php/7.0/fpm/php.ini
38
+ sed -i "s/post_max_size = .*/post_max_size = 100M/" /etc/php/7.0/fpm/php.ini
39
+ sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/7.0/fpm/php.ini
40
+
41
+ # Set PHP-FPM User
42
+ sed -i "s/user www-data;/user vagrant;/" /etc/nginx/nginx.conf
43
+ sed -i "s/# server_names_hash_bucket_size.*/server_names_hash_bucket_size 64;/" /etc/nginx/nginx.conf
44
+
45
+ sed -i "s/user = www-data/user = vagrant/" /etc/php/7.0/fpm/pool.d/www.conf
46
+ sed -i "s/group = www-data/group = vagrant/" /etc/php/7.0/fpm/pool.d/www.conf
47
+
48
+ sed -i "s/listen\.owner.*/listen.owner = vagrant/" /etc/php/7.0/fpm/pool.d/www.conf
49
+ sed -i "s/listen\.group.*/listen.group = vagrant/" /etc/php/7.0/fpm/pool.d/www.conf
50
+ sed -i "s/;listen\.mode.*/listen.mode = 0666/" /etc/php/7.0/fpm/pool.d/www.conf
51
+
52
+ service php7.0-fpm restart
@@ -0,0 +1,21 @@
1
+ #!/usr/bin/env bash
2
+
3
+ # Update Package List
4
+ apt-get update
5
+
6
+ wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
7
+ sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main" >> /etc/apt/sources.list.d/postgresql.list'
8
+
9
+ # Update Package Lists
10
+ apt-get update
11
+
12
+
13
+ # Install Postgres
14
+ apt-get install -y postgresql-9.4 postgresql-contrib-9.4
15
+
16
+ # Configure Postgres Remote Access
17
+ sed -i "s/#listen_addresses = 'localhost'/listen_addresses = '*'/g" /etc/postgresql/9.4/main/postgresql.conf
18
+ echo "host all all 10.0.2.2/32 md5" | tee -a /etc/postgresql/9.4/main/pg_hba.conf
19
+ sudo -u postgres psql -c "CREATE ROLE homestead LOGIN UNENCRYPTED PASSWORD 'secret' SUPERUSER INHERIT NOCREATEDB NOCREATEROLE NOREPLICATION;"
20
+ sudo -u postgres /usr/bin/createdb --echo --owner=homestead homestead
21
+ service postgresql restart
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env bash
2
+
3
+ apt-get remove -y python-pip
4
+ wget https://raw.github.com/pypa/pip/master/contrib/get-pip.py
5
+ python get-pip.py
6
+
7
+ #pip install requests[security]
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env bash
2
+
3
+ # Update Package List
4
+ apt-get update
5
+
6
+ # Add the ppa
7
+ apt-add-repository ppa:rwky/redis -y
8
+
9
+ # Update Package Lists
10
+ apt-get update
11
+
12
+ # Install Redis
13
+
14
+ apt-get install -y redis-server
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env bash
2
+
3
+ # Install SQLite
4
+ apt-get install -y sqlite3 libsqlite3-dev
@@ -0,0 +1,48 @@
1
+ #!/usr/bin/env bash
2
+
3
+ # Update Package List
4
+ apt-get update
5
+
6
+ # Upgrade System Packages
7
+ apt-get -y upgrade
8
+
9
+ # Force Locale
10
+ echo "LC_ALL=en_US.UTF-8" >> /etc/default/locale
11
+ locale-gen en_US.UTF-8
12
+
13
+ # Set Timezone
14
+ echo "America/New_York" | sudo tee /etc/timezone
15
+ sudo dpkg-reconfigure --frontend noninteractive tzdata
16
+
17
+ # install common packages
18
+ apt-get install -y \
19
+ software-properties-common \
20
+ curl build-essential \
21
+ dos2unix \
22
+ gcc \
23
+ git \
24
+ libmcrypt4 \
25
+ libpcre3-dev \
26
+ make \
27
+ python2.7-dev \
28
+ re2c \
29
+ supervisor \
30
+ unattended-upgrades \
31
+ whois \
32
+ vim \
33
+ libnotify-bin
34
+
35
+ # Install package cloud gpg.key
36
+ curl -s https://packagecloud.io/gpg.key | apt-key add -
37
+
38
+ apt-get update
39
+
40
+ # Add vagrant user to www-data
41
+ usermod -a -G www-data vagrant
42
+ id vagrant
43
+ groups vagrant
44
+
45
+ # Enable swap memory
46
+ /bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024
47
+ /sbin/mkswap /var/swap.1
48
+ /sbin/swapon /var/swap.1
@@ -0,0 +1,22 @@
1
+ #!/usr/bin/env bash
2
+
3
+ # Install
4
+ wget xdebug.org/files/xdebug-2.4.0rc3.tgz -P /tmp/xdebug
5
+ cd /tmp/xdebug
6
+ tar -xvzf xdebug-2.4.0rc3.tgz
7
+ cd xdebug-2.4.0RC3
8
+ phpize
9
+ bash ./configure
10
+ make
11
+ cp modules/xdebug.so /usr/lib/php/20151012
12
+
13
+ echo "zend_extension = /usr/lib/php/20151012/xdebug.so" >> '/etc/php/7.0/cli/php.ini'
14
+
15
+ Configure
16
+ config='/etc/php/7.0/fpm/conf.d/20-xdebug.ini'
17
+ touch $config
18
+
19
+ echo "xdebug.remote_enable = 1" >> $config
20
+ echo "xdebug.remote_connect_back = 1" >> $config
21
+ echo "xdebug.remote_port = 9000" >> $config
22
+ echo "xdebug.max_nesting_level = 512" >> $config
@@ -0,0 +1,38 @@
1
+ class AmazonWebServices
2
+
3
+ include VagrantPlugins::Conductor::Module
4
+
5
+ def create_profiles
6
+ profiles = args.find?('profiles', [])
7
+ create(profiles, "credentials")
8
+ create(profiles, "config")
9
+ end
10
+
11
+ def create(profiles, template_file)
12
+ result = generate_template(profiles, template_file)
13
+ # Add template to vagrant home directory
14
+ shell_provision(
15
+ "bash #{@scripts}/awsconfig.sh \"$1\" $2",
16
+ [result, template_file]
17
+ )
18
+ end
19
+
20
+ def install_aws_cli
21
+
22
+ end
23
+
24
+ def install_eb_cli
25
+ shell_provision(
26
+ "bash #{@scripts}/elasticbeanstalk.sh"
27
+ )
28
+ end
29
+
30
+ def provision
31
+
32
+ if args.find?('install', false)
33
+ shell_provision("bash #{@scripts}/awscli.sh", nil, false)
34
+ end
35
+
36
+ end
37
+
38
+ end