Commit c5c77448 authored by Paul Ilea's avatar Paul Ilea
Browse files

[TASK] Implement fallback to ubuntu_base configuration

parent 2f94b10e
default['webgrind']['ip_address'] = ''
default['webgrind']['hostname'] = ''
default['webgrind']['ip_address'] = false
default['webgrind']['hostname'] = false
default['webgrind']['base_hostname'] = false
default['webgrind']['install_path'] = '/opt/webgrind'
\ No newline at end of file
......@@ -22,11 +22,14 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
webgrind_ip_address = node['webgrind']['ip_address'] || node['ubuntu_base']['ip_address']
webgrind_hostname = node['webgrind']['hostname'] || "webgrind.#{node['ubuntu_base']['hostname']}"
if node['platform_version'] == '16.04'
include_recipe 'webgrind::webgrind'
hostsfile_entry node['webgrind']['ip_address'] do
hostname node['webgrind']['hostname']
hostsfile_entry webgrind_ip_address do
hostname webgrind_hostname
action :append
end
else
......
......@@ -28,6 +28,10 @@
package 'graphviz'
webgrind_ip_address = node['webgrind']['ip_address'] || node['ubuntu_base']['ip_address']
base_hostname = node['webgrind']['base_hostname'] || node['ubuntu_base']['hostname']
webgrind_hostname = node['webgrind']['hostname'] || "webgrind.#{base_hostname}"
#######################
### Download XhProf ###
#######################
......@@ -61,18 +65,21 @@ end
##########################
# ssl certificate needed (requires that typo3_site (or a kind of) was executed before this script)
web_app node['webgrind']['hostname'] do
server_name node['webgrind']['hostname']
web_app webgrind_hostname do
server_name webgrind_hostname
apache node['apache']
docroot node['webgrind']['install_path'] + '/'
end
node.default['webgrind']['base_hostname'] = node['typo3_site']['hostname']
template '/etc/apache2/sites-available/' + node['webgrind']['hostname'] + '.conf' do
template '/etc/apache2/sites-available/' + webgrind_hostname + '.conf' do
source 'web_app.conf.erb'
mode '0644'
variables(
:params => node['webgrind']
:params => {
:install_path => node['webgrind']['install_path'],
:hostname => webgrind_hostname,
:base_hostname => base_hostname
}
)
action :create
end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment