Beispiel #1
0
    def joined(self):
        """Indicate the relation is connected and install required plugins."""
        log("Installing and configuring gearman-plugin for Zuul communication")
        # zuul relation requires we install the required plugins and set the
        # address of the remote zuul/gearman service in the plugin setting.
        plugins = Plugins()
        plugins.install(PLUGINS)
        self.set_state("{relation_name}.connected")

        # Generate plugin config with address of remote unit.
        zuul_host = relation_get("private-address")
        zuul_config = ZUUL_CONFIG.format(zuul_host).encode("utf-8")
        write_file(GERMAN_PLUGIN,
                   zuul_config,
                   owner="jenkins",
                   group="nogroup")

        # Restart jenkins so changes will take efect.
        service_restart("jenkins")

        # Trigger the extension hook to update it with zuul relation data, if
        # it's coded to do so.
        hooks = Hooks()
        hooks.execute(["extension-relation-joined"])
Beispiel #2
0
    nova_metadata_requirement,
    CEPH_SECRET_UUID,
    assert_libvirt_rbd_imagebackend_allowed,
    NovaAPIAppArmorContext,
    NovaComputeAppArmorContext,
    NovaNetworkAppArmorContext,
)
from charmhelpers.contrib.charmsupport import nrpe
from charmhelpers.core.sysctl import create as create_sysctl
from charmhelpers.contrib.hardening.harden import harden

from socket import gethostname

import charmhelpers.contrib.openstack.vaultlocker as vaultlocker

hooks = Hooks()
CONFIGS = register_configs()
MIGRATION_AUTH_TYPES = ["ssh"]
LIBVIRTD_PID = '/var/run/libvirtd.pid'


@hooks.hook('install.real')
@harden()
def install():
    status_set('maintenance', 'Executing pre-install')
    execd_preinstall()
    configure_installation_source(config('openstack-origin'))

    status_set('maintenance', 'Installing apt packages')
    apt_update()
    apt_install(determine_packages(), fatal=True)
Beispiel #3
0
                        install_chef_cookbooks, \
                        run_recipe #pylint: disable=F0401


KAFKA_CONNECTOR_VERSION = "1.0.0"
ESB_VERSION = "4.9.0"
PING_SOAP_MESSAGE = """<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
   <soapenv:Body>
      <p:echoInt xmlns:p="http://echo.services.core.carbon.wso2.org">
         <in>1</in>
      </p:echoInt>
   </soapenv:Body>
</soapenv:Envelope>"""

HOOKS = Hooks()

@HOOKS.hook('install')
def install():
    # needed because of weird error
    fix_hostname_resolv()
    subprocess.check_call(['sudo', 'apt-get', 'update'])
    install_chef_zero()
    configure_chef_zero()
    # copy cookbooks and upload to server
    install_chef_cookbooks()
    # run wso2 esb cookbook
    run_recipe("wso2::esb")
    # Wait for ESB to start
    counter = 0
    print "Waiting for ESB to come online"