From 26eed874f986d64a54e9dcf92767fdccccd6dc4c Mon Sep 17 00:00:00 2001 From: Jeff George Date: Wed, 5 Jul 2017 22:38:43 -0400 Subject: [PATCH 01/60] Bump version of the precip puppet module --- puppet/precip/Modulefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/puppet/precip/Modulefile b/puppet/precip/Modulefile index 52977c4..6523f96 100644 --- a/puppet/precip/Modulefile +++ b/puppet/precip/Modulefile @@ -1,5 +1,5 @@ name 'clwdev-precip' -version '0.0.1' +version '0.0.2' source 'https://github.com/clwdev/precip' author 'clwdev' license 'MIT' From 35072268710212d5235be74e1102fa9205951080 Mon Sep 17 00:00:00 2001 From: Jeff George Date: Wed, 5 Jul 2017 22:39:03 -0400 Subject: [PATCH 02/60] Switch the base box to 16.04 --- Vagrantfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index e04c875..0b36d11 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -44,8 +44,8 @@ internal_hosts = internal_hosts.flatten Vagrant.configure(2) do |config| # Vagrant Box Address # This is a happy base box from PuppetLabs - config.vm.box = "puppetlabs/ubuntu-14.04-64-puppet" - config.vm.box_version = "1.0.3" + config.vm.box = "puppetlabs/ubuntu-16.04-64-puppet" + config.vm.box_version = "1.0.0" # Basic network config. config.vm.network :private_network, ip: "10.0.0.11" From 4bace17cc03636e43040fb83c52e5f57fb0ec7b6 Mon Sep 17 00:00:00 2001 From: Jeff George Date: Wed, 5 Jul 2017 22:39:16 -0400 Subject: [PATCH 03/60] Preemptively disable deprecation warnings --- Vagrantfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Vagrantfile b/Vagrantfile index 0b36d11..bd8246d 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -148,7 +148,7 @@ Vagrant.configure(2) do |config| config.vm.provision "shell", path: "shell/librarian.sh" # Hand off to puppet - config.vm.provision :puppet, :options => [""] do |puppet| + config.vm.provision :puppet, :options => ["--disable_warnings deprecations"] do |puppet| puppet.environment_path = "puppet/environments" puppet.environment = "vm" puppet.hiera_config_path = "puppet/hiera.yaml" From 310d577df36d881f3c64abea32661fe4563badcf Mon Sep 17 00:00:00 2001 From: Jeff George Date: Wed, 5 Jul 2017 22:39:44 -0400 Subject: [PATCH 04/60] Ensure librarian.sh pulls the right ruby package --- shell/librarian.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shell/librarian.sh b/shell/librarian.sh index fd640f7..398441e 100755 --- a/shell/librarian.sh +++ b/shell/librarian.sh @@ -6,8 +6,8 @@ if ! (which git > /dev/null 2>&1); then apt-get -q -y install git > /dev/null 2>&1; fi -if [ -n "$(apt-cache search ruby1.9.1-dev)" ]; then - apt-get -q -y install ruby1.9.1-dev > /dev/null 2>&1; +if [ -n "$(apt-cache search ruby-dev)" ]; then + apt-get -q -y install ruby-dev > /dev/null 2>&1; fi if ! (which librarian-puppet > /dev/null 2>&1); then From 982063909a553ef79965d7843363d9f5419f8510 Mon Sep 17 00:00:00 2001 From: Jeff George Date: Wed, 5 Jul 2017 22:42:05 -0400 Subject: [PATCH 05/60] Drop support for wkhtmltox --- puppet/Puppetfile | 2 -- puppet/precip/manifests/init.pp | 7 ------- 2 files changed, 9 deletions(-) diff --git a/puppet/Puppetfile b/puppet/Puppetfile index 01bd64d..ff0a751 100644 --- a/puppet/Puppetfile +++ b/puppet/Puppetfile @@ -14,8 +14,6 @@ mod 'ftaeger-mailhog', "1.1.0" #mod 'willdurand-composer' mod 'mayflower-php' -mod 'jlondon-wkhtmltox' - mod 'saz-memcached' mod 'clwdev-precip', :path => '/vagrant/puppet/precip' \ No newline at end of file diff --git a/puppet/precip/manifests/init.pp b/puppet/precip/manifests/init.pp index 351f542..a77e325 100644 --- a/puppet/precip/manifests/init.pp +++ b/puppet/precip/manifests/init.pp @@ -59,13 +59,6 @@ target => "/usr/share/zoneinfo/US/Eastern", } - if str2bool("$first_boot") { - # Install statically-compiled versions of wkhtmltopdf / wkhtmltoimage - class { 'wkhtmltox': - ensure => present, - } - } - # Awful hack to fix the permissions on ssmtp's config file define check_mode($mode) { exec { "/bin/chmod $mode $name": From 9e3ae73955fbeea3b8ea99627cd986b94fd0a194 Mon Sep 17 00:00:00 2001 From: Jeff George Date: Wed, 5 Jul 2017 22:42:45 -0400 Subject: [PATCH 06/60] Update apt, apache, mysql, and stdlib Puppet Modules --- puppet/Puppetfile | 7 +++---- puppet/Puppetfile.lock | 34 +++++++++++++++------------------- 2 files changed, 18 insertions(+), 23 deletions(-) diff --git a/puppet/Puppetfile b/puppet/Puppetfile index ff0a751..f2fcf5e 100644 --- a/puppet/Puppetfile +++ b/puppet/Puppetfile @@ -5,14 +5,13 @@ forge "https://forgeapi.puppetlabs.com" mod 'puppetlabs-apache' mod 'puppetlabs-apt' -mod 'puppetlabs-mysql', "3.2.0" +mod 'puppetlabs-mysql' mod 'puppetlabs-vcsrepo' -mod 'puppetlabs-stdlib', "4.12.0" +mod 'puppetlabs-stdlib' mod 'ftaeger-mailhog', "1.1.0" -#mod 'thias-php', "1.2.0" -#mod 'willdurand-composer' mod 'mayflower-php' +#mod 'puppet-php' # may switch later... mod 'saz-memcached' diff --git a/puppet/Puppetfile.lock b/puppet/Puppetfile.lock index fd80267..e5043f6 100644 --- a/puppet/Puppetfile.lock +++ b/puppet/Puppetfile.lock @@ -2,35 +2,32 @@ FORGE remote: https://forgeapi.puppetlabs.com specs: darin-zypprepo (1.0.2) - example42-puppi (2.2.1) - example42-yum (2.1.27) + example42-puppi (2.2.3) + puppetlabs-stdlib (< 5.0.0, >= 3.2.0) + example42-yum (2.1.28) example42-puppi (>= 2.0.0) ftaeger-mailhog (1.1.0) puppetlabs-stdlib (< 5.0.0, >= 4.10.0) - jlondon-wkhtmltox (1.1.0) - maestrodev-wget (>= 1.5.0) - puppetlabs-stdlib (>= 0) - maestrodev-wget (1.7.3) mayflower-php (4.0.0-beta1) darin-zypprepo (~> 1.0) example42-yum (~> 2.0) puppetlabs-apt (< 3.0.0, >= 1.8.0) puppetlabs-inifile (~> 1.0) puppetlabs-stdlib (< 5.0.0, >= 4.2.0) - nanliu-staging (1.0.3) - puppetlabs-apache (1.10.0) + puppet-staging (2.2.0) + puppetlabs-apache (1.11.0) puppetlabs-concat (< 3.0.0, >= 1.1.1) - puppetlabs-stdlib (< 5.0.0, >= 2.4.0) - puppetlabs-apt (2.2.2) - puppetlabs-stdlib (< 5.0.0, >= 4.5.0) - puppetlabs-concat (2.1.0) - puppetlabs-stdlib (< 5.0.0, >= 3.2.0) + puppetlabs-stdlib (< 5.0.0, >= 4.2.0) + puppetlabs-apt (2.4.0) + puppetlabs-stdlib (< 5.0.0, >= 4.13.0) + puppetlabs-concat (2.2.1) + puppetlabs-stdlib (< 5.0.0, >= 4.2.0) puppetlabs-firewall (1.8.1) puppetlabs-inifile (1.6.0) - puppetlabs-mysql (3.2.0) - nanliu-staging (~> 1.0) + puppetlabs-mysql (3.11.0) + puppet-staging (< 3.0.0, >= 1.0.1) puppetlabs-stdlib (< 5.0.0, >= 3.2.0) - puppetlabs-stdlib (4.12.0) + puppetlabs-stdlib (4.16.0) puppetlabs-vcsrepo (1.4.0) saz-memcached (2.8.1) puppetlabs-firewall (>= 0.1.0) @@ -44,12 +41,11 @@ PATH DEPENDENCIES clwdev-precip (>= 0) ftaeger-mailhog (= 1.1.0) - jlondon-wkhtmltox (>= 0) mayflower-php (>= 0) puppetlabs-apache (>= 0) puppetlabs-apt (>= 0) - puppetlabs-mysql (= 3.2.0) - puppetlabs-stdlib (= 4.12.0) + puppetlabs-mysql (>= 0) + puppetlabs-stdlib (>= 0) puppetlabs-vcsrepo (>= 0) saz-memcached (>= 0) From fd890c2ff0def43c4594273d70b2b1d24c238e55 Mon Sep 17 00:00:00 2001 From: Jeff George Date: Wed, 5 Jul 2017 22:43:04 -0400 Subject: [PATCH 07/60] Switch apt mirror and signing key for MariaDB --- puppet/precip/manifests/database.pp | 2 +- puppet/precip/manifests/keys.pp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/puppet/precip/manifests/database.pp b/puppet/precip/manifests/database.pp index f9104a6..ba2d963 100644 --- a/puppet/precip/manifests/database.pp +++ b/puppet/precip/manifests/database.pp @@ -2,7 +2,7 @@ # Define the MariaDB apt repo apt::source { 'MariaDB': - location => 'http://mirror.jmu.edu/pub/mariadb/repo/10.1/ubuntu', + location => 'http://nyc2.mirrors.digitalocean.com/mariadb/repo/10.1/ubuntu', repos => 'main', require => [ Apt::Key['mariadb'] diff --git a/puppet/precip/manifests/keys.pp b/puppet/precip/manifests/keys.pp index 7ca4ce7..a7f966f 100644 --- a/puppet/precip/manifests/keys.pp +++ b/puppet/precip/manifests/keys.pp @@ -13,7 +13,7 @@ # MariaDB's PPA key apt::key { 'mariadb': - id => '199369E5404BD5FC7D2FE43BCBCB082A1BB943DB', + id => '177F4010FE56CA3336300305F1656F24C74CD1D8', server => 'keyserver.ubuntu.com', } } \ No newline at end of file From a6a7419778777024a43f11e674a7983a604b8a3c Mon Sep 17 00:00:00 2001 From: Jeff George Date: Fri, 7 Jul 2017 16:16:57 -0400 Subject: [PATCH 08/60] Ignore librarian-puppet config files --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 3b7a127..95ea686 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,8 @@ sites/* bin/* ssl/* puppet/modules/* +puppet/.librarian +puppet/.tmp *.aliases.drushrc.php precip.box *.vdi From a9a63ddf3a5ae2d90133098b40cab18b1f2adabc Mon Sep 17 00:00:00 2001 From: Jeff George Date: Fri, 7 Jul 2017 16:17:38 -0400 Subject: [PATCH 09/60] Swap out mayflower-php for voxpupuli-php --- puppet/Puppetfile | 6 +++--- puppet/Puppetfile.lock | 32 ++++++++++++++++++-------------- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/puppet/Puppetfile b/puppet/Puppetfile index f2fcf5e..88f2266 100644 --- a/puppet/Puppetfile +++ b/puppet/Puppetfile @@ -4,14 +4,14 @@ forge "https://forgeapi.puppetlabs.com" mod 'puppetlabs-apache' -mod 'puppetlabs-apt' +mod 'puppetlabs-apt', "4.1.0" mod 'puppetlabs-mysql' mod 'puppetlabs-vcsrepo' mod 'puppetlabs-stdlib' mod 'ftaeger-mailhog', "1.1.0" -mod 'mayflower-php' -#mod 'puppet-php' # may switch later... +mod 'puppet-php', + :git => "https://github.com/voxpupuli/puppet-php.git" mod 'saz-memcached' diff --git a/puppet/Puppetfile.lock b/puppet/Puppetfile.lock index e5043f6..029c41a 100644 --- a/puppet/Puppetfile.lock +++ b/puppet/Puppetfile.lock @@ -2,24 +2,16 @@ FORGE remote: https://forgeapi.puppetlabs.com specs: darin-zypprepo (1.0.2) - example42-puppi (2.2.3) - puppetlabs-stdlib (< 5.0.0, >= 3.2.0) - example42-yum (2.1.28) - example42-puppi (>= 2.0.0) ftaeger-mailhog (1.1.0) puppetlabs-stdlib (< 5.0.0, >= 4.10.0) - mayflower-php (4.0.0-beta1) - darin-zypprepo (~> 1.0) - example42-yum (~> 2.0) - puppetlabs-apt (< 3.0.0, >= 1.8.0) - puppetlabs-inifile (~> 1.0) - puppetlabs-stdlib (< 5.0.0, >= 4.2.0) + puppet-archive (1.3.0) + puppetlabs-stdlib (< 5.0.0, >= 4.6.0) puppet-staging (2.2.0) puppetlabs-apache (1.11.0) puppetlabs-concat (< 3.0.0, >= 1.1.1) puppetlabs-stdlib (< 5.0.0, >= 4.2.0) - puppetlabs-apt (2.4.0) - puppetlabs-stdlib (< 5.0.0, >= 4.13.0) + puppetlabs-apt (4.1.0) + puppetlabs-stdlib (< 5.0.0, >= 4.16.0) puppetlabs-concat (2.2.1) puppetlabs-stdlib (< 5.0.0, >= 4.2.0) puppetlabs-firewall (1.8.1) @@ -33,6 +25,18 @@ FORGE puppetlabs-firewall (>= 0.1.0) puppetlabs-stdlib (>= 3.2.0) +GIT + remote: https://github.com/voxpupuli/puppet-php.git + ref: master + sha: dc9e9cc53bc4adc0dbfc1812a200618d5ad8e265 + specs: + puppet-php (5.0.0-rc0) + darin-zypprepo (< 2.0.0, >= 1.0.2) + puppet-archive (< 2.0.0, >= 1.0.0) + puppetlabs-apt (< 5.0.0, >= 4.1.0) + puppetlabs-inifile (< 2.0.0, >= 1.4.1) + puppetlabs-stdlib (< 5.0.0, >= 4.13.1) + PATH remote: /vagrant/puppet/precip specs: @@ -41,9 +45,9 @@ PATH DEPENDENCIES clwdev-precip (>= 0) ftaeger-mailhog (= 1.1.0) - mayflower-php (>= 0) + puppet-php (>= 0) puppetlabs-apache (>= 0) - puppetlabs-apt (>= 0) + puppetlabs-apt (= 4.1.0) puppetlabs-mysql (>= 0) puppetlabs-stdlib (>= 0) puppetlabs-vcsrepo (>= 0) From f3378209e4f6475018757992861bdc79411009c4 Mon Sep 17 00:00:00 2001 From: Jeff George Date: Fri, 7 Jul 2017 16:50:49 -0400 Subject: [PATCH 10/60] Switch Mailhog from ftaeger's mainline to my fork with a patch to stop warnings --- puppet/Puppetfile | 4 +++- puppet/Puppetfile.lock | 12 +++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/puppet/Puppetfile b/puppet/Puppetfile index 88f2266..1dbb6e6 100644 --- a/puppet/Puppetfile +++ b/puppet/Puppetfile @@ -8,7 +8,9 @@ mod 'puppetlabs-apt', "4.1.0" mod 'puppetlabs-mysql' mod 'puppetlabs-vcsrepo' mod 'puppetlabs-stdlib' -mod 'ftaeger-mailhog', "1.1.0" +mod 'ftaeger-mailhog', + :git => "https://github.com/jeffgeorge/ftaeger-mailhog.git", + :ref => "remove_wget_cache_dir" mod 'puppet-php', :git => "https://github.com/voxpupuli/puppet-php.git" diff --git a/puppet/Puppetfile.lock b/puppet/Puppetfile.lock index 029c41a..a535e23 100644 --- a/puppet/Puppetfile.lock +++ b/puppet/Puppetfile.lock @@ -2,8 +2,6 @@ FORGE remote: https://forgeapi.puppetlabs.com specs: darin-zypprepo (1.0.2) - ftaeger-mailhog (1.1.0) - puppetlabs-stdlib (< 5.0.0, >= 4.10.0) puppet-archive (1.3.0) puppetlabs-stdlib (< 5.0.0, >= 4.6.0) puppet-staging (2.2.0) @@ -25,6 +23,14 @@ FORGE puppetlabs-firewall (>= 0.1.0) puppetlabs-stdlib (>= 3.2.0) +GIT + remote: https://github.com/jeffgeorge/ftaeger-mailhog.git + ref: remove_wget_cache_dir + sha: 19ae4d8ef23606b497eba004bfbb37a928dd0bd7 + specs: + ftaeger-mailhog (1.1.0) + puppetlabs-stdlib (< 5.0.0, >= 4.10.0) + GIT remote: https://github.com/voxpupuli/puppet-php.git ref: master @@ -44,7 +50,7 @@ PATH DEPENDENCIES clwdev-precip (>= 0) - ftaeger-mailhog (= 1.1.0) + ftaeger-mailhog (>= 0) puppet-php (>= 0) puppetlabs-apache (>= 0) puppetlabs-apt (= 4.1.0) From aef9067efaab5f89204375cc6000ced98a607f81 Mon Sep 17 00:00:00 2001 From: Jeff George Date: Mon, 10 Jul 2017 12:04:03 -0400 Subject: [PATCH 11/60] Resolving a whole mess of vagrant-lint warnings / errors --- puppet/precip/manifests/database.pp | 40 ++++----- puppet/precip/manifests/httpd.pp | 126 +++++++++++++-------------- puppet/precip/manifests/init.pp | 76 ++++++++-------- puppet/precip/manifests/keys.pp | 2 +- puppet/precip/manifests/php.pp | 73 ++++++++-------- puppet/precip/manifests/pimpmylog.pp | 20 ++--- 6 files changed, 171 insertions(+), 166 deletions(-) diff --git a/puppet/precip/manifests/database.pp b/puppet/precip/manifests/database.pp index ba2d963..47252f2 100644 --- a/puppet/precip/manifests/database.pp +++ b/puppet/precip/manifests/database.pp @@ -1,5 +1,5 @@ class precip::database { - + # Define the MariaDB apt repo apt::source { 'MariaDB': location => 'http://nyc2.mirrors.digitalocean.com/mariadb/repo/10.1/ubuntu', @@ -10,52 +10,52 @@ } class { 'mysql::client': - package_name => 'mariadb-client', + package_name => 'mariadb-client', package_ensure => 'latest', - require => [ + require => [ Apt::Source['MariaDB'] ] } - + class { 'mysql::server': - package_name => 'mariadb-server', - package_ensure => 'latest', - override_options => { - 'mysqld' => { + package_name => 'mariadb-server', + package_ensure => 'latest', + override_options => { + 'mysqld' => { 'bind-address' => '0.0.0.0', - 'log_error' => '/vagrant/log/mysql_error.log' + 'log_error' => '/vagrant/log/mysql_error.log' }, 'mysqld_safe' => { 'log_error' => '/vagrant/log/mysql_error.log' } }, - require => [ + require => [ Apt::Source['MariaDB'] ] } - mysql_user { 'precip@%': - ensure => 'present', + mysql_user { 'precip@%': + ensure => 'present', password_hash => mysql_password('precip'), - subscribe => Service['mysqld'] + subscribe => Service['mysqld'] } mysql_grant { 'precip@%/*.*': ensure => 'present', options => ['GRANT'], privileges => ['ALL'], - table => "*.*", + table => '*.*', user => 'precip@%', require => Mysql_user['precip@%'], } - + # MySQL isn't *really* available to all hosts until you restart it. # So we need to restart it on *first boot only*. - if str2bool("$first_boot") { - exec { "restart-mysqld-after-grant": - path => ["/bin", "/sbin", "/usr/bin", "/usr/sbin/"], - command => "service mysql restart", - require => Mysql_grant["precip@%/*.*"], + if str2bool($first_boot) { + exec { 'restart-mysqld-after-grant': + path => ['/bin', '/sbin', '/usr/bin', '/usr/sbin/'], + command => 'service mysql restart', + require => Mysql_grant['precip@%/*.*'], } } } \ No newline at end of file diff --git a/puppet/precip/manifests/httpd.pp b/puppet/precip/manifests/httpd.pp index 0ec71e6..2ca7ef3 100644 --- a/puppet/precip/manifests/httpd.pp +++ b/puppet/precip/manifests/httpd.pp @@ -20,127 +20,127 @@ } # We'll also need this if there are any commands defined - file { "/vagrant/bin": - ensure => "directory" + file { '/vagrant/bin': + ensure => 'directory' } # a testing vhost - apache::vhost { "precip.vm": - docroot => "/vagrant/util", + apache::vhost { 'precip.vm': + docroot => '/vagrant/util', manage_docroot => false, - port => '80', - directories => [{ - path => "/vagrant/util", + port => '80', + directories => [{ + path => '/vagrant/util', allow_override => ['All',], }], - access_log => false, + access_log => false, } $parsed_siteinfo = parsejson($drupal_siteinfo) create_resources(drupal_vhosts, $parsed_siteinfo) - + # Create Drush aliases - file { "/vagrant/vm.aliases.drushrc.php": - content => template("precip/drush_vm_aliases.erb"), + file { '/vagrant/vm.aliases.drushrc.php': + content => template('precip/drush_vm_aliases.erb'), replace => true, - mode => '0644', + mode => '0644', } - - file { "/vagrant/vmi.aliases.drushrc.php": - content => template("precip/drush_vmi_aliases.erb"), + + file { '/vagrant/vmi.aliases.drushrc.php': + content => template('precip/drush_vmi_aliases.erb'), replace => true, - mode => '0644', + mode => '0644', } } -define drupal_vhosts($host, $aliases = [], $path, $drupal = "7", $multisite_dir = "default", $setenv = [], $git_url = "", $git_dir = "", $commands = {}, $ssl_cert = "/vagrant/ssl/precip_vm_host.pem", $ssl_ca = "/vagrant/ssl/precip_ca_bundle.crt.pem", $ssl_key = "/vagrant/ssl/precip_vm_host-key.pem") { - apache::vhost { "${host}": - docroot => "/srv/www/${path}", +define drupal_vhosts($host, $aliases = [], $path, $drupal = '7', $multisite_dir = 'default', $setenv = [], $git_url = '', $git_dir = '', $commands = {}, $ssl_cert = '/vagrant/ssl/precip_vm_host.pem', $ssl_ca = '/vagrant/ssl/precip_ca_bundle.crt.pem', $ssl_key = '/vagrant/ssl/precip_vm_host-key.pem') { + apache::vhost { $host: + docroot => "/srv/www/${path}", manage_docroot => false, - servername => "${host}", - serveraliases => $aliases, - port => '80', - directories => [{ - path => "/srv/www/${path}", + servername => $host, + serveraliases => $aliases, + port => '80', + directories => [{ + path => "/srv/www/${path}", allow_override => ['All',], }], - setenv => concat($setenv, + setenv => concat($setenv, [ "AH_SITE_GROUP ${name}", - "AH_SITE_ENVIRONMENT vm" + 'AH_SITE_ENVIRONMENT vm' ] ), - access_log => false, + access_log => false, } apache::vhost { "${host}-ssl": - docroot => "/srv/www/${path}", + docroot => "/srv/www/${path}", manage_docroot => false, - servername => "${host}", - serveraliases => $aliases, - port => '443', - directories => [{ - path => "/srv/www/${path}", + servername => $host, + serveraliases => $aliases, + port => '443', + directories => [{ + path => "/srv/www/${path}", allow_override => ['All',], }], - setenv => concat($setenv, + setenv => concat($setenv, [ "AH_SITE_GROUP ${name}", - "AH_SITE_ENVIRONMENT vm" + 'AH_SITE_ENVIRONMENT vm' ] ), - access_log => false, + access_log => false, error_log_file => "${host}_error.log", - ssl => true, - ssl_cert => "${ssl_cert}", - ssl_ca => "${ssl_ca}", - ssl_key => "${ssl_key}" + ssl => true, + ssl_cert => $ssl_cert, + ssl_ca => $ssl_ca, + ssl_key => $ssl_key } - + mysql::db { $name: - user => "${name}", - password => "${name}", + user => $name, + password => $name, host => 'localhost', grant => ['all'], } - + mysql_user { "${name}@%": ensure => 'present', - password_hash => mysql_password("${name}"), - subscribe => Service['mysqld'] + password_hash => mysql_password($name), + subscribe => Service['mysqld'] } - + mysql_grant { "${name}@%/${name}.*": ensure => 'present', options => ['GRANT'], privileges => ['ALL'], table => "${name}.*", user => "${name}@%", - require => [ Mysql_database["$name"], Mysql_user["$name@%"] ], + require => [ Mysql_database[$name], Mysql_user["${name}@%"] ], } - - if $drupal != "false" { + + if $drupal != 'false' { file {"/srv/www/${path}/sites/${multisite_dir}": ensure =>'directory', - mode => '0775', + mode => '0775', } - + # "local-settings.inc", a way of setting extra stuff for local development file {"/srv/www/${path}/sites/${multisite_dir}/local-settings.inc": - content => template("precip/drupal_${drupal}_local_settings_inc.erb"), - replace => false, - mode => '0775', + content => template("precip/drupal_${drupal}_local_settings_inc.erb"), + replace => false, + mode => '0775', subscribe => File["/srv/www/${path}/sites/${multisite_dir}"], } - + # An Acquia-style settings.php, if you need one. file { "/srv/www/${path}/sites/${multisite_dir}/settings.php": - content => template("precip/drupal_${drupal}_settings_php.erb"), - replace => false, - mode => '0775', + content => template("precip/drupal_${drupal}_settings_php.erb"), + replace => false, + mode => '0775', subscribe => File["/srv/www/${path}/sites/${multisite_dir}"], } } - + # Let's make some shell commands! if empty($commands) != true { create_resources(command_builder, $commands) @@ -149,9 +149,9 @@ define command_builder($path, $cmd){ file { "/vagrant/bin/${name}": - content => template("precip/shell_command.erb"), + content => template('precip/shell_command.erb'), replace => true, - mode => '0755', - require => File["/vagrant/bin"], + mode => '0755', + require => File['/vagrant/bin'], } } diff --git a/puppet/precip/manifests/init.pp b/puppet/precip/manifests/init.pp index a77e325..5659705 100644 --- a/puppet/precip/manifests/init.pp +++ b/puppet/precip/manifests/init.pp @@ -1,38 +1,38 @@ class precip { class { 'apt': } - + # Grab some helpful base packages package {[ - "ntp", - "htop", - "curl", - "wget", - "bzip2", - "git", - "openssl", - "imagemagick", - "vim", - "g++", - "software-properties-common", + 'ntp', + 'htop', + 'curl', + 'wget', + 'bzip2', + 'git', + 'openssl', + 'imagemagick', + 'vim', + 'g++', + 'software-properties-common', ]: ensure => present, } # Install a variety of Language Packs package {[ - "language-pack-de", - "language-pack-en", - "language-pack-es", - "language-pack-fr", - "language-pack-it", - # "language-pack-ja", - "language-pack-nl", - "language-pack-nn", - "language-pack-pt", - "language-pack-ru", - "language-pack-sv", - "language-pack-zh-hans", - "language-pack-zh-hant", + 'language-pack-de', + 'language-pack-en', + 'language-pack-es', + 'language-pack-fr', + 'language-pack-it', + # 'language-pack-ja', + 'language-pack-nl', + 'language-pack-nn', + 'language-pack-pt', + 'language-pack-ru', + 'language-pack-sv', + 'language-pack-zh-hans', + 'language-pack-zh-hant', ]: ensure => present, } @@ -50,13 +50,13 @@ # } # Make our log directory - file {"/vagrant/log": ensure => "directory", } + file {'/vagrant/log': ensure => 'directory', } # Fix the timezone with a symlink file { '/etc/localtime': - ensure => "link", - force => "true", - target => "/usr/share/zoneinfo/US/Eastern", + ensure => 'link', + force => true, + target => '/usr/share/zoneinfo/US/Eastern', } # Awful hack to fix the permissions on ssmtp's config file @@ -68,7 +68,7 @@ # Add all our hosts to /etc/hosts host { 'local.vm': - ip => '127.0.0.1', + ip => '127.0.0.1', host_aliases => parsejson($drupal_hosts), } @@ -89,18 +89,18 @@ include 'precip::database' include 'precip::pimpmylog' } - + # More elegant workaround for vbguest's issue #95 # See: https://github.com/dotless-de/vagrant-vbguest/issues/95#issuecomment-163777475 file { '/sbin/vboxadd': - ensure => "link", - force => "true", - target => "/sbin/rcvboxadd", + ensure => 'link', + force => true, + target => '/sbin/rcvboxadd', } - - file { "/etc/init/restart_services_once_mounted.conf": - content => template("precip/restart_services_once_mounted.conf.erb"), + + file { '/etc/init/restart_services_once_mounted.conf': ensure => 'file', + content => template('precip/restart_services_once_mounted.conf.erb'), mode => '0644', } -} +} \ No newline at end of file diff --git a/puppet/precip/manifests/keys.pp b/puppet/precip/manifests/keys.pp index a7f966f..eb2f136 100644 --- a/puppet/precip/manifests/keys.pp +++ b/puppet/precip/manifests/keys.pp @@ -10,7 +10,7 @@ id => '14AA40EC0831756756D7F66C4F4EA0AAE5267A6C', server => 'keyserver.ubuntu.com', } - + # MariaDB's PPA key apt::key { 'mariadb': id => '177F4010FE56CA3336300305F1656F24C74CD1D8', diff --git a/puppet/precip/manifests/php.pp b/puppet/precip/manifests/php.pp index 425c2a0..ee1c3f9 100644 --- a/puppet/precip/manifests/php.pp +++ b/puppet/precip/manifests/php.pp @@ -1,7 +1,11 @@ class precip::php { - class { '::php': + + class { '::php::globals': + php_version => '7.0', + config_root => '/etc/php/7.0', + }->class { '::php': manage_repos => true, - fpm => false, + fpm => true, dev => true, composer => true, pear => false, @@ -9,30 +13,31 @@ extensions => { curl => { }, gd => { }, - imagick => { }, + #imagick => { }, intl => { }, mbstring => { }, mcrypt => { }, - memcached => { }, + #memcached => { }, mysql => { }, - sqlite => { }, + sqlite => { }, + zip => { }, opcache => { settings => { - 'opcache/opcache.enable_cli' => '1', - 'opcache/opcache.revalidate_freq' => '1', - 'opcache/opcache.memory_consumption' => '512', - 'opcache/opcache.max_accelerated_files' => '10000', + 'opcache/opcache.enable_cli' => '1', + 'opcache/opcache.revalidate_freq' => '1', + 'opcache/opcache.memory_consumption' => '512', + 'opcache/opcache.max_accelerated_files' => '10000', 'opcache/opcache.interned_strings_buffer' => '16', - 'opcache/opcache.fast_shutdown' => '1', + 'opcache/opcache.fast_shutdown' => '1', }, }, xdebug => { settings => { - 'xdebug/xdebug.remote_autostart' => '1', - 'xdebug/xdebug.remote_enable' => '1', + 'xdebug/xdebug.remote_autostart' => '1', + 'xdebug/xdebug.remote_enable' => '1', 'xdebug/xdebug.remote_connect_back' => '1', - 'xdebug/xdebug.idekey' => 'vagrant', - 'xdebug/xdebug.max_nesting_level' => '10000', + 'xdebug/xdebug.idekey' => 'vagrant', + 'xdebug/xdebug.max_nesting_level' => '10000', }, }, }, @@ -50,7 +55,7 @@ 'PHP/sendmail_path' => '/usr/bin/mailhog sendmail noreply@precip.vm', 'Date/date.timezone' => 'America/New_York', }, - require => Package["software-properties-common"], + require => Package['software-properties-common'], } # Add Composer's vendor directory to the vagrant user's $PATH @@ -59,31 +64,31 @@ content => 'PATH DEFAULT=${PATH}:/home/vagrant/.composer/vendor/bin', require => Class['php'], } - + # These bits install Drush & Friends via composer - file { "/home/vagrant/.composer/": - ensure => 'directory', - mode => '0755', - owner => "vagrant", - group => "vagrant", + file { '/home/vagrant/.composer/': + ensure => 'directory', + mode => '0755', + owner => 'vagrant', + group => 'vagrant', require => Class['php'], } - - file { "/home/vagrant/.composer/composer.json": - content => template("precip/composer.json"), + + file { '/home/vagrant/.composer/composer.json': ensure => 'file', + content => template('precip/composer.json'), mode => '0644', - owner => "vagrant", - group => "vagrant", + owner => 'vagrant', + group => 'vagrant', require => [Class['php'], File['/home/vagrant/.composer/']], } - - exec { "install-composer-libraries": - command => "composer install --no-interaction --prefer-dist --no-dev --optimize-autoloader", - environment => [ "HOME=/home/vagrant", "COMPOSER_HOME=/home/vagrant/.composer" ], - cwd => "/home/vagrant/.composer", - path => "/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin", - user => "vagrant", - require => [Class['php'], File["/home/vagrant/.composer/composer.json"]], + + exec { 'install-composer-libraries': + command => 'composer install --no-interaction --prefer-dist --no-dev --optimize-autoloader', + environment => [ 'HOME=/home/vagrant', 'COMPOSER_HOME=/home/vagrant/.composer' ], + cwd => '/home/vagrant/.composer', + path => '/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin', + user => 'vagrant', + require => [Class['php'], File['/home/vagrant/.composer/composer.json']], } } diff --git a/puppet/precip/manifests/pimpmylog.pp b/puppet/precip/manifests/pimpmylog.pp index 0e41177..73fb3c8 100644 --- a/puppet/precip/manifests/pimpmylog.pp +++ b/puppet/precip/manifests/pimpmylog.pp @@ -1,16 +1,16 @@ -class precip::pimpmylog { - vcsrepo { "/vagrant/util/pml": - ensure => latest, - provider => git, - require => Package["git"], - source => "https://github.com/potsky/PimpMyLog.git", - revision => 'master' +class precip::pimpmylog { + vcsrepo { '/vagrant/util/pml': + ensure => latest, + provider => git, + require => Package['git'], + source => 'https://github.com/potsky/PimpMyLog.git', + revision => 'master' } $parsed_siteinfo = parsejson($drupal_siteinfo) - file { "/vagrant/util/pml/config.user.php": - content => template('precip/pml_config_user_php.erb'), - require => Vcsrepo['/vagrant/util/pml'] + file { '/vagrant/util/pml/config.user.php': + content => template('precip/pml_config_user_php.erb'), + require => Vcsrepo['/vagrant/util/pml'] } } \ No newline at end of file From b776b12ddbd7a7238f065e4d391bb2c5436ce884 Mon Sep 17 00:00:00 2001 From: Jeff George Date: Mon, 10 Jul 2017 12:04:36 -0400 Subject: [PATCH 12/60] Adding Puppetlabs' Repo Signing Key, which apparently isn't present in their own box --- puppet/precip/manifests/keys.pp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/puppet/precip/manifests/keys.pp b/puppet/precip/manifests/keys.pp index eb2f136..4db887c 100644 --- a/puppet/precip/manifests/keys.pp +++ b/puppet/precip/manifests/keys.pp @@ -16,4 +16,10 @@ id => '177F4010FE56CA3336300305F1656F24C74CD1D8', server => 'keyserver.ubuntu.com', } + + # Puppetlabs' Repo Signing Key + apt::key { 'puppetlabs': + id => '6F6B15509CF8E59E6E469F327F438280EF8D349F', + server => 'keyserver.ubuntu.com', + } } \ No newline at end of file From beb31a8f48f4b6a72c181b72c9d42deb72afbcdf Mon Sep 17 00:00:00 2001 From: Jeff George Date: Mon, 10 Jul 2017 12:05:09 -0400 Subject: [PATCH 13/60] Comment out mod_php stuff from httpd.php --- puppet/precip/manifests/httpd.pp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/puppet/precip/manifests/httpd.pp b/puppet/precip/manifests/httpd.pp index 2ca7ef3..1f2e496 100644 --- a/puppet/precip/manifests/httpd.pp +++ b/puppet/precip/manifests/httpd.pp @@ -1,23 +1,23 @@ class precip::httpd { # Need to specifically ask for Prefork, otherwise Ubuntu will go grab Worker # (Worker is weird) - class { 'apache': mpm_module => "prefork" } - class { 'apache::mod::php': - package_name => "libapache2-mod-php5.6", - path => "/usr/lib/apache2/modules/libphp5.6.so", - require => Class['php'] - } + class { 'apache': mpm_module => 'prefork' } + # class { 'apache::mod::php': + # package_name => "libapache2-mod-php5.6", + # path => "/usr/lib/apache2/modules/libphp5.6.so", + # require => Class['php'] + # } class { 'apache::mod::ssl': } class { 'apache::mod::rewrite': } # Merge /etc/php/5.6/apache2 with /etc/php/5.6/cli *after* we install mod_php - file { '/etc/php/5.6/apache2': - ensure => "link", - force => "true", - target => "/etc/php/5.6/cli", - require => Class['apache::mod::php'], - notify => Service['apache2'], - } + # file { '/etc/php/5.6/apache2': + # ensure => "link", + # force => "true", + # target => "/etc/php/5.6/cli", + # require => Class['apache::mod::php'], + # notify => Service['apache2'], + # } # We'll also need this if there are any commands defined file { '/vagrant/bin': From 15c2e95e9543d889b67d6becde6d2bf6cb255933 Mon Sep 17 00:00:00 2001 From: Jeff George Date: Mon, 10 Jul 2017 12:31:12 -0400 Subject: [PATCH 14/60] Add ruby / node build tools --- puppet/precip/manifests/init.pp | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/puppet/precip/manifests/init.pp b/puppet/precip/manifests/init.pp index 5659705..e76edde 100644 --- a/puppet/precip/manifests/init.pp +++ b/puppet/precip/manifests/init.pp @@ -7,6 +7,7 @@ 'htop', 'curl', 'wget', + 'unzip', 'bzip2', 'git', 'openssl', @@ -37,17 +38,25 @@ ensure => present, } - # Grab some gems. - # Commented out for now, until we figure out task runners - # package {[ - # "compass", - # "breakpoint", - # "sass", - # "susy", - # ]: - # ensure => 'installed', - # provider => 'gem', - # } + # Grab various stuff needed to build sites + package {[ + 'bundler', + 'compass', + 'breakpoint', + 'sass', + 'susy', + ]: + ensure => 'installed', + provider => 'gem', + } + + # @TODO: Install yarnpkg too, via their custom repo + package {[ + 'nodejs', + 'npm', + ]: + ensure => present, + } # Make our log directory file {'/vagrant/log': ensure => 'directory', } From 322ff05290078d32bc0fe3fa068092aa7c8d2978 Mon Sep 17 00:00:00 2001 From: Jeff George Date: Mon, 10 Jul 2017 13:58:09 -0400 Subject: [PATCH 15/60] Forcibly chain in ::php::repo::ubuntu, to bring in Ondrej's PPA --- puppet/precip/manifests/php.pp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/puppet/precip/manifests/php.pp b/puppet/precip/manifests/php.pp index ee1c3f9..70b36fb 100644 --- a/puppet/precip/manifests/php.pp +++ b/puppet/precip/manifests/php.pp @@ -3,6 +3,8 @@ class { '::php::globals': php_version => '7.0', config_root => '/etc/php/7.0', + }->class { '::php::repo::ubuntu': + version => '7.0', }->class { '::php': manage_repos => true, fpm => true, From abf3f359670a638537ba08ea612bdd626be84aa5 Mon Sep 17 00:00:00 2001 From: Jeff George Date: Mon, 10 Jul 2017 13:58:20 -0400 Subject: [PATCH 16/60] Bring back imagick and memcached --- puppet/precip/manifests/php.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/puppet/precip/manifests/php.pp b/puppet/precip/manifests/php.pp index 70b36fb..d892258 100644 --- a/puppet/precip/manifests/php.pp +++ b/puppet/precip/manifests/php.pp @@ -15,11 +15,11 @@ extensions => { curl => { }, gd => { }, - #imagick => { }, + imagick => { }, intl => { }, mbstring => { }, mcrypt => { }, - #memcached => { }, + memcached => { }, mysql => { }, sqlite => { }, zip => { }, From ee826abfed457661833f3b88666d37730242f992 Mon Sep 17 00:00:00 2001 From: Jeff George Date: Mon, 10 Jul 2017 14:25:42 -0400 Subject: [PATCH 17/60] Adding in SSH Agent Forwarding as a configuration option --- Vagrantfile | 5 +++++ config.rb-dist | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/Vagrantfile b/Vagrantfile index bd8246d..0d8937a 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -5,6 +5,7 @@ drupal_basepath = "sites" internal_hosts = [] external_hosts = {} packaging_mode = false +forward_ssh_agent = false # Determine if this is our first boot or not. # If there's a better way to figure this out we now have a single place to change. @@ -62,6 +63,10 @@ Vagrant.configure(2) do |config| # Disabling vbguest is helpful in development # config.vbguest.auto_update = false + # Forward your host's SSH Agent to the VM + # Allows for key-based git repo authentication inside the box without copying keys + config.ssh.forward_agent = forward_ssh_agent + # Synced Folders if Vagrant::Util::Platform.windows? # Windows gets vboxsf, because it can't do nfs + bindfs diff --git a/config.rb-dist b/config.rb-dist index 10d056e..766d5af 100644 --- a/config.rb-dist +++ b/config.rb-dist @@ -80,6 +80,15 @@ # } # +# Packaging Mode skips some of the build steps and preps a box for publishing. +# Uncomment the following line to run the site in "packaging mode" +# packaging_mode = true + +# Forward SSH Agent forwards your host's ssh_agent (so, all authorized keys and such) +# into the box, which means you'll be able to do key-based git authentication without +# having to copy/paste keys into the box. +# forward_ssh_agent = true + drupal_sites = { # "example" => { # "host" => "example.vm", From e29be644c97792bd6bcfa2aed9ad7127a6998603 Mon Sep 17 00:00:00 2001 From: Jeff George Date: Thu, 13 Jul 2017 18:27:53 -0400 Subject: [PATCH 18/60] Switch from Puppetlab's out of date 16.04 box to our own 16.04.2 box --- Vagrantfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 0d8937a..02c73df 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -44,8 +44,7 @@ internal_hosts = internal_hosts.flatten # The actual Vagrant Configuration Vagrant.configure(2) do |config| # Vagrant Box Address - # This is a happy base box from PuppetLabs - config.vm.box = "puppetlabs/ubuntu-16.04-64-puppet" + config.vm.box = "clwdev/precip-16.04-base" config.vm.box_version = "1.0.0" # Basic network config. From e4b0eb38c1e3fa80a2f34e99d6f2048e8f618959 Mon Sep 17 00:00:00 2001 From: Jeff George Date: Thu, 13 Jul 2017 18:28:11 -0400 Subject: [PATCH 19/60] Drop explicit entry of Puppetlabs' key because it's in the box now --- puppet/precip/manifests/keys.pp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/puppet/precip/manifests/keys.pp b/puppet/precip/manifests/keys.pp index 4db887c..eb2f136 100644 --- a/puppet/precip/manifests/keys.pp +++ b/puppet/precip/manifests/keys.pp @@ -16,10 +16,4 @@ id => '177F4010FE56CA3336300305F1656F24C74CD1D8', server => 'keyserver.ubuntu.com', } - - # Puppetlabs' Repo Signing Key - apt::key { 'puppetlabs': - id => '6F6B15509CF8E59E6E469F327F438280EF8D349F', - server => 'keyserver.ubuntu.com', - } } \ No newline at end of file From 37835eedaafc92af17b47269671d64fd046de553 Mon Sep 17 00:00:00 2001 From: Jeff George Date: Fri, 14 Jul 2017 12:04:56 -0400 Subject: [PATCH 20/60] Drop hacky suppression of an old warning, no longer an issue --- Vagrantfile | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 02c73df..5d782ac 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -142,12 +142,6 @@ Vagrant.configure(2) do |config| configured = 1 end - # Fix the harmless "stdin: is not a tty" issue once and for all - config.vm.provision "fix-no-tty", type: "shell" do |s| - s.privileged = false - s.inline = "sudo sed -i '/tty/!s/mesg n/tty -s \\&\\& mesg n/' /root/.profile" - end - # Set up and use puppet-librarian inside the box to get all our Puppet Modules config.vm.provision "shell", path: "shell/librarian.sh" From 7f6a8e6308fa356b4576cce0a657909482b9a910 Mon Sep 17 00:00:00 2001 From: Jeff George Date: Fri, 14 Jul 2017 12:05:13 -0400 Subject: [PATCH 21/60] Prevent warnings with latest vagrant --- puppet/hiera.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/puppet/hiera.yaml b/puppet/hiera.yaml index dea0533..86fe8b8 100644 --- a/puppet/hiera.yaml +++ b/puppet/hiera.yaml @@ -1,2 +1,3 @@ --- +version: 5 # Blank yaml to prevent Hiera from throwing a warning during provisioning :( \ No newline at end of file From ee218a6b0e791252a19916b191897937bb0a20c1 Mon Sep 17 00:00:00 2001 From: Jeff George Date: Fri, 14 Jul 2017 12:18:16 -0400 Subject: [PATCH 22/60] Update vagrant plugin dependencies --- .vagrantplugins | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.vagrantplugins b/.vagrantplugins index 70e337f..6e0378f 100644 --- a/.vagrantplugins +++ b/.vagrantplugins @@ -2,11 +2,11 @@ # via https://github.com/mitchellh/vagrant/issues/4347 required_plugins = { - 'vagrant-vbguest' => '~>0.13', - 'vagrant-hostsupdater' => '~>1.0', + 'vagrant-vbguest' => '0.14.2', + 'vagrant-hostsupdater' => '1.0.2', 'vagrant-useradd' => '0.0.1', - 'vagrant-bindfs' => '1.0.1', - 'vagrant-persistent-storage' => '0.0.21', + 'vagrant-bindfs' => '1.0.8', + 'vagrant-persistent-storage' => '0.0.33', } needs_restart = false From 60042f45555611f73edd07390d8dc9bb9e2c8ce9 Mon Sep 17 00:00:00 2001 From: Jeff George Date: Mon, 17 Jul 2017 16:51:04 -0400 Subject: [PATCH 23/60] Add in apache::mod::actions and ::fastcgi, needed for fastcgi (duh) --- puppet/precip/manifests/httpd.pp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/puppet/precip/manifests/httpd.pp b/puppet/precip/manifests/httpd.pp index 1f2e496..2f35c08 100644 --- a/puppet/precip/manifests/httpd.pp +++ b/puppet/precip/manifests/httpd.pp @@ -9,6 +9,8 @@ # } class { 'apache::mod::ssl': } class { 'apache::mod::rewrite': } + class { 'apache::mod::actions': } + class { 'apache::mod::fastcgi': } # Merge /etc/php/5.6/apache2 with /etc/php/5.6/cli *after* we install mod_php # file { '/etc/php/5.6/apache2': From 52d6cf9e2daf510b02fe5948acd4873833e67164 Mon Sep 17 00:00:00 2001 From: Jeff George Date: Mon, 17 Jul 2017 16:51:50 -0400 Subject: [PATCH 24/60] Actually set up a FastCGI Server and rig the base docroot to it --- puppet/precip/manifests/httpd.pp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/puppet/precip/manifests/httpd.pp b/puppet/precip/manifests/httpd.pp index 2f35c08..2aff324 100644 --- a/puppet/precip/manifests/httpd.pp +++ b/puppet/precip/manifests/httpd.pp @@ -20,6 +20,15 @@ # require => Class['apache::mod::php'], # notify => Service['apache2'], # } + # Actually set up the fastcgi server (note: this is the php7.0 one) + apache::fastcgi::server { 'php': + host => '127.0.0.1:9000', + timeout => 15, + flush => false, + faux_path => '/var/www/php.fcgi', + fcgi_alias => '/php.fcgi', + file_type => 'application/x-httpd-php' + } # We'll also need this if there are any commands defined file { '/vagrant/bin': @@ -36,6 +45,7 @@ allow_override => ['All',], }], access_log => false, + custom_fragment => 'AddType application/x-httpd-php .php' } $parsed_siteinfo = parsejson($drupal_siteinfo) From 01770518c492dc713a7d14ef0d75aca449d02242 Mon Sep 17 00:00:00 2001 From: Jeff George Date: Mon, 17 Jul 2017 16:51:59 -0400 Subject: [PATCH 25/60] Remove 5.6 cruft --- puppet/precip/manifests/httpd.pp | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/puppet/precip/manifests/httpd.pp b/puppet/precip/manifests/httpd.pp index 2aff324..060f4aa 100644 --- a/puppet/precip/manifests/httpd.pp +++ b/puppet/precip/manifests/httpd.pp @@ -2,24 +2,11 @@ # Need to specifically ask for Prefork, otherwise Ubuntu will go grab Worker # (Worker is weird) class { 'apache': mpm_module => 'prefork' } - # class { 'apache::mod::php': - # package_name => "libapache2-mod-php5.6", - # path => "/usr/lib/apache2/modules/libphp5.6.so", - # require => Class['php'] - # } class { 'apache::mod::ssl': } class { 'apache::mod::rewrite': } class { 'apache::mod::actions': } class { 'apache::mod::fastcgi': } - # Merge /etc/php/5.6/apache2 with /etc/php/5.6/cli *after* we install mod_php - # file { '/etc/php/5.6/apache2': - # ensure => "link", - # force => "true", - # target => "/etc/php/5.6/cli", - # require => Class['apache::mod::php'], - # notify => Service['apache2'], - # } # Actually set up the fastcgi server (note: this is the php7.0 one) apache::fastcgi::server { 'php': host => '127.0.0.1:9000', From 3b4a45d84fb8258eaa73d824099474d9af064efc Mon Sep 17 00:00:00 2001 From: Jeff George Date: Mon, 17 Jul 2017 16:52:28 -0400 Subject: [PATCH 26/60] Ensure php7 provisions properly --- puppet/precip/manifests/php.pp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/puppet/precip/manifests/php.pp b/puppet/precip/manifests/php.pp index d892258..6932d99 100644 --- a/puppet/precip/manifests/php.pp +++ b/puppet/precip/manifests/php.pp @@ -21,9 +21,10 @@ mcrypt => { }, memcached => { }, mysql => { }, - sqlite => { }, + sqlite3 => { }, zip => { }, opcache => { + zend => true, settings => { 'opcache/opcache.enable_cli' => '1', 'opcache/opcache.revalidate_freq' => '1', @@ -34,6 +35,7 @@ }, }, xdebug => { + zend => true, settings => { 'xdebug/xdebug.remote_autostart' => '1', 'xdebug/xdebug.remote_enable' => '1', From 05e119247e3885b74d6eb7122cd00a7ea057636e Mon Sep 17 00:00:00 2001 From: Jeff George Date: Mon, 17 Jul 2017 23:17:30 -0400 Subject: [PATCH 27/60] Fine. We'll make our own PHP Module. TODO: Actually drop the yucky old one --- puppet/precip/manifests/init.pp | 3 +- puppet/precip/manifests/manualphp.pp | 66 ++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 puppet/precip/manifests/manualphp.pp diff --git a/puppet/precip/manifests/init.pp b/puppet/precip/manifests/init.pp index e76edde..ba1c3c7 100644 --- a/puppet/precip/manifests/init.pp +++ b/puppet/precip/manifests/init.pp @@ -93,7 +93,8 @@ # Kick off the rest of our manifests include 'precip::keys' if !str2bool("$packaging_mode") { - include 'precip::php' + #include 'precip::php' + include 'precip::manualphp' include 'precip::httpd' include 'precip::database' include 'precip::pimpmylog' diff --git a/puppet/precip/manifests/manualphp.pp b/puppet/precip/manifests/manualphp.pp new file mode 100644 index 0000000..9b189cb --- /dev/null +++ b/puppet/precip/manifests/manualphp.pp @@ -0,0 +1,66 @@ +class precip::manualphp { + # All Puppet PHP Modules are Terrible. + # Let's not use them. + + # Get Ondrej's PPA + ::apt::ppa { "ppa:ondrej/php": } + + # Get all the PHP 7 deps + package{[ + 'php7.0-cli', + 'php7.0-common', + 'php7.0-curl', + 'php7.0-dev', + 'php7.0-fpm', + 'php7.0-gd', + 'php7.0-intl', + 'php7.0-json', + 'php7.0-mbstring', + 'php7.0-mcrypt', + 'php7.0-mysql', + 'php7.0-opcache', + 'php7.0-readline', + 'php7.0-sqlite3', + 'php7.0-xml', + 'php7.0-zip', + ]: + ensure => present, + require => [Apt::Ppa['ppa:ondrej/php'], Class['apt::update']], + } + + # Get all the PHP 5.6 deps + package{[ + 'php5.6-cli', + 'php5.6-common', + 'php5.6-curl', + 'php5.6-dev', + 'php5.6-fpm', + 'php5.6-gd', + 'php5.6-intl', + 'php5.6-json', + 'php5.6-mbstring', + 'php5.6-mcrypt', + 'php5.6-mysql', + 'php5.6-opcache', + 'php5.6-readline', + 'php5.6-sqlite3', + 'php5.6-xml', + 'php5.6-zip', + ]: + ensure => present, + require => [Apt::Ppa['ppa:ondrej/php'], Class['apt::update']], + } + + # . . and the ones we only need once + package{[ + 'php-igbinary', + 'php-imagick', + 'php-memcached', + 'php-msgpack', + 'php-pear', + 'php-xdebug', + ]: + ensure => present, + require => [Apt::Ppa['ppa:ondrej/php'], Class['apt::update']], + } +} \ No newline at end of file From 1965a89defb9e81754aedc1055c2a2c0ff880d19 Mon Sep 17 00:00:00 2001 From: Jeff George Date: Mon, 17 Jul 2017 23:17:54 -0400 Subject: [PATCH 28/60] Configure two FastCGI Servers --- puppet/precip/manifests/httpd.pp | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/puppet/precip/manifests/httpd.pp b/puppet/precip/manifests/httpd.pp index 060f4aa..d39ae90 100644 --- a/puppet/precip/manifests/httpd.pp +++ b/puppet/precip/manifests/httpd.pp @@ -7,14 +7,23 @@ class { 'apache::mod::actions': } class { 'apache::mod::fastcgi': } - # Actually set up the fastcgi server (note: this is the php7.0 one) - apache::fastcgi::server { 'php': - host => '127.0.0.1:9000', + # Set up some FastCGI Servers + apache::fastcgi::server { 'php56': + host => '/run/php/php5.6-fpm.sock', timeout => 15, flush => false, - faux_path => '/var/www/php.fcgi', - fcgi_alias => '/php.fcgi', - file_type => 'application/x-httpd-php' + faux_path => '/var/www/php56.fcgi', + fcgi_alias => '/php56.fcgi', + file_type => 'application/x-httpd-php-5.6' + } + + apache::fastcgi::server { 'php70': + host => '/run/php/php7.0-fpm.sock', + timeout => 15, + flush => false, + faux_path => '/var/www/php70.fcgi', + fcgi_alias => '/php70.fcgi', + file_type => 'application/x-httpd-php-7.0' } # We'll also need this if there are any commands defined @@ -32,7 +41,7 @@ allow_override => ['All',], }], access_log => false, - custom_fragment => 'AddType application/x-httpd-php .php' + custom_fragment => 'AddType application/x-httpd-php-5.6 .php' } $parsed_siteinfo = parsejson($drupal_siteinfo) From 764b44d6b4ec6fe563f902908ebce29e05582774 Mon Sep 17 00:00:00 2001 From: Jeff George Date: Mon, 17 Jul 2017 23:24:35 -0400 Subject: [PATCH 29/60] Add a PHP 7 version of the default vhost --- puppet/precip/manifests/httpd.pp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/puppet/precip/manifests/httpd.pp b/puppet/precip/manifests/httpd.pp index d39ae90..4679bbe 100644 --- a/puppet/precip/manifests/httpd.pp +++ b/puppet/precip/manifests/httpd.pp @@ -44,6 +44,18 @@ custom_fragment => 'AddType application/x-httpd-php-5.6 .php' } + apache::vhost { '70.precip.vm': + docroot => '/vagrant/util', + manage_docroot => false, + port => '80', + directories => [{ + path => '/vagrant/util', + allow_override => ['All',], + }], + access_log => false, + custom_fragment => 'AddType application/x-httpd-php-7.0 .php' + } + $parsed_siteinfo = parsejson($drupal_siteinfo) create_resources(drupal_vhosts, $parsed_siteinfo) From fc2d3f591a3c14b084f3b0bfdb096dd0717bbd67 Mon Sep 17 00:00:00 2001 From: Jeff George Date: Tue, 18 Jul 2017 20:47:59 -0400 Subject: [PATCH 30/60] Ensure the PHP7 debug vhost exists and gets mapped by HostsUpdater --- Vagrantfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Vagrantfile b/Vagrantfile index 5d782ac..2410052 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -39,6 +39,7 @@ drupal_sites.each do |name, site| internal_hosts.push(site['aliases']) end end +internal_hosts.push("70.precip.vm") internal_hosts = internal_hosts.flatten # The actual Vagrant Configuration From fe6ed2fb6d7aeb30bc6f25633172cee4b897b292 Mon Sep 17 00:00:00 2001 From: Jeff George Date: Tue, 18 Jul 2017 20:50:47 -0400 Subject: [PATCH 31/60] Configure and enable Xdebug, and restart the fpm's when it's done --- puppet/precip/manifests/manualphp.pp | 21 +++++++++++++++++++++ puppet/precip/templates/php56_xdebug.erb | 7 +++++++ puppet/precip/templates/php70_xdebug.erb | 7 +++++++ 3 files changed, 35 insertions(+) create mode 100644 puppet/precip/templates/php56_xdebug.erb create mode 100644 puppet/precip/templates/php70_xdebug.erb diff --git a/puppet/precip/manifests/manualphp.pp b/puppet/precip/manifests/manualphp.pp index 9b189cb..397589e 100644 --- a/puppet/precip/manifests/manualphp.pp +++ b/puppet/precip/manifests/manualphp.pp @@ -63,4 +63,25 @@ ensure => present, require => [Apt::Ppa['ppa:ondrej/php'], Class['apt::update']], } + + # config files + file { '/etc/php/5.6/mods-available/xdebug.ini': + ensure => 'file', + content => template('precip/php56_xdebug.erb'), + mode => '0644', + require => Package['php-xdebug'], + } + + file { '/etc/php/7.0/mods-available/xdebug.ini': + ensure => 'file', + content => template('precip/php70_xdebug.erb'), + mode => '0644', + require => Package['php-xdebug'], + } + + exec { 'sudo phpenmod -v ALL -s ALL xdebug && service php5.6-fpm reload && service php7.0-fpm reload': + path => '/usr/sbin:/usr/bin:/bin', + #onlyif => ['test `php5.6 --version|grep Xdebug -c` -eq 0','test `php7.0 --version|grep Xdebug -c` -eq 0'], + require => File['/etc/php/5.6/mods-available/xdebug.ini','/etc/php/7.0/mods-available/xdebug.ini'] + } } \ No newline at end of file diff --git a/puppet/precip/templates/php56_xdebug.erb b/puppet/precip/templates/php56_xdebug.erb new file mode 100644 index 0000000..c2f8c41 --- /dev/null +++ b/puppet/precip/templates/php56_xdebug.erb @@ -0,0 +1,7 @@ +zend_extension=/usr/lib/php/20131226/xdebug.so + +xdebug.remote_autostart=1 +xdebug.remote_enable=1 +xdebug.remote_connect_back=1 +xdebug.idekey=vagrant +xdebug.max_nesting_level=10000 \ No newline at end of file diff --git a/puppet/precip/templates/php70_xdebug.erb b/puppet/precip/templates/php70_xdebug.erb new file mode 100644 index 0000000..ccebb64 --- /dev/null +++ b/puppet/precip/templates/php70_xdebug.erb @@ -0,0 +1,7 @@ +zend_extension=/usr/lib/php/20151012/xdebug.so + +xdebug.remote_autostart=1 +xdebug.remote_enable=1 +xdebug.remote_connect_back=1 +xdebug.idekey=vagrant +xdebug.max_nesting_level=10000 \ No newline at end of file From dd3733d8d2faca14a672dedd245c41cb01099090 Mon Sep 17 00:00:00 2001 From: Jeff George Date: Thu, 20 Jul 2017 16:51:38 -0400 Subject: [PATCH 32/60] Simplify our various php ini includes --- puppet/precip/templates/opcache.ini.erb | 11 ----------- puppet/precip/templates/php70_xdebug.erb | 7 ------- puppet/precip/templates/php_opcache.erb | 8 ++++++++ puppet/precip/templates/php_overrides.erb | 13 +++++++++++++ .../templates/{php56_xdebug.erb => php_xdebug.erb} | 2 +- 5 files changed, 22 insertions(+), 19 deletions(-) delete mode 100644 puppet/precip/templates/opcache.ini.erb delete mode 100644 puppet/precip/templates/php70_xdebug.erb create mode 100644 puppet/precip/templates/php_opcache.erb create mode 100644 puppet/precip/templates/php_overrides.erb rename puppet/precip/templates/{php56_xdebug.erb => php_xdebug.erb} (73%) diff --git a/puppet/precip/templates/opcache.ini.erb b/puppet/precip/templates/opcache.ini.erb deleted file mode 100644 index 495f8ea..0000000 --- a/puppet/precip/templates/opcache.ini.erb +++ /dev/null @@ -1,11 +0,0 @@ -; NOTICE : File auto-generated by puppet, do not edit -; Enable OPCache extension module -zend_extension=opcache.so -<% if !@opcache_settings.empty? -%> - -; Custom settings -<% @opcache_settings.sort_by {|key, value| key}.each do |key,value| -%> -<%= key %>=<%= value %> -<% end -%> - -<% end -%> diff --git a/puppet/precip/templates/php70_xdebug.erb b/puppet/precip/templates/php70_xdebug.erb deleted file mode 100644 index ccebb64..0000000 --- a/puppet/precip/templates/php70_xdebug.erb +++ /dev/null @@ -1,7 +0,0 @@ -zend_extension=/usr/lib/php/20151012/xdebug.so - -xdebug.remote_autostart=1 -xdebug.remote_enable=1 -xdebug.remote_connect_back=1 -xdebug.idekey=vagrant -xdebug.max_nesting_level=10000 \ No newline at end of file diff --git a/puppet/precip/templates/php_opcache.erb b/puppet/precip/templates/php_opcache.erb new file mode 100644 index 0000000..0e1c31f --- /dev/null +++ b/puppet/precip/templates/php_opcache.erb @@ -0,0 +1,8 @@ +zend_extension=opcache.so + +opcache.enable_cli=1 +opcache.revalidate_freq=1 +opcache.memory_consumption=512 +opcache.max_accelerated_files=10000 +opcache.interned_strings_buffer=16 +opcache.fast_shutdown=1 \ No newline at end of file diff --git a/puppet/precip/templates/php_overrides.erb b/puppet/precip/templates/php_overrides.erb new file mode 100644 index 0000000..bb0d4a2 --- /dev/null +++ b/puppet/precip/templates/php_overrides.erb @@ -0,0 +1,13 @@ +# Precip php.ini Overrides. +max_execution_time=600 +max_input_time=300 +post_max_size=50M +upload_max_filesize=50M +memory_limit=256M +max_input_vars=10000 +realpath_cache_size=1024 +display_errors=On +html_errors=On +session_save_path=/tmp +sendmail_path=/usr/bin/mailhog sendmail noreply@precip.vm +date.timezone=America/New_York \ No newline at end of file diff --git a/puppet/precip/templates/php56_xdebug.erb b/puppet/precip/templates/php_xdebug.erb similarity index 73% rename from puppet/precip/templates/php56_xdebug.erb rename to puppet/precip/templates/php_xdebug.erb index c2f8c41..b03e91f 100644 --- a/puppet/precip/templates/php56_xdebug.erb +++ b/puppet/precip/templates/php_xdebug.erb @@ -1,4 +1,4 @@ -zend_extension=/usr/lib/php/20131226/xdebug.so +zend_extension=xdebug.so xdebug.remote_autostart=1 xdebug.remote_enable=1 From a0265343691501ee5d9c8ba6c6802dc193b3e961 Mon Sep 17 00:00:00 2001 From: Jeff George Date: Thu, 20 Jul 2017 16:52:36 -0400 Subject: [PATCH 33/60] Vastly refactor php ini includes and define services for php-fpm --- puppet/precip/manifests/manualphp.pp | 76 +++++++++++++++++++++++++--- 1 file changed, 68 insertions(+), 8 deletions(-) diff --git a/puppet/precip/manifests/manualphp.pp b/puppet/precip/manifests/manualphp.pp index 397589e..04df707 100644 --- a/puppet/precip/manifests/manualphp.pp +++ b/puppet/precip/manifests/manualphp.pp @@ -64,24 +64,84 @@ require => [Apt::Ppa['ppa:ondrej/php'], Class['apt::update']], } - # config files + # Define some services so we can easily notify them of changes + service { 'php5.6-fpm': + ensure => running, + enable => true, + hasrestart => true, + hasstatus => true, + } + + service { 'php7.0-fpm': + ensure => running, + enable => true, + hasrestart => true, + hasstatus => true, + } + + # Config files. Yes, these could be simplified because + # we only have the one .erb for each file. But we may + # have to eventually split them out, so i'm keeping + # them split out for now. + file { '/etc/php/5.6/mods-available/opcache.ini': + ensure => 'file', + content => template('precip/php_opcache.erb'), + mode => '0644', + require => Package['php5.6-fpm'], + notify => Service['php5.6-fpm'], + } + + file { '/etc/php/7.0/mods-available/opcache.ini': + ensure => 'file', + content => template('precip/php_opcache.erb'), + mode => '0644', + require => Package['php7.0-fpm'], + notify => Service['php7.0-fpm'], + } + file { '/etc/php/5.6/mods-available/xdebug.ini': ensure => 'file', - content => template('precip/php56_xdebug.erb'), + content => template('precip/php_xdebug.erb'), mode => '0644', - require => Package['php-xdebug'], + require => Package['php-xdebug','php5.6-fpm'], + notify => Service['php5.6-fpm'], } file { '/etc/php/7.0/mods-available/xdebug.ini': ensure => 'file', - content => template('precip/php70_xdebug.erb'), + content => template('precip/php_xdebug.erb'), + mode => '0644', + require => Package['php-xdebug','php7.0-fpm'], + notify => Service['php7.0-fpm'], + } + + file {[ + '/etc/php/5.6/cli/conf.d/99-overrides.ini', + '/etc/php/5.6/fpm/conf.d/99-overrides.ini', + ]: + ensure => 'file', + content => template('precip/php_overrides.erb'), + mode => '0644', + require => Package['php5.6-fpm'], + notify => Service['php5.6-fpm'], + } + + file {[ + '/etc/php/7.0/cli/conf.d/99-overrides.ini', + '/etc/php/7.0/fpm/conf.d/99-overrides.ini', + ]: + ensure => 'file', + content => template('precip/php_overrides.erb'), mode => '0644', - require => Package['php-xdebug'], + require => Package['php7.0-fpm'], + notify => Service['php7.0-fpm'], } - exec { 'sudo phpenmod -v ALL -s ALL xdebug && service php5.6-fpm reload && service php7.0-fpm reload': + # I think the onlyif is failing here. :( + exec { 'sudo phpenmod -v ALL -s ALL xdebug': path => '/usr/sbin:/usr/bin:/bin', - #onlyif => ['test `php5.6 --version|grep Xdebug -c` -eq 0','test `php7.0 --version|grep Xdebug -c` -eq 0'], - require => File['/etc/php/5.6/mods-available/xdebug.ini','/etc/php/7.0/mods-available/xdebug.ini'] + onlyif => ['test `curl -s 70.precip.vm | grep Xdebug -c` -eq 0','test `curl -s 70.precip.vm | grep Xdebug -c` -eq 0'], + require => [File['/etc/php/5.6/mods-available/xdebug.ini','/etc/php/7.0/mods-available/xdebug.ini'], Apache::Vhost['precip.vm','70.precip.vm']], + notify => Service['php5.6-fpm','php7.0-fpm'], } } \ No newline at end of file From 02988c0f630386ce82f4526705979c15a8a8d6c1 Mon Sep 17 00:00:00 2001 From: Jeff George Date: Fri, 21 Jul 2017 10:31:19 -0400 Subject: [PATCH 34/60] Install Yarn as an alternative package manager --- puppet/precip/manifests/init.pp | 18 +++++++++++++++--- puppet/precip/manifests/keys.pp | 8 +++++++- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/puppet/precip/manifests/init.pp b/puppet/precip/manifests/init.pp index ba1c3c7..789d661 100644 --- a/puppet/precip/manifests/init.pp +++ b/puppet/precip/manifests/init.pp @@ -38,7 +38,7 @@ ensure => present, } - # Grab various stuff needed to build sites + # Tools needed to build Omega-based themes package {[ 'bundler', 'compass', @@ -50,12 +50,24 @@ provider => 'gem', } - # @TODO: Install yarnpkg too, via their custom repo + # Define the Yarn apt repo + apt::source { 'yarn': + location => 'http://dl.yarnpkg.com/debian/', + release => 'stable', + repos => 'main', + require => [ + Apt::Key['yarn'] + ] + } + + # Tools needed to build Radix-based themes package {[ 'nodejs', 'npm', + 'yarn', ]: - ensure => present, + require => [Apt::Source['yarn'],Class['apt::update']], + ensure => present, } # Make our log directory diff --git a/puppet/precip/manifests/keys.pp b/puppet/precip/manifests/keys.pp index eb2f136..7d14566 100644 --- a/puppet/precip/manifests/keys.pp +++ b/puppet/precip/manifests/keys.pp @@ -11,9 +11,15 @@ server => 'keyserver.ubuntu.com', } - # MariaDB's PPA key + # MariaDB's Package Signing key apt::key { 'mariadb': id => '177F4010FE56CA3336300305F1656F24C74CD1D8', server => 'keyserver.ubuntu.com', } + + # Yarn's Package Signing Key + apt::key { 'yarn': + id => '72ECF46A56B4AD39C907BBB71646B01B86E50310', + server => 'keyserver.ubuntu.com', + } } \ No newline at end of file From daf853a9f54e36adc033e9e9009f6f612bdb5ee8 Mon Sep 17 00:00:00 2001 From: Jeff George Date: Fri, 21 Jul 2017 11:13:55 -0400 Subject: [PATCH 35/60] Bump the fastcgi timeout (may still not be enough for features_ui) --- puppet/precip/manifests/httpd.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/puppet/precip/manifests/httpd.pp b/puppet/precip/manifests/httpd.pp index 4679bbe..cdac652 100644 --- a/puppet/precip/manifests/httpd.pp +++ b/puppet/precip/manifests/httpd.pp @@ -10,7 +10,7 @@ # Set up some FastCGI Servers apache::fastcgi::server { 'php56': host => '/run/php/php5.6-fpm.sock', - timeout => 15, + timeout => 300, flush => false, faux_path => '/var/www/php56.fcgi', fcgi_alias => '/php56.fcgi', @@ -19,7 +19,7 @@ apache::fastcgi::server { 'php70': host => '/run/php/php7.0-fpm.sock', - timeout => 15, + timeout => 300, flush => false, faux_path => '/var/www/php70.fcgi', fcgi_alias => '/php70.fcgi', From e2670c86c3109af55bbc46a61f7bab162fabba3c Mon Sep 17 00:00:00 2001 From: Jeff George Date: Fri, 21 Jul 2017 11:14:09 -0400 Subject: [PATCH 36/60] Provision Puppet --- puppet/precip/manifests/manualphp.pp | 39 ++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/puppet/precip/manifests/manualphp.pp b/puppet/precip/manifests/manualphp.pp index 04df707..3b1e4e5 100644 --- a/puppet/precip/manifests/manualphp.pp +++ b/puppet/precip/manifests/manualphp.pp @@ -144,4 +144,43 @@ require => [File['/etc/php/5.6/mods-available/xdebug.ini','/etc/php/7.0/mods-available/xdebug.ini'], Apache::Vhost['precip.vm','70.precip.vm']], notify => Service['php5.6-fpm','php7.0-fpm'], } + + package {'composer': + ensure => present, + require => Package['php5.6-cli','php7.0-cli'], + } + + # Add Composer's vendor directory to the vagrant user's $PATH + file { '/home/vagrant/.pam_environment': + mode => '0644', + content => 'PATH DEFAULT=${PATH}:/home/vagrant/.composer/vendor/bin', + require => Package['composer'], + } + + # These bits install Drush & Friends via composer + file { '/home/vagrant/.composer/': + ensure => 'directory', + mode => '0755', + owner => 'vagrant', + group => 'vagrant', + require => Package['composer'], + } + + file { '/home/vagrant/.composer/composer.json': + ensure => 'file', + content => template('precip/composer.json'), + mode => '0644', + owner => 'vagrant', + group => 'vagrant', + require => [Package['composer'], File['/home/vagrant/.composer/']], + } + + exec { 'install-composer-libraries': + command => 'composer install --no-interaction --prefer-dist --no-dev --optimize-autoloader', + environment => [ 'HOME=/home/vagrant', 'COMPOSER_HOME=/home/vagrant/.composer' ], + cwd => '/home/vagrant/.composer', + path => '/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin', + user => 'vagrant', + require => [Package['composer'], File['/home/vagrant/.composer/composer.json']], + } } \ No newline at end of file From 0ad0eccc41a509f0311ed63c9cbdf6fced290f67 Mon Sep 17 00:00:00 2001 From: Jeff George Date: Fri, 21 Jul 2017 11:14:25 -0400 Subject: [PATCH 37/60] Update in-the-box Drush from 7.4.0 to 8.1.12 --- puppet/precip/templates/composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/puppet/precip/templates/composer.json b/puppet/precip/templates/composer.json index b715fbf..aa5bec9 100644 --- a/puppet/precip/templates/composer.json +++ b/puppet/precip/templates/composer.json @@ -1,6 +1,6 @@ { "require": { - "drush/drush": "7.4.0" + "drush/drush": "8.1.12" }, "repositories": { "drupal": { From 52070cd101b4803caf27a7f77fe530dcbbb0fc90 Mon Sep 17 00:00:00 2001 From: Jeff George Date: Fri, 21 Jul 2017 11:14:47 -0400 Subject: [PATCH 38/60] Start Updating the docs --- README.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index cd1b61c..40fbe52 100644 --- a/README.md +++ b/README.md @@ -5,10 +5,10 @@ ## What's Included? A full LAMP stack, and a few nice extras. -- Ubuntu Server 14.04 LTS +- Ubuntu Server 16.04.2 LTS - Apache Server 2.4 - MariaDB 10.1 -- PHP 5.6 +- PHP 5.6 *or* 7.0 - With Memcache, OPCache, and Xdebug all pre-configured - MailHog, the _absolute_ simplest way to locally test mail delivery @@ -48,13 +48,12 @@ A full LAMP stack, and a few nice extras. - As a general rule, getting latest Vagrant, Virtualbox and plugins is advised - BUT if you have issues, as sometimes bleeding edge releases can have unreported / unresolved bugs, roll back to prior versions by uninstalling and re-installing that earlier version (and search issue queues). The Macosx package includes an uninstaller script. - Current known stable releases as of March 7, 2017: - - vagrant 1.9.2 - - vagrant-bindfs (1.0.1) + - vagrant 1.9.7 + - vagrant-bindfs (1.0.8) - vagrant-hostsupdater (1.0.2) - - vagrant-persistent-storage (0.0.21) - - vagrant-share (1.1.6, system) + - vagrant-persistent-storage (0.0.33) - vagrant-useradd (0.0.1) - - vagrant-vbguest (0.13.0) + - vagrant-vbguest (0.14.2) ## Updating Vagrant - If you do a `$ git pull` and see that the `Vagrantfile` has been updated, you may want to make sure things are up to date by running `$ vagrant reload --provision`. From a0e1e6269fc86e5a2440a24274a993b5af6ce674 Mon Sep 17 00:00:00 2001 From: Jeff George Date: Fri, 21 Jul 2017 11:15:03 -0400 Subject: [PATCH 39/60] Implement switching between php 5.6 / 7.0 --- puppet/precip/manifests/httpd.pp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/puppet/precip/manifests/httpd.pp b/puppet/precip/manifests/httpd.pp index cdac652..daa39be 100644 --- a/puppet/precip/manifests/httpd.pp +++ b/puppet/precip/manifests/httpd.pp @@ -73,7 +73,7 @@ } } -define drupal_vhosts($host, $aliases = [], $path, $drupal = '7', $multisite_dir = 'default', $setenv = [], $git_url = '', $git_dir = '', $commands = {}, $ssl_cert = '/vagrant/ssl/precip_vm_host.pem', $ssl_ca = '/vagrant/ssl/precip_ca_bundle.crt.pem', $ssl_key = '/vagrant/ssl/precip_vm_host-key.pem') { +define drupal_vhosts($host, $aliases = [], $path, $drupal = '7', $multisite_dir = 'default', $setenv = [], $git_url = '', $git_dir = '', $commands = {}, $ssl_cert = '/vagrant/ssl/precip_vm_host.pem', $ssl_ca = '/vagrant/ssl/precip_ca_bundle.crt.pem', $ssl_key = '/vagrant/ssl/precip_vm_host-key.pem', $php_version = '5.6') { apache::vhost { $host: docroot => "/srv/www/${path}", manage_docroot => false, @@ -91,6 +91,8 @@ ] ), access_log => false, + error_log_file => "${host}_error.log", + custom_fragment => "AddType application/x-httpd-php-${php_version} .php" } apache::vhost { "${host}-ssl": docroot => "/srv/www/${path}", @@ -110,6 +112,7 @@ ), access_log => false, error_log_file => "${host}_error.log", + custom_fragment => "AddType application/x-httpd-php-${php_version} .php", ssl => true, ssl_cert => $ssl_cert, ssl_ca => $ssl_ca, From d62667f3b50eceef2a5390008894c62727eadf86 Mon Sep 17 00:00:00 2001 From: Jeff George Date: Fri, 21 Jul 2017 11:32:46 -0400 Subject: [PATCH 40/60] Forget phpenmod, just manually build the symlinks --- puppet/precip/manifests/manualphp.pp | 30 ++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/puppet/precip/manifests/manualphp.pp b/puppet/precip/manifests/manualphp.pp index 3b1e4e5..b691aa2 100644 --- a/puppet/precip/manifests/manualphp.pp +++ b/puppet/precip/manifests/manualphp.pp @@ -115,6 +115,28 @@ notify => Service['php7.0-fpm'], } + file {[ + '/etc/php/5.6/cli/conf.d/20-xdebug.ini', + '/etc/php/5.6/fpm/conf.d/20-xdebug.ini', + ]: + ensure => 'link', + force => true, + target => '/etc/php/5.6/mods-available/xdebug.ini', + require => [File['/etc/php/5.6/mods-available/xdebug.ini'], Package['php5.6-fpm']], + notify => Service['php5.6-fpm'], + } + + file {[ + '/etc/php/7.0/cli/conf.d/20-xdebug.ini', + '/etc/php/7.0/fpm/conf.d/20-xdebug.ini', + ]: + ensure => 'link', + force => true, + target => '/etc/php/7.0/mods-available/xdebug.ini', + require => [File['/etc/php/7.0/mods-available/xdebug.ini'], Package['php7.0-fpm']], + notify => Service['php7.0-fpm'], + } + file {[ '/etc/php/5.6/cli/conf.d/99-overrides.ini', '/etc/php/5.6/fpm/conf.d/99-overrides.ini', @@ -137,14 +159,6 @@ notify => Service['php7.0-fpm'], } - # I think the onlyif is failing here. :( - exec { 'sudo phpenmod -v ALL -s ALL xdebug': - path => '/usr/sbin:/usr/bin:/bin', - onlyif => ['test `curl -s 70.precip.vm | grep Xdebug -c` -eq 0','test `curl -s 70.precip.vm | grep Xdebug -c` -eq 0'], - require => [File['/etc/php/5.6/mods-available/xdebug.ini','/etc/php/7.0/mods-available/xdebug.ini'], Apache::Vhost['precip.vm','70.precip.vm']], - notify => Service['php5.6-fpm','php7.0-fpm'], - } - package {'composer': ensure => present, require => Package['php5.6-cli','php7.0-cli'], From 2764baa882c495462b0f21b63294a990d13740e2 Mon Sep 17 00:00:00 2001 From: Jeff George Date: Fri, 21 Jul 2017 11:43:39 -0400 Subject: [PATCH 41/60] Scrub out the old php implementation --- puppet/Puppetfile | 3 -- puppet/Puppetfile.lock | 17 ------ puppet/precip/manifests/php.pp | 98 ---------------------------------- 3 files changed, 118 deletions(-) delete mode 100644 puppet/precip/manifests/php.pp diff --git a/puppet/Puppetfile b/puppet/Puppetfile index 1dbb6e6..ba6dec5 100644 --- a/puppet/Puppetfile +++ b/puppet/Puppetfile @@ -12,9 +12,6 @@ mod 'ftaeger-mailhog', :git => "https://github.com/jeffgeorge/ftaeger-mailhog.git", :ref => "remove_wget_cache_dir" -mod 'puppet-php', - :git => "https://github.com/voxpupuli/puppet-php.git" - mod 'saz-memcached' mod 'clwdev-precip', :path => '/vagrant/puppet/precip' \ No newline at end of file diff --git a/puppet/Puppetfile.lock b/puppet/Puppetfile.lock index a535e23..badcf96 100644 --- a/puppet/Puppetfile.lock +++ b/puppet/Puppetfile.lock @@ -1,9 +1,6 @@ FORGE remote: https://forgeapi.puppetlabs.com specs: - darin-zypprepo (1.0.2) - puppet-archive (1.3.0) - puppetlabs-stdlib (< 5.0.0, >= 4.6.0) puppet-staging (2.2.0) puppetlabs-apache (1.11.0) puppetlabs-concat (< 3.0.0, >= 1.1.1) @@ -13,7 +10,6 @@ FORGE puppetlabs-concat (2.2.1) puppetlabs-stdlib (< 5.0.0, >= 4.2.0) puppetlabs-firewall (1.8.1) - puppetlabs-inifile (1.6.0) puppetlabs-mysql (3.11.0) puppet-staging (< 3.0.0, >= 1.0.1) puppetlabs-stdlib (< 5.0.0, >= 3.2.0) @@ -31,18 +27,6 @@ GIT ftaeger-mailhog (1.1.0) puppetlabs-stdlib (< 5.0.0, >= 4.10.0) -GIT - remote: https://github.com/voxpupuli/puppet-php.git - ref: master - sha: dc9e9cc53bc4adc0dbfc1812a200618d5ad8e265 - specs: - puppet-php (5.0.0-rc0) - darin-zypprepo (< 2.0.0, >= 1.0.2) - puppet-archive (< 2.0.0, >= 1.0.0) - puppetlabs-apt (< 5.0.0, >= 4.1.0) - puppetlabs-inifile (< 2.0.0, >= 1.4.1) - puppetlabs-stdlib (< 5.0.0, >= 4.13.1) - PATH remote: /vagrant/puppet/precip specs: @@ -51,7 +35,6 @@ PATH DEPENDENCIES clwdev-precip (>= 0) ftaeger-mailhog (>= 0) - puppet-php (>= 0) puppetlabs-apache (>= 0) puppetlabs-apt (= 4.1.0) puppetlabs-mysql (>= 0) diff --git a/puppet/precip/manifests/php.pp b/puppet/precip/manifests/php.pp deleted file mode 100644 index 6932d99..0000000 --- a/puppet/precip/manifests/php.pp +++ /dev/null @@ -1,98 +0,0 @@ -class precip::php { - - class { '::php::globals': - php_version => '7.0', - config_root => '/etc/php/7.0', - }->class { '::php::repo::ubuntu': - version => '7.0', - }->class { '::php': - manage_repos => true, - fpm => true, - dev => true, - composer => true, - pear => false, - phpunit => false, - extensions => { - curl => { }, - gd => { }, - imagick => { }, - intl => { }, - mbstring => { }, - mcrypt => { }, - memcached => { }, - mysql => { }, - sqlite3 => { }, - zip => { }, - opcache => { - zend => true, - settings => { - 'opcache/opcache.enable_cli' => '1', - 'opcache/opcache.revalidate_freq' => '1', - 'opcache/opcache.memory_consumption' => '512', - 'opcache/opcache.max_accelerated_files' => '10000', - 'opcache/opcache.interned_strings_buffer' => '16', - 'opcache/opcache.fast_shutdown' => '1', - }, - }, - xdebug => { - zend => true, - settings => { - 'xdebug/xdebug.remote_autostart' => '1', - 'xdebug/xdebug.remote_enable' => '1', - 'xdebug/xdebug.remote_connect_back' => '1', - 'xdebug/xdebug.idekey' => 'vagrant', - 'xdebug/xdebug.max_nesting_level' => '10000', - }, - }, - }, - settings => { - 'PHP/max_execution_time' => '600', - 'PHP/max_input_time' => '300', - 'PHP/post_max_size' => '50M', - 'PHP/upload_max_filesize' => '50M', - 'PHP/memory_limit' => '256M', - 'PHP/max_input_vars' => '10000', - 'PHP/realpath_cache_size' => '1024', - 'PHP/display_errors' => 'On', - 'PHP/html_errors' => 'On', - 'PHP/session_save_path' => '/tmp', - 'PHP/sendmail_path' => '/usr/bin/mailhog sendmail noreply@precip.vm', - 'Date/date.timezone' => 'America/New_York', - }, - require => Package['software-properties-common'], - } - - # Add Composer's vendor directory to the vagrant user's $PATH - file { '/home/vagrant/.pam_environment': - mode => '0644', - content => 'PATH DEFAULT=${PATH}:/home/vagrant/.composer/vendor/bin', - require => Class['php'], - } - - # These bits install Drush & Friends via composer - file { '/home/vagrant/.composer/': - ensure => 'directory', - mode => '0755', - owner => 'vagrant', - group => 'vagrant', - require => Class['php'], - } - - file { '/home/vagrant/.composer/composer.json': - ensure => 'file', - content => template('precip/composer.json'), - mode => '0644', - owner => 'vagrant', - group => 'vagrant', - require => [Class['php'], File['/home/vagrant/.composer/']], - } - - exec { 'install-composer-libraries': - command => 'composer install --no-interaction --prefer-dist --no-dev --optimize-autoloader', - environment => [ 'HOME=/home/vagrant', 'COMPOSER_HOME=/home/vagrant/.composer' ], - cwd => '/home/vagrant/.composer', - path => '/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin', - user => 'vagrant', - require => [Class['php'], File['/home/vagrant/.composer/composer.json']], - } -} From f723a984a9d5426b80814c902663139f46620d0d Mon Sep 17 00:00:00 2001 From: Jeff George Date: Fri, 21 Jul 2017 11:44:21 -0400 Subject: [PATCH 42/60] rename precip::manualphp to just precip::php --- puppet/precip/manifests/init.pp | 3 +-- puppet/precip/manifests/manualphp.pp | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/puppet/precip/manifests/init.pp b/puppet/precip/manifests/init.pp index 789d661..7bb5038 100644 --- a/puppet/precip/manifests/init.pp +++ b/puppet/precip/manifests/init.pp @@ -105,8 +105,7 @@ # Kick off the rest of our manifests include 'precip::keys' if !str2bool("$packaging_mode") { - #include 'precip::php' - include 'precip::manualphp' + include 'precip::php' include 'precip::httpd' include 'precip::database' include 'precip::pimpmylog' diff --git a/puppet/precip/manifests/manualphp.pp b/puppet/precip/manifests/manualphp.pp index b691aa2..4242c0c 100644 --- a/puppet/precip/manifests/manualphp.pp +++ b/puppet/precip/manifests/manualphp.pp @@ -1,4 +1,4 @@ -class precip::manualphp { +class precip::php { # All Puppet PHP Modules are Terrible. # Let's not use them. From 97468adc0d8a87990a339901270c122c8f8e55b2 Mon Sep 17 00:00:00 2001 From: Jeff George Date: Fri, 21 Jul 2017 11:46:55 -0400 Subject: [PATCH 43/60] Updating config.rb-dist re: php configuration, and the license copyright --- LICENSE | 2 +- config.rb-dist | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 1085d2a..41a5f34 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License -Copyright (c) 2015-2016 Clearwater Development +Copyright (c) 2015-2017 Clearwater Development Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/config.rb-dist b/config.rb-dist index 766d5af..5dd3428 100644 --- a/config.rb-dist +++ b/config.rb-dist @@ -13,6 +13,9 @@ # drupal: Drupal Version of the site, 6 or 7. Not Drupal? Pass in # "false". # +# php_version: "5.6" or "7.0", defaults to "5.6". Defines which php-fpm +# pool to talk to, on a host-by-host basis. +# # aliases: A list of alias domains to set up. Useful for testing # domain-based internationalization. # From b3935f9bb9e83fb6d074f3baf13d5e6c23c5f71d Mon Sep 17 00:00:00 2001 From: Jeff George Date: Fri, 21 Jul 2017 11:49:25 -0400 Subject: [PATCH 44/60] Update docs --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 40fbe52..da27882 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ A full LAMP stack, and a few nice extras. ## Pre-flight Checklist - Get [VirtualBox](https://www.virtualbox.org/wiki/Downloads) - Also [Vagrant](http://www.vagrantup.com/downloads.html) -- Then go download these super helpful Vagrant Plugins (If you forget to, Vagrant will install them for you. It'll error on your first `vagrant up`, but will work fine if you re-run `vagrant up`.) +- Then go download these super helpful Vagrant Plugins (If you forget to, Vagrant will install them for you. It *might* error on your first `vagrant up`, but should still install things fine.) - `$ vagrant plugin install vagrant-vbguest` - `$ vagrant plugin install vagrant-hostsupdater` - `$ vagrant plugin install vagrant-useradd` From 97e53476fdb25845d4e5f41327f95e6bb67ef73c Mon Sep 17 00:00:00 2001 From: Jeff George Date: Fri, 21 Jul 2017 11:56:00 -0400 Subject: [PATCH 45/60] Actually have to rename the file, too. --- puppet/precip/manifests/{manualphp.pp => php.pp} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename puppet/precip/manifests/{manualphp.pp => php.pp} (100%) diff --git a/puppet/precip/manifests/manualphp.pp b/puppet/precip/manifests/php.pp similarity index 100% rename from puppet/precip/manifests/manualphp.pp rename to puppet/precip/manifests/php.pp From 5582cc7f64ee199c6d27b87a24863c78aefb72b1 Mon Sep 17 00:00:00 2001 From: Jeff George Date: Fri, 21 Jul 2017 12:07:20 -0400 Subject: [PATCH 46/60] Ensure vagrant owns /usr/local/bin --- puppet/precip/manifests/init.pp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/puppet/precip/manifests/init.pp b/puppet/precip/manifests/init.pp index 7bb5038..dcc643d 100644 --- a/puppet/precip/manifests/init.pp +++ b/puppet/precip/manifests/init.pp @@ -111,6 +111,13 @@ include 'precip::pimpmylog' } + # Ensure vagrant owns /usr/local/bin + file { '/usr/local/bin': + ensure => 'directory', + owner => 'vagrant', + group => 'vagrant', + } + # More elegant workaround for vbguest's issue #95 # See: https://github.com/dotless-de/vagrant-vbguest/issues/95#issuecomment-163777475 file { '/sbin/vboxadd': From 57d2f279c55ed2e21f43070d36828f4089604de4 Mon Sep 17 00:00:00 2001 From: Jeff George Date: Fri, 21 Jul 2017 15:28:45 -0400 Subject: [PATCH 47/60] Minor tweaks to support building sites inside the box --- puppet/precip/manifests/init.pp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/puppet/precip/manifests/init.pp b/puppet/precip/manifests/init.pp index dcc643d..0272f5e 100644 --- a/puppet/precip/manifests/init.pp +++ b/puppet/precip/manifests/init.pp @@ -111,12 +111,24 @@ include 'precip::pimpmylog' } - # Ensure vagrant owns /usr/local/bin - file { '/usr/local/bin': + # Ensure vagrant owns /usr/local/bin and /usr/local/lib + file { [ + '/usr/local/bin', + '/usr/local/lib', + ]: ensure => 'directory', owner => 'vagrant', group => 'vagrant', } + + # On Ubuntu, the package name for "Node JS" is "nodejs" not "node". + # Lets smooth that out. + file { '/usr/local/bin/node': + ensure => 'link', + force => true, + target => '/usr/bin/nodejs', + require => [File['/usr/local/bin'],Package['nodejs']], + } # More elegant workaround for vbguest's issue #95 # See: https://github.com/dotless-de/vagrant-vbguest/issues/95#issuecomment-163777475 From 5490d00a643558d34a1e730fa84e3e08a2958227 Mon Sep 17 00:00:00 2001 From: Jeff George Date: Mon, 24 Jul 2017 15:33:24 -0400 Subject: [PATCH 48/60] Drop references to XHProf, which we don't actually support anymore. We might replace it with `php-tideways` later. --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index da27882..b8ee8b8 100644 --- a/README.md +++ b/README.md @@ -94,8 +94,6 @@ Each VirtualHost you define in `config.rb` automatically logs Apache errors to t ## Debugging Integration [Xdebug](http://xdebug.org/) is built in and preconfigured. Use something like [Xdebug Helper](https://chrome.google.com/webstore/detail/xdebug-helper/eadndfjplgieldjbigjakmdgkmoaaaoc?hl=en) to trigger a session, and your IDE should automagically pick it up. -The [XHProf PHP Extension](http://php.net/manual/en/book.xhprof.php) is also built in. There's a [pretty nice Drupal Module](https://www.drupal.org/project/xhprof) that can hook into it. - ## MailHog [MailHog](https://github.com/mailhog/MailHog) is an alternative mailhandler written in Go. Similar to MailCatcher it collects mail sent by PHP (or, anything actually) and puts it in a friendly local web UI. Said web UI lives on port 8025: [precip.vm:8025](http://precip.vm:8025). The major benefit MailHog has over MailCatcher is that it's written in Go and is distributed as a statically-compiled binary, so we don't have a mile-long list of Ruby dependencies to reconcile before installing. From 4c3224b82b9e6043d517e6db361325408be10ac0 Mon Sep 17 00:00:00 2001 From: Jeff George Date: Tue, 25 Jul 2017 12:35:40 -0400 Subject: [PATCH 49/60] Clean up global composer management --- puppet/precip/manifests/php.pp | 4 ++-- .../precip/templates/{composer.json => global-composer.json} | 0 2 files changed, 2 insertions(+), 2 deletions(-) rename puppet/precip/templates/{composer.json => global-composer.json} (100%) diff --git a/puppet/precip/manifests/php.pp b/puppet/precip/manifests/php.pp index 4242c0c..199f81c 100644 --- a/puppet/precip/manifests/php.pp +++ b/puppet/precip/manifests/php.pp @@ -172,7 +172,7 @@ } # These bits install Drush & Friends via composer - file { '/home/vagrant/.composer/': + file { '/home/vagrant/.composer': ensure => 'directory', mode => '0755', owner => 'vagrant', @@ -182,7 +182,7 @@ file { '/home/vagrant/.composer/composer.json': ensure => 'file', - content => template('precip/composer.json'), + content => template('precip/global-composer.json'), mode => '0644', owner => 'vagrant', group => 'vagrant', diff --git a/puppet/precip/templates/composer.json b/puppet/precip/templates/global-composer.json similarity index 100% rename from puppet/precip/templates/composer.json rename to puppet/precip/templates/global-composer.json From 87b8bf0bed46c5ca46758d0b2bc352084d352916 Mon Sep 17 00:00:00 2001 From: Jeff George Date: Tue, 25 Jul 2017 12:35:57 -0400 Subject: [PATCH 50/60] Experimental (read: totally non-functional) support for phpMemAdmin --- puppet/precip/manifests/phpmemadmin.pp | 29 +++++++++++++++++++ .../templates/phpmemadmin-composer.json | 10 +++++++ util/.gitignore | 1 + 3 files changed, 40 insertions(+) create mode 100644 puppet/precip/manifests/phpmemadmin.pp create mode 100644 puppet/precip/templates/phpmemadmin-composer.json diff --git a/puppet/precip/manifests/phpmemadmin.pp b/puppet/precip/manifests/phpmemadmin.pp new file mode 100644 index 0000000..94f2cf9 --- /dev/null +++ b/puppet/precip/manifests/phpmemadmin.pp @@ -0,0 +1,29 @@ +class precip::phpmemadmin { + # Experimental support for phpmemadmin + + file { '/vagrant/util/phpmemadmin': + ensure => 'directory', + mode => '0755', + owner => 'vagrant', + group => 'vagrant', + require => Package['composer'], + } + + file { '/vagrant/util/phpmemadmin/composer.json': + ensure => 'file', + content => template('precip/phpmemadmin-composer.json'), + mode => '0644', + owner => 'vagrant', + group => 'vagrant', + require => [Package['composer'], File['/vagrant/util/phpmemadmin']], + } + + exec { 'install-composer-phpmemadmin': + command => "/bin/echo $'1\n\n' | composer install --no-interaction --prefer-dist --no-dev --optimize-autoloader", + environment => [ 'HOME=/home/vagrant', 'COMPOSER_HOME=/home/vagrant/.composer' ], + cwd => '/vagrant/util/phpmemadmin', + path => '/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin', + user => 'vagrant', + require => [Package['composer'], File['/vagrant/util/phpmemadmin/composer.json']], + } +} \ No newline at end of file diff --git a/puppet/precip/templates/phpmemadmin-composer.json b/puppet/precip/templates/phpmemadmin-composer.json new file mode 100644 index 0000000..586b3c8 --- /dev/null +++ b/puppet/precip/templates/phpmemadmin-composer.json @@ -0,0 +1,10 @@ +{ + "require": { + "clickalicious/phpmemadmin": "~0.3" + }, + "scripts": { + "post-autoload-dump": [ + "Clickalicious\\PhpMemAdmin\\Installer::postInstall" + ] + } +} \ No newline at end of file diff --git a/util/.gitignore b/util/.gitignore index 47f0f4d..99fc04c 100644 --- a/util/.gitignore +++ b/util/.gitignore @@ -1,4 +1,5 @@ phpmyadmin* phpMyAdmin* +phpmemadmin* pml* misc \ No newline at end of file From cd3c28c5695658a496924f5e9cbbabaad8af97be Mon Sep 17 00:00:00 2001 From: Jeff George Date: Wed, 26 Jul 2017 16:13:13 -0400 Subject: [PATCH 51/60] Implement "vm_name" as an configurable element via config.rb Allows running multiple instances of precip. Not simultaneously, but at least you can physically _do_ it without Virtualbox and Vagrant freaking out. --- Vagrantfile | 5 +++-- config.rb-dist | 7 +++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 2410052..08a0c0d 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -6,6 +6,7 @@ internal_hosts = [] external_hosts = {} packaging_mode = false forward_ssh_agent = false +vm_name = "precip" # Determine if this is our first boot or not. # If there's a better way to figure this out we now have a single place to change. @@ -99,8 +100,8 @@ Vagrant.configure(2) do |config| # Configure the VM. Tweak as needed configured = -1 config.vm.provider :virtualbox do |vb| - # Name this virtual machine "precip" - vb.customize ["modifyvm", :id, "--name", "precip"] + # Provide a unique name for this virtual machine + vb.customize ["modifyvm", :id, "--name", vm_name] # IOAPIC is needed for a 64bit host for multiple cures vb.customize ["modifyvm", :id, "--ioapic", "on"] # Use ICH9 for performance diff --git a/config.rb-dist b/config.rb-dist index 5dd3428..5cccfcb 100644 --- a/config.rb-dist +++ b/config.rb-dist @@ -85,13 +85,20 @@ # Packaging Mode skips some of the build steps and preps a box for publishing. # Uncomment the following line to run the site in "packaging mode" +# # packaging_mode = true # Forward SSH Agent forwards your host's ssh_agent (so, all authorized keys and such) # into the box, which means you'll be able to do key-based git authentication without # having to copy/paste keys into the box. +# # forward_ssh_agent = true +# Sometimes you may need to run two instances of precip, but Virtualbox and Vagrant +# get angry if two boxes have the same name. Need to override that? Set it here. +# +# vm_name = "not-precip" + drupal_sites = { # "example" => { # "host" => "example.vm", From 897776dd370d1ad756ecb210875a6bb20bfaa660 Mon Sep 17 00:00:00 2001 From: Jeff George Date: Wed, 26 Jul 2017 16:41:08 -0400 Subject: [PATCH 52/60] Fix VMI Aliases (Resolves #54?) --- puppet/precip/templates/drush_vmi_aliases.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/puppet/precip/templates/drush_vmi_aliases.erb b/puppet/precip/templates/drush_vmi_aliases.erb index c53cfd6..ff12099 100644 --- a/puppet/precip/templates/drush_vmi_aliases.erb +++ b/puppet/precip/templates/drush_vmi_aliases.erb @@ -8,9 +8,9 @@ $aliases['<%= @site[0] %>'] = array( 'root' => '<%= @drupal_sites_path %>/<%= @site[1]["path"] %>', 'uri' => '<%= @site[1]["host"] %>', 'root' => '/srv/www/<%= @site[1]["path"] %>', - 'remote-host' => '127.0.0.1', + 'remote-host' => '10.0.0.11', 'remote-user' => 'vagrant', - 'ssh-options' => "-i \"\$HOME/.vagrant.d/insecure_private_key\" -o 'ControlMaster auto' -o \"ControlPath \$HOME/.ssh/vagrant\" -o 'ControlPersist 60000' -o 'StrictHostKeyChecking=no' -o 'KbdInteractiveAuthentication=no' -o 'PreferredAuthentications=publickey' -o 'PasswordAuthentication=no' -o 'ConnectTimeout=30' -p 2222 -4", + 'ssh-options' => "-i \"\$HOME/.vagrant.d/insecure_private_key\" -o 'ControlMaster auto' -o \"ControlPath \$HOME/.ssh/vagrant\" -o 'ControlPersist 60000' -o 'StrictHostKeyChecking=no' -o 'KbdInteractiveAuthentication=no' -o 'PreferredAuthentications=publickey' -o 'PasswordAuthentication=no' -o 'ConnectTimeout=30' -p 22 -4", ); <% end -%> <% end -%> From cc4fb8bdf293f1a819367e4c6ce56756c0e5fb7d Mon Sep 17 00:00:00 2001 From: Jeff George Date: Thu, 27 Jul 2017 14:42:32 -0400 Subject: [PATCH 53/60] Add Soap libraries, also reorder the dependencies so they're always 5.6 -> 7.0 --- puppet/precip/manifests/php.pp | 48 ++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/puppet/precip/manifests/php.pp b/puppet/precip/manifests/php.pp index 199f81c..8123e4c 100644 --- a/puppet/precip/manifests/php.pp +++ b/puppet/precip/manifests/php.pp @@ -5,29 +5,6 @@ # Get Ondrej's PPA ::apt::ppa { "ppa:ondrej/php": } - # Get all the PHP 7 deps - package{[ - 'php7.0-cli', - 'php7.0-common', - 'php7.0-curl', - 'php7.0-dev', - 'php7.0-fpm', - 'php7.0-gd', - 'php7.0-intl', - 'php7.0-json', - 'php7.0-mbstring', - 'php7.0-mcrypt', - 'php7.0-mysql', - 'php7.0-opcache', - 'php7.0-readline', - 'php7.0-sqlite3', - 'php7.0-xml', - 'php7.0-zip', - ]: - ensure => present, - require => [Apt::Ppa['ppa:ondrej/php'], Class['apt::update']], - } - # Get all the PHP 5.6 deps package{[ 'php5.6-cli', @@ -43,6 +20,7 @@ 'php5.6-mysql', 'php5.6-opcache', 'php5.6-readline', + 'php5.6-soap', 'php5.6-sqlite3', 'php5.6-xml', 'php5.6-zip', @@ -51,6 +29,30 @@ require => [Apt::Ppa['ppa:ondrej/php'], Class['apt::update']], } + # Get all the PHP 7 deps + package{[ + 'php7.0-cli', + 'php7.0-common', + 'php7.0-curl', + 'php7.0-dev', + 'php7.0-fpm', + 'php7.0-gd', + 'php7.0-intl', + 'php7.0-json', + 'php7.0-mbstring', + 'php7.0-mcrypt', + 'php7.0-mysql', + 'php7.0-opcache', + 'php7.0-readline', + 'php7.0-soap', + 'php7.0-sqlite3', + 'php7.0-xml', + 'php7.0-zip', + ]: + ensure => present, + require => [Apt::Ppa['ppa:ondrej/php'], Class['apt::update']], + } + # . . and the ones we only need once package{[ 'php-igbinary', From f2c6b863f84bef1f692db3e0e3d73b61ba5f60c2 Mon Sep 17 00:00:00 2001 From: Jeff George Date: Fri, 28 Jul 2017 16:42:40 -0400 Subject: [PATCH 54/60] Make sure we ignore the new custom.sh --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 95ea686..04aadf8 100644 --- a/.gitignore +++ b/.gitignore @@ -11,4 +11,5 @@ puppet/.tmp *.aliases.drushrc.php precip.box *.vdi -.idea \ No newline at end of file +.idea +shell/custom.sh \ No newline at end of file From 3734b20213f02216e40155e8d8bbf2b3722c4fa7 Mon Sep 17 00:00:00 2001 From: Jeff George Date: Fri, 28 Jul 2017 16:42:58 -0400 Subject: [PATCH 55/60] config.rb-dist docs for use_package_precip mode --- config.rb-dist | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/config.rb-dist b/config.rb-dist index 5cccfcb..c9fe8a8 100644 --- a/config.rb-dist +++ b/config.rb-dist @@ -84,7 +84,9 @@ # # Packaging Mode skips some of the build steps and preps a box for publishing. -# Uncomment the following line to run the site in "packaging mode" +# Uncomment the following line to run the site in "packaging mode". +# +# Warning: Only do this if you _really_ know what you're doing # # packaging_mode = true @@ -99,6 +101,13 @@ # # vm_name = "not-precip" +# We offer a partially pre-built version of the Precip Base Box, which ships with +# all keys and base packages pre-installed, so all that's left is installing PHP, +# Apache, MySQL, and Configuring everything. This can help on restrictive networks +# where you might not be able to add keys properly. +# +# use_packaged_precip = true + drupal_sites = { # "example" => { # "host" => "example.vm", From a4d552e4de7c97a5855f308ed4cf4a81f2f05516 Mon Sep 17 00:00:00 2001 From: Jeff George Date: Fri, 28 Jul 2017 16:43:23 -0400 Subject: [PATCH 56/60] Make the package.sh script a little less dangerous --- shell/package.sh | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/shell/package.sh b/shell/package.sh index 62a6453..17c8d25 100755 --- a/shell/package.sh +++ b/shell/package.sh @@ -19,25 +19,19 @@ echo "Ensuring a clean machine" vagrant destroy --force echo "Prepping config.rb and sites folder" -cp config.rb-dist config.rb -echo "packaging_mode = true" | tee -a config.rb -mkdir -p "$BASEDIR/../sites" >/dev/null 2>&1 - -echo "Installing prerequisites" -vagrant plugin install vagrant-vbguest -vagrant plugin install vagrant-hostsupdater -vagrant plugin install vagrant-useradd -vagrant plugin install vagrant-bindfs -vagrant plugin install vagrant-persistent-storage +# cp config.rb-dist config.rb +# echo "packaging_mode = true" | tee -a config.rb +# mkdir -p "$BASEDIR/../sites" >/dev/null 2>&1 echo "Setting up Vagrant" -sudo touch /etc/exports +# sudo touch /etc/exports vagrant up vagrant halt echo "Packaging Vagrant" rm -rf precip.box >/dev/null 2>&1 -vagrant package --base precip --output precip.box +vagrant ssh -c "sudo apt-get clean && cat /dev/null > ~/.bash_history && history -c" +vagrant package --output precip.box echo "Cleaning up" vagrant destroy --force \ No newline at end of file From 8466bf2d6daec98095b259d04e3f7428c88e74e4 Mon Sep 17 00:00:00 2001 From: Jeff George Date: Fri, 28 Jul 2017 16:43:49 -0400 Subject: [PATCH 57/60] Implement an optional in-the-box "custom" provisioning script --- Vagrantfile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Vagrantfile b/Vagrantfile index 08a0c0d..0cda4ca 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -163,4 +163,9 @@ Vagrant.configure(2) do |config| "packaging_mode" => packaging_mode, } end + + if File.file?('shell/custom.sh') && File.executable?('shell/custom.sh') + # Run any Extra stuff you may need + config.vm.provision "shell", path: "shell/custom.sh", privileged: false + end end From bbd21e1940a334d8f016679dde7125c2e5724a87 Mon Sep 17 00:00:00 2001 From: Jeff George Date: Fri, 28 Jul 2017 16:44:21 -0400 Subject: [PATCH 58/60] Set an extra flag to ensure extra symlinks work inside shared folders on Windows --- Vagrantfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Vagrantfile b/Vagrantfile index 0cda4ca..93fb35a 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -141,6 +141,10 @@ Vagrant.configure(2) do |config| # puts "CPUs set to: #{cpus}" # end end + # Allow Windows Hosts to create symlinks inside shared folders + if Vagrant::Util::Platform.windows? + vb.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/v-root", "1"] + end configured = 1 end From d9c3cc09279774a095d16a091e02777389209a3f Mon Sep 17 00:00:00 2001 From: Jeff George Date: Fri, 28 Jul 2017 16:45:02 -0400 Subject: [PATCH 59/60] Implement use_packaged_precip, a toggle switch to use the partially pre-built version of Precip --- Vagrantfile | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 93fb35a..46b05d3 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -7,6 +7,7 @@ external_hosts = {} packaging_mode = false forward_ssh_agent = false vm_name = "precip" +use_packaged_precip = false # Determine if this is our first boot or not. # If there's a better way to figure this out we now have a single place to change. @@ -46,8 +47,15 @@ internal_hosts = internal_hosts.flatten # The actual Vagrant Configuration Vagrant.configure(2) do |config| # Vagrant Box Address - config.vm.box = "clwdev/precip-16.04-base" - config.vm.box_version = "1.0.0" + if use_packaged_precip == true + # The pre-packaged and shrink-wrapped version of Precip + config.vm.box = "clwdev/precip" + config.vm.box_version = "2.0.0" + else + # The super-generic simple Ubuntu 16.04 base box (with Puppet) + config.vm.box = "clwdev/precip-16.04-base" + config.vm.box_version = "1.0.0" + end # Basic network config. config.vm.network :private_network, ip: "10.0.0.11" From 1c96430f3bc498ee6d06f61a40880425151c4443 Mon Sep 17 00:00:00 2001 From: Jeff George Date: Mon, 31 Jul 2017 10:24:01 -0400 Subject: [PATCH 60/60] Fix php.ini config file comment --- puppet/precip/templates/php_overrides.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/puppet/precip/templates/php_overrides.erb b/puppet/precip/templates/php_overrides.erb index bb0d4a2..d930a57 100644 --- a/puppet/precip/templates/php_overrides.erb +++ b/puppet/precip/templates/php_overrides.erb @@ -1,4 +1,4 @@ -# Precip php.ini Overrides. +;Precip php.ini Overrides. max_execution_time=600 max_input_time=300 post_max_size=50M