Add power stuff
This commit is contained in:
parent
2bfe7bfae5
commit
c600361299
12
config.yaml
12
config.yaml
|
@ -1,4 +1,16 @@
|
|||
options:
|
||||
power_ip:
|
||||
type: string
|
||||
description: IPs of the PowerKVM machines
|
||||
power_user:
|
||||
type: string
|
||||
description: Username of the PowerKVM machines
|
||||
power_key:
|
||||
type: string
|
||||
description: power user ssh key file
|
||||
power_repo:
|
||||
type: string
|
||||
descrption: url of the power repo
|
||||
openstack-origin:
|
||||
default: distro
|
||||
type: string
|
||||
|
|
|
@ -34,6 +34,8 @@ from charmhelpers.contrib.openstack.utils import (
|
|||
from charmhelpers.contrib.storage.linux.ceph import ensure_ceph_keyring
|
||||
from charmhelpers.payload.execd import execd_preinstall
|
||||
|
||||
from nova_compute_proxy import launch_power
|
||||
|
||||
from nova_compute_utils import (
|
||||
create_libvirt_secret,
|
||||
determine_packages,
|
||||
|
@ -65,7 +67,7 @@ def install():
|
|||
execd_preinstall()
|
||||
configure_installation_source(config('openstack-origin'))
|
||||
apt_update()
|
||||
packages = ['nova-common', 'libvirt-bin']
|
||||
packages = ['nova-common', 'libvirt-bin', 'fabric']
|
||||
apt_install(packages, fatal=True)
|
||||
|
||||
|
||||
|
@ -198,6 +200,7 @@ def compute_changed():
|
|||
import_authorized_keys()
|
||||
import_authorized_keys(user='nova', prefix='nova')
|
||||
import_keystone_ca_cert()
|
||||
launch_power()
|
||||
|
||||
|
||||
@hooks.hook('ceph-relation-joined')
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
import tempfile
|
||||
|
||||
from charmhelpers.core.hookenv import (
|
||||
unit_get,
|
||||
cached,
|
||||
log
|
||||
)
|
||||
|
||||
from charmhelpers.fetch import (
|
||||
apt_install,
|
||||
filter_installed_packages
|
||||
)
|
||||
|
||||
try:
|
||||
import jinja2
|
||||
except ImportError:
|
||||
apt_install(filter_installed_packages(['python-jinja2']),
|
||||
fatal=True)
|
||||
import jinja2
|
||||
|
||||
try:
|
||||
from fabric.api import cd, env, local, parallel, serial
|
||||
from fabric.api import put, run, settings, sudo
|
||||
except ImportError:
|
||||
apt_install(filter_installed_packages(['fabric']),
|
||||
fatal=True)
|
||||
|
||||
|
||||
def launch_power():
|
||||
log('Power launched')
|
|
@ -0,0 +1,5 @@
|
|||
[openstack-pkvm]
|
||||
name=PowerKVM OpenStack local repository
|
||||
baseurl={{ yum-repo }}
|
||||
gpgcheck=0
|
||||
enabled=1
|
Loading…
Reference in New Issue