<commit_before># Cookbook Name:: abiquo
# Attributes:: abiquo
#
# Copyright 2014, Abiquo
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# The profile to install: monolithic, remoteservices or kvm
default['abiquo']['profile'] = "monolithic"

# Wether or not to install external dependant services
# like MariaDB, Redis, RabbitMQ
# Set to false if you wish to use existing servers.
default['abiquo']['install_ext_services'] = true

# Attribute to use to setup UI config file.
# Change to 'ipaddress' to use IP instead of fqdn.
# 'fixed' will setup node['abiquo']['ui_address']
default['abiquo']['ui_address_type'] = 'fqdn'
default['abiquo']['ui_address'] = node['fqdn']

# Common properties
default['abiquo']['license'] = nil

# NFS repository configuration
default['abiquo']['nfs']['mountpoint'] = "/opt/vm_repository"
default['abiquo']['nfs']['location'] = nil  # Change to something like: "127.0.0.1:/opt/vm_repository"

# Yum repository configuration
default['abiquo']['yum']['base-repo'] = "http://mirror.abiquo.com/abiquo/3.8/os/x86_64"
default['abiquo']['yum']['updates-repo'] = "http://mirror.abiquo.com/abiquo/3.8/updates/x86_64"
default['abiquo']['yum']['gpg-check'] = true

# Database configuration
default['abiquo']['db']['host'] = "localhost"
default['abiquo']['db']['port'] = 3306
default['abiquo']['db']['user'] = "root"
default['abiquo']['db']['password'] = nil
default['abiquo']['db']['upgrade'] = true

# Tomcat configuration 
default['abiquo']['tomcat']['http-port'] = 8009
default['abiquo']['tomcat']['ajp-port'] = 8010
default['abiquo']['tomcat']['wait-for-webapps'] = false

# Wheter or not to generate a self signed certificate
# for this host. If not, provide path to certificate,
# private key and optionally a CA cert. The cookbook
# does not manage the certificate files path provided
# for non generated certificates.
default['abiquo']['certificate']['common_name'] = node['fqdn']
default['abiquo']['certificate']['organization'] = 'Abiquo'
default['abiquo']['certificate']['department'] = 'Engineering'
default['abiquo']['certificate']['country'] = 'ES'
default['abiquo']['certificate']['source'] = 'self-signed'
default['abiquo']['certificate']['file'] = "/etc/pki/abiquo/#{node['abiquo']['certificate']['common_name']}.crt"
default['abiquo']['certificate']['key_file'] = "/etc/pki/abiquo/#{node['abiquo']['certificate']['common_name']}.key"
default['abiquo']['certificate']['ca_file'] = nil

# Configure abiquo KVM
default['abiquo']['aim']['port'] = 8889

# Configure monitoring node
default['abiquo']['monitoring']['cassandra']['cluster_name'] = 'abiquo'
default['abiquo']['monitoring']['kairosdb']['version'] = '0.9.4'
default['abiquo']['monitoring']['kairosdb']['release'] = '6'
default['abiquo']['monitoring']['kairosdb']['host'] = 'localhost'
default['abiquo']['monitoring']['kairosdb']['port'] = 8080
default['abiquo']['monitoring']['rabbitmq']['host'] = 'localhost'
default['abiquo']['monitoring']['rabbitmq']['port'] = 5672
default['abiquo']['monitoring']['rabbitmq']['username'] = 'abiquo'
default['abiquo']['monitoring']['rabbitmq']['password'] = '<PASSWORD>'
default['abiquo']['monitoring']['db']['host'] = 'localhost'
default['abiquo']['monitoring']['db']['port'] = 3306
default['abiquo']['monitoring']['db']['user'] = 'root'
default['abiquo']['monitoring']['db']['password'] = ''
default['abiquo']['monitoring']['db']['install'] = true
default['abiquo']['monitoring']['emmett']['port'] = 36638

# Override the Apache proxy configuration
override['apache']['proxy']['order'] = "allow,deny"
override['apache']['proxy']['deny_from']  = "none"
override['apache']['proxy']['allow_from'] = "all"

