From f31b0c17013abd4ba0270784435a2f9309c9db8b Mon Sep 17 00:00:00 2001 From: David Brown Date: Sat, 30 Jan 2016 08:50:29 -0800 Subject: [PATCH] work with apache2 cookbook instead of breaking --- .kitchen.yml | 6 +++++ metadata.rb | 5 ++-- recipes/apache.rb | 13 ++++++++++ recipes/default.rb | 2 ++ templates/default/cobbler.conf.erb | 38 ++++++++++++++++++++++++++++++ 5 files changed, 62 insertions(+), 2 deletions(-) create mode 100644 recipes/apache.rb create mode 100644 templates/default/cobbler.conf.erb diff --git a/.kitchen.yml b/.kitchen.yml index 856e4d2..bedb001 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -21,6 +21,12 @@ suites: - name: default run_list: - 'recipe[cobblerd::default]' + - name: apache2 + run_list: + - 'recipe[cobblerd::default]' + attributes: + cobbler: + include_apache2: true - name: images run_list: - 'recipe[cobblerd::centos]' diff --git a/metadata.rb b/metadata.rb index 4fd54b6..cca763b 100644 --- a/metadata.rb +++ b/metadata.rb @@ -16,5 +16,6 @@ supports 'ubuntu', '= 14.04' depends 'poise', '~> 1.0' -recommends 'apt', '~> 2.4' -recommends 'yum-epel', '~> 0.3' +depends 'apt', '~> 2.4' +depends 'yum-epel', '~> 0.3' +depends 'apache2' diff --git a/recipes/apache.rb b/recipes/apache.rb new file mode 100644 index 0000000..3c82a0c --- /dev/null +++ b/recipes/apache.rb @@ -0,0 +1,13 @@ +include_recipe 'apache2' +include_recipe 'apache2::mod_proxy' +include_recipe 'apache2::mod_proxy_http' + +apache_module 'wsgi' + +web_app "cobbler" do + template "cobbler.conf.erb" +end + +service 'httpd' do + action [:enable, :start] +end diff --git a/recipes/default.rb b/recipes/default.rb index edf31a4..f3cde5b 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -6,8 +6,10 @@ # include_recipe 'yum-epel::default' if node[:platform_family] == "rhel" include_recipe 'apt::default' if node[:platform_family] == "debian" +include_recipe 'cobblerd::apache' if node[:cobbler][:include_apache2] package 'cobbler' +package 'syslinux' service 'cobbler' do action [:enable, :start] diff --git a/templates/default/cobbler.conf.erb b/templates/default/cobbler.conf.erb new file mode 100644 index 0000000..d9bd177 --- /dev/null +++ b/templates/default/cobbler.conf.erb @@ -0,0 +1,38 @@ +# This configuration file allows cobbler data +# to be accessed over HTTP. + +AliasMatch ^/cblr(?!/svc/)(.*)?$ "/var/www/cobbler" +AliasMatch ^/cobbler_track(.*)?$ "/var/www/cobbler" +#AliasMatch ^/cobbler(.*)?$ "/var/www/cobbler" +Alias /cobbler /var/www/cobbler +Alias /cobbler_webui_content /var/www/cobbler_webui_content + +WSGIScriptAliasMatch ^/cblr/svc/([^/]*) /var/www/cobbler/svc/services.py + + + Options Indexes FollowSymLinks + Order allow,deny + Allow from all + + +ProxyRequests off + +ProxyPass /cobbler_api http://localhost:25151/ +ProxyPassReverse /cobbler_api http://localhost:25151/ + + Order allow,deny + Allow from all + + +BrowserMatch "MSIE" AuthDigestEnableQueryStringHack=On + +# the webui is now part of the "cobbler-web" package +# and is visited at http://.../cobbler_web not this URL. +# this is only a pointer to the new page. + + + Options Indexes FollowSymLinks + Order allow,deny + Allow from all + +