Ejemplo n.º 1
0
#   limitations under the License.
#
##############################################################################
from resource_management import *
from resource_management.core.system import System
import os
import random
import string
import socket
import kavecommon as kc

config = Script.get_config()

hostname = config["hostname"]
nagios_passwd_file = "/etc/nagios/passwd"
www_folder = kc.default('configurations/kavenagios/www_folder',
                        '/var/www/html/', kc.is_valid_directory)
PORT = kc.default('configurations/kavenagios/PORT', '80', kc.is_valid_port)
servername = kc.default('configurations/kavenagios/servername', hostname,
                        kc.is_valid_hostname)
if servername == "hostname":
    servername = hostname

nagios_monitor_hosts = default('/clusterHostInfo/kavenagios_monitor_hosts',
                               ['unknown'])

template_000_default = default(
    'configurations/kavenagios/template_000_default', """
# Created automatically with Ambari
# All manual changes will be undone in the case of a server restart
# Edit the template through the Ambari interface instead
TraceEnable Off
Ejemplo n.º 2
0
#
##############################################################################
from resource_management import *
from resource_management.core.system import System
import os
import random
import string
import socket
import kavecommon as kc

config = Script.get_config()

hostname = config["hostname"]

kaveganglia_username = kc.default(
    'configurations/kaveganglia/kaveganglia_username', 'ganglia',
    kc.is_valid_username)

kaveganglia_clustername = kc.default(
    'configurations/kaveganglia/kaveganglia_clustername', 'KAVE',
    kc.is_upper_case)

kaveganglia_gridname = kc.default(
    'configurations/kaveganglia/kaveganglia_gridname', 'KAVE',
    kc.is_upper_case)

kaveganglia_port = kc.default('configurations/kaveganglia/kaveganglia_port',
                              '8649', kc.is_valid_port)

kaveganglia_xml_port = kc.default(
    'configurations/kaveganglia/kaveganglia_xml_port', '8651',
Ejemplo n.º 3
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.
#
##############################################################################
from resource_management import *
import kavecommon as kc

config = Script.get_config()

hostname = config["hostname"]

JENKINS_HOME = kc.default("configurations/jenkins/JENKINS_HOME",
                          "/var/lib/jenkins", kc.is_valid_directory)
JENKINS_PORT = kc.default("configurations/jenkins/JENKINS_PORT", "8080",
                          kc.is_valid_port)
JENKINS_HTTPS_PORT = kc.default("configurations/jenkins/JENKINS_HTTPS_PORT",
                                "8443", kc.is_valid_port)
JENKINS_USER = kc.default("configurations/jenkins/JENKINS_USER", "jenkins",
                          kc.is_valid_username)
JENKINS_ADMIN = kc.default("configurations/jenkins/JENKINS_ADMIN", "admin",
                           kc.is_valid_username)
JENKINS_ADMIN_EMAIL = default("configurations/jenkins/JENKINS_ADMIN_EMAIL",
                              "default")

if JENKINS_ADMIN_EMAIL == 'default':
    JENKINS_ADMIN_EMAIL = JENKINS_ADMIN + '@' + '.'.join(
        hostname.split('.')[1:])
kc.is_valid_emailid(JENKINS_ADMIN_EMAIL, "jenkins/JENKINS_ADMIN_EMAIL")
Ejemplo n.º 4
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.
#
##############################################################################
from resource_management import *
import kavecommon as kc

config = Script.get_config()

hostname = config["hostname"]

gitlab_conf_file = "/etc/gitlab/gitlab.rb"
gitlab_ssl_port = kc.default("configurations/gitlab/gitlab_ssl_port", "443", kc.is_valid_port)
gitlab_url = kc.default("configurations/gitlab/gitlab_url", hostname, kc.is_valid_hostname)
unicorn_port = kc.default("configurations/gitlab/unicorn_port", "8080", kc.is_valid_port)
unicorn_interface = default("configurations/gitlab/unicorn_interface", '127.0.0.1')

if gitlab_url == 'hostname':
    gitlab_url = hostname
if not gitlab_url:
    raise Exception('gitlab_url set to an unusable value \'%s\'' % gitlab_url)

gitlab_signin_enabled = default('configurations/gitlab/gitlab_signin_enabled', 'true')
gitlab_signin_enabled = kc.trueorfalse(gitlab_signin_enabled)
gitlab_admin_password = config['configurations']['gitlab']['gitlab_admin_password']
Logger.sensitive_strings[gitlab_admin_password] = "[PROTECTED]"
restrict_public_projects = default('configurations/gitlab/restrict_public_projects', 'true')
restrict_public_projects = kc.trueorfalse(restrict_public_projects)
Ejemplo n.º 5
0
#   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.
#
##############################################################################
from resource_management import *
from resource_management.core.system import System
import os
import kavecommon as kc

config = Script.get_config()

hostname = config["hostname"]

top_dir = kc.default("configurations/kavetoolbox/top_dir", "/opt/",
                     kc.is_valid_directory)
releaseversion = default('configurations/kavetoolbox/releaseversion',
                         "3.0-Beta")
alternative_download = default(
    'configurations/kavetoolbox/alternative_download', "none")
ignore_missing_groups = default(
    'configurations/kavetoolbox/ignore_missing_groups', "False")
ignore_missing_groups = kc.trueorfalse(ignore_missing_groups)
command_line_args = default('configurations/kavetoolbox/command_line_args',
                            "False")
try:
    command_line_args = kc.trueorfalse(command_line_args)
except TypeError, ValueError:
    if type(command_line_args) is str:
        pass
    else:
Ejemplo n.º 6
0
if None in [storm_zookeeper_servers]:
    raise NameError("Could not find required services of zookeeper_hostsfrom in clusterHostInfo : " +
                    str(config['clusterHostInfo']))
if None in [nimbus_host]:
    raise NameError("Could not find required services of nimbus_sd_master_hosts in clusterHostInfo: " +
                    str(config['clusterHostInfo']))

# find/replace localhost
if nimbus_host == hostname:
    nimbus_host = "localhost"
storm_zookeeper_servers = [s if s != hostname else 'localhost' for s in storm_zookeeper_servers]

if use_drpc:
    drpc_servers = [s if s != hostname else 'localhost' for s in drpc_servers]

storm_zookeeper_port = kc.default('configurations/stormsd/stormsd.zookeeper.port', "2181", kc.is_valid_port)
nimbus_childopts = default('configurations/stormsd/stormsd.nimbus.childopts',
                           '-Xmx1024m')

ui_port = kc.default('configurations/stormsd/stormsd.ui.port', "8744", kc.is_valid_port)

ui_childopts = default('configurations/stormsd/stormsd.ui.childopts', '-Xmx768m -Djava.net.preferIPv4Stack=true')
supervisor_slots_ports = default('configurations/stormsd/stormsd.supervisor.slots.ports',
                                 '6700, 6701').replace(", ", " ").replace(",", " ").split()
supervisor_childopts = default('configurations/stormsd/stormsd.supervisor.childopts', '-Djava.net.preferIPv4Stack=true')
worker_childopts = default('configurations/stormsd/stormsd.worker.childopts',
                           '-Xmx768m -Djava.net.preferIPv4Stack=true')
drpc_childopts = default('configurations/stormsd/stormsd.drpc.childopts', '-Xmx768m -Djava.net.preferIPv4Stack=true')
log_level = default('configurations/stormsd/stormsd.loglevel', 'WARN')
logviewer_childopts = default('configurations/stormsd/stormsd.logviewer.childopts',
                              '-Xmx128m -Djava.net.preferIPv4Stack=true')
Ejemplo n.º 7
0
if None in [nimbus_host]:
    raise NameError(
        "Could not find required services of nimbus_sd_master_hosts in clusterHostInfo: "
        + str(config['clusterHostInfo']))

# find/replace localhost
if nimbus_host == hostname:
    nimbus_host = "localhost"
storm_zookeeper_servers = [
    s if s != hostname else 'localhost' for s in storm_zookeeper_servers
]

if use_drpc:
    drpc_servers = [s if s != hostname else 'localhost' for s in drpc_servers]

storm_zookeeper_port = kc.default(
    'configurations/stormsd/stormsd.zookeeper.port', "2181", kc.is_valid_port)
nimbus_childopts = default('configurations/stormsd/stormsd.nimbus.childopts',
                           '-Xmx1024m')

ui_port = kc.default('configurations/stormsd/stormsd.ui.port', "8744",
                     kc.is_valid_port)

ui_childopts = default('configurations/stormsd/stormsd.ui.childopts',
                       '-Xmx768m -Djava.net.preferIPv4Stack=true')
supervisor_slots_ports = default(
    'configurations/stormsd/stormsd.supervisor.slots.ports',
    '6700, 6701').replace(", ", " ").replace(",", " ").split()
supervisor_childopts = default(
    'configurations/stormsd/stormsd.supervisor.childopts',
    '-Djava.net.preferIPv4Stack=true')
worker_childopts = default('configurations/stormsd/stormsd.worker.childopts',
Ejemplo n.º 8
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.
#
##############################################################################
from resource_management import *
from resource_management.core.system import System
import os
import kavecommon as kc

config = Script.get_config()
hostname = config["hostname"]

db_path = kc.default('configurations/mongodb/db_path', '/var/lib/mongo',
                     kc.is_valid_directory)
logpath = kc.default('configurations/mongodb/logpath',
                     '/var/log/mongodb/mongod.log', kc.is_valid_directory)
bind_ip = kc.default('configurations/mongodb/bind_ip', '0.0.0.0',
                     kc.is_valid_ipv4_address)
tcp_port = kc.default('configurations/mongodb/tcp_port', '27017',
                      kc.is_valid_port)
setname = default('configurations/mongodb/setname', 'None')

mongodb_baseurl = default(
    'configurations/mongodb/mongodb_baseurl',
    'https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.6/x86_64/')

# The web status page is always accessible at a port number that is 1000 greater than the port determined by tcp_port.

mongo_hosts = default('/clusterHostInfo/mongodb_master_hosts', ['unknown'])
Ejemplo n.º 9
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.
#
##############################################################################
from resource_management import *
from resource_management.core.system import System
import os
import kavecommon as kc

config = Script.get_config()
hostname = config["hostname"]

db_path = kc.default('configurations/mongodb/db_path', '/var/lib/mongo', kc.is_valid_directory)
logpath = kc.default('configurations/mongodb/logpath', '/var/log/mongodb/mongod.log', kc.is_valid_directory)
bind_ip = kc.default('configurations/mongodb/bind_ip', '0.0.0.0', kc.is_valid_ipv4_address)
tcp_port = kc.default('configurations/mongodb/tcp_port', '27017', kc.is_valid_port)
setname = default('configurations/mongodb/setname', 'None')

mongodb_baseurl = default('configurations/mongodb/mongodb_baseurl',
                          'https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.6/x86_64/')


# The web status page is always accessible at a port number that is 1000 greater than the port determined by tcp_port.

mongo_hosts = default('/clusterHostInfo/mongodb_master_hosts', ['unknown'])
mongo_host = mongo_hosts[0]

mongo_arbiter_hosts = default('/clusterHostInfo/mongodb_arbiter_hosts', [])
Ejemplo n.º 10
0
##############################################################################
import status_params

from resource_management import *
from ambari_commons.os_check import OSCheck
import kavecommon as kc

config = Script.get_config()
tmp_dir = Script.get_tmp_dir()

hostname = config["hostname"]

sonarqube_supported_plugins = ['sonar-python-plugin-1.5.jar']

sonarqube_install_directory = kc.default(
    'configurations/sonarqube/sonarqube_install_directory', '/opt/sonarqube',
    kc.is_valid_directory)
sonarqube_runner_install_directory = kc.default(
    'configurations/sonarqube/sonarqube_runner_install_directory',
    '/opt/sonarqube_runner', kc.is_valid_directory)
sonarqube_plugins = set()
for plugin in default('configurations/sonarqube/sonarqube_plugins',
                      'sonar-python-plugin-1.5.jar').split(','):
    if plugin == '':
        continue
    elif plugin in sonarqube_supported_plugins:
        sonarqube_plugins.add(plugin)
    else:
        print 'Ignoring unsupported plugin: %s' % plugin

known_authentication_methods = ['HBAC', 'NONE']
Ejemplo n.º 11
0
else:
    Logger.sensitive_strings[ldap_bind_password] = "[PROTECTED]"

hostname_components = config["hostname"].split('.')
if len(hostname_components) < 3:
    raise Exception(
        'FreeIPA hostname is not a FQDN. installation not possible')
domain = '.'.join(hostname_components[1:])
realm = '.'.join(hostname_components[1:]).upper()
realm_ldap = 'dc=' + ',dc='.join(hostname_components[1:])

install_with_dns = default('configurations/freeipa/install_with_dns', True)
install_with_dns = kc.trueorfalse(install_with_dns)
default_shell = default('configurations/freeipa/default_shell', '/bin/bash')

pki_insecure_port = kc.default('configurations/freeipa/pki_insecure_port',
                               '8081', kc.is_valid_port)
pki_secure_port = kc.default('configurations/freeipa/pki_secure_port', '8444',
                             kc.is_valid_port)

# Only except IPv4 for now
forwarders = default('configurations/freeipa/forwarders', '8.8.8.8').split(',')
forwarders = [forwarder.strip() for forwarder in forwarders]
forwarders = [
    forwarder for forwarder in forwarders
    if re.match('\\d+\\.\\d+\\.\\d+\\.\\d+', forwarder)
]

client_init_wait = default('configurations/freeipa/client_init_wait', 600)

all_hosts = default("/clusterHostInfo/all_hosts", None)
Ejemplo n.º 12
0
#   limitations under the License.
#
##############################################################################
from resource_management import *
from resource_management.core.system import System
import os
import string
import kavecommon as kc

config = Script.get_config()

hostname = config["hostname"]

AirflowVersion = default('configurations/airflow/AirflowVersion', '1.8.0')

airflow_home = kc.default('configurations/airflow/airflow_home', '/usr/opt/local/airflow', kc.is_valid_directory)

airflow_dags_folder = default('configurations/airflow/airflow_dags_folder', '/usr/opt/local/airflow/dags')

airflow_base_log_folder = default('configurations/airflow/airflow_base_log_folder', '/usr/opt/local/airflow/logs')

airflow_executor = default('configurations/airflow/airflow_executor', 'SequentialExecutor')

airflow_sql_alchemy_conn = default('configurations/airflow/airflow_sql_alchemy_conn',
                                   'sqlite:////usr/opt/local/airflow/airflow.db')

airflow_sql_alchemy_pool_size = default('configurations/airflow/airflow_sql_alchemy_pool_size', '5')

sql_alchemy_pool_recycle = default('configurations/airflow/sql_alchemy_pool_recycle', '3600')

airflow_parallelism = default('configurations/airflow/airflow_parallelism', '32')
Ejemplo n.º 13
0
#   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.
#
##############################################################################
from resource_management import *
from resource_management.core.system import System
import os
import kavecommon as kc

config = Script.get_config()

hostname = config["hostname"]

top_dir = kc.default("configurations/eskapade/top_dir", "/opt/", kc.is_valid_directory)
releaseversion = default('configurations/eskapade/releaseversion', "0.7")
alternative_download = default('configurations/eskapade/alternative_download', "none")
ignore_missing_groups = default('configurations/eskapade/ignore_missing_groups', "False")
ignore_missing_groups = kc.trueorfalse(ignore_missing_groups)
command_line_args = default('configurations/eskapade/command_line_args', "False")
try:
    command_line_args = kc.trueorfalse(command_line_args)
except TypeError, ValueError:
    if type(command_line_args) is str:
        pass
    else:
        print "could not interpret value of command_line_args correctly"
        raise
custom_install_template_default = """
# -------------------------------
Ejemplo n.º 14
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.
#
##############################################################################
from resource_management import *
import kavecommon as kc

config = Script.get_config()

hostname = config["hostname"]

gitlab_conf_file = "/etc/gitlab/gitlab.rb"
gitlab_port = kc.default("configurations/gitlab/gitlab_port", "80", kc.is_valid_port)
gitlab_url = kc.default("configurations/gitlab/gitlab_url", hostname, kc.is_valid_hostname)
unicorn_port = kc.default("configurations/gitlab/unicorn_port", "8080", kc.is_valid_port)
unicorn_interface = default("configurations/gitlab/unicorn_interface", '127.0.0.1')

if gitlab_url == 'hostname':
    gitlab_url = hostname
if not gitlab_url:
    raise Exception('gitlab_url set to an unusable value \'%s\'' % gitlab_url)

gitlab_signin_enabled = default('configurations/gitlab/gitlab_signin_enabled', 'true')
gitlab_signin_enabled = kc.trueorfalse(gitlab_signin_enabled)
gitlab_admin_password = config['configurations']['gitlab']['gitlab_admin_password']
Logger.sensitive_strings[gitlab_admin_password] = "[PROTECTED]"
restrict_public_projects = default('configurations/gitlab/restrict_public_projects', 'true')
restrict_public_projects = kc.trueorfalse(restrict_public_projects)
Ejemplo n.º 15
0
install_with_dns = default('configurations/freeipa/install_with_dns', False)
install_with_dns = kc.trueorfalse(install_with_dns)
default_shell = default('configurations/freeipa/default_shell', '/bin/bash')

# Only except IPv4 for now
forwarders = default('configurations/freeipa/forwarders', '10.0.0.10').split(',')
forwarders = [forwarder.strip() for forwarder in forwarders]
forwarders = [forwarder for forwarder in forwarders if re.match('\\d+\\.\\d+\\.\\d+\\.\\d+', forwarder)]

other_nameservers = '\n'.join(['nameserver ' + f for f in forwarders])

client_init_wait = default('configurations/freeipa/client_init_wait', 600)

all_hosts = default("/clusterHostInfo/all_hosts", None)

ldap_bind_user = kc.default('configurations/freeipa/ldap_bind_user', 'kave_bind_user', kc.is_valid_username)
ldap_bind_services = ['twiki', 'gitlab', 'jenkins']

initial_users_and_groups = default('configurations/freeipa/initial_users_and_groups', '{"Users": [], "Groups" : {}}')
initial_users_and_groups = json.loads(initial_users_and_groups)

initial_user_passwords = default('configurations/freeipa/initial_user_passwords', '{ }')
initial_user_passwords = json.loads(initial_user_passwords)

initial_sudoers = default('configurations/freeipa/initial_sudoers',
                          '{ "Users": [], "Groups":[], "cmdcat": "all", "hostcat": "all", '
                          + '"runasusercat": "all", "runasgroupcat": "all" }')
initial_sudoers = json.loads(initial_sudoers)

kadm5acl_template = default('configurations/freeipa/kadm5acl_template', """*/admin@{{realm}} *
admin@{{realm}} *
Ejemplo n.º 16
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.
#
##############################################################################
from resource_management import *
import kavecommon as kc

config = Script.get_config()

hostname = config["hostname"]

www_folder = kc.default('configurations/twiki/www_folder', '/var/www/html/', kc.is_valid_directory)
install_dir = www_folder + "twiki/"
PORT = default('configurations/twiki/PORT', '80')
servername = kc.default('configurations/twiki/servername', hostname, kc.is_valid_hostname)
if servername == "hostname":
    servername = hostname
admin_user = kc.default('configurations/twiki/admin_user', 'twiki-admin', kc.is_valid_username)

ldap_group = kc.default('configurations/twiki/ldap_group', 'twiki', kc.is_valid_username)

known_authentication_methods = ['HBAC', 'LDAP', 'NONE']
authentication_method = default('configurations/twiki/authentication_method', 'HBAC')
authentication_method = authentication_method.upper()
if authentication_method not in known_authentication_methods:
    raise ValueError("Authentication method not recognised, I only know "
                     + str(known_authentication_methods)
Ejemplo n.º 17
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.
#
##############################################################################
from resource_management import *
import kavecommon as kc

config = Script.get_config()

hostname = config["hostname"]

install_topdir = kc.default('configurations/archiva/install_topdir', '/opt/',
                            kc.is_valid_directory)

if len(install_topdir) < 4 or install_topdir.count(
        '/') < 2 or not install_topdir.startswith('/'):
    raise ValueError(
        'archiva/install_topdir must be a valid directory full path,'
        ' with a length of at least 4 and two /')

if not install_topdir.endswith('/'):
    install_topdir = install_topdir + '/'

install_subdir = default('configurations/archiva/install_subdir', 'archiva')

if not len(install_subdir) or install_subdir.count('/'):
    raise ValueError(
        'archiva/install_subdir must be a simple string, with no "/"')
Ejemplo n.º 18
0
#
##############################################################################
import status_params

from resource_management import *
from ambari_commons.os_check import OSCheck
import kavecommon as kc

config = Script.get_config()
tmp_dir = Script.get_tmp_dir()

hostname = config["hostname"]

sonarqube_supported_plugins = ['sonar-python-plugin-1.5.jar']

sonarqube_install_directory = kc.default('configurations/sonarqube/sonarqube_install_directory',
                                         '/opt/sonarqube', kc.is_valid_directory)
sonarqube_runner_install_directory = kc.default('configurations/sonarqube/sonarqube_runner_install_directory',
                                                '/opt/sonarqube_runner',
                                                kc.is_valid_directory
                                                )
sonarqube_plugins = set()
for plugin in default('configurations/sonarqube/sonarqube_plugins', 'sonar-python-plugin-1.5.jar').split(','):
    if plugin == '':
        continue
    elif plugin in sonarqube_supported_plugins:
        sonarqube_plugins.add(plugin)
    else:
        print 'Ignoring unsupported plugin: %s' % plugin


known_authentication_methods = ['HBAC', 'NONE']
Ejemplo n.º 19
0
LCM_UI_access_scheme = default('configurations/lcm_application/LCM_UI_access_scheme', 'https')

systemd_lcmui_unitfile_path = "/usr/lib/systemd/system/lcm-ui.service"

lcm_releaseversion = default('configurations/lcm_application/lcm_releaseversion', '0.2.5-SNAPSHOT')

lcm_application_name = default('configurations/lcm_application/lcm_application_name', 'lcmapp')

lcm_service_user = default('configurations/lcm_application/lcm_service_user', 'lcm')

lcm_install_dir = default('configurations/lcm_application/lcm_install_dir', '/opt/lcm')

lcm_home_dir = lcm_install_dir + '/lcm-complete-' + lcm_releaseversion + '/'

LCM_UI_URL = kc.default('configurations/lcm_application/LCM_UI_URL', hostname, kc.is_valid_hostname)

LCM_UI_PORT = kc.default('configurations/lcm_application/LCM_UI_PORT', '8081', kc.is_valid_port)

LCM_SecureUI_Port = kc.default('configurations/lcm_application/LCM_SecureUI_Port', '4444', kc.is_valid_port)

LCM_Server_URL = kc.default('configurations/lcm_application/LCM_Server_URL', hostname, kc.is_valid_hostname)

LCM_Server_PORT = kc.default('configurations/lcm_application/LCM_Server_PORT', '8085', kc.is_valid_port)

LCM_SecureServer_Port = kc.default('configurations/lcm_application/LCM_SecureServer_Port', '4445', kc.is_valid_port)

LCM_Swagger_PORT = kc.default('configurations/lcm_application/LCM_Swagger_PORT', '8083', kc.is_valid_port)

sever_log_file_path = default('configurations/lcm_logs/sever_log_file_path', 'logs/lcm-server.log')
Ejemplo n.º 20
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.
#
##############################################################################
from resource_management import *
import kavecommon as kc


config = Script.get_config()

hostname = config["hostname"]

JENKINS_HOME = kc.default("configurations/jenkins/JENKINS_HOME", "/var/lib/jenkins", kc.is_valid_directory)
JENKINS_PORT = kc.default("configurations/jenkins/JENKINS_PORT", "8080", kc.is_valid_port)
JENKINS_HTTPS_PORT = kc.default("configurations/jenkins/JENKINS_HTTPS_PORT", "8443", kc.is_valid_port)
JENKINS_USER = kc.default("configurations/jenkins/JENKINS_USER", "jenkins", kc.is_valid_username)
JENKINS_ADMIN = kc.default("configurations/jenkins/JENKINS_ADMIN", "admin", kc.is_valid_username)
JENKINS_ADMIN_EMAIL = default("configurations/jenkins/JENKINS_ADMIN_EMAIL", "default")


if JENKINS_ADMIN_EMAIL == 'default':
    JENKINS_ADMIN_EMAIL = JENKINS_ADMIN + '@' + '.'.join(hostname.split('.')[1:])
kc.is_valid_emailid(JENKINS_ADMIN_EMAIL, "jenkins/JENKINS_ADMIN_EMAIL")

JENKINS_ADMIN_PASSWORD = config['configurations']['jenkins']['JENKINS_ADMIN_PASSWORD']
Logger.sensitive_strings[JENKINS_ADMIN_PASSWORD] = "[PROTECTED]"

download_version = default("configurations/jenkins/download_version", "2.129")
Ejemplo n.º 21
0
#   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.
#
##############################################################################
from resource_management import *
from resource_management.core.system import System
import os
import kavecommon as kc

config = Script.get_config()

hostname = config["hostname"]

top_dir = kc.default("configurations/kavetoolbox/top_dir", "/opt/", kc.is_valid_directory)
releaseversion = default('configurations/kavetoolbox/releaseversion', "3.7-Beta")
alternative_download = default('configurations/kavetoolbox/alternative_download', "none")
ignore_missing_groups = default('configurations/kavetoolbox/ignore_missing_groups', "False")
ignore_missing_groups = kc.trueorfalse(ignore_missing_groups)
command_line_args = default('configurations/kavetoolbox/command_line_args', "False")
try:
    command_line_args = kc.trueorfalse(command_line_args)
except TypeError, ValueError:
    if type(command_line_args) is str:
        pass
    else:
        print "could not interpret value of command_line_args correctly"
        raise
kave_custom_environment = default('configurations/kavetoolbox/kave_custom_environment', """
# -------------------------------
Ejemplo n.º 22
0
#
#     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.
#
##############################################################################
from resource_management import *
import kavecommon as kc

config = Script.get_config()

log_dir = kc.default('configurations/wildfly/log_dir', '/var/log/wildfly', kc.is_valid_directory)

installation_dir = kc.default('configurations/wildfly/installation_dir', '/opt/wildfly/', kc.is_valid_directory)

bin_dir = installation_dir + '/bin'

config_dir = kc.default('configurations/wildfly/config_dir', '/standalone/configuration/', kc.is_valid_directory)

service_user = kc.default('configurations/wildfly/service_user', 'wildfly', kc.is_valid_username)

wildfly_xmlconf_filename = default('configurations/wildfly/wildfly_xmlconf_filename', 'standalone.xml')
wildfly_management_filename = default('configurations/wildfly/wildfly_management_filename', 'mgmt-users.properties')
wildfly_conf_file = installation_dir + config_dir + wildfly_xmlconf_filename
mgmt_users_file = installation_dir + config_dir + wildfly_management_filename

Ejemplo n.º 23
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.
#
##############################################################################
from resource_management import *
import kavecommon as kc

config = Script.get_config()

hostname = config["hostname"]

install_topdir = kc.default('configurations/archiva/install_topdir', '/opt/', kc.is_valid_directory)

if len(install_topdir) < 4 or install_topdir.count('/') < 2 or not install_topdir.startswith('/'):
    raise ValueError('archiva/install_topdir must be a valid directory full path,'
                     ' with a length of at least 4 and two /')

if not install_topdir.endswith('/'):
    install_topdir = install_topdir + '/'

install_subdir = default('configurations/archiva/install_subdir', 'archiva')

systemd_archiva_unitfile_path = "/usr/lib/systemd/system/archiva.service"

if not len(install_subdir) or install_subdir.count('/'):
    raise ValueError('archiva/install_subdir must be a simple string, with no "/"')
Ejemplo n.º 24
0
import socket


config = Script.get_config()

hostname = config["hostname"]

short_host = config["hostname"].split('.')[0]

AMBARI_ADMIN = config['configurations']['kavelanding']['AMBARI_ADMIN']
AMBARI_ADMIN_PASS = config['configurations']['kavelanding']['AMBARI_ADMIN_PASS']
Logger.sensitive_strings[AMBARI_ADMIN_PASS] = "[PROTECTED]"

AMBARI_SERVER = default("/clusterHostInfo/ambari_server_host", ['ambari'])[0]
# default('configurations/kavelanding/AMBARI_SERVER','ambari')
www_folder = kc.default('configurations/kavelanding/www_folder', '/var/www/html/', kc.is_valid_directory)
customlinks = default('configurations/kavelanding/customlinks', '{}')
PORT = kc.default('configurations/kavelanding/PORT', '80', kc.is_valid_port)
AMBARI_SHORT_HOST = AMBARI_SERVER.split('.')[0]

short_host_address = socket.gethostbyname(short_host)
AMBARI_SHORT_HOST_ADDRESS = socket.gethostbyname(AMBARI_SHORT_HOST)

servername = kc.default('configurations/kavelanding/servername', hostname, kc.is_valid_hostname)
if servername == "default":
    servername = hostname

# It's nice to accept " " and '' as values for customlinks without throwing json errors
# smallest valid json will be {}
if len(customlinks.strip()) <= 2:
    customlinks = '{}'
Ejemplo n.º 25
0
#
#     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.
#
##############################################################################
from resource_management import *
import kavecommon as kc

config = Script.get_config()

log_dir = kc.default('configurations/wildfly/log_dir', '/var/log/wildfly',
                     kc.is_valid_directory)

installation_dir = kc.default('configurations/wildfly/installation_dir',
                              '/opt/wildfly/', kc.is_valid_directory)

bin_dir = installation_dir + '/bin'

config_dir = kc.default('configurations/wildfly/config_dir',
                        '/standalone/configuration/', kc.is_valid_directory)

service_user = kc.default('configurations/wildfly/service_user', 'wildfly',
                          kc.is_valid_username)

wildfly_xmlconf_filename = default(
    'configurations/wildfly/wildfly_xmlconf_filename', 'standalone.xml')
wildfly_management_filename = default(
Ejemplo n.º 26
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.
#
##############################################################################
from resource_management import *
import kavecommon as kc

config = Script.get_config()

hostname = config["hostname"]

www_folder = kc.default('configurations/twiki/www_folder', '/var/www/html/',
                        kc.is_valid_directory)
install_dir = www_folder + "twiki/"
PORT = default('configurations/twiki/PORT', '80')
servername = kc.default('configurations/twiki/servername', hostname,
                        kc.is_valid_hostname)
if servername == "hostname":
    servername = hostname
admin_user = kc.default('configurations/twiki/admin_user', 'twiki-admin',
                        kc.is_valid_username)

ldap_group = kc.default('configurations/twiki/ldap_group', 'twiki',
                        kc.is_valid_username)

known_authentication_methods = ['HBAC', 'LDAP', 'NONE']
authentication_method = default('configurations/twiki/authentication_method',
                                'HBAC')
Ejemplo n.º 27
0
#   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.
#
##############################################################################
from resource_management import *
from resource_management.core.system import System
import os
import kavecommon as kc

config = Script.get_config()

hostname = config["hostname"]

top_dir = kc.default("configurations/eskapade/top_dir", "/opt/",
                     kc.is_valid_directory)
releaseversion = default('configurations/eskapade/releaseversion', "0.7")
alternative_download = default('configurations/eskapade/alternative_download',
                               "none")
ignore_missing_groups = default(
    'configurations/eskapade/ignore_missing_groups', "False")
ignore_missing_groups = kc.trueorfalse(ignore_missing_groups)
command_line_args = default('configurations/eskapade/command_line_args',
                            "False")
try:
    command_line_args = kc.trueorfalse(command_line_args)
except TypeError, ValueError:
    if type(command_line_args) is str:
        pass
    else:
        print "could not interpret value of command_line_args correctly"
Ejemplo n.º 28
0
# Only except IPv4 for now
forwarders = default('configurations/freeipa/forwarders',
                     '10.0.0.10').split(',')
forwarders = [forwarder.strip() for forwarder in forwarders]
forwarders = [
    forwarder for forwarder in forwarders
    if re.match('\\d+\\.\\d+\\.\\d+\\.\\d+', forwarder)
]

other_nameservers = '\n'.join(['nameserver ' + f for f in forwarders])

client_init_wait = default('configurations/freeipa/client_init_wait', 600)

all_hosts = default("/clusterHostInfo/all_hosts", None)

ldap_bind_user = kc.default('configurations/freeipa/ldap_bind_user',
                            'kave_bind_user', kc.is_valid_username)
ldap_bind_services = ['twiki', 'gitlab', 'jenkins']

initial_users_and_groups = default(
    'configurations/freeipa/initial_users_and_groups',
    '{"Users": [], "Groups" : {}}')
initial_users_and_groups = json.loads(initial_users_and_groups)

initial_user_passwords = default(
    'configurations/freeipa/initial_user_passwords', '{ }')
initial_user_passwords = json.loads(initial_user_passwords)

initial_sudoers = default(
    'configurations/freeipa/initial_sudoers',
    '{ "Users": [], "Groups":[], "cmdcat": "all", "hostcat": "all", ' +
    '"runasusercat": "all", "runasgroupcat": "all" }')
Ejemplo n.º 29
0
lcm_releaseversion = default(
    'configurations/lcm_application/lcm_releaseversion', '0.2.5-SNAPSHOT')

lcm_application_name = default(
    'configurations/lcm_application/lcm_application_name', 'lcmapp')

lcm_service_user = default('configurations/lcm_application/lcm_service_user',
                           'lcm')

lcm_install_dir = default('configurations/lcm_application/lcm_install_dir',
                          '/opt/lcm')

lcm_home_dir = lcm_install_dir + '/lcm-complete-' + lcm_releaseversion + '/'

LCM_UI_URL = kc.default('configurations/lcm_application/LCM_UI_URL', hostname,
                        kc.is_valid_hostname)

LCM_UI_PORT = kc.default('configurations/lcm_application/LCM_UI_PORT', '8081',
                         kc.is_valid_port)

LCM_SecureUI_Port = kc.default(
    'configurations/lcm_application/LCM_SecureUI_Port', '4444',
    kc.is_valid_port)

LCM_Server_URL = kc.default('configurations/lcm_application/LCM_Server_URL',
                            hostname, kc.is_valid_hostname)

LCM_Server_PORT = kc.default('configurations/lcm_application/LCM_Server_PORT',
                             '8085', kc.is_valid_port)

LCM_SecureServer_Port = kc.default(