# Override the default java configuration
# TODO: Configure these attributes in a way that they don't have precedence over user config
override['java']['oracle']['accept_oracle_download_terms'] = true
override['java']['java_home'] = "/usr/java/default"
override['java']['jdk_version'] = 8

# Default properties
default['abiquo']['properties']['abiquo.datacenter.id'] = node['hostname']
default['abiquo']['properties']['abiquo.rabbitmq.username'] = 'abiquo'
default['abiquo']['properties']['abiquo.rabbitmq.password'] = '<PASSWORD>'
default['abiquo']['properties']['abiquo.rabbitmq.host'] = '127.0.0.1'
default['abiquo']['properties']['abiquo.rabbitmq.port'] = 5672
default['abiquo']['properties']['abiquo.vncport.min'] = 6000
default['abiquo']['properties']['abiquo.vncport.max'] = 6999

case node['abiquo']['profile']
when "monolithic", "server"
    default['abiquo']['properties']['abiquo.m.identity'] = 'default_outbound_api_user'
    default['abiquo']['properties']['abiquo.server.sessionTimeout'] = 30
    default['abiquo']['properties']['abiquo.server.mail.server'] = '127.0.0.1'
    default['abiquo']['properties']['abiquo.server.mail.user'] = '<EMAIL>'
    default['abiquo']['properties']['abiquo.server.mail.password'] = '<PASSWORD>'
    default['abiquo']['properties']['abiquo.redis.host'] = '127.0.0.1'
    default['abiquo']['properties']['abiquo.redis.port'] = 6379
    default['abiquo']['properties']['abiquo.monitoring.enabled'] = false

    if node['abiquo']['ui_address_type'] != "fixed"<commit_msg>Make sure Cassandra is restarted when needed<commit_after># Cookbook Name:: abiquo
# Attributes:: abiquo
#
# Copyright 2014, Abiquo
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# The profile to install: monolithic, remoteservices or kvm
default['abiquo']['profile'] = "monolithic"

# Wether or not to install external dependant services
# like MariaDB, Redis, RabbitMQ
# Set to false if you wish to use existing servers.
default['abiquo']['install_ext_services'] = true

# Attribute to use to setup UI config file.
# Change to 'ipaddress' to use IP instead of fqdn.
# 'fixed' will setup node['abiquo']['ui_address']
default['abiquo']['ui_address_type'] = 'fqdn'
default['abiquo']['ui_address'] = node['fqdn']

# Common properties
default['abiquo']['license'] = nil

# NFS repository configuration
default['abiquo']['nfs']['mountpoint'] = "/opt/vm_repository"
default['abiquo']['nfs']['location'] = nil  # Change to something like: "127.0.0.1:/opt/vm_repository"

# Yum repository configuration
default['abiquo']['yum']['base-repo'] = "http://mirror.abiquo.com/abiquo/3.8/os/x86_64"
default['abiquo']['yum']['updates-repo'] = "http://mirror.abiquo.com/abiquo/3.8/updates/x86_64"
default['abiquo']['yum']['gpg-check'] = true

# Database configuration
default['abiquo']['db']['host'] = "localhost"
default['abiquo']['db']['port'] = 3306
default['abiquo']['db']['user'] = "root"
default['abiquo']['db']['password'] = <PASSWORD>
default['abiquo']['db']['upgrade'] = true

# Tomcat configuration 
default['abiquo']['tomcat']['http-port'] = 8009
default['abiquo']['tomcat']['ajp-port'] = 8010
default['abiquo']['tomcat']['wait-for-webapps'] = false

