diff --git a/Vagrantfile b/Vagrantfile index 8f6d3e339..3ed4d9636 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -74,106 +74,7 @@ Vagrant.configure(2) do |config| "puppet/environment/#{environment}/modules_contrib", "puppet/environment/#{environment}/modules", ] - puppet.manifest_file = 'install_packages.pp' - puppet.hiera_config_path = 'hiera.yaml' - end - - ## Custom Manifest: build scikit-learn - config.vm.provision 'puppet' do |puppet| - puppet.environment_path = 'puppet/environment' - puppet.environment = environment - puppet.manifests_path = "puppet/environment/#{environment}/manifests" - puppet.module_path = [ - "puppet/environment/#{environment}/modules_contrib", - "puppet/environment/#{environment}/modules", - ] - puppet.manifest_file = 'install_sklearn.pp' - puppet.hiera_config_path = 'hiera.yaml' - end - - ## Custom Manifest: ensure vagrant-mounted event - # - # Note: future parser allow heredoc syntax in the puppet manifest (since puppet 3.5) - config.vm.provision 'puppet' do |puppet| - puppet.environment_path = 'puppet/environment' - puppet.environment = environment - puppet.manifests_path = "puppet/environment/#{environment}/manifests" - puppet.module_path = [ - "puppet/environment/#{environment}/modules_contrib", - "puppet/environment/#{environment}/modules", - ] - puppet.manifest_file = 'vagrant_mounted.pp' - puppet.hiera_config_path = 'hiera.yaml' - end - - ## Custom Manifest: install redis client / server - # - # Note: future parser allow heredoc syntax in the puppet manifest (since puppet 3.5) - config.vm.provision 'puppet' do |puppet| - puppet.environment_path = 'puppet/environment' - puppet.environment = environment - puppet.manifests_path = "puppet/environment/#{environment}/manifests" - puppet.module_path = [ - "puppet/environment/#{environment}/modules_contrib", - "puppet/environment/#{environment}/modules", - ] - puppet.manifest_file = 'configure_redis.pp' - puppet.hiera_config_path = 'hiera.yaml' - end - - ## Custom Manifest: configure system (i.e. system timezone) - config.vm.provision 'puppet' do |puppet| - puppet.environment_path = 'puppet/environment' - puppet.environment = environment - puppet.manifests_path = "puppet/environment/#{environment}/manifests" - puppet.module_path = [ - "puppet/environment/#{environment}/modules_contrib", - "puppet/environment/#{environment}/modules", - ] - puppet.manifest_file = 'configure_system.pp' - end - - ## Custom Manifest: define webcompilers - # - # Note: future parser allow heredoc sytnax (since puppet 3.5), and allows - # array iteration in the puppet manifest. - config.vm.provision 'puppet' do |puppet| - puppet.environment_path = 'puppet/environment' - puppet.environment = environment - puppet.manifests_path = "puppet/environment/#{environment}/manifests" - puppet.module_path = [ - "puppet/environment/#{environment}/modules_contrib", - "puppet/environment/#{environment}/modules", - ] - puppet.manifest_file = 'compile_asset.pp' - puppet.hiera_config_path = 'hiera.yaml' - end - - ## Custom Manifest: install, and configure SQL database - config.vm.provision 'puppet' do |puppet| - puppet.environment_path = 'puppet/environment' - puppet.environment = environment - puppet.manifests_path = "puppet/environment/#{environment}/manifests" - puppet.module_path = [ - "puppet/environment/#{environment}/modules_contrib", - "puppet/environment/#{environment}/modules", - ] - puppet.manifest_file = 'setup_database.pp' - puppet.hiera_config_path = 'hiera.yaml' - end - - ## Custom Manifest: start webserver - # - # Note: future parser allow heredoc syntax in the puppet manifest (since puppet 3.5) - config.vm.provision 'puppet' do |puppet| - puppet.environment_path = 'puppet/environment' - puppet.environment = environment - puppet.manifests_path = "puppet/environment/#{environment}/manifests" - puppet.module_path = [ - "puppet/environment/#{environment}/modules_contrib", - "puppet/environment/#{environment}/modules", - ] - puppet.manifest_file = 'start_webserver.pp' + puppet.manifest_file = 'site.pp' puppet.hiera_config_path = 'hiera.yaml' end diff --git a/puppet/environment/vagrant/manifests/compile_asset.pp b/puppet/environment/vagrant/manifests/compile_asset.pp deleted file mode 100644 index 31a12fcef..000000000 --- a/puppet/environment/vagrant/manifests/compile_asset.pp +++ /dev/null @@ -1,47 +0,0 @@ -### -### compile_asset.pp: install, configure, and run initial compile against -### source files. -### - -## ensure log directory, package dependencies -class dependencies { - require system::log_directory - contain package::webcompilers -} - -## configure webcompilers -class configure { - ## set dependency - require dependencies - - ## configure webcompilers - require system::webcompiler_directory - contain compiler::webcompilers -} - -## start webcompilers -class start { - ## set dependency - require dependencies - require configure - - ## start compiler(s) - contain compiler::start_sass - contain compiler::start_uglifyjs - contain compiler::start_browserify - contain compiler::start_imagemin -} - -## initial compile -class initiate { - ## set dependency - require dependencies - require configure - require start - - ## initial compile - contain compiler::initial_compile -} - -## initiate -include initiate \ No newline at end of file diff --git a/puppet/environment/vagrant/manifests/configure_redis.pp b/puppet/environment/vagrant/manifests/configure_redis.pp deleted file mode 100644 index 0afc6f63a..000000000 --- a/puppet/environment/vagrant/manifests/configure_redis.pp +++ /dev/null @@ -1,9 +0,0 @@ -### -### configure_redis.pp: install redis client, and redis server. -### - -## install redis client -include package::redis_client - -## install redis-server -include package::redis_server \ No newline at end of file diff --git a/puppet/environment/vagrant/manifests/configure_system.pp b/puppet/environment/vagrant/manifests/configure_system.pp deleted file mode 100644 index 27121b1db..000000000 --- a/puppet/environment/vagrant/manifests/configure_system.pp +++ /dev/null @@ -1,6 +0,0 @@ -### -### configure_system.pp: configure system with general requirements. -### - -## define system timezone -include system::set_timezone \ No newline at end of file diff --git a/puppet/environment/vagrant/manifests/install_packages.pp b/puppet/environment/vagrant/manifests/install_packages.pp deleted file mode 100644 index ca70d0d33..000000000 --- a/puppet/environment/vagrant/manifests/install_packages.pp +++ /dev/null @@ -1,42 +0,0 @@ -### -### install_packages.pp: install general packages. -### - -## nodejs, with npm: this cannot be wrapped into a module, and included, as -## needed. Puppet will only allow one instance of this class, regardless of -## of its implementation. -class install_nodejs { - ## set dependency - require apt - - ## install nodejs, with npm - class { 'nodejs': - repo_url_suffix => '5.x', - } - contain nodejs -} - -## general packages -class general_packages { - ## set dependency - require apt - require install_nodejs - require system::webcompiler_directory - - ## install packages - contain package::inotify_tools - contain package::react_presets - contain package::jsonschema - contain package::xmltodict - contain package::six - contain package::fetch - contain package::pyyaml - contain package::flask_script - contain package::pytest_flask - contain package::python_dev - contain package::libssl_dev - contain package::scrypt -} - -## initiate -include general_packages diff --git a/puppet/environment/vagrant/manifests/install_sklearn.pp b/puppet/environment/vagrant/manifests/install_sklearn.pp deleted file mode 100644 index 750a8bc7f..000000000 --- a/puppet/environment/vagrant/manifests/install_sklearn.pp +++ /dev/null @@ -1,18 +0,0 @@ -### -### install_sklearn.pp: install sklearn, with all necessary dependencies. -### - -## create '/vagrant/build/' directory -include system::build_directory - -## install sklearn dependencies -include package::sklearn_dependencies - -## download scikit-learn -include package::sklearn - -## build scikit-learn -include sklearn::build_sklearn - -## install scikit-learn -include sklearn::install_sklearn \ No newline at end of file diff --git a/puppet/environment/vagrant/manifests/setup_database.pp b/puppet/environment/vagrant/manifests/setup_database.pp deleted file mode 100644 index 18fee0b6a..000000000 --- a/puppet/environment/vagrant/manifests/setup_database.pp +++ /dev/null @@ -1,24 +0,0 @@ -### -### setup_database.pp: install client, and initialize database tables. -### - -## install sql -class install_sql { - ## install mariadb - contain database::server - - ## install mariadb client - contain database::client - - ## install mariad bindings - contain database::bindings -} - -## create database tables -class create_db { - require install_sql - contain database::database -} - -## initiate -include create_db diff --git a/puppet/environment/vagrant/manifests/site.pp b/puppet/environment/vagrant/manifests/site.pp new file mode 100644 index 000000000..1939ddfc0 --- /dev/null +++ b/puppet/environment/vagrant/manifests/site.pp @@ -0,0 +1,12 @@ +### +### site.pp: load all necessary modules. +### + +include package +include sklearn +include vagrant +include redis +include system +include compiler +include database +include webserver \ No newline at end of file diff --git a/puppet/environment/vagrant/manifests/start_webserver.pp b/puppet/environment/vagrant/manifests/start_webserver.pp deleted file mode 100644 index d5b703d70..000000000 --- a/puppet/environment/vagrant/manifests/start_webserver.pp +++ /dev/null @@ -1,13 +0,0 @@ -### -### start_webserver.pp: start webserver. -### - -## ensure log directory -require system::log_directory - -## install webserver -include webserver::service - -## start webservers -include package::gunicorn -include webserver::start \ No newline at end of file diff --git a/puppet/environment/vagrant/manifests/vagrant_mounted.pp b/puppet/environment/vagrant/manifests/vagrant_mounted.pp deleted file mode 100644 index 85fef01f2..000000000 --- a/puppet/environment/vagrant/manifests/vagrant_mounted.pp +++ /dev/null @@ -1,11 +0,0 @@ -### -### vagrant_mounted.pp: ensure 'vagrant-mounted' event fires, when '/vagrant' -### shared directory, is mounted within the guest virtual -### machine. -### - -## configure service -include vagrant::service - -## start service -include vagrant::start \ No newline at end of file diff --git a/puppet/environment/vagrant/modules/compiler/manifests/init.pp b/puppet/environment/vagrant/modules/compiler/manifests/init.pp new file mode 100644 index 000000000..6aeda4400 --- /dev/null +++ b/puppet/environment/vagrant/modules/compiler/manifests/init.pp @@ -0,0 +1,49 @@ +### +### init.pp: install, configure, and run initial compile against +### source files. +### + +class compiler { + ## ensure log directory, package dependencies + class dependencies { + require system::log_directory + contain package::webcompilers + } + + ## configure webcompilers + class configure { + ## set dependency + require dependencies + + ## configure webcompilers + require system::webcompiler_directory + contain compiler::webcompilers + } + + ## start webcompilers + class start { + ## set dependency + require dependencies + require configure + + ## start compiler(s) + contain compiler::start_sass + contain compiler::start_uglifyjs + contain compiler::start_browserify + contain compiler::start_imagemin + } + + ## initial compile + class initiate { + ## set dependency + require dependencies + require configure + require start + + ## initial compile + contain compiler::initial_compile + } + + ## initiate + include initiate +} \ No newline at end of file diff --git a/puppet/environment/vagrant/modules/database/manifests/init.pp b/puppet/environment/vagrant/modules/database/manifests/init.pp new file mode 100644 index 000000000..bf9b7fbd9 --- /dev/null +++ b/puppet/environment/vagrant/modules/database/manifests/init.pp @@ -0,0 +1,26 @@ +### +### init.pp: install client, and initialize database tables. +### + +class database { + ## install sql + class install_sql { + ## install mariadb + contain database::server + + ## install mariadb client + contain database::client + + ## install mariad bindings + contain database::bindings + } + + ## create database tables + class create_db { + require install_sql + contain database::database + } + + ## initiate + include create_db +} \ No newline at end of file diff --git a/puppet/environment/vagrant/modules/package/manifests/init.pp b/puppet/environment/vagrant/modules/package/manifests/init.pp new file mode 100644 index 000000000..ba91ed1b3 --- /dev/null +++ b/puppet/environment/vagrant/modules/package/manifests/init.pp @@ -0,0 +1,44 @@ +### +### init.pp: install general packages. +### + +class package { + ## nodejs, with npm: this cannot be wrapped into a module, and included, as + ## needed. Puppet will only allow one instance of this class, + ## regardless of its implementation. + class install_nodejs { + ## set dependency + require apt + + ## install nodejs, with npm + class { 'nodejs': + repo_url_suffix => '5.x', + } + contain nodejs + } + + ## general packages + class general_packages { + ## set dependency + require apt + require install_nodejs + require system::webcompiler_directory + + ## install packages + contain package::inotify_tools + contain package::react_presets + contain package::jsonschema + contain package::xmltodict + contain package::six + contain package::fetch + contain package::pyyaml + contain package::flask_script + contain package::pytest_flask + contain package::python_dev + contain package::libssl_dev + contain package::scrypt + } +} + +## initiate +include general_packages diff --git a/puppet/environment/vagrant/modules/redis/manifests/init.pp b/puppet/environment/vagrant/modules/redis/manifests/init.pp new file mode 100644 index 000000000..51f2ad8e3 --- /dev/null +++ b/puppet/environment/vagrant/modules/redis/manifests/init.pp @@ -0,0 +1,11 @@ +### +### init.pp: install redis client, and redis server. +### + +class redis { + ## install redis client + include package::redis_client + + ## install redis-server + include package::redis_server +} \ No newline at end of file diff --git a/puppet/environment/vagrant/modules/sklearn/manifests/init.pp b/puppet/environment/vagrant/modules/sklearn/manifests/init.pp new file mode 100644 index 000000000..dbe4dc1c3 --- /dev/null +++ b/puppet/environment/vagrant/modules/sklearn/manifests/init.pp @@ -0,0 +1,20 @@ +### +### init.pp: install sklearn, with all necessary dependencies. +### + +class sklearn { + ## create '/vagrant/build/' directory + include system::build_directory + + ## install sklearn dependencies + include package::sklearn_dependencies + + ## download scikit-learn + include package::sklearn + + ## build scikit-learn + include sklearn::build_sklearn + + ## install scikit-learn + include sklearn::install_sklearn +} \ No newline at end of file diff --git a/puppet/environment/vagrant/modules/system/manifests/init.pp b/puppet/environment/vagrant/modules/system/manifests/init.pp new file mode 100644 index 000000000..cb66f584f --- /dev/null +++ b/puppet/environment/vagrant/modules/system/manifests/init.pp @@ -0,0 +1,7 @@ +### +### init.pp: configure system with general requirements. +### + +class system { + include system::set_timezone +} \ No newline at end of file diff --git a/puppet/environment/vagrant/modules/vagrant/manifests/init.pp b/puppet/environment/vagrant/modules/vagrant/manifests/init.pp new file mode 100644 index 000000000..c81f37eb9 --- /dev/null +++ b/puppet/environment/vagrant/modules/vagrant/manifests/init.pp @@ -0,0 +1,12 @@ +### +### init.pp: ensure 'vagrant-mounted' event fires, when '/vagrant' shared +### directory, is mounted within the guest virtual machine. +### + +class vagrant { + ## configure service + include vagrant::service + + ## start service + include vagrant::start +} \ No newline at end of file diff --git a/puppet/environment/vagrant/modules/webserver/manifests/init.pp b/puppet/environment/vagrant/modules/webserver/manifests/init.pp new file mode 100644 index 000000000..e424dd6e4 --- /dev/null +++ b/puppet/environment/vagrant/modules/webserver/manifests/init.pp @@ -0,0 +1,15 @@ +### +### init.pp: start webserver. +### + +class webserver { + ## ensure log directory + require system::log_directory + + ## install webserver + include webserver::service + + ## start webservers + include package::gunicorn + include webserver::start +} \ No newline at end of file