Changes:
Updated template files Configured plumgrid install sources
This commit is contained in:
parent
174d5da3e8
commit
561ee23925
|
@ -34,7 +34,8 @@ from pg_gw_utils import (
|
||||||
load_iptables,
|
load_iptables,
|
||||||
restart_on_change,
|
restart_on_change,
|
||||||
restart_on_stop,
|
restart_on_stop,
|
||||||
director_cluster_ready
|
director_cluster_ready,
|
||||||
|
configure_pg_sources
|
||||||
)
|
)
|
||||||
|
|
||||||
hooks = Hooks()
|
hooks = Hooks()
|
||||||
|
@ -92,6 +93,9 @@ def config_changed():
|
||||||
charm_config.changed('iovisor-build')):
|
charm_config.changed('iovisor-build')):
|
||||||
stop_pg()
|
stop_pg()
|
||||||
status_set('maintenance', 'Upgrading apt packages')
|
status_set('maintenance', 'Upgrading apt packages')
|
||||||
|
if charm_config.changed('install_sources'):
|
||||||
|
if not configure_pg_sources():
|
||||||
|
log('IOError: /etc/apt/sources.list couldn\'t be updated')
|
||||||
configure_sources(update=True)
|
configure_sources(update=True)
|
||||||
pkgs = determine_packages()
|
pkgs = determine_packages()
|
||||||
for pkg in pkgs:
|
for pkg in pkgs:
|
||||||
|
|
|
@ -42,6 +42,7 @@ from charmhelpers.contrib.openstack.utils import (
|
||||||
os_release,
|
os_release,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
SOURCES_LIST = '/etc/apt/sources.list'
|
||||||
LXC_CONF = "/etc/libvirt/lxc.conf"
|
LXC_CONF = "/etc/libvirt/lxc.conf"
|
||||||
TEMPLATES = 'templates/'
|
TEMPLATES = 'templates/'
|
||||||
PG_LXC_DATA_PATH = '/var/lib/libvirt/filesystems/plumgrid-data'
|
PG_LXC_DATA_PATH = '/var/lib/libvirt/filesystems/plumgrid-data'
|
||||||
|
@ -78,6 +79,23 @@ 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()
|
||||||
|
return True
|
||||||
|
except IOError:
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
def determine_packages():
|
def determine_packages():
|
||||||
'''
|
'''
|
||||||
Returns list of packages required by PLUMgrid Gateway as specified
|
Returns list of packages required by PLUMgrid Gateway as specified
|
||||||
|
|
|
@ -1,2 +1,3 @@
|
||||||
$template ls_json,"{{'{'}}{{'%'}}timestamp:::date-rfc3339,jsonf:@timestamp%,%source:::jsonf:@source_host%,%msg:::json%}"
|
$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" ~
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{{ fabric_interface }} = fabric_core host
|
{{ fabric_interface }} = fabric_core host
|
||||||
{% if ext_interfaces -%}
|
{% if ext_interfaces -%}
|
||||||
{% for ip in ext_interfaces -%}
|
{% for dev in ext_interfaces -%}
|
||||||
{{ ip }} = access_phys
|
{{ dev }} = access_phys
|
||||||
{% endfor -%}
|
{% endfor -%}
|
||||||
{% endif -%}
|
{% endif -%}
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,9 @@ label={{ label}}
|
||||||
plumgrid_rsync_port=2222
|
plumgrid_rsync_port=2222
|
||||||
plumgrid_rest_addr=0.0.0.0:9180
|
plumgrid_rest_addr=0.0.0.0:9180
|
||||||
fabric_mode={{ fabric_mode }}
|
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_iovisor=yes
|
||||||
start_plumgrid=`/opt/pg/scripts/pg_is_director.sh $plumgrid_ip`
|
start_plumgrid=`/opt/pg/scripts/pg_is_director.sh $plumgrid_ip`
|
||||||
location=
|
location=
|
||||||
|
|
Loading…
Reference in New Issue