Ejemplo n.º 1
0
def install():
    if config()['offline'] is False:
        apt_update(fatal=True)
        apt_install(packages=[
            'bind9',
            'dnsutils',
            ], fatal=True)
    else:
        log("Installing offline debian packages")
        install_packages('files/bind')
        # rerun cuz its buggy
        install_packages('files/bind')
        log("Installing Python packages")
        pip_install('files/bind/pip')
    ## use the nameserver in /etc/resolv.conf as a forwarder ...
    import DNS
    DNS.ParseResolvConf("/etc/resolv.conf")
    nameserver = DNS.defaults['server'][0]
    log('Setting dns to be forwarder to :'+nameserver)
    import jinja2
    templateLoader = jinja2.FileSystemLoader( searchpath= os.environ['CHARM_DIR'] )
    #use Jinja2 template to enable bind forwarding
    templateEnv=jinja2.Environment( loader=templateLoader );
    template=templateEnv.get_template('contrib/bind/templates/named.conf.options.jinja2')
    output_from_parsed_template = template.render(forwarder=nameserver)
    # to save the results
    with open("/etc/bind/named.conf.options", "wb") as fh:
        fh.write(output_from_parsed_template)
        ## use jinja2 templates..


    if not os.path.exists('/etc/bind/zone-backup'):
        os.makedirs('/etc/bind/zone-backup')
    open_port(53, "TCP")
    open_port(53, "UDP")
Ejemplo n.º 2
0
def install_deps():
    install_packages([
        'docker-io',
        'git',
        'golang',
        'screen',
        'vim',
    ])
Ejemplo n.º 3
0
def deploy(proxy=''):
    install_packages(['kubernetes'])
    enable_services(['docker.socket',
                     'etcd.service',
                     'kube-apiserver.service',
                     'kube-controller-manager.service',
                     'kube-proxy.service',
                     'kube-scheduler.service',
                     'kubelet.service'])
Ejemplo n.º 4
0
def deploy(proxy=''):
    install_packages(['kubernetes'], proxy=proxy)
    enable_services(['docker.socket',
                     'etcd.service',
                     'kube-apiserver.service',
                     'kube-controller-manager.service',
                     'kube-proxy.service',
                     'kube-scheduler.service',
                     'kubelet.service'])
Ejemplo n.º 5
0
def deploy_engine(proxy=''):
    install_packages([OVIRT_RELEASE], proxy=proxy)
    install_packages(['ovirt-engine'], proxy=proxy)

    put('resources/engine-setup.answers',
        '/tmp/engine-setup.answers', mode=0600)

    sudo('engine-setup '
         '--jboss-home=/usr/share/ovirt-engine-jboss-as '
         '--config=/tmp/engine-setup.answers')
Ejemplo n.º 6
0
def deploy_engine(proxy=''):
    install_packages([OVIRT_RELEASE], proxy=proxy)
    install_packages(['ovirt-engine'], proxy=proxy)

    put('resources/engine-setup.answers',
        '/tmp/engine-setup.answers',
        mode=0600)

    sudo('engine-setup '
         '--jboss-home=/usr/share/ovirt-engine-jboss-as '
         '--config=/tmp/engine-setup.answers')
Ejemplo n.º 7
0
def install_deps():
    install_packages([
        'docker',
        'docker-registry',
        'git',
        'golang',
        'screen',
        'vim',
    ])
    # required on CentOS7
    sudo('yum -y update device-mapper')
Ejemplo n.º 8
0
def install_deps():
    install_packages([
        'gcc',
        'gcc-c++',
        'git',
        'graphviz-devel'
        'libxml2-devel',
        'libxslt',
        'libxslt-devel',
        'memcached',
        'postgresql-devel',
        'postgresql-server',
        'ruby-devel',
        'vim',
    ])
Ejemplo n.º 9
0
    def install(self):
        if config()["offline"] is False:
            apt_update(fatal=True)
            apt_install(packages=["bind9", "dnsutils"], fatal=True)
        else:
            log("Installing offline debian packages")
            install_packages("files/bind")
            # rerun cuz its buggy
            install_packages("files/bind")
            log("Installing Python packages")
            pip_install("files/bind/pip")

        os.makedirs("/etc/bind/zone-backup")
        open_port(53, "TCP")
        open_port(53, "UDP")
Ejemplo n.º 10
0
    def install(self):
        if config()['offline'] is False:
            apt_update(fatal=True)
            apt_install(packages=[
                'bind9',
                'dnsutils',
            ], fatal=True)
        else:
            log("Installing offline debian packages")
            install_packages('files/bind')
            # rerun cuz its buggy
            install_packages('files/bind')
            log("Installing Python packages")
            pip_install('files/bind/pip')

        open_port(53)
Ejemplo n.º 11
0
    def install(self):
        if config()['offline'] is False:
            apt_update(fatal=True)
            apt_install(packages=[
                'bind9',
                'dnsutils',
                ], fatal=True)
        else:
            log("Installing offline debian packages")
            install_packages('files/bind')
            # rerun cuz its buggy
            install_packages('files/bind')
            log("Installing Python packages")
            pip_install('files/bind/pip')

        open_port(53)
Ejemplo n.º 12
0
def install():
    if config()['offline'] is False:
        apt_update(fatal=True)
        apt_install(packages=[
            'bind9',
            'dnsutils',
        ], fatal=True)
    else:
        log("Installing offline debian packages")
        install_packages('files/bind')
        # rerun cuz its buggy
        install_packages('files/bind')
        log("Installing Python packages")
        pip_install('files/bind/pip')
    ## use the nameserver in /etc/resolv.conf as a forwarder ...
    import DNS
    DNS.ParseResolvConf("/etc/resolv.conf")
    nameserver = DNS.defaults['server'][0]
    log('Setting dns to be forwarder to :' + nameserver)
    import jinja2
    templateLoader = jinja2.FileSystemLoader(
        searchpath=os.environ['CHARM_DIR'])
    #use Jinja2 template to enable bind forwarding
    templateEnv = jinja2.Environment(loader=templateLoader)
    template = templateEnv.get_template(
        'contrib/bind/templates/named.conf.options.jinja2')
    output_from_parsed_template = template.render(forwarder=nameserver)
    # to save the results
    with open("/etc/bind/named.conf.options", "wb") as fh:
        fh.write(output_from_parsed_template)
        ## use jinja2 templates..

    if not os.path.exists('/etc/bind/zone-backup'):
        os.makedirs('/etc/bind/zone-backup')
    open_port(53, "TCP")
    open_port(53, "UDP")
Ejemplo n.º 13
0
 def test_install_packages(self, spcm, osldm):
     osldm.return_value = ['foo.deb', 'bar.deb']
     common.install_packages('/tmp/nope')
     spcm.assert_called_with(['dpkg', '-i', '/tmp/nope/bar.deb'])
Ejemplo n.º 14
0
 def test_install_packages(self, spcm, osldm):
     osldm.return_value = ['foo.deb', 'bar.deb']
     common.install_packages('/tmp/nope')
     spcm.assert_called_with(['dpkg', '-i', '/tmp/nope/bar.deb'])
Ejemplo n.º 15
0
def deploy_node(proxy=''):
    install_packages([OVIRT_RELEASE], proxy=proxy)
Ejemplo n.º 16
0
def deploy_node(proxy=''):
    install_packages([OVIRT_RELEASE], proxy=proxy)