# Wheter or not to generate a self signed certificate
# for this host. If not, provide path to certificate,
# private key and optionally a CA cert. The cookbook
# does not manage the certificate files path provided
# for non generated certificates.
default['abiquo']['certificate']['common_name'] = node['fqdn']
default['abiquo']['certificate']['organization'] = 'Abiquo'
default['abiquo']['certificate']['department'] = 'Engineering'
default['abiquo']['certificate']['country'] = 'ES'
default['abiquo']['certificate']['source'] = 'self-signed'
default['abiquo']['certificate']['file'] = "/etc/pki/abiquo/#{node['abiquo']['certificate']['common_name']}.crt"
default['abiquo']['certificate']['key_file'] = "/etc/pki/abiquo/#{node['abiquo']['certificate']['common_name']}.key"
default['abiquo']['certificate']['ca_file'] = nil

# Configure abiquo KVM
default['abiquo']['aim']['port'] = 8889

# Configure monitoring node
default['abiquo']['monitoring']['cassandra']['cluster_name'] = 'abiquo'
default['abiquo']['monitoring']['kairosdb']['version'] = '0.9.4'
default['abiquo']['monitoring']['kairosdb']['release'] = '6'
default['abiquo']['monitoring']['kairosdb']['host'] = 'localhost'
default['abiquo']['monitoring']['kairosdb']['port'] = 8080
default['abiquo']['monitoring']['rabbitmq']['host'] = 'localhost'
default['abiquo']['monitoring']['rabbitmq']['port'] = 5672
default['abiquo']['monitoring']['rabbitmq']['username'] = 'abiquo'
default['abiquo']['monitoring']['rabbitmq']['password'] = '<PASSWORD>'
default['abiquo']['monitoring']['db']['host'] = 'localhost'
default['abiquo']['monitoring']['db']['port'] = 3306
default['abiquo']['monitoring']['db']['user'] = 'root'
default['abiquo']['monitoring']['db']['password'] = ''
default['abiquo']['monitoring']['db']['install'] = true
default['abiquo']['monitoring']['emmett']['port'] = 36638

# Override the Apache proxy configuration
override['apache']['proxy']['order'] = "allow,deny"
override['apache']['proxy']['deny_from']  = "none"
override['apache']['proxy']['allow_from'] = "all"

# Override the default java configuration
# TODO: Configure these attributes in a way that they don't have precedence over user config
override['java']['oracle']['accept_oracle_download_terms'] = true
override['java']['java_home'] = "/usr/java/default"
override['java']['jdk_version'] = 8

# Override Cassandra default configuration to make sure it is always running properly
override['cassandra']['notify_restart'] = true

# Default properties
default['abiquo']['properties']['abiquo.datacenter.id'] = node['hostname']
default['abiquo']['properties']['abiquo.rabbitmq.username'] = 'abiquo'
default['abiquo']['properties']['abiquo.rabbitmq.password'] = '<PASSWORD>'
default['abiquo']['properties']['abiquo.rabbitmq.host'] = '127.0.0.1'
default['abiquo']['properties']['abiquo.rabbitmq.port'] = 5672
default['abiquo']['properties']['abiquo.vncport.min'] = 6000
default['abiquo']['properties']['abiquo.vncport.max'] = 6999

case node['abiquo']['profile']
when "monolithic", "server"
    default['abiquo']['properties']['abiquo.m.identity'] = 'default_outbound_api_user'
    default['abiquo']['properties']['abiquo.server.sessionTimeout'] = 30
    default['abiquo']['properties']['abiquo.server.mail.server'] = '127.0.0.1'
    default['abiquo']['properties']['abiquo.server.mail.user'] = 'none<EMAIL>.es'
    default['abiquo']['properties']['abiquo.server.mail.password'] = '<PASSWORD>'
    default['abiquo']['properties']['abiquo.redis.host'] = '127.0.0.1'
    default['abiquo']['properties']['abiquo.redis.port'] = 6379
    default['abiquo']['properties']['abiquo.monitoring.enabled'] = false

    if node['abiquo']['ui_address_type'] != "fixed"
{'fraction_non_alphanumeric': 0.20871459694989106, 'fraction_numerical': 0.017429193899782137, 'mean_word_length': 7.930739299610895, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 8, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1266017', 'n_tokens_mistral': 3757, 'n_tokens_neox': 3590, 'n_words': 739}