Explorar el Código

5.1 changes

- configure-pg-sources added
- updated templates
tags/14.04-eol
Bilal Baqar hace 3 años
padre
commit
03c379164b

+ 4
- 1
hooks/pg_gw_hooks.py Ver fichero

@@ -34,7 +34,8 @@ from pg_gw_utils import (
load_iptables,
restart_on_change,
restart_on_stop,
director_cluster_ready
director_cluster_ready,
configure_pg_sources
)

hooks = Hooks()
@@ -92,6 +93,8 @@ def config_changed():
charm_config.changed('iovisor-build')):
stop_pg()
status_set('maintenance', 'Upgrading apt packages')
if charm_config.changed('install_sources'):
configure_pg_sources()
configure_sources(update=True)
pkgs = determine_packages()
for pkg in pkgs:

+ 17
- 0
hooks/pg_gw_utils.py Ver fichero

@@ -42,6 +42,7 @@ from charmhelpers.contrib.openstack.utils import (
os_release,
)

SOURCES_LIST = '/etc/apt/sources.list'
LXC_CONF = "/etc/libvirt/lxc.conf"
TEMPLATES = 'templates/'
PG_LXC_DATA_PATH = '/var/lib/libvirt/filesystems/plumgrid-data'
@@ -78,6 +79,22 @@ BASE_RESOURCE_MAP = OrderedDict([
])


def configure_pg_sources():
'''
Returns true if install sources is updated in sources.list file
'''
try:
with open(SOURCES_LIST, 'r+') as sources:
all_lines = sources.readlines()
sources.seek(0)
for i in (line for line in all_lines if "plumgrid" not in line):
sources.write(i)
sources.truncate()
sources.close()
except IOError:
log('Unable to update /etc/apt/sources.list')


def determine_packages():
'''
Returns list of packages required by PLUMgrid Gateway as specified

+ 2
- 1
templates/kilo/00-pg.conf Ver fichero

@@ -1,2 +1,3 @@
$template ls_json,"{{'{'}}{{'%'}}timestamp:::date-rfc3339,jsonf:@timestamp%,%source:::jsonf:@source_host%,%msg:::json%}"
:syslogtag,isequal,"pg:" @{{ opsvm_ip }}:6000;ls_json
if $syslogtag == 'pg:' and not ($msg contains 'dht_cli_') then @{{ opsvm_ip }}:6000;ls_json
:msg, contains, "VM Interface Stats" ~

+ 2
- 2
templates/kilo/ifcs.conf Ver fichero

@@ -1,7 +1,7 @@
{{ fabric_interface }} = fabric_core host
{% if ext_interfaces -%}
{% for ip in ext_interfaces -%}
{{ ip }} = access_phys
{% for dev in ext_interfaces -%}
{{ dev }} = access_phys
{% endfor -%}
{% endif -%}


+ 3
- 0
templates/kilo/plumgrid.conf Ver fichero

@@ -5,6 +5,9 @@ label={{ label}}
plumgrid_rsync_port=2222
plumgrid_rest_addr=0.0.0.0:9180
fabric_mode={{ fabric_mode }}
plumgrid_syslog_ng_ip={{ plumgrid_syslog_ng_ip }}
plumgrid_syslog_ng_port={{ plumgrid_syslog_ng_port }}
plumgrid_monitor_interval={{ plumgrid_monitor_interval }}
start_plumgrid_iovisor=yes
start_plumgrid=`/opt/pg/scripts/pg_is_director.sh $plumgrid_ip`
location=

Cargando…
Cancelar
Guardar