agile_solo 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/.gitignore +22 -0
- data/Gemfile +4 -0
- data/LICENSE +20 -0
- data/README.md +90 -0
- data/Rakefile +1 -0
- data/agile_solo.gemspec +30 -0
- data/lib/agile_solo.rb +13 -0
- data/lib/agile_solo/application/solo.rb +20 -0
- data/lib/agile_solo/command.rb +17 -0
- data/lib/agile_solo/composite_command.rb +35 -0
- data/lib/agile_solo/config.rb +13 -0
- data/lib/agile_solo/consumer.rb +41 -0
- data/lib/agile_solo/server.rb +19 -0
- data/lib/agile_solo/version.rb +3 -0
- data/spec/agile_solo/command_spec.rb +15 -0
- data/spec/agile_solo/composite_command_spec.rb +31 -0
- data/spec/agile_solo/config_spec.rb +8 -0
- data/spec/agile_solo/consumer_spec.rb +52 -0
- data/spec/agile_solo/server_spec.rb +35 -0
- data/spec/chef_repo/.chef/knife.rb +6 -0
- data/spec/chef_repo/.gitignore +3 -0
- data/spec/chef_repo/.gitmodules +3 -0
- data/spec/chef_repo/.librarian/chef/config +3 -0
- data/spec/chef_repo/Cheffile +11 -0
- data/spec/chef_repo/Cheffile.lock +33 -0
- data/spec/chef_repo/README.md +92 -0
- data/spec/chef_repo/README_APP.md +23 -0
- data/spec/chef_repo/Rakefile +5 -0
- data/spec/chef_repo/chefignore +11 -0
- data/spec/chef_repo/cookbooks/apache/CHANGES.md +9 -0
- data/spec/chef_repo/cookbooks/apache/README.md +64 -0
- data/spec/chef_repo/cookbooks/apache/metadata.json +32 -0
- data/spec/chef_repo/cookbooks/apache/metadata.rb +11 -0
- data/spec/chef_repo/cookbooks/apache/providers/fastcgi.rb +116 -0
- data/spec/chef_repo/cookbooks/apache/recipes/default.rb +8 -0
- data/spec/chef_repo/cookbooks/apache/resources/fastcgi.rb +14 -0
- data/spec/chef_repo/cookbooks/apache/templates/default/fast-cgi-vhost.erb +41 -0
- data/spec/chef_repo/cookbooks/apache2/.gitignore +3 -0
- data/spec/chef_repo/cookbooks/apache2/CHANGELOG.md +158 -0
- data/spec/chef_repo/cookbooks/apache2/CONTRIBUTING.md +257 -0
- data/spec/chef_repo/cookbooks/apache2/Gemfile +10 -0
- data/spec/chef_repo/cookbooks/apache2/LICENSE +201 -0
- data/spec/chef_repo/cookbooks/apache2/README.md +581 -0
- data/spec/chef_repo/cookbooks/apache2/attributes/default.rb +153 -0
- data/spec/chef_repo/cookbooks/apache2/attributes/mod_auth_cas.rb +2 -0
- data/spec/chef_repo/cookbooks/apache2/attributes/mod_auth_openid.rb +32 -0
- data/spec/chef_repo/cookbooks/apache2/attributes/mod_ssl.rb +19 -0
- data/spec/chef_repo/cookbooks/apache2/definitions/apache_conf.rb +26 -0
- data/spec/chef_repo/cookbooks/apache2/definitions/apache_module.rb +53 -0
- data/spec/chef_repo/cookbooks/apache2/definitions/apache_site.rb +43 -0
- data/spec/chef_repo/cookbooks/apache2/definitions/web_app.rb +50 -0
- data/spec/chef_repo/cookbooks/apache2/files/default/apache2_module_conf_generate.pl +41 -0
- data/spec/chef_repo/cookbooks/apache2/files/default/tests/minitest/default_test.rb +77 -0
- data/spec/chef_repo/cookbooks/apache2/files/default/tests/minitest/god_monitor_test.rb +34 -0
- data/spec/chef_repo/cookbooks/apache2/files/default/tests/minitest/mod_apreq2_test.rb +19 -0
- data/spec/chef_repo/cookbooks/apache2/files/default/tests/minitest/mod_auth_cas_test.rb +11 -0
- data/spec/chef_repo/cookbooks/apache2/files/default/tests/minitest/mod_auth_openid_test.rb +37 -0
- data/spec/chef_repo/cookbooks/apache2/files/default/tests/minitest/mod_cgi_test.rb +13 -0
- data/spec/chef_repo/cookbooks/apache2/files/default/tests/minitest/mod_dav_svn_test.rb +14 -0
- data/spec/chef_repo/cookbooks/apache2/files/default/tests/minitest/mod_fastcgi.rb +11 -0
- data/spec/chef_repo/cookbooks/apache2/files/default/tests/minitest/mod_include_test.rb +15 -0
- data/spec/chef_repo/cookbooks/apache2/files/default/tests/minitest/mod_perl_test.rb +18 -0
- data/spec/chef_repo/cookbooks/apache2/files/default/tests/minitest/mod_php5_test.rb +13 -0
- data/spec/chef_repo/cookbooks/apache2/files/default/tests/minitest/mod_python_test.rb +10 -0
- data/spec/chef_repo/cookbooks/apache2/files/default/tests/minitest/mod_ssl_test.rb +28 -0
- data/spec/chef_repo/cookbooks/apache2/files/default/tests/minitest/support/helpers.rb +65 -0
- data/spec/chef_repo/cookbooks/apache2/metadata.json +527 -0
- data/spec/chef_repo/cookbooks/apache2/metadata.rb +213 -0
- data/spec/chef_repo/cookbooks/apache2/recipes/default.rb +223 -0
- data/spec/chef_repo/cookbooks/apache2/recipes/god_monitor.rb +33 -0
- data/spec/chef_repo/cookbooks/apache2/recipes/iptables.rb +20 -0
- data/spec/chef_repo/cookbooks/apache2/recipes/logrotate.rb +31 -0
- data/spec/chef_repo/cookbooks/apache2/recipes/mod_alias.rb +22 -0
- data/spec/chef_repo/cookbooks/apache2/recipes/mod_apreq2.rb +54 -0
- data/spec/chef_repo/cookbooks/apache2/recipes/mod_auth_basic.rb +20 -0
- data/spec/chef_repo/cookbooks/apache2/recipes/mod_auth_cas.rb +59 -0
- data/spec/chef_repo/cookbooks/apache2/recipes/mod_auth_digest.rb +20 -0
- data/spec/chef_repo/cookbooks/apache2/recipes/mod_auth_openid.rb +125 -0
- data/spec/chef_repo/cookbooks/apache2/recipes/mod_authn_file.rb +20 -0
- data/spec/chef_repo/cookbooks/apache2/recipes/mod_authnz_ldap.rb +20 -0
- data/spec/chef_repo/cookbooks/apache2/recipes/mod_authz_default.rb +20 -0
- data/spec/chef_repo/cookbooks/apache2/recipes/mod_authz_groupfile.rb +20 -0
- data/spec/chef_repo/cookbooks/apache2/recipes/mod_authz_host.rb +20 -0
- data/spec/chef_repo/cookbooks/apache2/recipes/mod_authz_user.rb +20 -0
- data/spec/chef_repo/cookbooks/apache2/recipes/mod_autoindex.rb +22 -0
- data/spec/chef_repo/cookbooks/apache2/recipes/mod_cgi.rb +20 -0
- data/spec/chef_repo/cookbooks/apache2/recipes/mod_dav.rb +20 -0
- data/spec/chef_repo/cookbooks/apache2/recipes/mod_dav_fs.rb +21 -0
- data/spec/chef_repo/cookbooks/apache2/recipes/mod_dav_svn.rb +41 -0
- data/spec/chef_repo/cookbooks/apache2/recipes/mod_deflate.rb +22 -0
- data/spec/chef_repo/cookbooks/apache2/recipes/mod_dir.rb +22 -0
- data/spec/chef_repo/cookbooks/apache2/recipes/mod_env.rb +20 -0
- data/spec/chef_repo/cookbooks/apache2/recipes/mod_expires.rb +20 -0
- data/spec/chef_repo/cookbooks/apache2/recipes/mod_fastcgi.rb +26 -0
- data/spec/chef_repo/cookbooks/apache2/recipes/mod_fcgid.rb +55 -0
- data/spec/chef_repo/cookbooks/apache2/recipes/mod_headers.rb +20 -0
- data/spec/chef_repo/cookbooks/apache2/recipes/mod_include.rb +22 -0
- data/spec/chef_repo/cookbooks/apache2/recipes/mod_ldap.rb +20 -0
- data/spec/chef_repo/cookbooks/apache2/recipes/mod_log_config.rb +24 -0
- data/spec/chef_repo/cookbooks/apache2/recipes/mod_logio.rb +24 -0
- data/spec/chef_repo/cookbooks/apache2/recipes/mod_mime.rb +22 -0
- data/spec/chef_repo/cookbooks/apache2/recipes/mod_negotiation.rb +22 -0
- data/spec/chef_repo/cookbooks/apache2/recipes/mod_perl.rb +44 -0
- data/spec/chef_repo/cookbooks/apache2/recipes/mod_php5.rb +78 -0
- data/spec/chef_repo/cookbooks/apache2/recipes/mod_proxy.rb +22 -0
- data/spec/chef_repo/cookbooks/apache2/recipes/mod_proxy_ajp.rb +21 -0
- data/spec/chef_repo/cookbooks/apache2/recipes/mod_proxy_balancer.rb +20 -0
- data/spec/chef_repo/cookbooks/apache2/recipes/mod_proxy_connect.rb +20 -0
- data/spec/chef_repo/cookbooks/apache2/recipes/mod_proxy_http.rb +20 -0
- data/spec/chef_repo/cookbooks/apache2/recipes/mod_python.rb +37 -0
- data/spec/chef_repo/cookbooks/apache2/recipes/mod_rewrite.rb +20 -0
- data/spec/chef_repo/cookbooks/apache2/recipes/mod_setenvif.rb +22 -0
- data/spec/chef_repo/cookbooks/apache2/recipes/mod_ssl.rb +46 -0
- data/spec/chef_repo/cookbooks/apache2/recipes/mod_status.rb +22 -0
- data/spec/chef_repo/cookbooks/apache2/recipes/mod_wsgi.rb +38 -0
- data/spec/chef_repo/cookbooks/apache2/recipes/mod_xsendfile.rb +38 -0
- data/spec/chef_repo/cookbooks/apache2/templates/default/a2dismod.erb +22 -0
- data/spec/chef_repo/cookbooks/apache2/templates/default/a2dissite.erb +29 -0
- data/spec/chef_repo/cookbooks/apache2/templates/default/a2enmod.erb +37 -0
- data/spec/chef_repo/cookbooks/apache2/templates/default/a2ensite.erb +38 -0
- data/spec/chef_repo/cookbooks/apache2/templates/default/apache2.conf.erb +238 -0
- data/spec/chef_repo/cookbooks/apache2/templates/default/apache2.god.erb +19 -0
- data/spec/chef_repo/cookbooks/apache2/templates/default/charset.erb +6 -0
- data/spec/chef_repo/cookbooks/apache2/templates/default/default-site.erb +57 -0
- data/spec/chef_repo/cookbooks/apache2/templates/default/etc-sysconfig-httpd.erb +31 -0
- data/spec/chef_repo/cookbooks/apache2/templates/default/mods/README +2 -0
- data/spec/chef_repo/cookbooks/apache2/templates/default/mods/alias.conf.erb +24 -0
- data/spec/chef_repo/cookbooks/apache2/templates/default/mods/auth_cas.conf.erb +1 -0
- data/spec/chef_repo/cookbooks/apache2/templates/default/mods/auth_cas.load.erb +1 -0
- data/spec/chef_repo/cookbooks/apache2/templates/default/mods/authopenid.load.erb +1 -0
- data/spec/chef_repo/cookbooks/apache2/templates/default/mods/autoindex.conf.erb +101 -0
- data/spec/chef_repo/cookbooks/apache2/templates/default/mods/deflate.conf.erb +16 -0
- data/spec/chef_repo/cookbooks/apache2/templates/default/mods/dir.conf.erb +5 -0
- data/spec/chef_repo/cookbooks/apache2/templates/default/mods/fastcgi.conf.erb +5 -0
- data/spec/chef_repo/cookbooks/apache2/templates/default/mods/fcgid.conf.erb +10 -0
- data/spec/chef_repo/cookbooks/apache2/templates/default/mods/include.conf.erb +4 -0
- data/spec/chef_repo/cookbooks/apache2/templates/default/mods/include.erb +4 -0
- data/spec/chef_repo/cookbooks/apache2/templates/default/mods/mime.conf.erb +198 -0
- data/spec/chef_repo/cookbooks/apache2/templates/default/mods/negotiation.conf.erb +18 -0
- data/spec/chef_repo/cookbooks/apache2/templates/default/mods/php5.conf.erb +16 -0
- data/spec/chef_repo/cookbooks/apache2/templates/default/mods/proxy.conf.erb +19 -0
- data/spec/chef_repo/cookbooks/apache2/templates/default/mods/setenvif.conf.erb +28 -0
- data/spec/chef_repo/cookbooks/apache2/templates/default/mods/ssl.conf.erb +77 -0
- data/spec/chef_repo/cookbooks/apache2/templates/default/mods/status.conf.erb +26 -0
- data/spec/chef_repo/cookbooks/apache2/templates/default/port_apache.erb +3 -0
- data/spec/chef_repo/cookbooks/apache2/templates/default/ports.conf.erb +6 -0
- data/spec/chef_repo/cookbooks/apache2/templates/default/security.erb +50 -0
- data/spec/chef_repo/cookbooks/apache2/templates/default/web_app.conf.erb +47 -0
- data/spec/chef_repo/cookbooks/apt/.gitignore +14 -0
- data/spec/chef_repo/cookbooks/apt/.kitchen.yml +33 -0
- data/spec/chef_repo/cookbooks/apt/Berksfile +8 -0
- data/spec/chef_repo/cookbooks/apt/CHANGELOG.md +79 -0
- data/spec/chef_repo/cookbooks/apt/CONTRIBUTING +29 -0
- data/spec/chef_repo/cookbooks/apt/LICENSE +201 -0
- data/spec/chef_repo/cookbooks/apt/README.md +238 -0
- data/spec/chef_repo/cookbooks/apt/TESTING.md +25 -0
- data/spec/chef_repo/cookbooks/apt/attributes/default.rb +3 -0
- data/spec/chef_repo/cookbooks/apt/files/default/apt-proxy-v2.conf +50 -0
- data/spec/chef_repo/cookbooks/apt/metadata.json +34 -0
- data/spec/chef_repo/cookbooks/apt/metadata.rb +14 -0
- data/spec/chef_repo/cookbooks/apt/providers/preference.rb +61 -0
- data/spec/chef_repo/cookbooks/apt/providers/repository.rb +138 -0
- data/spec/chef_repo/cookbooks/apt/recipes/cacher-client.rb +59 -0
- data/spec/chef_repo/cookbooks/apt/recipes/cacher-ng.rb +38 -0
- data/spec/chef_repo/cookbooks/apt/recipes/default.rb +68 -0
- data/spec/chef_repo/cookbooks/apt/resources/preference.rb +30 -0
- data/spec/chef_repo/cookbooks/apt/resources/repository.rb +40 -0
- data/spec/chef_repo/cookbooks/apt/templates/default/01proxy.erb +2 -0
- data/spec/chef_repo/cookbooks/apt/templates/default/acng.conf.erb +276 -0
- data/spec/chef_repo/cookbooks/apt/templates/ubuntu-10.04/acng.conf.erb +270 -0
- data/spec/chef_repo/cookbooks/build-essential/.gitignore +4 -0
- data/spec/chef_repo/cookbooks/build-essential/.kitchen.yml +42 -0
- data/spec/chef_repo/cookbooks/build-essential/Berksfile +3 -0
- data/spec/chef_repo/cookbooks/build-essential/CHANGELOG.md +42 -0
- data/spec/chef_repo/cookbooks/build-essential/CONTRIBUTING +29 -0
- data/spec/chef_repo/cookbooks/build-essential/LICENSE +201 -0
- data/spec/chef_repo/cookbooks/build-essential/README.md +139 -0
- data/spec/chef_repo/cookbooks/build-essential/TESTING.md +25 -0
- data/spec/chef_repo/cookbooks/build-essential/attributes/default.rb +33 -0
- data/spec/chef_repo/cookbooks/build-essential/metadata.json +44 -0
- data/spec/chef_repo/cookbooks/build-essential/metadata.rb +16 -0
- data/spec/chef_repo/cookbooks/build-essential/recipes/debian.rb +45 -0
- data/spec/chef_repo/cookbooks/build-essential/recipes/default.rb +24 -0
- data/spec/chef_repo/cookbooks/build-essential/recipes/fedora.rb +36 -0
- data/spec/chef_repo/cookbooks/build-essential/recipes/mac_os_x.rb +40 -0
- data/spec/chef_repo/cookbooks/build-essential/recipes/rhel.rb +43 -0
- data/spec/chef_repo/cookbooks/build-essential/recipes/smartos.rb +36 -0
- data/spec/chef_repo/cookbooks/build-essential/recipes/solaris2.rb +42 -0
- data/spec/chef_repo/cookbooks/build-essential/recipes/suse.rb +36 -0
- data/spec/chef_repo/cookbooks/install_from/README.md +51 -0
- data/spec/chef_repo/cookbooks/install_from/attributes/default.rb +2 -0
- data/spec/chef_repo/cookbooks/install_from/metadata.json +46 -0
- data/spec/chef_repo/cookbooks/install_from/metadata.rb +19 -0
- data/spec/chef_repo/cookbooks/install_from/providers/release.rb +143 -0
- data/spec/chef_repo/cookbooks/install_from/recipes/default.rb +26 -0
- data/spec/chef_repo/cookbooks/install_from/resources/release.rb +121 -0
- data/spec/chef_repo/cookbooks/metachef/.rspec +3 -0
- data/spec/chef_repo/cookbooks/metachef/.watchr +20 -0
- data/spec/chef_repo/cookbooks/metachef/Gemfile +15 -0
- data/spec/chef_repo/cookbooks/metachef/README.md +97 -0
- data/spec/chef_repo/cookbooks/metachef/attributes/default.rb +18 -0
- data/spec/chef_repo/cookbooks/metachef/definitions/daemon_user.rb +68 -0
- data/spec/chef_repo/cookbooks/metachef/definitions/kill_old_service.rb +35 -0
- data/spec/chef_repo/cookbooks/metachef/definitions/standard_dirs.rb +54 -0
- data/spec/chef_repo/cookbooks/metachef/libraries/aspect.rb +125 -0
- data/spec/chef_repo/cookbooks/metachef/libraries/aspects.rb +170 -0
- data/spec/chef_repo/cookbooks/metachef/libraries/attr_struct.rb +160 -0
- data/spec/chef_repo/cookbooks/metachef/libraries/component.rb +164 -0
- data/spec/chef_repo/cookbooks/metachef/libraries/cookbook_utils.rb +69 -0
- data/spec/chef_repo/cookbooks/metachef/libraries/discovery.rb +124 -0
- data/spec/chef_repo/cookbooks/metachef/libraries/discovery_lol.rb +55 -0
- data/spec/chef_repo/cookbooks/metachef/libraries/dump_aspects.rb +83 -0
- data/spec/chef_repo/cookbooks/metachef/libraries/metachef.rb +18 -0
- data/spec/chef_repo/cookbooks/metachef/libraries/node_utils.rb +91 -0
- data/spec/chef_repo/cookbooks/metachef/metadata.json +102 -0
- data/spec/chef_repo/cookbooks/metachef/metadata.rb +39 -0
- data/spec/chef_repo/cookbooks/metachef/recipes/default.rb +22 -0
- data/spec/chef_repo/cookbooks/nginx/.gitignore +9 -0
- data/spec/chef_repo/cookbooks/nginx/.kitchen.yml +62 -0
- data/spec/chef_repo/cookbooks/nginx/Berksfile +7 -0
- data/spec/chef_repo/cookbooks/nginx/CHANGELOG.md +158 -0
- data/spec/chef_repo/cookbooks/nginx/CONTRIBUTING.md +257 -0
- data/spec/chef_repo/cookbooks/nginx/LICENSE +201 -0
- data/spec/chef_repo/cookbooks/nginx/README.md +398 -0
- data/spec/chef_repo/cookbooks/nginx/TESTING.md +25 -0
- data/spec/chef_repo/cookbooks/nginx/attributes/default.rb +89 -0
- data/spec/chef_repo/cookbooks/nginx/attributes/echo.rb +10 -0
- data/spec/chef_repo/cookbooks/nginx/attributes/geoip.rb +30 -0
- data/spec/chef_repo/cookbooks/nginx/attributes/headers_more.rb +22 -0
- data/spec/chef_repo/cookbooks/nginx/attributes/naxsi.rb +24 -0
- data/spec/chef_repo/cookbooks/nginx/attributes/repo.rb +30 -0
- data/spec/chef_repo/cookbooks/nginx/attributes/source.rb +41 -0
- data/spec/chef_repo/cookbooks/nginx/attributes/upload_progress.rb +23 -0
- data/spec/chef_repo/cookbooks/nginx/chefignore +96 -0
- data/spec/chef_repo/cookbooks/nginx/definitions/nginx_site.rb +41 -0
- data/spec/chef_repo/cookbooks/nginx/files/default/mime.types +74 -0
- data/spec/chef_repo/cookbooks/nginx/files/default/naxsi_core.rules +82 -0
- data/spec/chef_repo/cookbooks/nginx/files/default/tests/minitest/default_test.rb +12 -0
- data/spec/chef_repo/cookbooks/nginx/files/default/tests/minitest/source_test.rb +9 -0
- data/spec/chef_repo/cookbooks/nginx/files/default/tests/minitest/support/helpers.rb +7 -0
- data/spec/chef_repo/cookbooks/nginx/metadata.json +315 -0
- data/spec/chef_repo/cookbooks/nginx/metadata.rb +113 -0
- data/spec/chef_repo/cookbooks/nginx/recipes/authorized_ips.rb +37 -0
- data/spec/chef_repo/cookbooks/nginx/recipes/commons.rb +23 -0
- data/spec/chef_repo/cookbooks/nginx/recipes/commons_conf.rb +40 -0
- data/spec/chef_repo/cookbooks/nginx/recipes/commons_dir.rb +41 -0
- data/spec/chef_repo/cookbooks/nginx/recipes/commons_script.rb +28 -0
- data/spec/chef_repo/cookbooks/nginx/recipes/default.rb +46 -0
- data/spec/chef_repo/cookbooks/nginx/recipes/headers_more_module.rb +54 -0
- data/spec/chef_repo/cookbooks/nginx/recipes/http_echo_module.rb +46 -0
- data/spec/chef_repo/cookbooks/nginx/recipes/http_geoip_module.rb +116 -0
- data/spec/chef_repo/cookbooks/nginx/recipes/http_gzip_static_module.rb +23 -0
- data/spec/chef_repo/cookbooks/nginx/recipes/http_realip_module.rb +42 -0
- data/spec/chef_repo/cookbooks/nginx/recipes/http_ssl_module.rb +23 -0
- data/spec/chef_repo/cookbooks/nginx/recipes/http_stub_status_module.rb +36 -0
- data/spec/chef_repo/cookbooks/nginx/recipes/ipv6.rb +22 -0
- data/spec/chef_repo/cookbooks/nginx/recipes/naxsi_module.rb +53 -0
- data/spec/chef_repo/cookbooks/nginx/recipes/ohai_plugin.rb +39 -0
- data/spec/chef_repo/cookbooks/nginx/recipes/passenger.rb +81 -0
- data/spec/chef_repo/cookbooks/nginx/recipes/repo.rb +42 -0
- data/spec/chef_repo/cookbooks/nginx/recipes/source.rb +204 -0
- data/spec/chef_repo/cookbooks/nginx/recipes/upload_progress_module.rb +46 -0
- data/spec/chef_repo/cookbooks/nginx/templates/debian/nginx.init.erb +97 -0
- data/spec/chef_repo/cookbooks/nginx/templates/default/default-site.erb +11 -0
- data/spec/chef_repo/cookbooks/nginx/templates/default/modules/authorized_ip.erb +6 -0
- data/spec/chef_repo/cookbooks/nginx/templates/default/modules/http_geoip.conf.erb +4 -0
- data/spec/chef_repo/cookbooks/nginx/templates/default/modules/http_realip.conf.erb +4 -0
- data/spec/chef_repo/cookbooks/nginx/templates/default/modules/nginx_status.erb +14 -0
- data/spec/chef_repo/cookbooks/nginx/templates/default/modules/passenger.conf.erb +10 -0
- data/spec/chef_repo/cookbooks/nginx/templates/default/nginx-upstart.conf.erb +40 -0
- data/spec/chef_repo/cookbooks/nginx/templates/default/nginx.conf.erb +69 -0
- data/spec/chef_repo/cookbooks/nginx/templates/default/nginx.init.erb +111 -0
- data/spec/chef_repo/cookbooks/nginx/templates/default/nginx.pill.erb +15 -0
- data/spec/chef_repo/cookbooks/nginx/templates/default/nginx.sysconfig.erb +1 -0
- data/spec/chef_repo/cookbooks/nginx/templates/default/nxdissite.erb +29 -0
- data/spec/chef_repo/cookbooks/nginx/templates/default/nxensite.erb +38 -0
- data/spec/chef_repo/cookbooks/nginx/templates/default/plugins/nginx.rb.erb +66 -0
- data/spec/chef_repo/cookbooks/nginx/templates/default/sv-nginx-log-run.erb +2 -0
- data/spec/chef_repo/cookbooks/nginx/templates/default/sv-nginx-run.erb +3 -0
- data/spec/chef_repo/cookbooks/nginx/templates/gentoo/nginx.init.erb +87 -0
- data/spec/chef_repo/cookbooks/nginx/templates/ubuntu/nginx.init.erb +97 -0
- data/spec/chef_repo/cookbooks/ohai/CHANGELOG.md +27 -0
- data/spec/chef_repo/cookbooks/ohai/CONTRIBUTING +29 -0
- data/spec/chef_repo/cookbooks/ohai/LICENSE +201 -0
- data/spec/chef_repo/cookbooks/ohai/README.md +49 -0
- data/spec/chef_repo/cookbooks/ohai/attributes/default.rb +29 -0
- data/spec/chef_repo/cookbooks/ohai/files/default/plugins/README +1 -0
- data/spec/chef_repo/cookbooks/ohai/metadata.json +60 -0
- data/spec/chef_repo/cookbooks/ohai/metadata.rb +23 -0
- data/spec/chef_repo/cookbooks/ohai/recipes/default.rb +54 -0
- data/spec/chef_repo/cookbooks/redis/README.md +76 -0
- data/spec/chef_repo/cookbooks/redis/attributes/default.rb +51 -0
- data/spec/chef_repo/cookbooks/redis/metadata.json +304 -0
- data/spec/chef_repo/cookbooks/redis/metadata.rb +112 -0
- data/spec/chef_repo/cookbooks/redis/recipes/client.rb +23 -0
- data/spec/chef_repo/cookbooks/redis/recipes/default.rb +34 -0
- data/spec/chef_repo/cookbooks/redis/recipes/install_from_package.rb +26 -0
- data/spec/chef_repo/cookbooks/redis/recipes/install_from_release.rb +30 -0
- data/spec/chef_repo/cookbooks/redis/recipes/server.rb +42 -0
- data/spec/chef_repo/cookbooks/redis/templates/default/redis.conf.erb +136 -0
- data/spec/chef_repo/cookbooks/redis/templates/default/sv-redis_server-log-run.erb +2 -0
- data/spec/chef_repo/cookbooks/redis/templates/default/sv-redis_server-run.erb +6 -0
- data/spec/chef_repo/cookbooks/runit/.gitignore +17 -0
- data/spec/chef_repo/cookbooks/runit/.kitchen.yml +53 -0
- data/spec/chef_repo/cookbooks/runit/Berksfile +12 -0
- data/spec/chef_repo/cookbooks/runit/CHANGELOG.md +97 -0
- data/spec/chef_repo/cookbooks/runit/CONTRIBUTING.md +257 -0
- data/spec/chef_repo/cookbooks/runit/Gemfile +8 -0
- data/spec/chef_repo/cookbooks/runit/LICENSE +201 -0
- data/spec/chef_repo/cookbooks/runit/README.md +448 -0
- data/spec/chef_repo/cookbooks/runit/Rakefile +17 -0
- data/spec/chef_repo/cookbooks/runit/attributes/default.rb +77 -0
- data/spec/chef_repo/cookbooks/runit/files/default/runit-2.1.1.tar.gz +0 -0
- data/spec/chef_repo/cookbooks/runit/files/default/runit.seed +1 -0
- data/spec/chef_repo/cookbooks/runit/files/default/runsvdir +0 -0
- data/spec/chef_repo/cookbooks/runit/files/ubuntu-6.10/runsvdir +6 -0
- data/spec/chef_repo/cookbooks/runit/files/ubuntu-7.04/runsvdir +7 -0
- data/spec/chef_repo/cookbooks/runit/files/ubuntu-7.10/runsvdir +7 -0
- data/spec/chef_repo/cookbooks/runit/files/ubuntu-8.04/runsvdir +7 -0
- data/spec/chef_repo/cookbooks/runit/libraries/default.rb +0 -0
- data/spec/chef_repo/cookbooks/runit/libraries/provider_runit_service.rb +428 -0
- data/spec/chef_repo/cookbooks/runit/libraries/resource_runit_service.rb +185 -0
- data/spec/chef_repo/cookbooks/runit/metadata.rb +16 -0
- data/spec/chef_repo/cookbooks/runit/recipes/default.rb +124 -0
- data/spec/chef_repo/cookbooks/runit/templates/debian/init.d.erb +66 -0
- data/spec/chef_repo/cookbooks/runit/templates/gentoo/runit-start.sh.erb +32 -0
- data/spec/chef_repo/cookbooks/yum/.gitignore +14 -0
- data/spec/chef_repo/cookbooks/yum/.kitchen.yml +22 -0
- data/spec/chef_repo/cookbooks/yum/Berksfile +7 -0
- data/spec/chef_repo/cookbooks/yum/CHANGELOG.md +97 -0
- data/spec/chef_repo/cookbooks/yum/CONTRIBUTING.md +257 -0
- data/spec/chef_repo/cookbooks/yum/LICENSE +201 -0
- data/spec/chef_repo/cookbooks/yum/README.md +270 -0
- data/spec/chef_repo/cookbooks/yum/attributes/default.rb +30 -0
- data/spec/chef_repo/cookbooks/yum/attributes/elrepo.rb +24 -0
- data/spec/chef_repo/cookbooks/yum/attributes/epel.rb +39 -0
- data/spec/chef_repo/cookbooks/yum/attributes/remi.rb +30 -0
- data/spec/chef_repo/cookbooks/yum/files/default/tests/minitest/default_test.rb +28 -0
- data/spec/chef_repo/cookbooks/yum/files/default/tests/minitest/support/helpers.rb +37 -0
- data/spec/chef_repo/cookbooks/yum/files/default/tests/minitest/test_test.rb +66 -0
- data/spec/chef_repo/cookbooks/yum/metadata.json +100 -0
- data/spec/chef_repo/cookbooks/yum/metadata.rb +37 -0
- data/spec/chef_repo/cookbooks/yum/providers/key.rb +79 -0
- data/spec/chef_repo/cookbooks/yum/providers/repository.rb +124 -0
- data/spec/chef_repo/cookbooks/yum/recipes/default.rb +18 -0
- data/spec/chef_repo/cookbooks/yum/recipes/elrepo.rb +31 -0
- data/spec/chef_repo/cookbooks/yum/recipes/epel.rb +35 -0
- data/spec/chef_repo/cookbooks/yum/recipes/ius.rb +42 -0
- data/spec/chef_repo/cookbooks/yum/recipes/remi.rb +35 -0
- data/spec/chef_repo/cookbooks/yum/recipes/repoforge.rb +41 -0
- data/spec/chef_repo/cookbooks/yum/recipes/test.rb +39 -0
- data/spec/chef_repo/cookbooks/yum/recipes/yum.rb +23 -0
- data/spec/chef_repo/cookbooks/yum/resources/key.rb +29 -0
- data/spec/chef_repo/cookbooks/yum/resources/repository.rb +41 -0
- data/spec/chef_repo/cookbooks/yum/templates/default/repo.erb +38 -0
- data/spec/chef_repo/cookbooks/yum/templates/default/yum-rhel5.conf.erb +33 -0
- data/spec/chef_repo/cookbooks/yum/templates/default/yum-rhel6.conf.erb +36 -0
- data/spec/chef_repo/data_bags/.gitkeep +0 -0
- data/spec/chef_repo/data_bags/sample/items.json +1 -0
- data/spec/chef_repo/roles/.gitkeep +0 -0
- data/spec/chef_repo/roles/dummy.json +14 -0
- data/spec/chef_repo/site-cookbooks/.gitkeep +0 -0
- data/spec/chef_repo/site-cookbooks/sample/CHANGELOG.md +12 -0
- data/spec/chef_repo/site-cookbooks/sample/README.md +68 -0
- data/spec/chef_repo/site-cookbooks/sample/metadata.rb +7 -0
- data/spec/chef_repo/site-cookbooks/sample/recipes/default.rb +18 -0
- data/spec/chef_repo/solo.rb +3 -0
- data/spec/fixtures/items.json +1 -0
- data/spec/spec_helper.rb +32 -0
- metadata +880 -0
@@ -0,0 +1,77 @@
|
|
1
|
+
#
|
2
|
+
# Cookbook Name:: runit
|
3
|
+
# Attribute File:: sv_bin
|
4
|
+
#
|
5
|
+
# Copyright 2008-2009, Opscode, Inc.
|
6
|
+
#
|
7
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
+
# you may not use this file except in compliance with the License.
|
9
|
+
# You may obtain a copy of the License at
|
10
|
+
#
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
#
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
+
# See the License for the specific language governing permissions and
|
17
|
+
# limitations under the License.
|
18
|
+
#
|
19
|
+
|
20
|
+
case node["platform_family"]
|
21
|
+
when "debian"
|
22
|
+
|
23
|
+
default["runit"]["sv_bin"] = "/usr/bin/sv"
|
24
|
+
default["runit"]["chpst_bin"] = "/usr/bin/chpst"
|
25
|
+
default["runit"]["service_dir"] = "/etc/service"
|
26
|
+
default["runit"]["sv_dir"] = "/etc/sv"
|
27
|
+
default["runit"]["executable"] = "/sbin/runit"
|
28
|
+
|
29
|
+
if node["platform"] == "debian"
|
30
|
+
|
31
|
+
default["runit"]["start"] = "runsvdir-start"
|
32
|
+
default["runit"]["stop"] = ""
|
33
|
+
default["runit"]["reload"] = ""
|
34
|
+
|
35
|
+
elsif node["platform"] == "ubuntu"
|
36
|
+
|
37
|
+
default["runit"]["start"] = "start runsvdir"
|
38
|
+
default["runit"]["stop"] = "stop runsvdir"
|
39
|
+
default["runit"]["reload"] = "reload runsvdir"
|
40
|
+
|
41
|
+
end
|
42
|
+
|
43
|
+
when "rhel"
|
44
|
+
|
45
|
+
default["runit"]["sv_bin"] = "/sbin/sv"
|
46
|
+
default["runit"]["chpst_bin"] = "/sbin/chpst"
|
47
|
+
default["runit"]["service_dir"] = "/etc/service"
|
48
|
+
default["runit"]["sv_dir"] = "/etc/sv"
|
49
|
+
default["runit"]["executable"] = "/sbin/runit"
|
50
|
+
|
51
|
+
if node["platform_version"].to_i < 6
|
52
|
+
|
53
|
+
default["runit"]["start"] = "/etc/init.d/runit-start start"
|
54
|
+
default["runit"]["stop"] = "/etc/init.d/runit-start stop"
|
55
|
+
default["runit"]["reload"] = "/etc/init.d/runit-start reload"
|
56
|
+
|
57
|
+
else
|
58
|
+
|
59
|
+
default["runit"]["start"] = "/etc/init.d/runit-start start"
|
60
|
+
default["runit"]["stop"] = "/etc/init.d/runit-start stop"
|
61
|
+
default["runit"]["reload"] = "/etc/init.d/runit-start reload"
|
62
|
+
|
63
|
+
end
|
64
|
+
|
65
|
+
when "gentoo"
|
66
|
+
|
67
|
+
default["runit"]["sv_bin"] = "/usr/bin/sv"
|
68
|
+
default["runit"]["chpst_bin"] = "/usr/bin/chpst"
|
69
|
+
default["runit"]["service_dir"] = "/var/service"
|
70
|
+
default["runit"]["sv_dir"] = "/etc/sv"
|
71
|
+
default["runit"]["executable"] = "/sbin/runit"
|
72
|
+
default["runit"]["start"] = "/etc/init.d/runit-start start"
|
73
|
+
default["runit"]["stop"] = "/etc/init.d/runit-start stop"
|
74
|
+
default["runit"]["reload"] = "/etc/init.d/runit-start reload"
|
75
|
+
|
76
|
+
end
|
77
|
+
|
Binary file
|
@@ -0,0 +1 @@
|
|
1
|
+
runit runit/signalinit boolean true
|
File without changes
|
File without changes
|
@@ -0,0 +1,428 @@
|
|
1
|
+
#
|
2
|
+
# Cookbook Name:: runit
|
3
|
+
# Provider:: service
|
4
|
+
#
|
5
|
+
# Copyright 2011, Joshua Timberman
|
6
|
+
# Copyright 2011, Opscode, Inc.
|
7
|
+
#
|
8
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
9
|
+
# you may not use this file except in compliance with the License.
|
10
|
+
# You may obtain a copy of the License at
|
11
|
+
#
|
12
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
13
|
+
#
|
14
|
+
# Unless required by applicable law or agreed to in writing, software
|
15
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
16
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
17
|
+
# See the License for the specific language governing permissions and
|
18
|
+
# limitations under the License.
|
19
|
+
#
|
20
|
+
|
21
|
+
require 'chef/provider/service'
|
22
|
+
require 'chef/provider/link'
|
23
|
+
require 'chef/resource/link'
|
24
|
+
require 'chef/provider/directory'
|
25
|
+
require 'chef/resource/directory'
|
26
|
+
require 'chef/provider/template'
|
27
|
+
require 'chef/resource/template'
|
28
|
+
require 'chef/provider/file'
|
29
|
+
require 'chef/resource/file'
|
30
|
+
require 'chef/mixin/shell_out'
|
31
|
+
require 'chef/mixin/language'
|
32
|
+
|
33
|
+
class Chef
|
34
|
+
class Provider
|
35
|
+
class Service
|
36
|
+
class Runit < Chef::Provider::Service
|
37
|
+
include Chef::Mixin::ShellOut
|
38
|
+
|
39
|
+
def initialize(*args)
|
40
|
+
super
|
41
|
+
@sv_dir = nil
|
42
|
+
@run_script = nil
|
43
|
+
@log_dir = nil
|
44
|
+
@log_main_dir = nil
|
45
|
+
@default_log_dir = nil
|
46
|
+
@log_run_script = nil
|
47
|
+
@env_dir = nil
|
48
|
+
@env_files = nil
|
49
|
+
@finish_script = nil
|
50
|
+
@control_dir = nil
|
51
|
+
@control_signal_files = nil
|
52
|
+
@lsb_init = nil
|
53
|
+
@service_link = nil
|
54
|
+
@new_resource.supports[:status] = true
|
55
|
+
end
|
56
|
+
|
57
|
+
def load_current_resource
|
58
|
+
@current_resource = Chef::Resource::RunitService.new(new_resource.name)
|
59
|
+
@current_resource.service_name(new_resource.service_name)
|
60
|
+
|
61
|
+
Chef::Log.debug("Checking status of service #{new_resource.service_name}")
|
62
|
+
|
63
|
+
# verify Runit was installed properly
|
64
|
+
unless ::File.exist?(new_resource.sv_bin) && ::File.executable?(new_resource.sv_bin)
|
65
|
+
no_runit_message = "Could not locate main runit sv_bin at \"#{new_resource.sv_bin}\". "
|
66
|
+
no_runit_message << "Did you remember to install runit before declaring a \"runit_service\" resource? "
|
67
|
+
no_runit_message << "\n\nTry adding the following to the top of your recipe:\n\ninclude_recipe \"runit\""
|
68
|
+
raise no_runit_message
|
69
|
+
end
|
70
|
+
|
71
|
+
@current_resource.running(running?)
|
72
|
+
@current_resource.enabled(enabled?)
|
73
|
+
@current_resource
|
74
|
+
end
|
75
|
+
|
76
|
+
#
|
77
|
+
# Chef::Provider::Service overrides
|
78
|
+
#
|
79
|
+
|
80
|
+
def action_enable
|
81
|
+
converge_by("configure service #{@new_resource}") do
|
82
|
+
configure_service # Do this every run, even if service is already enabled and running
|
83
|
+
Chef::Log.info("#{@new_resource} configured")
|
84
|
+
end
|
85
|
+
if @current_resource.enabled
|
86
|
+
Chef::Log.debug("#{@new_resource} already enabled - nothing to do")
|
87
|
+
else
|
88
|
+
converge_by("enable service #{@new_resource}") do
|
89
|
+
enable_service
|
90
|
+
Chef::Log.info("#{@new_resource} enabled")
|
91
|
+
end
|
92
|
+
end
|
93
|
+
load_new_resource_state
|
94
|
+
@new_resource.enabled(true)
|
95
|
+
restart_service if @new_resource.restart_on_update and run_script.updated_by_last_action?
|
96
|
+
end
|
97
|
+
|
98
|
+
def configure_service
|
99
|
+
if new_resource.sv_templates
|
100
|
+
Chef::Log.debug("Creating sv_dir for #{new_resource.service_name}")
|
101
|
+
sv_dir.run_action(:create)
|
102
|
+
Chef::Log.debug("Creating run_script for #{new_resource.service_name}")
|
103
|
+
run_script.run_action(:create)
|
104
|
+
|
105
|
+
if new_resource.log
|
106
|
+
Chef::Log.debug("Setting up svlog for #{new_resource.service_name}")
|
107
|
+
log_dir.run_action(:create)
|
108
|
+
log_main_dir.run_action(:create)
|
109
|
+
default_log_dir.run_action(:create) if new_resource.default_logger
|
110
|
+
log_run_script.run_action(:create)
|
111
|
+
else
|
112
|
+
Chef::Log.debug("log not specified for #{new_resource.service_name}, continuing")
|
113
|
+
end
|
114
|
+
|
115
|
+
unless new_resource.env.empty?
|
116
|
+
Chef::Log.debug("Setting up environment files for #{new_resource.service_name}")
|
117
|
+
env_dir.run_action(:create)
|
118
|
+
env_files.each {|file| file.run_action(:create)}
|
119
|
+
else
|
120
|
+
Chef::Log.debug("Environment not specified for #{new_resource.service_name}, continuing")
|
121
|
+
|
122
|
+
end
|
123
|
+
|
124
|
+
if new_resource.finish
|
125
|
+
Chef::Log.debug("Creating finish script for #{new_resource.service_name}")
|
126
|
+
finish_script.run_action(:create)
|
127
|
+
else
|
128
|
+
Chef::Log.debug("Finish script not specified for #{new_resource.service_name}, continuing")
|
129
|
+
end
|
130
|
+
|
131
|
+
unless new_resource.control.empty?
|
132
|
+
Chef::Log.debug("Creating control signal scripts for #{new_resource.service_name}")
|
133
|
+
control_dir.run_action(:create)
|
134
|
+
control_signal_files.each {|file| file.run_action(:create)}
|
135
|
+
else
|
136
|
+
Chef::Log.debug("Control signals not specified for #{new_resource.service_name}, continuing")
|
137
|
+
end
|
138
|
+
end
|
139
|
+
|
140
|
+
Chef::Log.debug("Creating lsb_init compatible interface #{new_resource.service_name}")
|
141
|
+
lsb_init.run_action(:create)
|
142
|
+
end
|
143
|
+
|
144
|
+
def enable_service
|
145
|
+
Chef::Log.debug("Creating symlink in service_dir for #{new_resource.service_name}")
|
146
|
+
service_link.run_action(:create)
|
147
|
+
|
148
|
+
Chef::Log.debug("waiting until named pipe #{service_dir_name}/supervise/ok exists.")
|
149
|
+
until ::FileTest.pipe?("#{service_dir_name}/supervise/ok") do
|
150
|
+
sleep 1
|
151
|
+
Chef::Log.debug(".")
|
152
|
+
end
|
153
|
+
end
|
154
|
+
|
155
|
+
def disable_service
|
156
|
+
shell_out("#{new_resource.sv_bin} down #{service_dir_name}")
|
157
|
+
Chef::Log.debug("#{new_resource} down")
|
158
|
+
FileUtils.rm(service_dir_name)
|
159
|
+
Chef::Log.debug("#{new_resource} service symlink removed")
|
160
|
+
end
|
161
|
+
|
162
|
+
def start_service
|
163
|
+
shell_out!("#{new_resource.sv_bin} start #{service_dir_name}")
|
164
|
+
end
|
165
|
+
|
166
|
+
def stop_service
|
167
|
+
shell_out!("#{new_resource.sv_bin} stop #{service_dir_name}")
|
168
|
+
end
|
169
|
+
|
170
|
+
def restart_service
|
171
|
+
shell_out!("#{new_resource.sv_bin} restart #{service_dir_name}")
|
172
|
+
end
|
173
|
+
|
174
|
+
def reload_service
|
175
|
+
shell_out!("#{new_resource.sv_bin} force-reload #{service_dir_name}")
|
176
|
+
end
|
177
|
+
|
178
|
+
#
|
179
|
+
# Addtional Runit-only actions
|
180
|
+
#
|
181
|
+
|
182
|
+
# only take action if the service is running
|
183
|
+
[:down, :hup, :int, :term, :kill, :quit].each do |signal|
|
184
|
+
define_method "action_#{signal}".to_sym do
|
185
|
+
if @current_resource.running
|
186
|
+
runit_send_signal(signal)
|
187
|
+
else
|
188
|
+
Chef::Log.debug("#{new_resource} not running - nothing to do")
|
189
|
+
end
|
190
|
+
end
|
191
|
+
end
|
192
|
+
|
193
|
+
# only take action if service is *not* running
|
194
|
+
[:up, :once, :cont].each do |signal|
|
195
|
+
define_method "action_#{signal}".to_sym do
|
196
|
+
if @current_resource.running
|
197
|
+
Chef::Log.debug("#{new_resource} already running - nothing to do")
|
198
|
+
else
|
199
|
+
runit_send_signal(signal)
|
200
|
+
end
|
201
|
+
end
|
202
|
+
end
|
203
|
+
|
204
|
+
def action_usr1
|
205
|
+
runit_send_signal(1, :usr1)
|
206
|
+
end
|
207
|
+
|
208
|
+
def action_usr2
|
209
|
+
runit_send_signal(2, :usr2)
|
210
|
+
end
|
211
|
+
|
212
|
+
private
|
213
|
+
|
214
|
+
def runit_send_signal(signal, friendly_name=nil)
|
215
|
+
friendly_name ||= signal
|
216
|
+
converge_by("send #{friendly_name} to #{new_resource}") do
|
217
|
+
shell_out!("#{new_resource.sv_bin} #{signal} #{service_dir_name}")
|
218
|
+
Chef::Log.info("#{new_resource} sent #{friendly_name}")
|
219
|
+
new_resource.updated_by_last_action(true)
|
220
|
+
end
|
221
|
+
end
|
222
|
+
|
223
|
+
def running?
|
224
|
+
cmd = shell_out("#{new_resource.sv_bin} status #{new_resource.service_name}")
|
225
|
+
(cmd.stdout =~ /^run:/ && cmd.exitstatus == 0)
|
226
|
+
end
|
227
|
+
|
228
|
+
def enabled?
|
229
|
+
::File.exists?(::File.join(service_dir_name, "run"))
|
230
|
+
end
|
231
|
+
|
232
|
+
def sv_dir_name
|
233
|
+
::File.join(new_resource.sv_dir, new_resource.service_name)
|
234
|
+
end
|
235
|
+
|
236
|
+
def service_dir_name
|
237
|
+
::File.join(new_resource.service_dir, new_resource.service_name)
|
238
|
+
end
|
239
|
+
|
240
|
+
def template_cookbook
|
241
|
+
new_resource.cookbook.nil? ? new_resource.cookbook_name.to_s : new_resource.cookbook
|
242
|
+
end
|
243
|
+
|
244
|
+
def default_logger_content
|
245
|
+
return <<-EOF
|
246
|
+
#!/bin/sh
|
247
|
+
exec svlogd -tt /var/log/#{new_resource.service_name}
|
248
|
+
EOF
|
249
|
+
end
|
250
|
+
|
251
|
+
#
|
252
|
+
# Helper Resources
|
253
|
+
#
|
254
|
+
def sv_dir
|
255
|
+
return @sv_dir unless @sv_dir.nil?
|
256
|
+
@sv_dir = Chef::Resource::Directory.new(sv_dir_name, run_context)
|
257
|
+
@sv_dir.recursive(true)
|
258
|
+
@sv_dir.owner(new_resource.owner)
|
259
|
+
@sv_dir.group(new_resource.group)
|
260
|
+
@sv_dir.mode(00755)
|
261
|
+
@sv_dir
|
262
|
+
end
|
263
|
+
|
264
|
+
def run_script
|
265
|
+
return @run_script unless @run_script.nil?
|
266
|
+
@run_script = Chef::Resource::Template.new(::File.join(sv_dir_name, 'run'), run_context)
|
267
|
+
@run_script.owner(new_resource.owner)
|
268
|
+
@run_script.group(new_resource.group)
|
269
|
+
@run_script.source("sv-#{new_resource.run_template_name}-run.erb")
|
270
|
+
@run_script.cookbook(template_cookbook)
|
271
|
+
@run_script.mode(00755)
|
272
|
+
if new_resource.options.respond_to?(:has_key?)
|
273
|
+
@run_script.variables(:options => new_resource.options)
|
274
|
+
end
|
275
|
+
@run_script
|
276
|
+
end
|
277
|
+
|
278
|
+
def log_dir
|
279
|
+
return @log_dir unless @log_dir.nil?
|
280
|
+
@log_dir = Chef::Resource::Directory.new(::File.join(sv_dir_name, 'log'), run_context)
|
281
|
+
@log_dir.recursive(true)
|
282
|
+
@log_dir.owner(new_resource.owner)
|
283
|
+
@log_dir.group(new_resource.group)
|
284
|
+
@log_dir.mode(00755)
|
285
|
+
@log_dir
|
286
|
+
end
|
287
|
+
|
288
|
+
def log_main_dir
|
289
|
+
return @log_main_dir unless @log_main_dir.nil?
|
290
|
+
@log_main_dir = Chef::Resource::Directory.new(::File.join(sv_dir_name, 'log', 'main'), run_context)
|
291
|
+
@log_main_dir.recursive(true)
|
292
|
+
@log_main_dir.owner(new_resource.owner)
|
293
|
+
@log_main_dir.group(new_resource.group)
|
294
|
+
@log_main_dir.mode(00755)
|
295
|
+
@log_main_dir
|
296
|
+
end
|
297
|
+
|
298
|
+
def default_log_dir
|
299
|
+
return @default_log_dir unless @default_log_dir.nil?
|
300
|
+
@default_log_dir = Chef::Resource::Directory.new(::File.join("/var/log/#{new_resource.service_name}"), run_context)
|
301
|
+
@default_log_dir.recursive(true)
|
302
|
+
@default_log_dir.owner(new_resource.owner)
|
303
|
+
@default_log_dir.group(new_resource.group)
|
304
|
+
@default_log_dir.mode(00755)
|
305
|
+
@default_log_dir
|
306
|
+
end
|
307
|
+
|
308
|
+
def log_run_script
|
309
|
+
return @log_run_script unless @log_run_script.nil?
|
310
|
+
if new_resource.default_logger
|
311
|
+
@log_run_script = Chef::Resource::File.new(::File.join( sv_dir_name,
|
312
|
+
'log',
|
313
|
+
'run' ),
|
314
|
+
run_context)
|
315
|
+
@log_run_script.content(default_logger_content)
|
316
|
+
@log_run_script.owner(new_resource.owner)
|
317
|
+
@log_run_script.group(new_resource.group)
|
318
|
+
@log_run_script.mode(00755)
|
319
|
+
else
|
320
|
+
@log_run_script = Chef::Resource::Template.new(::File.join( sv_dir_name,
|
321
|
+
'log',
|
322
|
+
'run' ),
|
323
|
+
run_context)
|
324
|
+
@log_run_script.owner(new_resource.owner)
|
325
|
+
@log_run_script.group(new_resource.group)
|
326
|
+
@log_run_script.mode(00755)
|
327
|
+
@log_run_script.source("sv-#{new_resource.log_template_name}-log-run.erb")
|
328
|
+
@log_run_script.cookbook(template_cookbook)
|
329
|
+
if new_resource.options.respond_to?(:has_key?)
|
330
|
+
@log_run_script.variables(:options => new_resource.options)
|
331
|
+
end
|
332
|
+
end
|
333
|
+
@log_run_script
|
334
|
+
end
|
335
|
+
|
336
|
+
def env_dir
|
337
|
+
return @env_dir unless @env_dir.nil?
|
338
|
+
@env_dir = Chef::Resource::Directory.new(::File.join(sv_dir_name, 'env'), run_context)
|
339
|
+
@env_dir.owner(new_resource.owner)
|
340
|
+
@env_dir.group(new_resource.group)
|
341
|
+
@env_dir.mode(00755)
|
342
|
+
@env_dir
|
343
|
+
end
|
344
|
+
|
345
|
+
def env_files
|
346
|
+
return @env_files unless @env_files.nil?
|
347
|
+
@env_files = new_resource.env.map do |var, value|
|
348
|
+
env_file = Chef::Resource::File.new(::File.join(sv_dir_name, 'env', var), run_context)
|
349
|
+
env_file.owner(new_resource.owner)
|
350
|
+
env_file.group(new_resource.group)
|
351
|
+
env_file.content(value)
|
352
|
+
env_file
|
353
|
+
end
|
354
|
+
@env_files
|
355
|
+
end
|
356
|
+
|
357
|
+
def finish_script
|
358
|
+
return @finish_script unless @finish_script.nil?
|
359
|
+
@finish_script = Chef::Resource::Template.new(::File.join(sv_dir_name, 'finish'), run_context)
|
360
|
+
@finish_script.owner(new_resource.owner)
|
361
|
+
@finish_script.group(new_resource.group)
|
362
|
+
@finish_script.mode(00755)
|
363
|
+
@finish_script.source("sv-#{new_resource.finish_script_template_name}-finish.erb")
|
364
|
+
@finish_script.cookbook(template_cookbook)
|
365
|
+
if new_resource.options.respond_to?(:has_key?)
|
366
|
+
@finish_script.variables(:options => new_resource.options)
|
367
|
+
end
|
368
|
+
@finish_script
|
369
|
+
end
|
370
|
+
|
371
|
+
def control_dir
|
372
|
+
return @control_dir unless @control_dir.nil?
|
373
|
+
@control_dir = Chef::Resource::Directory.new(::File.join(sv_dir_name, 'control'), run_context)
|
374
|
+
@control_dir.owner(new_resource.owner)
|
375
|
+
@control_dir.group(new_resource.group)
|
376
|
+
@control_dir.mode(00755)
|
377
|
+
@control_dir
|
378
|
+
end
|
379
|
+
|
380
|
+
def control_signal_files
|
381
|
+
return @control_signal_files unless @control_signal_files.nil?
|
382
|
+
@control_signal_files = new_resource.control.map do |signal|
|
383
|
+
control_signal_file = Chef::Resource::Template.new(::File.join( sv_dir_name,
|
384
|
+
'control',
|
385
|
+
signal),
|
386
|
+
run_context)
|
387
|
+
control_signal_file.owner(new_resource.owner)
|
388
|
+
control_signal_file.group(new_resource.group)
|
389
|
+
control_signal_file.mode(00755)
|
390
|
+
control_signal_file.source("sv-#{new_resource.control_template_names[signal]}-#{signal}.erb")
|
391
|
+
control_signal_file.cookbook(template_cookbook)
|
392
|
+
if new_resource.options.respond_to?(:has_key?)
|
393
|
+
control_signal_file.variables(:options => new_resource.options)
|
394
|
+
end
|
395
|
+
control_signal_file
|
396
|
+
end
|
397
|
+
@control_signal_files
|
398
|
+
end
|
399
|
+
|
400
|
+
def lsb_init
|
401
|
+
return @lsb_init unless @lsb_init.nil?
|
402
|
+
initfile = ::File.join( '/etc', 'init.d', new_resource.service_name)
|
403
|
+
if node['platform'] == 'debian'
|
404
|
+
::File.unlink(initfile) if ::File.symlink?(initfile)
|
405
|
+
@lsb_init = Chef::Resource::Template.new(initfile, run_context)
|
406
|
+
@lsb_init.owner('root')
|
407
|
+
@lsb_init.group('root')
|
408
|
+
@lsb_init.mode(00755)
|
409
|
+
@lsb_init.cookbook('runit')
|
410
|
+
@lsb_init.source('init.d.erb')
|
411
|
+
@lsb_init.variables(:name => new_resource.service_name)
|
412
|
+
else
|
413
|
+
@lsb_init = Chef::Resource::Link.new(initfile, run_context)
|
414
|
+
@lsb_init.to(new_resource.sv_bin)
|
415
|
+
end
|
416
|
+
@lsb_init
|
417
|
+
end
|
418
|
+
|
419
|
+
def service_link
|
420
|
+
return @service_link unless @service_link.nil?
|
421
|
+
@service_link = Chef::Resource::Link.new(::File.join(service_dir_name), run_context)
|
422
|
+
@service_link.to(sv_dir_name)
|
423
|
+
@service_link
|
424
|
+
end
|
425
|
+
end
|
426
|
+
end
|
427
|
+
end
|
428
|
+
end
|