diff options
Diffstat (limited to 'deploy')
10 files changed, 54 insertions, 325 deletions
diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-collector.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-collector.yml index 4077ba64..1143ec5c 100755 --- a/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-collector.yml +++ b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-collector.yml @@ -63,7 +63,7 @@ option: "{{ item.option }}" value: "{{ item.value }}" with_items: - - { section: "DEFAULTS", option: "zookeeper", value: "{{ contrail_address }}:2128" } + - { section: "DEFAULTS", option: "zookeeper", value: "{{ contrail_address }}:2181" } - { section: "DISCOVERY", option: "disc_server_ip", value: "{{ contrail_haproxy_address }}" } - { section: "DISCOVERY", option: "disc_server_port", value: "5998" } diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-compute.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-compute.yml index 30d836d9..32ca0cce 100755 --- a/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-compute.yml +++ b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-compute.yml @@ -54,6 +54,10 @@ regexp: "dev=__DEVICE__" line: "dev={{ contrail_vhost_device }}" +- name: "get last ip address" + shell: expr substr `cat /etc/hostname` 5 1 + register: lastip + - name: "fix up contrail vrouter agent config" template: src: "../../templates/provision/contrail-vrouter-agent-conf.j2" diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-webui.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-webui.yml index e50f6a63..7fa3ce9a 100755 --- a/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-webui.yml +++ b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-webui.yml @@ -63,3 +63,4 @@ service: name: "supervisor-webui" state: "restarted" + diff --git a/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-analytics-api-conf.j2 b/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-analytics-api-conf.j2 index dd5e121e..9fbeeca5 100755 --- a/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-analytics-api-conf.j2 +++ b/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-analytics-api-conf.j2 @@ -1,5 +1,5 @@ [DEFAULTS] -host_ip = {{ contrail_address }} +host_ip = {{ contrail_haproxy_address }} rest_api_ip = {{ contrail_haproxy_address }} rest_api_port = 8081 #cassandra_server_list = {% for cur_host in groups['controller'] %}{{ ip_settings[cur_host]['mgmt']['ip'] }}:9160{% if not loop.last %} {% endif %}{% endfor %} diff --git a/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-query-engine-conf.j2 b/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-query-engine-conf.j2 index 3eb20443..d1228b11 100755 --- a/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-query-engine-conf.j2 +++ b/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-query-engine-conf.j2 @@ -1,6 +1,10 @@ [DEFAULT] hostip = {{ contrail_address }} + + #cassandra_server_list = {% for cur_host in groups['controller'] %}{{ ip_settings[cur_host]['mgmt']['ip'] }}:9160{% if not loop.last %} {% endif %}{% endfor %} + + cassandra_server_list = {% for cur_host in groups['controller'] %}{{ haproxy_hosts[cur_host] }}:9160{% if not loop.last %} {% endif %}{% endfor %} collectors = {{ contrail_haproxy_address }}:8086 diff --git a/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-vrouter-agent-conf.j2 b/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-vrouter-agent-conf.j2 index 61a517c9..d15ec386 100755 --- a/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-vrouter-agent-conf.j2 +++ b/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-vrouter-agent-conf.j2 @@ -127,7 +127,7 @@ control_network_ip = {{ contrail_haproxy_address }} name = vhost0 # IP address and prefix in ip/prefix_len format -ip = {{ contrail_vhost_address }}/{{ contrail_prefixlen }} +ip = {{ contrail_vhost_address }}{{ lastip.stdout_lines[0] }}/{{ contrail_prefixlen }} # Gateway IP address for virtual host gateway = {{ contrail_vhost_gateway }} diff --git a/deploy/adapters/cobbler/kickstarts/default.seed b/deploy/adapters/cobbler/kickstarts/default.seed index 64be15ab..f65b20b3 100644 --- a/deploy/adapters/cobbler/kickstarts/default.seed +++ b/deploy/adapters/cobbler/kickstarts/default.seed @@ -13,6 +13,11 @@ d-i debian-installer/locale string en_US d-i debian-installer/country string US d-i debian-installer/language string en +d-i debian-installer/splash boolean false +d-i debian-installer/quiet boolean false +d-i debian-installer/framebuffer boolean true +d-i hw-detect/load_firmware boolean true + # Keyboard selection. # Disable automatic (interactive) keymap detection. d-i console-setup/ask_detect boolean false diff --git a/deploy/adapters/cobbler/kickstarts/default.xml b/deploy/adapters/cobbler/kickstarts/default.xml deleted file mode 100644 index 04f53632..00000000 --- a/deploy/adapters/cobbler/kickstarts/default.xml +++ /dev/null @@ -1,269 +0,0 @@ -## Figure out if we're kickstarting a system or a profile -#if $getVar('system_name','') != '' -#set $what = "system" -#else -#set $what = "profile" -#end if -<?xml version="1.0" standalone="no"?> -<!-- - - Copyright (c) 2011 Novell - Uwe Gansert ug@suse.de - - This software is licensed to you under the GNU General Public License, - version 2 (GPLv2). There is NO WARRANTY for this software, express or - implied, including the implied warranties of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2 - along with this software; if not, see - http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. - ---> -<!DOCTYPE profile [ -<!ENTITY network SYSTEM "/tmp/profile/network.xml"> -<!ENTITY partition SYSTEM "/tmp/profile/partition.xml"> -<!ENTITY bootloader SYSTEM "/tmp/profile/bootloader.xml"> -]> -<profile xmlns="http://www.suse.com/1.0/yast2ns" xmlns:config="http://www.suse.com/1.0/configns"> - <deploy_image> - <image_installation config:type="boolean">false</image_installation> - </deploy_image> - ## without the next 6 lines autoyast will ask for confirmation bevore installation - <general> - <signature-handling> - <accept_unsigned_file config:type="boolean">true</accept_unsigned_file> - <accept_file_without_checksum config:type="boolean">true</accept_file_without_checksum> - <accept_verification_failed config:type="boolean">true</accept_verification_failed> - <accept_unknown_gpg_key config:type="boolean">true</accept_unknown_gpg_key> - <import_gpg_key config:type="boolean">true</import_gpg_key> - <accept_non_trusted_gpg_key config:type="boolean">true</accept_non_trusted_gpg_key> - </signature-handling> - <mode> - <confirm config:type="boolean">false</confirm> - <final_reboot config:type="boolean">true</final_reboot> - </mode> - </general> - $SNIPPET('hosts.xml') - $SNIPPET('kdump.xml') - ## <keyboard> - ## <keymap>english</keymap> - ## </keyboard> - <language> - <language>en_US</language> - <languages></languages> - </language> - <timezone> - <hwclock>localtime</hwclock> -#if $getVar('timezone', '') != "" - <timezone>$timezone</timezone> -#else - <timezone>US/Pacific</timezone> -#end if - </timezone> - <software> - <add-on> - <add_on_products config:type="list"> - $SNIPPET('repo_config.xml') - </add_on_products> - </add-on> - <patterns config:type="list"> - <pattern>base</pattern> - </patterns> - <packages config:type="list"> - <package>iputils</package> - <package>openssh</package> - <package>gcc</package> - <package>net-tools</package> - <package>ethtool</package> - <package>ntp</package> - <package>wget</package> - <package>rsyslog</package> - <package>iproute2</package> - <package>parted</package> - <package>lsb-release</package> -#if $getVar('tool', '') != '' - #set $suse_software = "software_%s.xml" % $tool -$SNIPPET($suse_software) -#end if - </packages> - <do_online_update config:type="boolean">true</do_online_update> <!-- since openSUSE 11.1 --> - </software> - $SNIPPET('yast_repo_config.xml') - <files config:type="list"> - $SNIPPET('limits_conf.xml') - $SNIPPET('ssh.xml') - $SNIPPET('sshd.xml') - $SNIPPET('sysctl.xml') - $SNIPPET('rsyslog.xml') - </files> - <login_settings/> - <sysconfig config:type="list" > - </sysconfig> - <networking> - &amp;network; - </networking> - $SNIPPET('ntp.xml') - <partitioning config:type="list"> - &amp;partition; - </partitioning> - <bootloader> - &amp;bootloader; - </bootloader> - <runlevel> - <default>3</default> - <services config:type="list"> - <service> - <service_name>sshd</service_name> - <service_status>enable</service_status> - </service> - <service> - <service_name>ntp</service_name> - <service_status>enable</service_status> - </service> - <service> - <service_name>syslog</service_name> - <service_status>enable</service_status> - </service> - <service> - <service_name>autoyast</service_name> - <service_status>enable</service_status> - </service> - </services> - </runlevel> - <sysconfig config:type="list"> - <sysconfig_entry> - <sysconfig_key>SYSLOG_DAEMON</sysconfig_key> - <sysconfig_path>/etc/sysconfig/syslog</sysconfig_path> - <sysconfig_value>rsyslogd</sysconfig_value> - </sysconfig_entry> - <sysconfig_entry> - <sysconfig_key>RSYSLOGD_COMPAT_VERSION</sysconfig_key> - <sysconfig_path>/etc/sysconfig/syslog</sysconfig_path> - <sysconfig_value>4</sysconfig_value> - </sysconfig_entry> - </sysconfig> - <user_defaults> - <expire></expire> - <home>/home</home> - <inactive>-1</inactive> - <shell>/bin/bash</shell> - <skel>/etc/skel</skel> - </user_defaults> - <users config:type="list"> -#if $getVar('username', 'root') != "root" - <user> - <encrypted config:type="boolean">false</encrypted> - <fullname>root</fullname> - <gid>0</gid> - <home>/root</home> - <password_settings> - <expire></expire> - <flag></flag> - <inact></inact> - <max></max> - <min></min> - <warn></warn> - </password_settings> - <shell>/bin/bash</shell> - <uid>0</uid> - <username>root</username> - <user_password>root</user_password> - </user> - #set username = $getVar('username', 'root') - <user> -#if $getVar('password', '') != "" - <encrypted config:type="boolean">true</encrypted> - <user_password>$password</user_password> -#else - <encrypted config:type="boolean">false</encrypted> - <user_password>$username</user_password> -#end if - <username>$username</username> - <fullname>$username</fullname> - <password_settings> - <expire></expire> - <flag></flag> - <inact></inact> - <max></max> - <min></min> - <warn></warn> - </password_settings> - <shell>/bin/bash</shell> - </user> -#else - <user> -#if $getVar('password', '') != "" - <encrypted config:type="boolean">true</encrypted> - <user_password>$password</user_password> -#else - <encrypted config:type="boolean">false</encrypted> - <user_password>root</user_password> -#end if - <username>root</username> - <fullname>root</fullname> - <gid>0</gid> - <home>/root</home> - <password_settings> - <expire></expire> - <flag></flag> - <inact></inact> - <max></max> - <min></min> - <warn></warn> - </password_settings> - <shell>/bin/bash</shell> - <uid>0</uid> - </user> -#end if - </users> - <scripts> - ## we have to include the pre-scripts tag to get kickstart_start included - <pre-scripts config:type="list"> - <script> - <interpreter>shell</interpreter> - <filename>pre_install_script.sh</filename> - <source><![CDATA[ - wget -O- http://$http_server/cblr/svc/op/script/$what/$name/?script=suse_early_default | /bin/bash - ]]></source> - </script> - ## SuSE has an annoying habit on ppc64 of changing the system - ## boot order after installation. This makes it non-trivial to - ## automatically re-install future OS. -#set global $wrappedscript = 'save_boot_device' -$SNIPPET('suse_scriptwrapper.xml') - </pre-scripts> - <post-scripts config:type="list"> - <script> - <interpreter>shell</interpreter> - <network_needed config:type="boolean">true</network_needed> - <filename>post_install_script.sh</filename> - <source><![CDATA[ - wget -O- http://$http_server/cblr/svc/op/script/$what/$name/?script=suse_post_default | /bin/bash - ]]></source> - </script> - ## This plugin wrapper provides the flexibility to call pure shell - ## snippets which can be used directly on kickstart and with with - ## wrapper on SuSE. -#set global $wrappedscript = 'restore_boot_device' -$SNIPPET('suse_scriptwrapper.xml') - </post-scripts> - <chroot-scripts config:type="list"> - <script> - <interpreter>shell</interpreter> - <chrooted config:type="boolean">true</chrooted> - <filename>chroot_install_script.sh</filename> - <source><![CDATA[ - wget -O- http://$http_server/cblr/svc/op/script/$what/$name/?script=suse_late_default | /bin/bash - ]]></source> - </script> - </chroot-scripts> - <init-scripts config:type="list"> - <script> - <interpreter>shell</interpreter> - <filename>init_install_script.sh</filename> - <source><![CDATA[ - wget -O- http://$http_server/cblr/svc/op/script/$what/$name/?script=suse_init_default | /bin/bash - ]]></source> - </script> - </init-scripts> - </scripts> -</profile> diff --git a/deploy/client.py b/deploy/client.py index 62d12885..174356e0 100644 --- a/deploy/client.py +++ b/deploy/client.py @@ -835,48 +835,49 @@ class CompassClient(object): raise RuntimeError("redeploy cluster failed") def get_installing_progress(self, cluster_id): - """get intalling progress.""" - action_timeout = time.time() + 60 * float(CONF.action_timeout) - deployment_timeout = time.time() + 60 * float( - CONF.deployment_timeout) - - current_time = time.time - deployment_failed = True - while current_time() < deployment_timeout: - status, cluster_state = self.client.get_cluster_state(cluster_id) - if not self.is_ok(status): - raise RuntimeError("can not get cluster state") + def _get_installing_progress(): + """get intalling progress.""" + action_timeout = time.time() + 60 * float(CONF.action_timeout) + deployment_timeout = time.time() + 60 * float( + CONF.deployment_timeout) + + current_time = time.time + while current_time() < deployment_timeout: + status, cluster_state = self.client.get_cluster_state(cluster_id) + if not self.is_ok(status): + LOG.error("can not get cluster state") - if cluster_state['state'] in ['UNINITIALIZED', 'INITIALIZED']: - if current_time() >= action_timeout: - deployment_failed = True + # maybe a transient error? + time.sleep(5) + status, cluster_state = self.client.get_cluster_state(cluster_id) + if not self.is_ok(status): + # OK, there's something wrong + raise RuntimeError("can not get cluster state") + + if cluster_state['state'] in ['UNINITIALIZED', 'INITIALIZED']: + if current_time() >= action_timeout: + raise RuntimeError("installation timeout") + else: + time.sleep(5) + continue + + elif cluster_state['state'] == 'SUCCESSFUL': LOG.info( 'get cluster %s state status %s: %s, successful', cluster_id, status, cluster_state ) break - else: - time.sleep(5) - continue - - elif cluster_state['state'] == 'SUCCESSFUL': - deployment_failed = False - LOG.info( - 'get cluster %s state status %s: %s, successful', - cluster_id, status, cluster_state - ) - break - elif cluster_state['state'] == 'ERROR': - deployment_failed = True - LOG.info( - 'get cluster %s state status %s: %s, error', - cluster_id, status, cluster_state - ) - break - - kill_print_proc() - if deployment_failed: - raise RuntimeError("deploy cluster failed") + elif cluster_state['state'] == 'ERROR': + raise RuntimeError( + 'get cluster %s state status %s: %s, error', + (cluster_id, status, cluster_state) + ) + try: + _get_installing_progress() + finally: + # do this twice, make sure process be killed + kill_print_proc() + kill_print_proc() def check_dashboard_links(self, cluster_id): dashboard_url = CONF.dashboard_url diff --git a/deploy/status_callback.py b/deploy/status_callback.py index 86191322..e430326b 100755 --- a/deploy/status_callback.py +++ b/deploy/status_callback.py @@ -1,20 +1,3 @@ -# (C) 2012, Michael DeHaan, <michael.dehaan@gmail.com> - -# This file is part of Ansible -# -# Ansible is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Ansible is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Ansible. If not, see <http://www.gnu.org/licenses/>. - import httplib import json import sys |