From 0b8659d790f5d9522ab17b39fa3bb6d9492944f7 Mon Sep 17 00:00:00 2001 From: Xicheng Chang Date: Tue, 5 Jul 2016 17:52:54 -0400 Subject: [PATCH 01/32] enable remote-deploy Change-Id: I44177e7f212a7f6f3c76ebed49574e4d537bcd8f --- bin/refresh.sh | 14 +- compass/actions/poll_switch.py | 3 +- compass/api/api.py | 15 + compass/db/api/cluster.py | 53 ++- compass/db/api/health_check_report.py | 5 +- compass/db/api/host.py | 55 ++- compass/db/api/machine.py | 33 +- compass/db/api/switch.py | 37 +- compass/db/models.py | 1 + conf/celeryconfig | 5 +- conf/setting | 2 +- .../vars/HA-ansible-multinodes.tmpl | 6 +- install/ansible.sh | 3 +- install/cobbler.sh | 2 +- install/dependency.sh | 9 +- install/install.conf | 117 ++++--- install/install.sh | 316 +++++++++++------- install/register.sh | 21 ++ misc/adapter_changes/Debian.yml | 18 + misc/adapter_changes/keystone_install.yml | 74 ++++ misc/compass_install.repo | 5 + tox.ini | 2 +- 22 files changed, 579 insertions(+), 217 deletions(-) create mode 100755 install/register.sh create mode 100644 misc/adapter_changes/Debian.yml create mode 100644 misc/adapter_changes/keystone_install.yml create mode 100644 misc/compass_install.repo diff --git a/bin/refresh.sh b/bin/refresh.sh index e19b907a..13c3050e 100755 --- a/bin/refresh.sh +++ b/bin/refresh.sh @@ -1,13 +1,13 @@ #!/bin/bash set -e -systemctl restart mysql.service -systemctl status mysql.service || exit $? -/opt/compass/bin/manage_db.py createdb +# systemctl restart mysql.service +# systemctl status mysql.service || exit $? +# /opt/compass/bin/manage_db.py createdb /opt/compass/bin/clean_installers.py --noasync /opt/compass/bin/clean_installation_logs.py rm -rf /var/ansible/run/* -systemctl restart httpd.service -systemctl status httpd.service || exit $? +# systemctl restart httpd.service +# systemctl status httpd.service || exit $? systemctl restart rsyslog.service systemctl status rsyslog.service || exit $? systemctl restart redis.service @@ -17,6 +17,6 @@ systemctl restart cobblerd.service systemctl status cobblerd.service || exit $? systemctl restart compass-celeryd.service systemctl status compass-celeryd.service || exit $? -systemctl restart compass-progress-updated.service -systemctl status compass-progress-updated.service || exit $? +# systemctl restart compass-progress-updated.service +# systemctl status compass-progress-updated.service || exit $? diff --git a/compass/actions/poll_switch.py b/compass/actions/poll_switch.py index d759a8cc..5c29b013 100644 --- a/compass/actions/poll_switch.py +++ b/compass/actions/poll_switch.py @@ -150,7 +150,8 @@ def poll_switch(poller_email, ip_addr, credentials, for switch in switches: for machine_dict in machine_dicts: - logging.debug('add machine: %s', machine_dict) + logging.info('add machine: %s', machine_dict) + machine_dict['owner_id'] = poller.id switch_api.add_switch_machine( switch['id'], False, user=poller, **machine_dict ) diff --git a/compass/api/api.py b/compass/api/api.py index 3cfb8d8f..fe169f3e 100644 --- a/compass/api/api.py +++ b/compass/api/api.py @@ -393,6 +393,10 @@ def _login(use_cookie): ) data['expire_timestamp'] = expire_timestamp user = auth_handler.authenticate_user(**data) + if not user.active: + raise exception_handler.UserDisabled( + '%s is not activated' % user.email + ) if not login_user(user, remember=data.get('remember', False)): raise exception_handler.UserDisabled('failed to login: %s' % user) @@ -415,6 +419,17 @@ def login(): return _login(True) +@app.route("/users/register", methods=['POST']) +def register(): + """register new user.""" + data = _get_request_data() + data['is_admin'] = False + data['active'] = False + return utils.make_json_response( + 200, user_api.add_user(**data) + ) + + @app.route('/users/logout', methods=['POST']) @login_required def logout(): diff --git a/compass/db/api/cluster.py b/compass/db/api/cluster.py index 9fc00402..f00889d5 100644 --- a/compass/db/api/cluster.py +++ b/compass/db/api/cluster.py @@ -480,7 +480,10 @@ def del_cluster( for clusterhost in cluster.clusterhosts ], delete_underlying_host - ) + ), + queue=user.email, + exchange=user.email, + routing_key=user.email ) return { 'status': 'delete action is sent', @@ -1183,7 +1186,10 @@ def _del_cluster_host( ( user.email, clusterhost.cluster_id, clusterhost.host_id, delete_underlying_host - ) + ), + queue=user.email, + exchange=user.email, + routing_key=user.email ) return { 'status': 'delete action sent', @@ -1854,7 +1860,10 @@ def deploy_cluster( ( user.email, cluster_id, [clusterhost.host_id for clusterhost in clusterhosts] - ) + ), + queue=user.email, + exchange=user.email, + routing_key=user.email ) return { 'status': 'deploy action sent', @@ -1918,7 +1927,10 @@ def redeploy_cluster( 'compass.tasks.redeploy_cluster', ( user.email, cluster_id - ) + ), + queue=user.email, + exchange=user.email, + routing_key=user.email ) return { 'status': 'redeploy action sent', @@ -1945,7 +1957,10 @@ def patch_cluster(cluster_id, user=None, session=None, **kwargs): 'compass.tasks.patch_cluster', ( user.email, cluster_id, - ) + ), + queue=user.email, + exchange=user.email, + routing_key=user.email ) return { 'status': 'patch action sent', @@ -2046,7 +2061,7 @@ def update_cluster_host_state( def _update_clusterhost_state( clusterhost, from_database_only=False, - session=None, **kwargs + session=None, user=None, **kwargs ): """Update clusterhost state. @@ -2087,13 +2102,22 @@ def _update_clusterhost_state( utils.update_db_object(session, cluster.state, ready=False) status = '%s state is updated' % clusterhost.name else: + if not user: + user_id = cluster.creator_id + user_dict = user_api.get_user(user_id, session=session) + user_email = user_dict['email'] + else: + user_email = user.email from compass.tasks import client as celery_client celery_client.celery.send_task( 'compass.tasks.package_installed', ( clusterhost.cluster_id, clusterhost.host_id, cluster_ready, host_ready - ) + ), + queue=user_email, + exchange=user_email, + routing_key=user_email ) status = '%s: cluster ready %s host ready %s' % ( clusterhost.name, cluster_ready, host_ready @@ -2126,7 +2150,7 @@ def update_cluster_host_state_internal( ) return _update_clusterhost_state( clusterhost, from_database_only=from_database_only, - session=session, **kwargs + session=session, users=user, **kwargs ) @@ -2169,7 +2193,7 @@ def update_clusterhost_state_internal( clusterhost = _get_clusterhost(clusterhost_id, session=session) return _update_clusterhost_state( clusterhost, from_database_only=from_database_only, - session=session, **kwargs + session=session, user=user, **kwargs ) @@ -2240,10 +2264,19 @@ def update_cluster_state_internal( ) status = '%s state is updated' % cluster.name else: + if not user: + user_id = cluster.creator_id + user_dict = user_api.get_user(user_id, session=session) + user_email = user_dict['email'] + else: + user_email = user.email from compass.tasks import client as celery_client celery_client.celery.send_task( 'compass.tasks.cluster_installed', - (clusterhost.cluster_id, clusterhost_ready) + (clusterhost.cluster_id, clusterhost_ready), + queue=user_email, + exchange=user_email, + routing_key=user_email ) status = '%s installed action set clusterhost ready %s' % ( cluster.name, clusterhost_ready diff --git a/compass/db/api/health_check_report.py b/compass/db/api/health_check_report.py index 562008c9..aaea7a7c 100644 --- a/compass/db/api/health_check_report.py +++ b/compass/db/api/health_check_report.py @@ -179,7 +179,10 @@ def start_check_cluster_health(cluster_id, send_report_url, from compass.tasks import client as celery_client celery_client.celery.send_task( 'compass.tasks.cluster_health', - (cluster.id, send_report_url, user.email) + (cluster.id, send_report_url, user.email), + queue=user.email, + exchange=user.email, + routing_key=user.email ) return { "cluster_id": cluster.id, diff --git a/compass/db/api/host.py b/compass/db/api/host.py index c82f3f8c..3b9b6268 100644 --- a/compass/db/api/host.py +++ b/compass/db/api/host.py @@ -414,12 +414,21 @@ def del_host( logging.info( 'send del host %s task to celery', host_id ) + if not user: + user_id = host.creator_id + user_dict = user_api.get_user(user_id, session=session) + user_email = user_dict['email'] + else: + user_email = user.email from compass.tasks import client as celery_client celery_client.celery.send_task( 'compass.tasks.delete_host', ( user.email, host.id, cluster_ids - ) + ), + queue=user_email, + exchange=user_email, + routing_key=user_email ) return { 'status': 'delete action sent', @@ -912,13 +921,22 @@ def update_host_state_internal( ) status = '%s state is updated' % host.name else: + if not user: + user_id = host.creator_id + user_dict = user_api.get_user(user_id, session=session) + user_email = user_dict['email'] + else: + user_email = user.email from compass.tasks import client as celery_client celery_client.celery.send_task( 'compass.tasks.os_installed', ( host.id, clusterhosts_ready, clusters_os_ready - ) + ), + queue=user_email, + exchange=user_email, + routing_key=user_email ) status = '%s: clusterhosts ready %s clusters os ready %s' % ( host.name, clusterhosts_ready, clusters_os_ready @@ -1011,9 +1029,18 @@ def poweron_host( from compass.tasks import client as celery_client host = _get_host(host_id, session=session) check_host_validated(host) + if not user: + user_id = host.creator_id + user_dict = user_api.get_user(user_id, session=session) + user_email = user_dict['email'] + else: + user_email = user.email celery_client.celery.send_task( 'compass.tasks.poweron_host', - (host.id,) + (host.id,), + queue=user_email, + exchange=user_email, + routing_key=user_email ) return { 'status': 'poweron %s action sent' % host.name, @@ -1037,9 +1064,18 @@ def poweroff_host( from compass.tasks import client as celery_client host = _get_host(host_id, session=session) check_host_validated(host) + if not user: + user_id = host.creator_id + user_dict = user_api.get_user(user_id, session=session) + user_email = user_dict['email'] + else: + user_email = user.email celery_client.celery.send_task( 'compass.tasks.poweroff_host', - (host.id,) + (host.id,), + queue=user_email, + exchange=user_email, + routing_key=user_email ) return { 'status': 'poweroff %s action sent' % host.name, @@ -1063,9 +1099,18 @@ def reset_host( from compass.tasks import client as celery_client host = _get_host(host_id, session=session) check_host_validated(host) + if not user: + user_id = host.creator_id + user_dict = user_api.get_user(user_id, session=session) + user_email = user_dict['email'] + else: + user_email = user.email celery_client.celery.send_task( 'compass.tasks.reset_host', - (host.id,) + (host.id,), + queue=user_email, + exchange=user_email, + routing_key=user_email ) return { 'status': 'reset %s action sent' % host.name, diff --git a/compass/db/api/machine.py b/compass/db/api/machine.py index 9a8d3eac..b7b16b2d 100644 --- a/compass/db/api/machine.py +++ b/compass/db/api/machine.py @@ -226,9 +226,18 @@ def poweron_machine( machine = _get_machine( machine_id, session=session ) + if not user: + user_id = machine.owner_id + user_dict = user_api.get_user(user_id, session=session) + user_email = user_dict['email'] + else: + user_email = user.email celery_client.celery.send_task( 'compass.tasks.poweron_machine', - (machine_id,) + (machine_id,), + queue=user_email, + exchange=user_email, + routing_key=user_email ) return { 'status': 'poweron %s action sent' % machine.mac, @@ -253,9 +262,18 @@ def poweroff_machine( machine = _get_machine( machine_id, session=session ) + if not user: + user_id = machine.owner_id + user_dict = user_api.get_user(user_id, session=session) + user_email = user_dict['email'] + else: + user_email = user.email celery_client.celery.send_task( 'compass.tasks.poweroff_machine', - (machine_id,) + (machine_id,), + queue=user_email, + exchange=user_email, + routing_key=user_email ) return { 'status': 'poweroff %s action sent' % machine.mac, @@ -280,9 +298,18 @@ def reset_machine( machine = _get_machine( machine_id, session=session ) + if not user: + user_id = machine.owner_id + user_dict = user_api.get_user(user_id, session=session) + user_email = user_dict['email'] + else: + user_email = user.email celery_client.celery.send_task( 'compass.tasks.reset_machine', - (machine_id,) + (machine_id,), + queue=user_email, + exchange=user_email, + routing_key=user_email ) return { 'status': 'reset %s action sent' % machine.mac, diff --git a/compass/db/api/switch.py b/compass/db/api/switch.py index 4c7c8e59..53814b84 100644 --- a/compass/db/api/switch.py +++ b/compass/db/api/switch.py @@ -30,10 +30,11 @@ from compass.utils import util SUPPORTED_FIELDS = ['ip_int', 'vendor', 'state'] SUPPORTED_FILTER_FIELDS = ['ip_int', 'vendor', 'state'] SUPPORTED_SWITCH_MACHINES_FIELDS = [ - 'switch_ip_int', 'port', 'vlans', 'mac', 'tag', 'location' + 'switch_ip_int', 'port', 'vlans', 'mac', 'tag', 'location', + 'owner_id' ] SUPPORTED_MACHINES_FIELDS = [ - 'port', 'vlans', 'mac', 'tag', 'location' + 'port', 'vlans', 'mac', 'tag', 'location', 'owner_id' ] SUPPORTED_SWITCH_MACHINES_HOSTS_FIELDS = [ 'switch_ip_int', 'port', 'vlans', 'mac', @@ -57,7 +58,7 @@ UPDATED_FILTERS_FIELDS = ['put_machine_filters'] PATCHED_FILTERS_FIELDS = ['patched_machine_filters'] ADDED_MACHINES_FIELDS = ['mac'] OPTIONAL_ADDED_MACHINES_FIELDS = [ - 'ipmi_credentials', 'tag', 'location' + 'ipmi_credentials', 'tag', 'location', 'owner_id' ] ADDED_SWITCH_MACHINES_FIELDS = ['port'] OPTIONAL_ADDED_SWITCH_MACHINES_FIELDS = ['vlans'] @@ -65,7 +66,7 @@ UPDATED_MACHINES_FIELDS = [ 'ipmi_credentials', 'tag', 'location' ] -UPDATED_SWITCH_MACHINES_FIELDS = ['port', 'vlans'] +UPDATED_SWITCH_MACHINES_FIELDS = ['port', 'vlans', 'owner_id'] PATCHED_MACHINES_FIELDS = [ 'patched_ipmi_credentials', 'patched_tag', 'patched_location' @@ -83,7 +84,7 @@ RESP_ACTION_FIELDS = [ ] RESP_MACHINES_FIELDS = [ 'id', 'switch_id', 'switch_ip', 'machine_id', 'switch_machine_id', - 'port', 'vlans', 'mac', + 'port', 'vlans', 'mac', 'owner_id', 'ipmi_credentials', 'tag', 'location', 'created_at', 'updated_at' ] @@ -590,6 +591,8 @@ def list_switch_machines( switch_machines = utils.list_db_objects( session, models.SwitchMachine, switch_id=switch.id, **filters ) + if not user.is_admin and len(switch_machines): + switch_machines = [m for m in switch_machines if m.machine.owner_id == user.id] return _filter_switch_machines(switch_machines) @@ -676,13 +679,14 @@ def _add_machine_if_not_exist(mac=None, session=None, **kwargs): @utils.input_validates(vlans=_check_vlans) def _add_switch_machine_only( switch, machine, exception_when_existing=True, - session=None, port=None, **kwargs + session=None, owner_id=None, port=None, **kwargs ): """add a switch machine.""" return utils.add_db_object( session, models.SwitchMachine, exception_when_existing, switch.id, machine.id, port=port, + owner_id=owner_id, **kwargs ) @@ -698,7 +702,7 @@ def _add_switch_machine_only( @utils.wrap_to_dict(RESP_MACHINES_FIELDS) def _add_switch_machine( switch_id, exception_when_existing=True, - mac=None, port=None, session=None, **kwargs + mac=None, port=None, session=None, owner_id=None, **kwargs ): """Add switch machine. @@ -707,7 +711,7 @@ def _add_switch_machine( """ switch = _get_switch(switch_id, session=session) machine = _add_machine_if_not_exist( - mac=mac, session=session, **kwargs + mac=mac, session=session, owner_id=owner_id, **kwargs ) return _add_switch_machine_only( switch, machine, @@ -722,13 +726,14 @@ def _add_switch_machine( ) def add_switch_machine( switch_id, exception_when_existing=True, - mac=None, user=None, session=None, **kwargs + mac=None, user=None, session=None, + owner_id=None, **kwargs ): """Add switch machine to a switch.""" return _add_switch_machine( switch_id, exception_when_existing=exception_when_existing, - mac=mac, session=session, **kwargs + mac=mac, session=session, owner_id=owner_id, **kwargs ) @@ -747,7 +752,7 @@ def add_switch_machine( ) def add_switch_machines( exception_when_existing=False, - data=[], user=None, session=None + data=[], user=None, session=None, owner_id=None ): """Add switch machines.""" switch_machines = [] @@ -817,7 +822,7 @@ def add_switch_machines( switch_machines.append(_add_switch_machine_only( switch_object, machine_object, exception_when_existing, - session=session, **machine + session=session, owner_id=owner_id, **machine )) return { 'switches_machines': switch_machines, @@ -838,7 +843,10 @@ def poll_switch(switch_id, user=None, session=None, **kwargs): switch = _get_switch(switch_id, session=session) celery_client.celery.send_task( 'compass.tasks.pollswitch', - (user.email, switch.ip, switch.credentials) + (user.email, switch.ip, switch.credentials), + queue=user.email, + exchange=user.email, + routing_key=user.email ) return { 'status': 'action %s sent' % kwargs, @@ -1116,7 +1124,8 @@ def _add_machine_to_switch( machine_id, session=session ) _add_switch_machine_only( - switch, machine, False, **kwargs + switch, machine, False, + owner_id=machine.owner_id, **kwargs ) diff --git a/compass/db/models.py b/compass/db/models.py index 2063d03d..e183eb08 100644 --- a/compass/db/models.py +++ b/compass/db/models.py @@ -1357,6 +1357,7 @@ class SwitchMachine(BASE, HelperMixin, TimestampMixin): Integer, ForeignKey('machine.id', onupdate='CASCADE', ondelete='CASCADE') ) + owner_id = Column(Integer, ForeignKey('user.id')) port = Column(String(80), nullable=True) vlans = Column(JSONEncoded, default=[]) __table_args__ = ( diff --git a/conf/celeryconfig b/conf/celeryconfig index f4911279..797e7618 100644 --- a/conf/celeryconfig +++ b/conf/celeryconfig @@ -2,8 +2,11 @@ CELERY_RESULT_BACKEND ="amqp://" -BROKER_URL = "amqp://guest:guest@localhost:5672//" +BROKER_URL = "amqp://guest:guest@www.stack360.io:5672//" CELERY_IMPORTS=("compass.tasks.tasks",) CELERY_ACCEPT_CONTENT = ['pickle', 'json', 'msgpack', 'yaml'] C_FORCE_ROOT = 1 +CELERY_DEFAULT_QUEUE = 'admin@huawei.com' +CELERY_DEFAULT_EXCHANGE = 'admin@huawei.com' +CELERY_DEFAULT_ROUTING_KEY = 'admin@huawei.com' diff --git a/conf/setting b/conf/setting index a1e9bff2..481db89f 100644 --- a/conf/setting +++ b/conf/setting @@ -2,7 +2,7 @@ CONFIG_DIR = '/etc/compass' DATABASE_TYPE = 'mysql' DATABASE_USER = 'root' DATABASE_PASSWORD = 'root' -DATABASE_SERVER = '127.0.0.1:3306' +DATABASE_SERVER = 'www.stack360.io:3306' DATABASE_NAME = 'compass' SQLALCHEMY_DATABASE_URI = '%s://%s:%s@%s/%s' % (DATABASE_TYPE, DATABASE_USER, DATABASE_PASSWORD, DATABASE_SERVER, DATABASE_NAME) SQLALCHEMY_DATABASE_POOL_TYPE = 'instant' diff --git a/conf/templates/ansible_installer/openstack_mitaka/vars/HA-ansible-multinodes.tmpl b/conf/templates/ansible_installer/openstack_mitaka/vars/HA-ansible-multinodes.tmpl index 8cb19081..53954ad0 100644 --- a/conf/templates/ansible_installer/openstack_mitaka/vars/HA-ansible-multinodes.tmpl +++ b/conf/templates/ansible_installer/openstack_mitaka/vars/HA-ansible-multinodes.tmpl @@ -111,8 +111,10 @@ ERLANG_TOKEN: YOWSJSJIGGAUFZTIBRAD #set neutron_pass = $console_credentials.network.password #set ceilometer_dbpass = $credentials.metering.password #set ceilometer_pass = $console_credentials.metering.password -#set aodh_dbpass = $credentials.alarming.password -#set aodh_pass = $console_credentials.alarming.password +##set aodh_dbpass = $credentials.alarming.password +#set aodh_dbpass = "alarming" +##set aodh_pass = $console_credentials.alarming.password +#set aodh_pass = "alarming" #set admin_pass = $console_credentials.admin.password #set demo_pass = $console_credentials.demo.password diff --git a/install/ansible.sh b/install/ansible.sh index 6010221f..7f24cfbc 100755 --- a/install/ansible.sh +++ b/install/ansible.sh @@ -13,7 +13,8 @@ fi source $DIR/install_func.sh echo "INstalling ansible related packages" -sudo yum -y install ansible +# sudo yum -y install ansible +pip install ansible==1.9.2 if [[ "$?" != "0" ]]; then echo "Failed to install ansible" exit 1 diff --git a/install/cobbler.sh b/install/cobbler.sh index d505ae93..6c88f4dc 100755 --- a/install/cobbler.sh +++ b/install/cobbler.sh @@ -13,7 +13,7 @@ fi source $DIR/install_func.sh echo "Installing cobbler related packages" -sudo yum -y install cobbler cobbler-web createrepo mkisofs python-cheetah python-simplejson python-urlgrabber PyYAML Django corosync pykickstart +sudo yum --enablerepo=compass_install --nogpgcheck -y install cobbler cobbler-web createrepo mkisofs python-cheetah python-simplejson python-urlgrabber PyYAML Django corosync pykickstart sudo yum -y upgrade yum-utils if [[ "$?" != "0" ]]; then echo "failed to install cobbler related packages" diff --git a/install/dependency.sh b/install/dependency.sh index b9a577c3..1353bf72 100755 --- a/install/dependency.sh +++ b/install/dependency.sh @@ -4,17 +4,18 @@ echo 'Installing Required packages for Compass...' sudo yum clean all sudo yum update -y --skip-broken if [ "$tempest" == "true" ]; then - sudo yum install -y virt-install libvirt qemu-kvm libxml2-devel libffi-devel libxslt-devel python-devel sshpass openssl-devel + sudo yum --enablerepo=compass_install install -y virt-install libvirt qemu-kvm libxml2-devel libffi-devel libxslt-devel python-devel sshpass openssl-devel --nogpgcheck if [[ "$?" != "0" ]]; then echo "failed to install tempest yum dependency" exit 1 fi fi -sudo yum install -y $MYSQL -sudo yum install -y rsyslog logrotate ntp iproute openssh-clients python python-devel git wget syslinux amqp rabbitmq-server mod_wsgi httpd squid dhcp bind rsync yum-utils xinetd tftp-server gcc net-snmp-utils net-snmp net-snmp-python unzip openssl openssl098e ca-certificates mysql-devel mysql-server mysql MySQL-python python-virtualenv python-setuptools python-pip bc libselinux-python libffi-devel openssl-devel +sudo yum --enablerepo=compass_install install -y $MYSQL +sudo yum --enablerepo=compass_install --nogpgcheck install -y rsyslog logrotate ntp iproute openssh-clients python python-devel git wget syslinux amqp rabbitmq-server mod_wsgi httpd squid dhcp bind rsync yum-utils xinetd tftp-server gcc net-snmp-utils net-snmp net-snmp-python unzip openssl openssl098e ca-certificates mysql-devel mysql-server mysql MySQL-python python-virtualenv python-setuptools python-pip bc libselinux-python libffi-devel openssl-devel sudo yum --setopt=tsflags=noscripts -y remove redis -sudo yum --enablerepo=remi,remi-test install -y redis +# sudo yum --enablerepo=remi,remi-test install -y redis +sudo yum --enablerepo=compass_install --nogpgcheck install -y redis if [[ "$?" != "0" ]]; then echo "failed to install yum dependency" diff --git a/install/install.conf b/install/install.conf index bfcf173b..7315c908 100755 --- a/install/install.conf +++ b/install/install.conf @@ -2,90 +2,107 @@ # Config File for Compass Installer # ##################################### # OS_INSTALLER indicates the tool for OS provisioning, default is 'cobbler'. -export OS_INSTALLER=${OS_INSTALLER:-cobbler} +export OS_INSTALLER="cobbler" # PACKAGE_INSTALLER indicates the tool for Package provisioning, default is 'chef'. -export PACKAGE_INSTALLER=${PACKAGE_INSTALLER:-package} +export PACKAGE_INSTALLER="package" # set remi release url # export ATOMIC=${ATOMIC:-http://www6.atomicorp.com/channels/atomic/${IMAGE_TYPE,,}/${IMAGE_VERSION_MAJOR}/${IMAGE_ARCH}/RPMS/atomic-release-1.0-19.${IMAGE_TYPE_OTHER}${IMAGE_VERSION_MAJOR}.art.noarch.rpm} # export REMI=${REMI:-http://rpms.famillecollet.com/enterprise/remi-release-6.rpm} -export REMI=${REMI:-http://rpms.famillecollet.com/enterprise/remi-release-7.rpm} +export REMI="http://rpms.famillecollet.com/enterprise/remi-release-7.rpm" -export EPEL=${EPEL:-https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm} +export EPEL="https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm" -export MYSQL=${MYSQL:-http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm} +export MYSQL="http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm" -export OPENSTACK_ANSIBLE_MODULE=${OPENSTACK_ANSIBLE_MODULE:-https://github.com/openstack-ansible/openstack-ansible-modules.git} -# service NIC -export NIC=${NIC:-} -export IPADDR=${IPADDR:-} -export NETMASK=${NETMASK:-} +export OPENSTACK_ANSIBLE_MODULE="https://github.com/openstack-ansible/openstack-ansible-modules.git" -# DHCP config +# External network config for access remote compass server +# External network NIC +export PUBLIC_NIC="eth0" + +# External NIC IP address, use the IP assigned to PUBLIC_NIC by default +export PUBLIC_IP= + +# Install network config, it is a private network +export NIC="eth1" +export IPADDR="10.1.0.15" +export NETMASK="255.255.255.0" + +# DHCP config for install network # DHCP option router address(Default is your management interface IP address )" -export OPTION_ROUTER=${OPTION_ROUTER:-} +export OPTION_ROUTER="10.1.0.15" # The IP range for DHCP clients (Default: local subnet start from 100 to 254) -export IP_START=${IP_START:-} -export IP_END=${IP_END:-} +export IP_START="10.1.0.100" +export IP_END="10.1.0.200" # TFTP server's IP address(Default: Management Interface/eth0 IP) -export NEXTSERVER=${NEXTSERVER:-} +export NEXTSERVER="10.1.10.15" + +# The machines MAC list. it must be filled, any space or null is wrong in quotes: +export switch_IP="127.0.0.1" +export PXE_MACs=("port=300,mac=00:0c:29:8c:c3:b5" + "port=301,mac=00:0c:29:87:79:9a" + "port=302,mac=00:0c:29:73:74:41" + "port=303,mac=00:0c:29:f9:eb:fd" + "port=304,mac=00:0c:29:ac:e7:14") # the domains covered by nameserver -export NAMESERVER_DOMAINS=${NAMESERVER_DOMAINS:-} -export NAMESERVER_REVERSE_ZONES=${NAMESERVER_REVERSE_ZONES:-} +export NAMESERVER_DOMAINS="ods.com" +export NAMESERVER_REVERSE_ZONES="unused" # set the default cobbler user "cobbler" password, if not set, the default will be cobbler/cobbler -export CBLR_USER=${CBLR_USER:-} -export CBLR_PASSWD=${CBLR_PASSWD:-} +export CBLR_USER= +export CBLR_PASSWD= # set default local repo flag -export LOCAL_REPO=${LOCAL_REPO:-} -export SUPPORT_CENTOS_7_2=${SUPPORT_CENTOS_7_2:-} -export SUPPORT_UBUNTU_14_04_03=${SUPPORT_UBUNTU_14_04_03:-} +export LOCAL_REPO= +export SUPPORT_CENTOS_7_2= +export SUPPORT_UBUNTU_14_04_03= -export IMAGE_TYPE=${IMAGE_TYPE:-"CentOS"} -export IMAGE_TYPE_OTHER=${IMAGE_TYPE_OTHER:-"el"} -export IMAGE_VERSION_MAJOR=${IMAGE_VERSION_MAJOR:-"6"} -export IMAGE_VERSION_NINOR=${IMAGE_VERSION_MINOR:-"5"} -export IMAGE_VERSION=${IMAGE_VERSION:-"${IMAGE_VERSION_MAJOR}.${IMAGE_VERSION_MINOR}"} -export IMAGE_NAME=${IMAGE_NAME:-"${IMAGE_TYPE}-${IMAGE_VERSION}"} -export IMAGE_ARCH=${IMAGE_ARCH:-"x86_64"} +export IMAGE_TYPE="CentOS" +export IMAGE_TYPE_OTHER="el" +export IMAGE_VERSION_MAJOR="6" +export IMAGE_VERSION_NINOR="5" +export IMAGE_VERSION="${IMAGE_VERSION_MAJOR}.${IMAGE_VERSION_MINOR}" +export IMAGE_NAME="${IMAGE_TYPE}-${IMAGE_VERSION}" +export IMAGE_ARCH="x86_64" -export CENTOS_7_2_IMAGE_SOURCE=${CENTOS_7_2_IMAGE_SOURCE:-"http://205.177.226.237:9999/CentOS-7-x86_64-Minimal-1511.iso"} -export UBUNTU_14_04_03_IMAGE_SOURCE=${UBUNTU_14_04_03_IMAGE_SOURCE:-"http://205.177.226.237:9999/ubuntu-14.04.3-server-amd64.iso"} -export CENTOS_7_2_PPA_REPO_SOURCE=${CENTOS_7_2_PPA_REPO_SOURCE:-"http://205.177.226.237:9999/centos7-juno-ppa.tar.gz"} -export UBUNTU_14_04_03_PPA_REPO_SOURCE=${UBUNTU_14_04_03_PPA_REPO_SOURCE:-"http://205.177.226.237:9999/trusty-liberty-ppa.tar.gz"} -export PIP_PACKAGES=${PIP_PACKAGES:-"http://205.177.226.237:9999/pip.tar.gz"} +export CENTOS_7_2_IMAGE_SOURCE="http://205.177.226.237:9999/CentOS-7-x86_64-Minimal-1511.iso" +export UBUNTU_14_04_03_IMAGE_SOURCE="http://205.177.226.237:9999/ubuntu-14.04.3-server-amd64.iso" +export CENTOS_7_2_PPA_REPO_SOURCE="http://205.177.226.237:9999/centos7-juno-ppa.tar.gz" +export UBUNTU_14_04_03_PPA_REPO_SOURCE="http://205.177.226.237:9999/trusty-mitaka-ppa.tar.gz" +export PIP_PACKAGES="http://205.177.226.237:9999/pip.tar.gz" -export COBBLER_PASSWORD=${COBBLER_PASSWORD:-"cobbler"} +export COBBLER_PASSWORD="cobbler" -export COBBLER_LOADERS_SOURCE=${COBBLER_LOADERS_SOURCE:-"https://s3-us-west-1.amazonaws.com/compass-local-repo/loaders.tar.gz"} -export COBBLER_LOADERS_SOURCE_ASIA=${COBBLER_LOADERS_SOURCE_ASIA:-"http://huawei-repo.uubright.com/repos/compass/loaders.tar.gz"} +export COBBLER_LOADERS_SOURCE="https://s3-us-west-1.amazonaws.com/compass-local-repo/loaders.tar.gz" +export COBBLER_LOADERS_SOURCE_ASIA="http://huawei-repo.uubright.com/repos/compass/loaders.tar.gz" # Currently the use of Javascript MVC is set to version 3.2.4 -export JS_MVC=${JS_MVC:-"javascriptmvc-3.2.4"} +export JS_MVC="javascriptmvc-3.2.4" # set the chef packages download path -export CHEF_SRV=${CHEF_SRV:-"http://opscode-omnibus-packages.s3.amazonaws.com/${IMAGE_TYPE_OTHER}/${IMAGE_VERSION_MAJOR}/${IMAGE_ARCH}/chef-server-11.0.8-1.${IMAGE_TYPE_OTHER}${IMAGE_VERSION_MAJOR}.${IMAGE_ARCH}.rpm"} -export CHEF_SRV_HUAWEI=${CHEF_SRV_HUAWEI:-"http://huawei-repo.uubright.com/repos/compass/${IMAGE_TYPE_OTHER}/${IMAGE_VERSION_MAJOR}/${IMAGE_ARCH}/chef-server-11.0.8-1.${IMAGE_TYPE_OTHER}${IMAGE_VERSION_MAJOR}.${IMAGE_ARCH}.rpm"} -export CHEF_CLIENT=${CHEF_CLIENT:-"https://opscode-omnibus-packages.s3.amazonaws.com/${IMAGE_TYPE_OTHER}/${IMAGE_VERSION_MAJOR}/${IMAGE_ARCH}/chef-11.10.4-1.${IMAGE_TYPE_OTHER}${IMAGE_VERSION_MAJOR}.${IMAGE_ARCH}.rpm"} -export CHEF_CLIENT_HUAWEI=${CHEF_CLIENT_HUAWEI:-"http://huawei-repo.uubright.com/repos/compass/${IMAGE_TYPE_OTHER}/${IMAGE_VERSION_MAJOR}/${IMAGE_ARCH}/chef-11.10.4-1.${IMAGE_TYPE_OTHER}${IMAGE_VERSION_MAJOR}.${IMAGE_ARCH}.rpm"} +export CHEF_SRV="http://opscode-omnibus-packages.s3.amazonaws.com/${IMAGE_TYPE_OTHER}/${IMAGE_VERSION_MAJOR}/${IMAGE_ARCH}/chef-server-11.0.8-1.${IMAGE_TYPE_OTHER}${IMAGE_VERSION_MAJOR}.${IMAGE_ARCH}.rpm" +export CHEF_SRV_HUAWEI="http://huawei-repo.uubright.com/repos/compass/${IMAGE_TYPE_OTHER}/${IMAGE_VERSION_MAJOR}/${IMAGE_ARCH}/chef-server-11.0.8-1.${IMAGE_TYPE_OTHER}${IMAGE_VERSION_MAJOR}.${IMAGE_ARCH}.rpm" +export CHEF_CLIENT="https://opscode-omnibus-packages.s3.amazonaws.com/${IMAGE_TYPE_OTHER}/${IMAGE_VERSION_MAJOR}/${IMAGE_ARCH}/chef-11.10.4-1.${IMAGE_TYPE_OTHER}${IMAGE_VERSION_MAJOR}.${IMAGE_ARCH}.rpm" +export CHEF_CLIENT_HUAWEI="http://huawei-repo.uubright.com/repos/compass/${IMAGE_TYPE_OTHER}/${IMAGE_VERSION_MAJOR}/${IMAGE_ARCH}/chef-11.10.4-1.${IMAGE_TYPE_OTHER}${IMAGE_VERSION_MAJOR}.${IMAGE_ARCH}.rpm" # Set Chef password for Chef web UI -export CHEF_PASSWD=${CHEF_PASSWD:-"root1234"} +export CHEF_PASSWD="root1234" # Set Compass-web and Compass-adpater variables -export WEB_HOME=${WEB_HOME:-'/tmp/web'} -export ADAPTERS_HOME=${ADAPTERS_HOME:-'/tmp/adapter'} -export WEB_SOURCE=${WEB_SOURCE:-} -export ADAPTERS_SOURCE=${ADAPTERS_SOURCE:-} +export WEB_HOME="/tmp/web" +export ADAPTERS_HOME="/tmp/adapter" +export WEB_SOURCE= +export ADAPTERS_SOURCE= # Set compass environment export SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) export COMPASSDIR=${SCRIPT_DIR}/.. -export TESTMODE=${TESTMODE:-"False"} +export TESTMODE="False" # Set Local Repo sources -export LOCAL_REPO_US=${LOCAL_REPO_US:-"https://s3-us-west-1.amazonaws.com/compass-local-repo"} -export LOCAL_REPO_HUAWEI=${LOCAL_REPO_HUAWEI:-"http://huawei-repo.uubright.com/repos/compass"} +export LOCAL_REPO_US="https://s3-us-west-1.amazonaws.com/compass-local-repo" +export LOCAL_REPO_HUAWEI="http://huawei-repo.uubright.com/repos/compass" + diff --git a/install/install.sh b/install/install.sh index df4eb63f..8118b1d6 100755 --- a/install/install.sh +++ b/install/install.sh @@ -1,6 +1,6 @@ #!/bin/bash # - +#set -x ### Log the script all outputs locally exec > >(sudo tee install.log) exec 2>&1 @@ -48,6 +48,7 @@ _prepare_locking() _prepare_locking # PUBLIC + exlock_now() { _lock xn || exit 1 @@ -59,10 +60,93 @@ if [[ "$?" != "0" ]]; then exit 1 fi -### BEGIN OF SCRIPT ### +set_iptables() +{ + # external_ipaddr=$1; install_ipaddr=$2; install_netmask=$3 + + local argument_error="ERROR: argument ARG_NUM is invalidation that is for ARG_DESC" + local varnames=("3" "external_ipaddr" "install_ipaddr" "install_netmask") + if [ $# -lt ${varnames[0]} ];then + echo "ERROR: please input ${varnames[0]} arguments to call function _set_iptables()";exit 1 + fi + local i=1 + while [ $1 ];do + eval "${varnames[i]}"=$1 + sudo ipcalc $1 -c + if [ $? -ne 0 ];then + echo ${argument_error} | sed 's/ARG_NUM/'"$i"'/g' | sed 's/ARG_DESC/g'"${varnames[i]}"'/g';exit 1 + fi + let i++;shift + done + + local install_netaddr=$(sudo ipcalc ${install_ipaddr} ${install_netmask} -n | awk -F = '{print $2}') + local install_netprefix=$(sudo ipcalc ${install_ipaddr} ${install_netmask} -p | awk -F = '{print $2}') + + sudo sed -i '/^\s*net\.ipv4\.ip_forward\s*=/d' /etc/sysctl.conf + sudo sed -i '$a net.ipv4.ip_forward=1' /etc/sysctl.conf + sudo sysctl -p + + sudo rpm -qa | grep iptables-services + if [ $? -ne 0 ]; then + sudo yum --enablerepo=compass_install --nogpgcheck -y install iptables-services + fi + + sudo /bin/systemctl status iptables.service + if [ $? -eq 0 ];then + sudo /usr/sbin/service iptables save + sudo /bin/systemctl stop iptables.service + fi + + sudo mkdir /etc/sysconfig/iptables.bak.d 2>/dev/null + if [ -f /etc/sysconfig/iptables ];then + sudo mv -f /etc/sysconfig/iptables /etc/sysconfig/iptables.bak.d/$(uuidgen) + fi + + iptables_config=" *filter\n + :INPUT ACCEPT [0:0]\n + :FORWARD ACCEPT [0:0]\n + :OUTPUT ACCEPT [0:0]\n + COMMIT\n + *nat\n + :PREROUTING ACCEPT [0:0]\n + :INPUT ACCEPT [0:0]\n + :OUTPUT ACCEPT [0:0]\n + :POSTROUTING ACCEPT [0:0]\n + -A POSTROUTING -s ${install_ipaddr}/32 -j ACCEPT\n + -A POSTROUTING -s ${install_netaddr}/${install_netprefix} -j SNAT --to-source ${external_ipaddr}\n + COMMIT\n" + sudo echo -e ${iptables_config} | sed 's/^\s*//g' > /etc/sysconfig/iptables + + sudo /bin/systemctl enable iptables + sudo /bin/systemctl start iptables.service +} + +# convert between ip address and integers +ipaddr_to_int() +{ + ipaddr=$1 + IFS=. read -r a b c d <<< "$ipaddr" + printf '%d\n' "$((a * 256 ** 3 + b * 256 ** 2 + c * 256 + d))" +} +int_to_ipaddr() +{ + ipint=$1 + let a=ipint/$[256**3];let ipint%=$[256**3] + let b=ipint/$[256**2];let ipint%=$[256**2] + let c=ipint/256;let ipint%=256 + let d=ipint + printf '%d.%d.%d.%d\n' $a $b $c $d +} + + +### BEGIN OF SCRIPT + DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) + +### LOAD FILE CONFIGURATION source $DIR/install.conf + ### Change selinux security policy sudo setenforce 0 sudo sed -i 's/enforcing/disabled/g' /etc/selinux/config @@ -127,131 +211,118 @@ figlet -ctf slant Compass Installer while [ $1 ]; do flags=$1 param=${flags/'--'/''} - var=$(echo $param | cut -d"=" -f1) - val=$(echo $param | cut -d"=" -f2) - export $var=$val + var=$(echo $param | awk -F = '{print $1}') + val=$(echo $param | awk -F = '{print $2}') + eval export $var=$val shift done -# convert ip address to int -ipaddr_convert() -{ - ipaddr=$1 - IFS=. read -r a b c d <<< "$ipaddr" - printf '%d\n' "$((a * 256 ** 3 + b * 256 ** 2 + c * 256 + d))" -} +yum update -y +sudo rpm -qa | grep net-tools +if [ $? -ne 0 ];then + yum --enablerepo=compass_install --nogpgcheck -y install net-tools +fi -# Load variables -loadvars() -{ - varname=${1,,} - eval var=\$$(echo $1) - - if [[ -z $var ]]; then - echo -e "\x1b[32mPlease enter the $varname (Example: $2):\x1b[37m" - while read input - do - if [ "$input" == "" ]; then - echo "Default $varname '$2' chosen" - export $(echo $1)="$2" - break - else - echo "You have entered $input" - export $(echo $1)="$input" - break - fi - done +# check the correct format of ip variables +ip_vars="PUBLIC_IP PUBLIC_NETMASK PUBLIC_GATEWAY + IPADDR NETMASK + OPTION_ROUTER NEXTSERVER IP_START IP_END" +for ip_var in ${ip_vars}; do + eval ip_val=\$${ip_var} + if [ ! -z ${ip_val} ];then + ipcalc ${ip_val} -c + if [ $? -ne 0 ];then + echo "The variable of '${ip_var}'='${ip_val}' is invalid." + exit 1 fi -} -yum -y install net-tools -loadvars NIC "eth0" -sudo ifconfig $NIC -if [ $? -ne 0 ]; then - echo "There is no nic '$NIC' yet" - exit 1 -fi -# sudo ifconfig $NIC | grep 'inet addr:' >& /dev/null -sudo ifconfig $NIC |grep 'inet '| cut -d ' ' -f10 >& /dev/null -if [ $? -ne 0 ]; then - echo "There is not any IP address assigned to the NIC '$NIC' yet, please assign an IP address first." - exit 1 + fi +done + +# public network variables: +export PUBLIC_NIC=${PUBLIC_NIC:-"eth0"} +export PUBLIC_IP=${PUBLIC_IP:-$(sudo ifconfig ${PUBLIC_NIC} | awk '($1=="inet"){print $2}')} +export PUBLIC_GATEWAY=${PUBLIC_GATEWAY:-$(sudo route -n | awk '($1=="0.0.0.0" && $3=="0.0.0.0"){print $2}')} + +if [ -z ${PUBLIC_IP} ];then + echo "ERROR: There is not any PUBLIC_IP to be set yet, please assign an IP to PUBLIC_NIC or configure 'install.conf' first." + exit 1 +elif [ -z ${PUBLIC_GATEWAY} ];then + echo "WARNING: There is not any PUBLIC_GATEWAY, please ensure that the agent server can access remote compass center if no gateway." + sleep 2 fi -export ipaddr=$(ifconfig $NIC | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}') -echo " this line " -if [ -z "$ipaddr" ]; then - export ipaddr=$(ifconfig $NIC | grep 'inet ' | sed 's/^[ \t]*//g' | sed 's/[ \t]\+/ /g' | cut -d' ' -f2) +export PUBLIC_NETMASK=${PUBLIC_NETMASK:-$(sudo ifconfig ${PUBLIC_NIC} | awk '($3=="netmask"){print $4}')} +export PUBLIC_NETMASK=${PUBLIC_NETMASK:-$(sudo ipcalc ${PUBLIC_IP} -m | awk -F = '{print $2}')} + +if [[ $(ipcalc ${PUBLIC_IP} ${PUBLIC_NETMASK} -n) != $(ipcalc ${PUBLIC_GATEWAY} ${PUBLIC_NETMASK} -n) ]];then + echo "ERROR: The PUBLIC_IP:${PUBLIC_IP} and PUBLIC_GATEWAY:${PUBLIC_GATEWAY} are not in the same subnet, please check the configuration." + exit 1 fi -loadvars IPADDR ${ipaddr} -ipcalc $IPADDR -c -if [ $? -ne 0 ]; then - echo "ip addr $IPADDR format should be x.x.x.x" + +sudo ifconfig ${PUBLIC_NIC} ${PUBLIC_IP} netmask ${PUBLIC_NETMASK} up + +if [ ! -z ${PUBLIC_GATEWAY} ];then + sudo route del -net 0.0.0.0/0 + sudo route add -net 0.0.0.0/0 gw ${PUBLIC_GATEWAY} +fi + +# install network variables: +export NIC=${NIC:-"eth1"} +export IPADDR=${IPADDR:-$(sudo ifconfig ${NIC} | awk '($1=="inet"){print $2}')} +export IPADDR=${IPADDR:-"10.1.0.15"} +export NETMASK=${NETMASK:-$(sudo ifconfig ${NIC} | awk '($3="netmask"){print $4}')} +export NETMASK=${NETMASK:-"255.255.255.0"} + +sudo ifconfig ${NIC} ${IPADDR} netmask ${NETMASK} up + +export OPTION_ROUTER=${OPTION_ROUTE:-${IPADDR}} +export NEXTSERVER=${NEXTSERVER:-${IPADDR}} + +if [ -z ${IP_START} ];then + temp_int=$(ipaddr-to-int ${IPADDR}) + let temp_int++ + IP_START=$(int-to-ipaddr ${temp_int}) +fi +export IP_START + +if [ -z ${IP_END} ];then + broad_addr=$(sudo ipcalc ${IPADDR} ${NETMASK} -b | awk -F = '{print $2}') + temp_int=$(ipadd-to-int ${broad_addr}) + let temp_int-- + IP_END=$(int-to-ipaddr ${temp_int}) +fi +export IP_END + +# check the validation of IP_START and IP_END +for ip_var in IP_START IP_END;do + if [[ $(eval ipcalc \$${ip_var} ${NETMASK} -n) != $(ipcalc ${IPADDR} ${NETMASK} -n) ]];then + eval echo "ERROR: The ${ip_var}:\$${ip_var} and install nic are not in the same subnet."; exit 1 -fi -export netmask=$(ifconfig $NIC | grep Mask | cut -d: -f4) -if [ -z "$netmask" ]; then - export netmask=$(ifconfig $NIC | grep netmask | sed 's/^[ \t]*//g' | sed 's/[ \t]\+/ /g' | cut -d' ' -f4) -fi -loadvars NETMASK ${netmask} -export netaddr=$(ipcalc $IPADDR $NETMASK -n |cut -f 2 -d '=') -export netprefix=$(ipcalc $IPADDR $NETMASK -p |cut -f 2 -d '=') -subnet=${netaddr}/${netprefix} -ipcalc $subnet -c -if [ $? -ne 0 ]; then - echo "subnet $subnet format should be x.x.x.x/x" - exit 1 -fi -loadvars OPTION_ROUTER $(route -n | grep '^0.0.0.0' | xargs | cut -d ' ' -f 2) -ipcalc $OPTION_ROUTER -c -if [ $? -ne 0 ]; then - echo "router $OPTION_ROUTER format should be x.x.x.x" - exit 1 -fi -export ip_start=$(echo "$IPADDR"|cut -f 1,2,3 -d '.')."100" -export ip_end=$(echo "$IPADDR"|cut -f 1,2,3 -d '.')."250" -loadvars IP_START "$ip_start" -ipcalc $IP_START -c -if [ $? -ne 0 ]; then - echo "ip start $IP_START format should be x.x.x.x" - exit 1 -else - echo "ip start address is $IP_START" -fi -ip_start_net=$(ipcalc $IP_START $NETMASK -n |cut -f 2 -d '=') -if [[ "$ip_start_net" != "$netaddr" ]]; then - echo "ip start $IP_START is not in $subnet" - exit 1 -fi -loadvars IP_END "$ip_end" -ipcalc $IP_END -c -if [ $? -ne 0 ]; then - echo "ip end $IP_END format should be x.x.x.x" - exit 1 -fi -ip_end_net=$(ipcalc $IP_END $NETMASK -n |cut -f 2 -d '=') -if [[ "$ip_end_net" != "$netaddr" ]]; then - echo "ip end $IP_END is not in $subnet" - exit 1 -fi -ip_start_int=$(ipaddr_convert $IP_START) -ip_end_int=$(ipaddr_convert $IP_END) + fi +done +ip_start_int=$(ipaddr_to_int ${IP_START}) +ip_end_int=$(ipaddr_to_int ${IP_END}) let ip_range=${ip_end_int}-${ip_start_int} -if [ $ip_range -le 0 ]; then - echo "there is no available ips to assign between $IP_START and $IP_END" - exit 1 -fi -echo "there will be at most $ip_range hosts deployed." -loadvars NEXTSERVER $IPADDR -ipcalc $NEXTSERVER -c -if [ $? -ne 0 ]; then - echo "next server $NEXTSERVER format should be x.x.x.x" - exit 1 +if [ ${ip_range} -le 0 ];then + echo "There is no avialable IPs between IP_START:'${IP_START}' and IP_END:'${IP_END}'." + exit 1 fi -loadvars NAMESERVER_DOMAINS "ods.com" -loadvars NAMESERVER_REVERSE_ZONES "unused" -loadvars WEB_SOURCE 'http://git.openstack.org/openstack/compass-web' -loadvars ADAPTERS_SOURCE 'https://gerrit.opnfv.org/gerrit/compass4nfv' +# print all variables about IP +for ip_var in ${ip_vars};do + eval echo "${ip_var}=\$${ip_var}" +done + +export NAMESERVER_DOMAINS=${NAMESERVER_DOMAINS:-"ods.com"} +export NAMESERVER_REVERSE_ZONES=${NAMESERVER_REVERSE_ZONES:-"unused"} +export WEB_SOURCE=${WEB_SOURCE:-"http://git.openstack.org/openstack/compass-web"} +export ADAPTERS_SOURCE=${ADAPTERS_SOURCE:-"https://gerrit.opnfv.org/gerrit/compass4nfv"} + +echo "set the iptables' rules so that the openstack hosts installed can access remote compass through agent server" +set_iptables ${PUBLIC_IP} ${IPADDR} ${NETMASK} + +rm -rf /etc/yum.repos.d/compass_install.repo 2>/dev/nullcp +cp ${COMPASSDIR}/misc/compass_install.repo /etc/yum.repos.d/ echo "script dir: $SCRIPT_DIR" echo "compass dir is $COMPASSDIR" @@ -280,3 +351,18 @@ source ${COMPASSDIR}/install/compass.sh || exit $? figlet -ctf slant Installation Complete! echo -e "It takes\x1b[32m $SECONDS \x1b[0mseconds during the installation." + +machine_list_conf="MACHINE_LIST = [ { '${switch_IP}': [ " +for host in ${PXE_MACs[@]}; do + port=$(echo ${host} | awk -F , '{print $1}' | awk -F = '{print $2}') + mac=$(echo ${host} | awk -F , '{print $2}' | awk -F = '{print $2}') + machine_list_conf="${machine_list_conf}${comma}\n{'port': '${port}', 'mac': '${mac}', 'vlan': '0'}" + comma="," +done +machine_list_conf="${machine_list_conf}\n ] } ]" +sudo echo -e ${machine_list_conf} > /etc/compass/machine_list/machine_list.conf + +rm -rf /var/ansible/roles/keystone/vars/Debian.yml 2>/dev/null +cp ${COMPASSDIR}/misc/adapter_changes/Debian.yml /var/ansible/roles/keystone/vars/ +rm -rf /var/ansible/roles/keystone/tasks/keystone_install.yml 2>/dev/null +cp ${COMPASSDIR}/misc/adapter_changes/keystone_install.yml /var/ansible/roles/keystone/tasks/ diff --git a/install/register.sh b/install/register.sh new file mode 100755 index 00000000..c3b95747 --- /dev/null +++ b/install/register.sh @@ -0,0 +1,21 @@ +#!/bin/bash +# +#set -x +### Register current user to compass + +DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) +source $DIR/install.conf +echo "The email address you use to register is ${USER_EMAIL}" +password=`< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c6` +data=`echo "{\"email\":\"${USER_EMAIL}\",\"password\":\"${password}\"}"` +wget -O /tmp/user_info --post-data=$data --header=Content-Type:application/json "http://www.stack360.io/api/users/register" + +if [ $? -ne 0 ]; then +echo "Register failed" +exit 1 +fi + +echo "Register suceeded, your password is $password, please remember your password at all times." +sed -i 's/^CELERY_DEFAULT_QUEUE.*/CELERY_DEFAULT_QUEUE = '"${USER_EMAIL}"'/g' /etc/compass/celeryconfig +sed -i 's/^CELERY_DEFAULT_EXCHANGE.*/CELERY_DEFAULT_EXCHANGE = '"${USER_EMAIL}"'/g' /etc/compass/celeryconfig +sed -i 's/^CELERY_DEFAULT_ROUTING_KEY.*/CELERY_DEFAULT_ROUTING_KEY = '"${USER_EMAIL}"'/g' /etc/compass/celeryconfig diff --git a/misc/adapter_changes/Debian.yml b/misc/adapter_changes/Debian.yml new file mode 100644 index 00000000..e1d7adac --- /dev/null +++ b/misc/adapter_changes/Debian.yml @@ -0,0 +1,18 @@ +############################################################################# +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################# +--- + +cron_path: "/var/spool/cron/crontabs" + +packages: + - keystone + + services: + - apache2 + - keystone diff --git a/misc/adapter_changes/keystone_install.yml b/misc/adapter_changes/keystone_install.yml new file mode 100644 index 00000000..01907c66 --- /dev/null +++ b/misc/adapter_changes/keystone_install.yml @@ -0,0 +1,74 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## +--- +- include_vars: "{{ ansible_os_family }}.yml" + +- name: disable auto start + copy: + content: "#!/bin/sh\nexit 101" + dest: "/usr/sbin/policy-rc.d" + mode: 0755 + when: ansible_os_family == "Debian" + +- name: install keystone packages + action: "{{ ansible_pkg_mgr }} name={{ item }} state=present" + with_items: packages | union(packages_noarch) + +- name: enable auto start + file: + path=/usr/sbin/policy-rc.d + state=absent + when: ansible_os_family == "Debian" + +- name: generate keystone service list + lineinfile: dest=/opt/service create=yes line='{{ item }}' + with_items: services | union(services_noarch) + +- name: delete sqlite database + file: + path: /var/lib/keystone/keystone.db + state: absent + +- name: update keystone conf + template: src=keystone.conf dest=/etc/keystone/keystone.conf backup=yes + notify: + - restart keystone services + +- name: update apache2 configs + template: + src: wsgi-keystone.conf.j2 + dest: '{{ apache_config_dir }}/sites-available/wsgi-keystone.conf' + when: ansible_os_family == 'Debian' + notify: + - restart keystone services + +- name: update apache2 configs + template: + src: wsgi-keystone.conf.j2 + dest: '{{ apache_config_dir }}/wsgi-keystone.conf' + when: ansible_os_family == 'RedHat' + notify: + - restart keystone services + +- name: enable keystone server + file: + src: "{{ apache_config_dir }}/sites-available/wsgi-keystone.conf" + dest: "{{ apache_config_dir }}/sites-enabled/wsgi-keystone.conf" + state: "link" + when: ansible_os_family == 'Debian' + notify: + - restart keystone services + +- name: keystone source files + template: src={{ item }} dest=/opt/{{ item }} + with_items: + - admin-openrc.sh + - demo-openrc.sh + +- meta: flush_handlers diff --git a/misc/compass_install.repo b/misc/compass_install.repo new file mode 100644 index 00000000..5d71ef28 --- /dev/null +++ b/misc/compass_install.repo @@ -0,0 +1,5 @@ +[compass_install] +name=compass_repo +baseurl=http://www.stack360.io/centos7/ +gpgcheck=0 +enabled=1 diff --git a/tox.ini b/tox.ini index a537cd04..f8c6fcdb 100644 --- a/tox.ini +++ b/tox.ini @@ -28,7 +28,7 @@ commands = {posargs} commands = python setup.py testr --coverage --testr-args='{posargs}' [flake8] -ignore = H302,H304,H233,H803,F401,H104,H236,H237,H238 +ignore = H302,H304,H233,H803,F401,H104,H236,H237,H238,E501 show-source = true builtins = _ exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,tools,build From 8e5525aeb618d642ee6741433e00902f9bd31f7e Mon Sep 17 00:00:00 2001 From: Xicheng Chang Date: Wed, 6 Jul 2016 17:19:59 -0400 Subject: [PATCH 02/32] update install.conf with public network configs Change-Id: Ib7e2af5e90b4095ae0d4abc398dd3d184859b290 --- install/install.conf | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/install/install.conf b/install/install.conf index 7315c908..fdae9918 100755 --- a/install/install.conf +++ b/install/install.conf @@ -1,6 +1,8 @@ ##################################### # Config File for Compass Installer # ##################################### +# User Email +export USER_EMAIL="lab@huawei.com" # OS_INSTALLER indicates the tool for OS provisioning, default is 'cobbler'. export OS_INSTALLER="cobbler" @@ -24,6 +26,8 @@ export PUBLIC_NIC="eth0" # External NIC IP address, use the IP assigned to PUBLIC_NIC by default export PUBLIC_IP= +export PUBLIC_NETMASK= +export PUBLIC_GATEWAY= # Install network config, it is a private network export NIC="eth1" From 250bd4736688d9e302cdd02eda1bbe4f68d4ebb6 Mon Sep 17 00:00:00 2001 From: Xicheng Chang Date: Wed, 6 Jul 2016 20:39:59 -0400 Subject: [PATCH 03/32] update install.sh and confs Change-Id: Ic7f0bb6f1bfd1b2a7dbfe0c90c85f929b1f907f5 --- install/compass.sh | 38 +++++++++++++++++++------------------- install/install.conf | 2 +- install/install.sh | 4 ++-- install/register.sh | 8 +++++--- 4 files changed, 27 insertions(+), 25 deletions(-) diff --git a/install/compass.sh b/install/compass.sh index 0ecfafd2..f420dc35 100755 --- a/install/compass.sh +++ b/install/compass.sh @@ -129,13 +129,13 @@ else echo "compassed service is refreshed" fi -sudo systemctl status httpd.service -if [[ "$?" != "0" ]]; then - echo "httpd is not started" - exit 1 -else - echo "httpd has already started" -fi +# sudo systemctl status httpd.service +# if [[ "$?" != "0" ]]; then +# echo "httpd is not started" +# exit 1 +# else +# echo "httpd has already started" +# fi sudo systemctl status redis.service |grep running if [[ "$?" != "0" ]]; then @@ -145,11 +145,11 @@ else echo "redis has already started" fi -sudo systemctl status mysql.service |grep running -if [[ "$?" != "0" ]]; then - echo "mysqld is not started" - exit 1 -fi +# sudo systemctl status mysql.service |grep running +# if [[ "$?" != "0" ]]; then +# echo "mysqld is not started" +# exit 1 +# fi sudo systemctl status compass-celeryd.service |grep running if [[ "$?" != "0" ]]; then @@ -159,13 +159,13 @@ else echo "compass-celeryd has already started" fi -sudo systemctl status compass-progress-updated.service |grep running -if [[ "$?" != "0" ]]; then - echo "compass-progress-updated is not started" - exit 1 -else - echo "compass-progress-updated has already started" -fi +# sudo systemctl status compass-progress-updated.service |grep running +# if [[ "$?" != "0" ]]; then +# echo "compass-progress-updated is not started" +# exit 1 +#else +# echo "compass-progress-updated has already started" +#fi sleep 10 #compass check diff --git a/install/install.conf b/install/install.conf index fdae9918..30d09ad7 100755 --- a/install/install.conf +++ b/install/install.conf @@ -41,7 +41,7 @@ export OPTION_ROUTER="10.1.0.15" export IP_START="10.1.0.100" export IP_END="10.1.0.200" # TFTP server's IP address(Default: Management Interface/eth0 IP) -export NEXTSERVER="10.1.10.15" +export NEXTSERVER="10.1.0.15" # The machines MAC list. it must be filled, any space or null is wrong in quotes: export switch_IP="127.0.0.1" diff --git a/install/install.sh b/install/install.sh index 8118b1d6..029dab1b 100755 --- a/install/install.sh +++ b/install/install.sh @@ -88,7 +88,7 @@ set_iptables() sudo rpm -qa | grep iptables-services if [ $? -ne 0 ]; then - sudo yum --enablerepo=compass_install --nogpgcheck -y install iptables-services + sudo yum -y install iptables-services fi sudo /bin/systemctl status iptables.service @@ -220,7 +220,7 @@ done yum update -y sudo rpm -qa | grep net-tools if [ $? -ne 0 ];then - yum --enablerepo=compass_install --nogpgcheck -y install net-tools + yum -y install net-tools fi # check the correct format of ip variables diff --git a/install/register.sh b/install/register.sh index c3b95747..4db968c3 100755 --- a/install/register.sh +++ b/install/register.sh @@ -16,6 +16,8 @@ exit 1 fi echo "Register suceeded, your password is $password, please remember your password at all times." -sed -i 's/^CELERY_DEFAULT_QUEUE.*/CELERY_DEFAULT_QUEUE = '"${USER_EMAIL}"'/g' /etc/compass/celeryconfig -sed -i 's/^CELERY_DEFAULT_EXCHANGE.*/CELERY_DEFAULT_EXCHANGE = '"${USER_EMAIL}"'/g' /etc/compass/celeryconfig -sed -i 's/^CELERY_DEFAULT_ROUTING_KEY.*/CELERY_DEFAULT_ROUTING_KEY = '"${USER_EMAIL}"'/g' /etc/compass/celeryconfig +sed -i 's/^CELERY_DEFAULT_QUEUE.*/CELERY_DEFAULT_QUEUE = \"'"${USER_EMAIL}"'\"/g' /etc/compass/celeryconfig +sed -i 's/^CELERY_DEFAULT_EXCHANGE.*/CELERY_DEFAULT_EXCHANGE = \"'"${USER_EMAIL}"'\"/g' /etc/compass/celeryconfig +sed -i 's/^CELERY_DEFAULT_ROUTING_KEY.*/CELERY_DEFAULT_ROUTING_KEY = \"'"${USER_EMAIL}"'\"/g' /etc/compass/celeryconfig + +systemctl restart compass-celeryd.service From 4e1e8063f9c5a8c1911fa3f83bc499306486ce56 Mon Sep 17 00:00:00 2001 From: Xicheng Chang Date: Wed, 6 Jul 2016 21:11:07 -0400 Subject: [PATCH 04/32] disable acclerate mode Change-Id: I924f327edb028399067761b55b719367079f5970 --- install/install.sh | 2 + .../adapter_changes/HA-ansible-Multinodes.yml | 239 ++++++++++++++++++ 2 files changed, 241 insertions(+) create mode 100644 misc/adapter_changes/HA-ansible-Multinodes.yml diff --git a/install/install.sh b/install/install.sh index 029dab1b..8ea8b958 100755 --- a/install/install.sh +++ b/install/install.sh @@ -366,3 +366,5 @@ rm -rf /var/ansible/roles/keystone/vars/Debian.yml 2>/dev/null cp ${COMPASSDIR}/misc/adapter_changes/Debian.yml /var/ansible/roles/keystone/vars/ rm -rf /var/ansible/roles/keystone/tasks/keystone_install.yml 2>/dev/null cp ${COMPASSDIR}/misc/adapter_changes/keystone_install.yml /var/ansible/roles/keystone/tasks/ +rm -rf /var/ansible/openstack_mitaka/HA-ansible-multinodes.yml 2>/dev/null +cp ${COMPASSDIR}/misc/adapter_changes/HA-ansible-multinodes.yml /var/ansible/openstack_mitaka/ diff --git a/misc/adapter_changes/HA-ansible-Multinodes.yml b/misc/adapter_changes/HA-ansible-Multinodes.yml new file mode 100644 index 00000000..b0c5810e --- /dev/null +++ b/misc/adapter_changes/HA-ansible-Multinodes.yml @@ -0,0 +1,239 @@ +--- +- hosts: all + remote_user: root + pre_tasks: + - name: make sure ssh dir exist + file: + path: '{{ item.path }}' + owner: '{{ item.owner }}' + group: '{{ item.group }}' + state: directory + mode: 0755 + with_items: + - path: /root/.ssh + owner: root + group: root + + - name: write ssh config + copy: + content: "UserKnownHostsFile /dev/null\nStrictHostKeyChecking no" + dest: '{{ item.dest }}' + owner: '{{ item.owner }}' + group: '{{ item.group }}' + mode: 0600 + with_items: + - dest: /root/.ssh/config + owner: root + group: root + + - name: generate ssh keys + shell: if [ ! -f ~/.ssh/id_rsa.pub ]; then ssh-keygen -q -t rsa -f ~/.ssh/id_rsa -N ""; else echo "already gen ssh key!"; fi; + + - name: fetch ssh keys + fetch: src=/root/.ssh/id_rsa.pub dest=/tmp/ssh-keys-{{ ansible_hostname }} flat=yes + + - authorized_key: + user: root + key: "{{ lookup('file', 'item') }}" + with_fileglob: + - /tmp/ssh-keys-* + max_fail_percentage: 0 + roles: + - common + +- hosts: all + remote_user: root + accelerate: false + max_fail_percentage: 0 + roles: + - setup-network + +- hosts: ha + remote_user: root + accelerate: false + max_fail_percentage: 0 + roles: + - ha + +- hosts: controller + remote_user: root + accelerate: false + max_fail_percentage: 0 + roles: + - memcached + - apache + - database + - mq + - keystone + - nova-controller + - neutron-controller + - cinder-controller + - glance + - neutron-common + - neutron-network + - ceilometer_controller +# - ext-network + - dashboard + - heat + - aodh + +- hosts: all + remote_user: root + accelerate: false + max_fail_percentage: 0 + roles: + - storage + +- hosts: compute + remote_user: root + accelerate: false + max_fail_percentage: 0 + roles: + - nova-compute + - neutron-compute + - cinder-volume + - ceilometer_compute + +- hosts: all + remote_user: root + accelerate: false + max_fail_percentage: 0 + roles: + - secgroup + +- hosts: ceph_adm + remote_user: root + accelerate: false + max_fail_percentage: 0 + roles: [] + # - ceph-deploy + +- hosts: ceph + remote_user: root + accelerate: false + max_fail_percentage: 0 + roles: + - ceph-purge + - ceph-config + +- hosts: ceph_mon + remote_user: root + accelerate: false + max_fail_percentage: 0 + roles: + - ceph-mon + +- hosts: ceph_osd + remote_user: root + accelerate: false + max_fail_percentage: 0 + roles: + - ceph-osd + +- hosts: ceph + remote_user: root + accelerate: false + max_fail_percentage: 0 + roles: + - ceph-openstack + +- hosts: all + remote_user: root + accelerate: false + max_fail_percentage: 0 + roles: + - monitor + + +- hosts: all + remote_user: root + accelerate: false + max_fail_percentage: 0 + tasks: + - name: set bash to nova + user: + name: nova + shell: /bin/bash + + - name: make sure ssh dir exist + file: + path: '{{ item.path }}' + owner: '{{ item.owner }}' + group: '{{ item.group }}' + state: directory + mode: 0755 + with_items: + - path: /var/lib/nova/.ssh + owner: nova + group: nova + + - name: copy ssh keys for nova + shell: cp -rf /root/.ssh/id_rsa /var/lib/nova/.ssh; + + - name: write ssh config + copy: + content: "UserKnownHostsFile /dev/null\nStrictHostKeyChecking no" + dest: '{{ item.dest }}' + owner: '{{ item.owner }}' + group: '{{ item.group }}' + mode: 0600 + with_items: + - dest: /var/lib/nova/.ssh/config + owner: nova + group: nova + + - authorized_key: + user: nova + key: "{{ lookup('file', 'item') }}" + with_fileglob: + - /tmp/ssh-keys-* + + - name: chown ssh file + shell: chown -R nova:nova /var/lib/nova/.ssh; + + +- hosts: all + remote_user: root + max_fail_percentage: 0 + roles: + - odl_cluster + +- hosts: all + remote_user: root + accelerate: false + max_fail_percentage: 0 + roles: + - onos_cluster + +- hosts: all + remote_user: root + sudo: True + max_fail_percentage: 0 + roles: + - open-contrail + +- hosts: all + remote_user: root + serial: 1 + max_fail_percentage: 0 + roles: + - odl_cluster_neutron + +- hosts: all + remote_user: root + max_fail_percentage: 0 + roles: + - odl_cluster_post + +- hosts: controller + remote_user: root + max_fail_percentage: 0 + roles: + - ext-network + +- hosts: controller + remote_user: root + accelerate: false + max_fail_percentage: 0 + roles: + - tacker From 02523b9a7e66e361947ae10093694498f1a82c64 Mon Sep 17 00:00:00 2001 From: Xicheng Chang Date: Sat, 9 Jul 2016 19:26:55 -0400 Subject: [PATCH 05/32] Trim some install scripts for agent install Change-Id: I80e4605d80a5eaf186e3e80a061590739e2ed592 --- compass/db/api/switch.py | 2 + install/dependency.sh | 14 ++++-- install/install.conf | 2 + install/install.sh | 38 ++++++++------- install/prepare.sh | 101 ++++++++++++++++++++------------------- 5 files changed, 87 insertions(+), 70 deletions(-) diff --git a/compass/db/api/switch.py b/compass/db/api/switch.py index 53814b84..647eec0d 100644 --- a/compass/db/api/switch.py +++ b/compass/db/api/switch.py @@ -653,6 +653,8 @@ def list_switchmachines_hosts(user=None, session=None, **filters): switch_machines = utils.list_db_objects( session, models.SwitchMachine, **filters ) + if not user.is_admin and len(switch_machines): + switch_machines = [m for m in switch_machines if m.machine.owner_id == user.id] return _filter_switch_machines_hosts( switch_machines ) diff --git a/install/dependency.sh b/install/dependency.sh index 1353bf72..29ee1183 100755 --- a/install/dependency.sh +++ b/install/dependency.sh @@ -11,8 +11,12 @@ if [ "$tempest" == "true" ]; then fi fi -sudo yum --enablerepo=compass_install install -y $MYSQL -sudo yum --enablerepo=compass_install --nogpgcheck install -y rsyslog logrotate ntp iproute openssh-clients python python-devel git wget syslinux amqp rabbitmq-server mod_wsgi httpd squid dhcp bind rsync yum-utils xinetd tftp-server gcc net-snmp-utils net-snmp net-snmp-python unzip openssl openssl098e ca-certificates mysql-devel mysql-server mysql MySQL-python python-virtualenv python-setuptools python-pip bc libselinux-python libffi-devel openssl-devel +if [ "$FULL_COMAPSS_SERVER" == "true" ]; then + sudo yum --enablerepo=compass_install install -y $MYSQL + sudo yum --enablerepo=compass_install --nogpgcheck install -y rsyslog logrotate ntp iproute openssh-clients python python-devel git wget syslinux amqp rabbitmq-server mod_wsgi httpd squid dhcp bind rsync yum-utils xinetd tftp-server gcc net-snmp-utils net-snmp net-snmp-python unzip openssl openssl098e ca-certificates mysql-devel mysql-server mysql MySQL-python python-virtualenv python-setuptools python-pip bc libselinux-python libffi-devel openssl-devel +else + sudo yum --enablerepo=compass_install --nogpgcheck install -y rsyslog logrotate ntp iproute openssh-clients python python-devel git wget syslinux amqp dhcp bind rsync yum-utils xinetd tftp-server gcc net-snmp-utils net-snmp net-snmp-python unzip openssl openssl098e ca-certificates python-virtualenv python-setuptools python-pip bc libselinux-python libffi-devel openssl-devel +fi sudo yum --setopt=tsflags=noscripts -y remove redis # sudo yum --enablerepo=remi,remi-test install -y redis sudo yum --enablerepo=compass_install --nogpgcheck install -y redis @@ -57,5 +61,7 @@ sudo systemctl enable sshd.service sudo systemctl enable rsyslog.service sudo systemctl enable ntpd.service sudo systemctl enable redis.service -sudo systemctl enable mysqld.service -sudo systemctl enable rabbitmq-server.service +if [ "$FULL_COMAPSS_SERVER" == "true" ]; then + sudo systemctl enable mysqld.service + sudo systemctl enable rabbitmq-server.service +fi diff --git a/install/install.conf b/install/install.conf index 30d09ad7..b09b4db9 100755 --- a/install/install.conf +++ b/install/install.conf @@ -1,6 +1,8 @@ ##################################### # Config File for Compass Installer # ##################################### +# Agent or Fullserver +export FULL_COMPASS_SERVER="false" # User Email export USER_EMAIL="lab@huawei.com" # OS_INSTALLER indicates the tool for OS provisioning, default is 'cobbler'. diff --git a/install/install.sh b/install/install.sh index 8ea8b958..ae6fcc3c 100755 --- a/install/install.sh +++ b/install/install.sh @@ -343,8 +343,10 @@ echo "Install the Package Installer Tool" # source ${COMPASSDIR}/install/chef.sh || exit $? source ${COMPASSDIR}/install/ansible.sh || exit $? -echo "Download and install Compass Web" -source ${COMPASSDIR}/install/compass_web.sh || exit $? +if [ "$FULL_COMAPSS_SERVER" == "true"]; then + echo "Download and install Compass Web" + source ${COMPASSDIR}/install/compass_web.sh || exit $? +fi echo "Download and Setup Compass and related services" source ${COMPASSDIR}/install/compass.sh || exit $? @@ -352,19 +354,21 @@ source ${COMPASSDIR}/install/compass.sh || exit $? figlet -ctf slant Installation Complete! echo -e "It takes\x1b[32m $SECONDS \x1b[0mseconds during the installation." -machine_list_conf="MACHINE_LIST = [ { '${switch_IP}': [ " -for host in ${PXE_MACs[@]}; do - port=$(echo ${host} | awk -F , '{print $1}' | awk -F = '{print $2}') - mac=$(echo ${host} | awk -F , '{print $2}' | awk -F = '{print $2}') - machine_list_conf="${machine_list_conf}${comma}\n{'port': '${port}', 'mac': '${mac}', 'vlan': '0'}" - comma="," -done -machine_list_conf="${machine_list_conf}\n ] } ]" -sudo echo -e ${machine_list_conf} > /etc/compass/machine_list/machine_list.conf +if [ "$FULL_COMPASS_SERVER" == "false" ]; then + machine_list_conf="MACHINE_LIST = [ { '${switch_IP}': [ " + for host in ${PXE_MACs[@]}; do + port=$(echo ${host} | awk -F , '{print $1}' | awk -F = '{print $2}') + mac=$(echo ${host} | awk -F , '{print $2}' | awk -F = '{print $2}') + machine_list_conf="${machine_list_conf}${comma}\n{'port': '${port}', 'mac': '${mac}', 'vlan': '0'}" + comma="," + done + machine_list_conf="${machine_list_conf}\n ] } ]" + sudo echo -e ${machine_list_conf} > /etc/compass/machine_list/machine_list.conf -rm -rf /var/ansible/roles/keystone/vars/Debian.yml 2>/dev/null -cp ${COMPASSDIR}/misc/adapter_changes/Debian.yml /var/ansible/roles/keystone/vars/ -rm -rf /var/ansible/roles/keystone/tasks/keystone_install.yml 2>/dev/null -cp ${COMPASSDIR}/misc/adapter_changes/keystone_install.yml /var/ansible/roles/keystone/tasks/ -rm -rf /var/ansible/openstack_mitaka/HA-ansible-multinodes.yml 2>/dev/null -cp ${COMPASSDIR}/misc/adapter_changes/HA-ansible-multinodes.yml /var/ansible/openstack_mitaka/ + rm -rf /var/ansible/roles/keystone/vars/Debian.yml 2>/dev/null + cp ${COMPASSDIR}/misc/adapter_changes/Debian.yml /var/ansible/roles/keystone/vars/ + rm -rf /var/ansible/roles/keystone/tasks/keystone_install.yml 2>/dev/null + cp ${COMPASSDIR}/misc/adapter_changes/keystone_install.yml /var/ansible/roles/keystone/tasks/ + rm -rf /var/ansible/openstack_mitaka/HA-ansible-multinodes.yml 2>/dev/null + cp ${COMPASSDIR}/misc/adapter_changes/HA-ansible-multinodes.yml /var/ansible/openstack_mitaka/ +fi diff --git a/install/prepare.sh b/install/prepare.sh index 613bcbf3..8405a14e 100755 --- a/install/prepare.sh +++ b/install/prepare.sh @@ -104,58 +104,61 @@ else fi #update mysqld -echo "update mysqld" -mkdir -p /var/log/mysql -chmod -R 777 /var/log/mysql -sleep 10 -systemctl restart mysql.service -sudo sleep 10 -systemctl status mysql.service -if [[ "$?" != "0" ]]; then - echo "failed to restart mysqld" - exit 1 -else - echo "mysqld restarted" -fi -MYSQL_USER=${MYSQL_USER:-root} -MYSQL_OLD_PASSWORD=${MYSQL_OLD_PASSWORD:-root} -MYSQL_PASSWORD=${MYSQL_PASSWORD:-root} -MYSQL_SERVER=${MYSQL_SERVER:-127.0.0.1} -MYSQL_PORT=${MYSQL_PORT:-3306} -MYSQL_DATABASE=${MYSQL_DATABASE:-compass} -# first time set mysql password -sudo mysqladmin -h${MYSQL_SERVER} --port=${MYSQL_PORT} -u ${MYSQL_USER} -p"${MYSQL_OLD_PASSWORD}" password ${MYSQL_PASSWORD} -if [[ "$?" != "0" ]]; then -echo "setting up mysql initial password" -sudo mysqladmin -h${MYSQL_SERVER} --port=${MYSQL_PORT} -u ${MYSQL_USER} password ${MYSQL_PASSWORD} -fi -mysql -h${MYSQL_SERVER} --port=${MYSQL_PORT} -u${MYSQL_USER} -p${MYSQL_PASSWORD} -e "show databases;" -if [[ "$?" != "0" ]]; then - echo "mysql password set failed" - exit 1 -else - echo "mysql password set succeeded" -fi +if [ "$FULL_COMAPSS_SERVER" == "true"]; then + echo "update mysqld" + mkdir -p /var/log/mysql + chmod -R 777 /var/log/mysql + sleep 10 + systemctl restart mysql.service + sudo sleep 10 + systemctl status mysql.service + if [[ "$?" != "0" ]]; then + echo "failed to restart mysqld" + exit 1 + else + echo "mysqld restarted" + fi -sudo mysql -h${MYSQL_SERVER} --port=${MYSQL_PORT} -u${MYSQL_USER} -p${MYSQL_PASSWORD} -e "drop database ${MYSQL_DATABASE}" -sudo mysql -h${MYSQL_SERVER} --port=${MYSQL_PORT} -u${MYSQL_USER} -p${MYSQL_PASSWORD} -e "create database ${MYSQL_DATABASE}" -if [[ "$?" != "0" ]]; then - echo "mysql database set failed" - exit 1 -fi + MYSQL_USER=${MYSQL_USER:-root} + MYSQL_OLD_PASSWORD=${MYSQL_OLD_PASSWORD:-root} + MYSQL_PASSWORD=${MYSQL_PASSWORD:-root} + MYSQL_SERVER=${MYSQL_SERVER:-127.0.0.1} + MYSQL_PORT=${MYSQL_PORT:-3306} + MYSQL_DATABASE=${MYSQL_DATABASE:-compass} + # first time set mysql password + sudo mysqladmin -h${MYSQL_SERVER} --port=${MYSQL_PORT} -u ${MYSQL_USER} -p"${MYSQL_OLD_PASSWORD}" password ${MYSQL_PASSWORD} + if [[ "$?" != "0" ]]; then + echo "setting up mysql initial password" + sudo mysqladmin -h${MYSQL_SERVER} --port=${MYSQL_PORT} -u ${MYSQL_USER} password ${MYSQL_PASSWORD} + fi + mysql -h${MYSQL_SERVER} --port=${MYSQL_PORT} -u${MYSQL_USER} -p${MYSQL_PASSWORD} -e "show databases;" + if [[ "$?" != "0" ]]; then + echo "mysql password set failed" + exit 1 + else + echo "mysql password set succeeded" + fi -sudo systemctl restart mysql.service -sudo systemctl status mysql.service -if [[ "$?" != "0" ]]; then - echo "mysqld is not started" - exit 1 -fi + sudo mysql -h${MYSQL_SERVER} --port=${MYSQL_PORT} -u${MYSQL_USER} -p${MYSQL_PASSWORD} -e "drop database ${MYSQL_DATABASE}" + sudo mysql -h${MYSQL_SERVER} --port=${MYSQL_PORT} -u${MYSQL_USER} -p${MYSQL_PASSWORD} -e "create database ${MYSQL_DATABASE}" + if [[ "$?" != "0" ]]; then + echo "mysql database set failed" + exit 1 + fi -sudo systemctl restart rabbitmq-server.service -sudo systemctl status rabbitmq-server.service -if [[ "$?" != "0" ]]; then - echo "rabbitmq-server is not started" - exit 1 + sudo systemctl restart mysql.service + sudo systemctl status mysql.service + if [[ "$?" != "0" ]]; then + echo "mysqld is not started" + exit 1 + fi + + sudo systemctl restart rabbitmq-server.service + sudo systemctl status rabbitmq-server.service + if [[ "$?" != "0" ]]; then + echo "rabbitmq-server is not started" + exit 1 + fi fi cd $SCRIPT_DIR From 92061511a51035ce37f080b4e17a5aa432975b6a Mon Sep 17 00:00:00 2001 From: Xicheng Chang Date: Sat, 9 Jul 2016 21:23:07 -0400 Subject: [PATCH 06/32] trim install fix bugs Change-Id: Ib844b103d4c1bb9e9b8bf70f0c5df323e0be8a2b --- install/dependency.sh | 2 +- install/install.sh | 4 ++++ .../{HA-ansible-Multinodes.yml => HA-ansible-multinodes.yml} | 0 requirements.txt | 2 +- 4 files changed, 6 insertions(+), 2 deletions(-) rename misc/adapter_changes/{HA-ansible-Multinodes.yml => HA-ansible-multinodes.yml} (100%) diff --git a/install/dependency.sh b/install/dependency.sh index 29ee1183..5deb38a6 100755 --- a/install/dependency.sh +++ b/install/dependency.sh @@ -15,7 +15,7 @@ if [ "$FULL_COMAPSS_SERVER" == "true" ]; then sudo yum --enablerepo=compass_install install -y $MYSQL sudo yum --enablerepo=compass_install --nogpgcheck install -y rsyslog logrotate ntp iproute openssh-clients python python-devel git wget syslinux amqp rabbitmq-server mod_wsgi httpd squid dhcp bind rsync yum-utils xinetd tftp-server gcc net-snmp-utils net-snmp net-snmp-python unzip openssl openssl098e ca-certificates mysql-devel mysql-server mysql MySQL-python python-virtualenv python-setuptools python-pip bc libselinux-python libffi-devel openssl-devel else - sudo yum --enablerepo=compass_install --nogpgcheck install -y rsyslog logrotate ntp iproute openssh-clients python python-devel git wget syslinux amqp dhcp bind rsync yum-utils xinetd tftp-server gcc net-snmp-utils net-snmp net-snmp-python unzip openssl openssl098e ca-certificates python-virtualenv python-setuptools python-pip bc libselinux-python libffi-devel openssl-devel + sudo yum --enablerepo=compass_install --nogpgcheck install -y rsyslog logrotate ntp iproute openssh-clients python python-devel git wget syslinux amqp httpd dhcp bind rsync yum-utils xinetd tftp-server gcc net-snmp-utils net-snmp net-snmp-python unzip openssl openssl098e ca-certificates mysql-devel mysql MySQL-python python-virtualenv python-setuptools python-pip bc libselinux-python libffi-devel openssl-devel fi sudo yum --setopt=tsflags=noscripts -y remove redis # sudo yum --enablerepo=remi,remi-test install -y redis diff --git a/install/install.sh b/install/install.sh index ae6fcc3c..8224f0a5 100755 --- a/install/install.sh +++ b/install/install.sh @@ -371,4 +371,8 @@ if [ "$FULL_COMPASS_SERVER" == "false" ]; then cp ${COMPASSDIR}/misc/adapter_changes/keystone_install.yml /var/ansible/roles/keystone/tasks/ rm -rf /var/ansible/openstack_mitaka/HA-ansible-multinodes.yml 2>/dev/null cp ${COMPASSDIR}/misc/adapter_changes/HA-ansible-multinodes.yml /var/ansible/openstack_mitaka/ + + sed -i 's/^CELERY_DEFAULT_QUEUE.*/CELERY_DEFAULT_QUEUE = \"'"${USER_EMAIL}"'\"/g' /etc/compass/celeryconfig + sed -i 's/^CELERY_DEFAULT_EXCHANGE.*/CELERY_DEFAULT_EXCHANGE = \"'"${USER_EMAIL}"'\"/g' /etc/compass/celeryconfig + sed -i 's/^CELERY_DEFAULT_ROUTING_KEY.*/CELERY_DEFAULT_ROUTING_KEY = \"'"${USER_EMAIL}"'\"/g' /etc/compass/celeryconfig fi diff --git a/misc/adapter_changes/HA-ansible-Multinodes.yml b/misc/adapter_changes/HA-ansible-multinodes.yml similarity index 100% rename from misc/adapter_changes/HA-ansible-Multinodes.yml rename to misc/adapter_changes/HA-ansible-multinodes.yml diff --git a/requirements.txt b/requirements.txt index 87e26a4a..d156c034 100644 --- a/requirements.txt +++ b/requirements.txt @@ -14,8 +14,8 @@ itsdangerous importlib lazypy lockfile -MySQL-python netaddr +MySQL-python paramiko PyChef python-daemon!=2.0,!=2.0.1,!=2.0.2,!=2.0.3 From fb26ea6210d876177510ef70ca624eb3555f2836 Mon Sep 17 00:00:00 2001 From: Xicheng Chang Date: Sun, 10 Jul 2016 01:13:38 -0400 Subject: [PATCH 07/32] Fix syntax bug in debian.yml Change-Id: Ib641328ecc26455cc8069273153d91f50580ac2a --- misc/adapter_changes/Debian.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/misc/adapter_changes/Debian.yml b/misc/adapter_changes/Debian.yml index e1d7adac..0f76f751 100644 --- a/misc/adapter_changes/Debian.yml +++ b/misc/adapter_changes/Debian.yml @@ -13,6 +13,6 @@ cron_path: "/var/spool/cron/crontabs" packages: - keystone - services: - - apache2 - - keystone +services: + - apache2 + - keystone From 96987b54acb35b990592be4f1dde318e00af704e Mon Sep 17 00:00:00 2001 From: Xicheng Chang Date: Mon, 11 Jul 2016 14:03:48 -0400 Subject: [PATCH 08/32] Make two more apache config files. Change-Id: I53ec87d069d55c9a979dd46a4b226465c45a65a0 --- install/ansible.sh | 2 +- install/compass.sh | 16 +++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/install/ansible.sh b/install/ansible.sh index 7f24cfbc..2b481423 100755 --- a/install/ansible.sh +++ b/install/ansible.sh @@ -26,7 +26,7 @@ sudo cp -rn /var/ansible/* /root/backup/ansible/ for i in `ls $ADAPTERS_HOME/ansible/ | grep "openstack_"`; do mkdir -p /var/ansible/$i -# cp -rf $ADAPTERS_HOME/ansible/openstack/* /var/ansible/$i + cp -rf $ADAPTERS_HOME/ansible/openstack/* /var/ansible/$i cp -rf $ADAPTERS_HOME/ansible/$i /var/ansible/ done diff --git a/install/compass.sh b/install/compass.sh index f420dc35..6b71faff 100755 --- a/install/compass.sh +++ b/install/compass.sh @@ -28,6 +28,8 @@ sudo rm -rf /var/www/compass/* sudo cp -rf $COMPASSDIR/misc/apache/ods-server.conf /etc/httpd/conf.d/ods-server.conf sudo cp -rf $COMPASSDIR/misc/apache/http_pip.conf /etc/httpd/conf.d/http_pip.conf +sudo cp -rf $COMPASSDIR/misc/apache/images.conf /etc/httpd/conf.d/images.conf +sudo cp -rf $COMPASSDIR/misc/apache/packages.conf /etc/httpd/conf.d/packages.conf sudo cp -rf $COMPASSDIR/conf/* /etc/compass/ sudo cp -rf $COMPASSDIR/service/* /etc/init.d/ sudo cp -rf $COMPASSDIR/bin/*.py /opt/compass/bin/ @@ -129,13 +131,13 @@ else echo "compassed service is refreshed" fi -# sudo systemctl status httpd.service -# if [[ "$?" != "0" ]]; then -# echo "httpd is not started" -# exit 1 -# else -# echo "httpd has already started" -# fi +sudo systemctl status httpd.service +if [[ "$?" != "0" ]]; then + echo "httpd is not started" + exit 1 +else + echo "httpd has already started" +fi sudo systemctl status redis.service |grep running if [[ "$?" != "0" ]]; then From 9449deffce5ecafe81c45ee7156d32dcfd20e346 Mon Sep 17 00:00:00 2001 From: Xicheng Chang Date: Mon, 11 Jul 2016 18:17:41 -0400 Subject: [PATCH 09/32] Add confs Change-Id: Ib9bc2c5c6ca224bb88bccf296fcfd8fafbcaee0d --- misc/apache/images.conf | 9 +++++++++ misc/apache/packages.conf | 9 +++++++++ 2 files changed, 18 insertions(+) create mode 100644 misc/apache/images.conf create mode 100644 misc/apache/packages.conf diff --git a/misc/apache/images.conf b/misc/apache/images.conf new file mode 100644 index 00000000..d38986a1 --- /dev/null +++ b/misc/apache/images.conf @@ -0,0 +1,9 @@ +Alias /image /var/www/guestimg + + + SetEnv VIRTUALENV + Options Indexes FollowSymLinks + Order allow,deny + Allow from all + + diff --git a/misc/apache/packages.conf b/misc/apache/packages.conf new file mode 100644 index 00000000..0934fcd4 --- /dev/null +++ b/misc/apache/packages.conf @@ -0,0 +1,9 @@ +Alias /packages /var/www/packages + + + SetEnv VIRTUALENV + Options Indexes FollowSymLinks + Order allow,deny + Allow from all + + From 62d20d75d5df09e7fa7e7cd8257c6aee77e7fb5a Mon Sep 17 00:00:00 2001 From: Xicheng Chang Date: Mon, 11 Jul 2016 20:14:00 -0400 Subject: [PATCH 10/32] Edit preseed post anamon snippet Change-Id: I9da54e4344ed160561191f0e4abda00f9de36e76 --- install/install.sh | 2 + misc/adapter_changes/preseed_post_anamon | 80 ++++++++++++++++++++++++ 2 files changed, 82 insertions(+) create mode 100644 misc/adapter_changes/preseed_post_anamon diff --git a/install/install.sh b/install/install.sh index 8224f0a5..84c1fd65 100755 --- a/install/install.sh +++ b/install/install.sh @@ -371,6 +371,8 @@ if [ "$FULL_COMPASS_SERVER" == "false" ]; then cp ${COMPASSDIR}/misc/adapter_changes/keystone_install.yml /var/ansible/roles/keystone/tasks/ rm -rf /var/ansible/openstack_mitaka/HA-ansible-multinodes.yml 2>/dev/null cp ${COMPASSDIR}/misc/adapter_changes/HA-ansible-multinodes.yml /var/ansible/openstack_mitaka/ + rm -rf /var/lib/cobbler/snippets/preseed_post_anamon 2>/dev/null + cp ${COMPASSDIR}/misc/adapter_changes/preseed_post_anamon /var/lib/cobbler/snippets/ sed -i 's/^CELERY_DEFAULT_QUEUE.*/CELERY_DEFAULT_QUEUE = \"'"${USER_EMAIL}"'\"/g' /etc/compass/celeryconfig sed -i 's/^CELERY_DEFAULT_EXCHANGE.*/CELERY_DEFAULT_EXCHANGE = \"'"${USER_EMAIL}"'\"/g' /etc/compass/celeryconfig diff --git a/misc/adapter_changes/preseed_post_anamon b/misc/adapter_changes/preseed_post_anamon new file mode 100644 index 00000000..a1235466 --- /dev/null +++ b/misc/adapter_changes/preseed_post_anamon @@ -0,0 +1,80 @@ +#if $str($getVar('anamon_enabled','')) == "1" + +## install anamon script + #if $getVar("compass_server", "") != "" +wget -O /usr/local/sbin/anamon "http://$compass_server:$http_port/cobbler/aux/anamon" + #else +wget -O /usr/local/sbin/anamon "http://$server:$http_port/cobbler/aux/anamon" + #end if +## install anamon system service +cat << EOF > /etc/init.d/anamon.init +#raw +#!/bin/bash +## BEGIN INIT INFO +# Provides: anamon.init +# Default-Start: 3 5 +# Default-Stop: 0 1 2 4 6 +# Required-Start: $network +# Short-Description: Starts the cobbler anamon boot notification program +# Description: anamon runs the first time a machine is booted after +# installation. +## END INIT INFO + +# +# anamon.init: Starts the cobbler post-install boot notification program +# +# chkconfig: 35 95 95 +# +# description: anamon runs the first time a machine is booted after +# installation. +# +#end raw +cd /var/log/installer +gunzip initial-status.gz +cd - +#if $getVar("compass_server","") != "" +/usr/local/sbin/anamon --watchfile "/var/log/installer/syslog /var/log/installer/hardware-summary /var/log/installer/initial-status /var/log/installer/status" --name $name --server $compass_server --port $http_port --exit +#else +/usr/local/sbin/anamon --watchfile "/var/log/installer/syslog /var/log/installer/hardware-summary /var/log/installer/initial-status /var/log/installer/status" --name $name --server $server --port $http_port --exit +#end if +update-rc.d -f anamon remove +mv /etc/init.d/anamon.init /tmp/anamon.init +EOF + +## adjust permissions +chmod 755 /etc/init.d/anamon.init /usr/local/sbin/anamon +test -d /selinux && restorecon /etc/init.d/anamon.init /usr/local/sbin/anamon + +## enable the script +update-rc.d anamon.init defaults 95 95 +#end if + +## place start-up script for updating os state +#if $getVar('compass_server', '') != "" + #set srv = $getVar('compass_server','') +#else + #set srv = $getVar('server','') +#end if +cat << EOF > /etc/init.d/set_state +#raw +#!/bin/bash +# Provides: set_state +# Default-Start: 3 5 +# Default-Stop: 0 1 2 4 6 +# Required-Start: $network $ssh +# Short-Description: Notifies the os installation is finished +# Description: set_state runs the first time a machine is booted after +# installation. +#end raw +wget -O /tmp/os_state --post-data='{"ready": true}' --header=Content-Type:application/json "http://www.stack360.io/api/hosts/${hostname}/state_internal" +update-rc.d -f set_state remove +mv /etc/init.d/set_state /tmp/set_state +EOF + +## adjust permissions +chmod 755 /etc/init.d/set_state +test -d /selinux && restorecon /etc/init.d/set_state + +update-rc.d set_state defaults 99 99 + +echo "compass_server=$server" >> /etc/compass.conf From 6b13fb7a391d38a70552fec97ddbcde5bc51db4d Mon Sep 17 00:00:00 2001 From: Xicheng Chang Date: Mon, 11 Jul 2016 23:52:44 -0400 Subject: [PATCH 11/32] remove some of the replacement Change-Id: I465b0229c492f0c874d4014ccb4be1f873939d29 --- install/dependency.sh | 4 ++-- install/install.sh | 14 +++++++------- install/prepare.sh | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/install/dependency.sh b/install/dependency.sh index 5deb38a6..fecfe507 100755 --- a/install/dependency.sh +++ b/install/dependency.sh @@ -11,7 +11,7 @@ if [ "$tempest" == "true" ]; then fi fi -if [ "$FULL_COMAPSS_SERVER" == "true" ]; then +if [ "$FULL_COMPASS_SERVER" == "true" ]; then sudo yum --enablerepo=compass_install install -y $MYSQL sudo yum --enablerepo=compass_install --nogpgcheck install -y rsyslog logrotate ntp iproute openssh-clients python python-devel git wget syslinux amqp rabbitmq-server mod_wsgi httpd squid dhcp bind rsync yum-utils xinetd tftp-server gcc net-snmp-utils net-snmp net-snmp-python unzip openssl openssl098e ca-certificates mysql-devel mysql-server mysql MySQL-python python-virtualenv python-setuptools python-pip bc libselinux-python libffi-devel openssl-devel else @@ -61,7 +61,7 @@ sudo systemctl enable sshd.service sudo systemctl enable rsyslog.service sudo systemctl enable ntpd.service sudo systemctl enable redis.service -if [ "$FULL_COMAPSS_SERVER" == "true" ]; then +if [ "$FULL_COMPASS_SERVER" == "true" ]; then sudo systemctl enable mysqld.service sudo systemctl enable rabbitmq-server.service fi diff --git a/install/install.sh b/install/install.sh index 84c1fd65..8a99870d 100755 --- a/install/install.sh +++ b/install/install.sh @@ -343,7 +343,7 @@ echo "Install the Package Installer Tool" # source ${COMPASSDIR}/install/chef.sh || exit $? source ${COMPASSDIR}/install/ansible.sh || exit $? -if [ "$FULL_COMAPSS_SERVER" == "true"]; then +if [ "$FULL_COMPASS_SERVER" == "true"]; then echo "Download and install Compass Web" source ${COMPASSDIR}/install/compass_web.sh || exit $? fi @@ -365,12 +365,12 @@ if [ "$FULL_COMPASS_SERVER" == "false" ]; then machine_list_conf="${machine_list_conf}\n ] } ]" sudo echo -e ${machine_list_conf} > /etc/compass/machine_list/machine_list.conf - rm -rf /var/ansible/roles/keystone/vars/Debian.yml 2>/dev/null - cp ${COMPASSDIR}/misc/adapter_changes/Debian.yml /var/ansible/roles/keystone/vars/ - rm -rf /var/ansible/roles/keystone/tasks/keystone_install.yml 2>/dev/null - cp ${COMPASSDIR}/misc/adapter_changes/keystone_install.yml /var/ansible/roles/keystone/tasks/ - rm -rf /var/ansible/openstack_mitaka/HA-ansible-multinodes.yml 2>/dev/null - cp ${COMPASSDIR}/misc/adapter_changes/HA-ansible-multinodes.yml /var/ansible/openstack_mitaka/ +# rm -rf /var/ansible/roles/keystone/vars/Debian.yml 2>/dev/null +# cp ${COMPASSDIR}/misc/adapter_changes/Debian.yml /var/ansible/roles/keystone/vars/ +# rm -rf /var/ansible/roles/keystone/tasks/keystone_install.yml 2>/dev/null +# cp ${COMPASSDIR}/misc/adapter_changes/keystone_install.yml /var/ansible/roles/keystone/tasks/ +# rm -rf /var/ansible/openstack_mitaka/HA-ansible-multinodes.yml 2>/dev/null +# cp ${COMPASSDIR}/misc/adapter_changes/HA-ansible-multinodes.yml /var/ansible/openstack_mitaka/ rm -rf /var/lib/cobbler/snippets/preseed_post_anamon 2>/dev/null cp ${COMPASSDIR}/misc/adapter_changes/preseed_post_anamon /var/lib/cobbler/snippets/ diff --git a/install/prepare.sh b/install/prepare.sh index 8405a14e..e8b724b8 100755 --- a/install/prepare.sh +++ b/install/prepare.sh @@ -104,7 +104,7 @@ else fi #update mysqld -if [ "$FULL_COMAPSS_SERVER" == "true"]; then +if [ "$FULL_COMPASS_SERVER" == "true"]; then echo "update mysqld" mkdir -p /var/log/mysql chmod -R 777 /var/log/mysql From d96761d6815fe8f8634f1857d19c6f4a483a47db Mon Sep 17 00:00:00 2001 From: Xicheng Chang Date: Tue, 12 Jul 2016 19:04:45 -0400 Subject: [PATCH 12/32] Install a pip pacakge to enable ansible accelerate mode. Change-Id: I4c4e3256669ad6cc70d29e5128d717392d5e16b9 --- install/ansible.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/install/ansible.sh b/install/ansible.sh index 2b481423..b48db5ff 100755 --- a/install/ansible.sh +++ b/install/ansible.sh @@ -15,6 +15,7 @@ source $DIR/install_func.sh echo "INstalling ansible related packages" # sudo yum -y install ansible pip install ansible==1.9.2 +pip install python-keyczar if [[ "$?" != "0" ]]; then echo "Failed to install ansible" exit 1 From 0a50f8da51733829ef7334d9faa2f462399afeaf Mon Sep 17 00:00:00 2001 From: Xicheng Chang Date: Wed, 13 Jul 2016 16:44:22 -0400 Subject: [PATCH 13/32] Update some package sources Change-Id: I438b028e2b27ecc839fcd785fca321f028065c91 --- install/compass.sh | 1 + install/install.conf | 1 + install/install.sh | 22 ++++++++++++++++++++++ 3 files changed, 24 insertions(+) diff --git a/install/compass.sh b/install/compass.sh index 6b71faff..493df606 100755 --- a/install/compass.sh +++ b/install/compass.sh @@ -59,6 +59,7 @@ if [ ! -f /usr/lib64/libcrypto.so ]; then fi download -u "$PIP_PACKAGES" `basename $PIP_PACKAGES` unzip /var/www/ || exit $? +download -u "$EXTRA_PACKAGES" `basename $EXTRA_PACKAGES` unzip /var/www/ || exit $? sudo mkdir -p /opt/compass/db sudo chmod -R 777 /opt/compass/db diff --git a/install/install.conf b/install/install.conf index b09b4db9..210e9876 100755 --- a/install/install.conf +++ b/install/install.conf @@ -79,6 +79,7 @@ export UBUNTU_14_04_03_IMAGE_SOURCE="http://205.177.226.237:9999/ubuntu-14.04.3- export CENTOS_7_2_PPA_REPO_SOURCE="http://205.177.226.237:9999/centos7-juno-ppa.tar.gz" export UBUNTU_14_04_03_PPA_REPO_SOURCE="http://205.177.226.237:9999/trusty-mitaka-ppa.tar.gz" export PIP_PACKAGES="http://205.177.226.237:9999/pip.tar.gz" +export EXTRA_PACKAGES="http://www.stack360.io/packages.tar.gz" export COBBLER_PASSWORD="cobbler" diff --git a/install/install.sh b/install/install.sh index 8a99870d..56d48b12 100755 --- a/install/install.sh +++ b/install/install.sh @@ -377,4 +377,26 @@ if [ "$FULL_COMPASS_SERVER" == "false" ]; then sed -i 's/^CELERY_DEFAULT_QUEUE.*/CELERY_DEFAULT_QUEUE = \"'"${USER_EMAIL}"'\"/g' /etc/compass/celeryconfig sed -i 's/^CELERY_DEFAULT_EXCHANGE.*/CELERY_DEFAULT_EXCHANGE = \"'"${USER_EMAIL}"'\"/g' /etc/compass/celeryconfig sed -i 's/^CELERY_DEFAULT_ROUTING_KEY.*/CELERY_DEFAULT_ROUTING_KEY = \"'"${USER_EMAIL}"'\"/g' /etc/compass/celeryconfig + + # Restart services + systemctl restart httpd.service + sleep 10 + echo "Checking if httpd is running" + sudo systemctl status httpd.service + if [[ "$?" == "0" ]]; then + echo "httpd is running" + else + echo "httpd is not running" + exit 1 + fi + + systemctl restart compass-celeryd.service + echo "Checking if httpd is running" + sudo systemctl status compass-celeryd.service + if [[ "$?" == "0" ]]; then + echo "celeryd is running" + else + echo "celeryd is not running" + exit 1 + fi fi From 63dd7d6fc04e2d0a47a8a10c43ac9f7cb58c05cc Mon Sep 17 00:00:00 2001 From: Xicheng Chang Date: Thu, 14 Jul 2016 02:01:42 -0400 Subject: [PATCH 14/32] Edit cluster and host models. To allow different users to use the same cluster and host name. Change-Id: Icf68735b54c7e051ea655624ee83f2b6ae2c43bd --- compass/db/api/cluster.py | 2 +- compass/db/api/host.py | 3 ++- compass/db/models.py | 22 +++++++++++++++++----- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/compass/db/api/cluster.py b/compass/db/api/cluster.py index f00889d5..bb838d12 100644 --- a/compass/db/api/cluster.py +++ b/compass/db/api/cluster.py @@ -359,7 +359,7 @@ def add_cluster( cluster = utils.add_db_object( session, models.Cluster, exception_when_existing, - name, creator_id=user.id, adapter_id=adapter_id, + name, user.id, adapter_id=adapter_id, flavor_id=flavor_id, flavor=flavor, **kwargs ) return cluster diff --git a/compass/db/api/host.py b/compass/db/api/host.py index 3b9b6268..f485a245 100644 --- a/compass/db/api/host.py +++ b/compass/db/api/host.py @@ -658,10 +658,11 @@ def _add_host_network( """Add hostnetwork to a host.""" host = _get_host(host_id, session=session) check_host_editable(host, user=user) + user_id = user.id return utils.add_db_object( session, models.HostNetwork, exception_when_existing, - host.id, interface, ip=ip, **kwargs + host.id, interface, user_id, ip=ip, **kwargs ) diff --git a/compass/db/models.py b/compass/db/models.py index e183eb08..afc0e1ed 100644 --- a/compass/db/models.py +++ b/compass/db/models.py @@ -204,17 +204,20 @@ class HostNetwork(BASE, TimestampMixin, HelperMixin): Integer, ForeignKey('subnet.id', onupdate='CASCADE', ondelete='CASCADE') ) - ip_int = Column(BigInteger, unique=True, nullable=False) + user_id = Column(Integer, ForeignKey('user.id')) + ip_int = Column(BigInteger, nullable=False) is_mgmt = Column(Boolean, default=False) is_promiscuous = Column(Boolean, default=False) __table_args__ = ( UniqueConstraint('host_id', 'interface', name='constraint'), + UniqueConstraint('ip_int', 'user_id', name='constraint') ) - def __init__(self, host_id, interface, **kwargs): + def __init__(self, host_id, interface, user_id, **kwargs): self.host_id = host_id self.interface = interface + self.user_id = user_id super(HostNetwork, self).__init__(**kwargs) def __str__(self): @@ -265,6 +268,7 @@ class HostNetwork(BASE, TimestampMixin, HelperMixin): dict_info['interface'] = self.interface dict_info['netmask'] = self.netmask dict_info['subnet'] = self.subnet.subnet + dict_info['user_id'] = self.user_id return dict_info @@ -702,7 +706,7 @@ class Host(BASE, TimestampMixin, HelperMixin): """Host table.""" __tablename__ = 'host' - name = Column(String(80), unique=True, nullable=True) + name = Column(String(80), nullable=True) config_step = Column(String(80), default='') os_config = Column(JSONEncoded, default={}) config_validated = Column(Boolean, default=False) @@ -712,6 +716,10 @@ class Host(BASE, TimestampMixin, HelperMixin): owner = Column(String(80)) os_installer = Column(JSONEncoded, default={}) + __table_args__ = ( + UniqueConstraint('name', 'owner', name='constraint'), + ) + id = Column( Integer, ForeignKey('machine.id', onupdate='CASCADE', ondelete='CASCADE'), @@ -972,7 +980,7 @@ class Cluster(BASE, TimestampMixin, HelperMixin): __tablename__ = 'cluster' id = Column(Integer, primary_key=True) - name = Column(String(80), unique=True, nullable=False) + name = Column(String(80), nullable=False) reinstall_distributed_system = Column(Boolean, default=True) config_step = Column(String(80), default='') os_name = Column(String(80)) @@ -1000,9 +1008,13 @@ class Cluster(BASE, TimestampMixin, HelperMixin): cascade='all, delete-orphan', backref=backref('cluster') ) + __table_args__ = ( + UniqueConstraint('name', 'creator_id', name='constraint'), + ) - def __init__(self, name, **kwargs): + def __init__(self, name, creator_id, **kwargs): self.name = name + self.creator_id = creator_id self.state = ClusterState() super(Cluster, self).__init__(**kwargs) From d490c94aec2dd556c01ddaa2d2d30ec72e5a9b57 Mon Sep 17 00:00:00 2001 From: Xicheng Chang Date: Mon, 18 Jul 2016 14:16:12 -0400 Subject: [PATCH 15/32] Fix bug in model Change-Id: I95e695e8c28113106e54a0c06744ffa35619ebbf --- compass/db/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compass/db/models.py b/compass/db/models.py index afc0e1ed..d4b0324d 100644 --- a/compass/db/models.py +++ b/compass/db/models.py @@ -210,8 +210,8 @@ class HostNetwork(BASE, TimestampMixin, HelperMixin): is_promiscuous = Column(Boolean, default=False) __table_args__ = ( - UniqueConstraint('host_id', 'interface', name='constraint'), - UniqueConstraint('ip_int', 'user_id', name='constraint') + UniqueConstraint('host_id', 'interface', name='interface_constraint'), + UniqueConstraint('ip_int', 'user_id', name='ip_constraint') ) def __init__(self, host_id, interface, user_id, **kwargs): From cbdb6093bd490ab0ba389e8caff1224749785edf Mon Sep 17 00:00:00 2001 From: Xicheng Chang Date: Tue, 19 Jul 2016 18:25:03 -0400 Subject: [PATCH 16/32] Fix some bugs Change-Id: I4b87d63e31f80faeefcf97eccf903d70ce6e8504 --- install/install.conf | 2 +- misc/compass_install.repo | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/install/install.conf b/install/install.conf index 210e9876..839b6e63 100755 --- a/install/install.conf +++ b/install/install.conf @@ -79,7 +79,7 @@ export UBUNTU_14_04_03_IMAGE_SOURCE="http://205.177.226.237:9999/ubuntu-14.04.3- export CENTOS_7_2_PPA_REPO_SOURCE="http://205.177.226.237:9999/centos7-juno-ppa.tar.gz" export UBUNTU_14_04_03_PPA_REPO_SOURCE="http://205.177.226.237:9999/trusty-mitaka-ppa.tar.gz" export PIP_PACKAGES="http://205.177.226.237:9999/pip.tar.gz" -export EXTRA_PACKAGES="http://www.stack360.io/packages.tar.gz" +export EXTRA_PACKAGES="http://205.177.226.237:9999/packages.tar.gz" export COBBLER_PASSWORD="cobbler" diff --git a/misc/compass_install.repo b/misc/compass_install.repo index 5d71ef28..beeb1c4d 100644 --- a/misc/compass_install.repo +++ b/misc/compass_install.repo @@ -1,5 +1,5 @@ [compass_install] name=compass_repo -baseurl=http://www.stack360.io/centos7/ +baseurl=http://205.177.226.237:9999/compass_install/centos7/ gpgcheck=0 enabled=1 From 975ac6820cf27d1d034d160fc8cb952e1b1f68c5 Mon Sep 17 00:00:00 2001 From: Xicheng Chang Date: Tue, 16 Aug 2016 19:14:20 -0400 Subject: [PATCH 17/32] fix url in preseed_post_anamon. Change-Id: I5416544bea020eaea7bd8e5b867c2d53bd0678c4 --- misc/adapter_changes/preseed_post_anamon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/adapter_changes/preseed_post_anamon b/misc/adapter_changes/preseed_post_anamon index a1235466..216e70dc 100644 --- a/misc/adapter_changes/preseed_post_anamon +++ b/misc/adapter_changes/preseed_post_anamon @@ -66,7 +66,7 @@ cat << EOF > /etc/init.d/set_state # Description: set_state runs the first time a machine is booted after # installation. #end raw -wget -O /tmp/os_state --post-data='{"ready": true}' --header=Content-Type:application/json "http://www.stack360.io/api/hosts/${hostname}/state_internal" +wget -O /tmp/os_state --post-data='{"ready": true}' --header=Content-Type:application/json "http://c.stack360.io/api/hosts/${hostname}/state_internal" update-rc.d -f set_state remove mv /etc/init.d/set_state /tmp/set_state EOF From 9da13f2b85566a0d3674f5c964af172050c7d566 Mon Sep 17 00:00:00 2001 From: Xicheng Chang Date: Fri, 19 Aug 2016 13:15:08 -0400 Subject: [PATCH 18/32] Add logstash forwarder to agent. Change-Id: I6ba34cadaf9f7d69d6b7039b9ebea9523d433fd1 --- install/install.sh | 3 + install/logstash-forwarder.sh | 22 +++++++ .../logstash-forwarder.conf | 57 +++++++++++++++++++ .../logstash-forwarder/logstash-forwarder.crt | 29 ++++++++++ .../logstash-forwarder.repo | 6 ++ 5 files changed, 117 insertions(+) create mode 100644 install/logstash-forwarder.sh create mode 100644 misc/logstash-forwarder/logstash-forwarder.conf create mode 100644 misc/logstash-forwarder/logstash-forwarder.crt create mode 100644 misc/logstash-forwarder/logstash-forwarder.repo diff --git a/install/install.sh b/install/install.sh index 56d48b12..24525e59 100755 --- a/install/install.sh +++ b/install/install.sh @@ -343,6 +343,9 @@ echo "Install the Package Installer Tool" # source ${COMPASSDIR}/install/chef.sh || exit $? source ${COMPASSDIR}/install/ansible.sh || exit $? +echo "Install log agent." +source ${COMPASSDIR}/install/logstash-forwarder.sh || exit $? + if [ "$FULL_COMPASS_SERVER" == "true"]; then echo "Download and install Compass Web" source ${COMPASSDIR}/install/compass_web.sh || exit $? diff --git a/install/logstash-forwarder.sh b/install/logstash-forwarder.sh new file mode 100644 index 00000000..a3eb33f5 --- /dev/null +++ b/install/logstash-forwarder.sh @@ -0,0 +1,22 @@ +#!/bin/bash +# + +echo "Installing logstash-forwarder" +DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) +source $DIR/install.conf + +sudo cp -rf $COMPASSDIR/misc/logstash-forwarder/logstash-forwarder.repo /etc/yum.repos.d/logstash-forwarder.repo +sudo yum -y install logstash-forwarder +sudo rm -rf /etc/logstash-forwarder.conf +sudo cp -rf $COMPASSDIR/misc/logstash-forwarder/logstash-forwarder.conf /etc/logstash-forwarder.conf +sudo mkdir -p /etc/pki/tls/certs +sudo cp -rf $COMPASSDIR/misc/logstash-forwarder/logstash-forwarder.crt /etc/pki/tls/certs/logstash-forwarder.crt + +sudo systemctl restart logstash-forwarder.service +sleep 3 +echo "checking if logstash-forwarder is running" +sudo systemctl status logstash-forwarder.service +if [[ "$?" != 0 ]]; then + echo "logstash-forwarder is not running" + exit +fi diff --git a/misc/logstash-forwarder/logstash-forwarder.conf b/misc/logstash-forwarder/logstash-forwarder.conf new file mode 100644 index 00000000..d0cffeb9 --- /dev/null +++ b/misc/logstash-forwarder/logstash-forwarder.conf @@ -0,0 +1,57 @@ +{ + # The network section covers network configuration :) + "network": { + # A list of downstream servers listening for our messages. + # logstash-forwarder will pick one at random and only switch if + # the selected one appears to be dead or unresponsive + "servers": [ "www.stack360.io:5000" ], + + # The path to your client ssl certificate (optional) + #"ssl certificate": "./logstash-forwarder.crt", + # The path to your client ssl key (optional) + #"ssl key": "./logstash-forwarder.key", + + # The path to your trusted ssl CA file. This is used + # to authenticate your downstream server. + "ssl ca": "/etc/pki/tls/certs/logstash-forwarder.crt", + + # Network timeout in seconds. This is most important for + # logstash-forwarder determining whether to stop waiting for an + # acknowledgement from the downstream server. If an timeout is reached, + # logstash-forwarder will assume the connection or server is bad and + # will connect to a server chosen at random from the servers list. + "timeout": 15 + }, + + # The list of files configurations + "files": [ + { + "paths": [ + "/var/log/compass/celery.log" + ] + } + # An array of hashes. Each hash tells what paths to watch and + # what fields to annotate on events from those paths. + #{ + #"paths": [ + # single paths are fine + #"/var/log/messages", + # globs are fine too, they will be periodically evaluated + # to see if any new files match the wildcard. + #"/var/log/*.log" + #], + + # A dictionary of fields to annotate on each event. + #"fields": { "type": "syslog" } + #}, { + # A path of "-" means stdin. + #"paths": [ "-" ], + #"fields": { "type": "stdin" } + #}, { + #"paths": [ + #"/var/log/apache/httpd-*.log" + #], + #"fields": { "type": "apache" } + #} + ] +} diff --git a/misc/logstash-forwarder/logstash-forwarder.crt b/misc/logstash-forwarder/logstash-forwarder.crt new file mode 100644 index 00000000..90f66b17 --- /dev/null +++ b/misc/logstash-forwarder/logstash-forwarder.crt @@ -0,0 +1,29 @@ +-----BEGIN CERTIFICATE----- +MIIFAzCCAuugAwIBAgIJAKrryFncVfJNMA0GCSqGSIb3DQEBCwUAMBgxFjAUBgNV +BAMMDSouc3RhY2szNjAuaW8wHhcNMTYwODE4MTcwNzEyWhcNMjYwODE2MTcwNzEy +WjAYMRYwFAYDVQQDDA0qLnN0YWNrMzYwLmlvMIICIjANBgkqhkiG9w0BAQEFAAOC +Ag8AMIICCgKCAgEAw4p1OVw8tMeYfk9828FiRLPhYWwHD2OCVwlKr8P3bl974I/P +PhYTkrjEEe5SDYCWNcO58MxJ5X1vB2uQGNBBUFMni+KOqbVvcbPLL4Mkf8pjLdzD +2pItE1X7UQ8p1iYBEyAnLoV4MjA7CJ4MmUtOOcCb6keHWEhyJFOj9IzkTjFCbKuL +Y0paxayQOFlkuEK2d3Aa2HXgTLh3FFUX3kRqOcGg1uxEs2awf0nwP/NwcyfAgTSe +6yqVjnb3GLYdy283FqvxW1MrZS9UAxp/tAXRgMT8I9L2wSrjnPmrabBv5I+Kuf0p +EmLmxedOCTQsRYtYGL7TmySYgGuYtt/4UNKaG9tCPBnRXuMzlRClBDIoDhwLEKzC +LlE8JKyClNgutMKcrHbWlEJiGxooyDC1H9gwkHTi3w7qF9BYYBhkXFN2Sl0mPk0m +6NMfhQUAeqI0HlOsAX/HLwSWyRl0Nr2rvVJqgbbHRF18pADitQEuc/koT9qhON5f +BReYhQZIarwPJ/UBgwgadrP79bvWJ5u9Oga6H7yHf49/UYD3gQCvu3/Hxo/IY6AX +86eZg1ZObD6J0xpWb5jskVSgugar6Xq/h6iRkX8O3ssUdIyIxsIMhtCgxykSmdQY +FDEIWGZq2kdEVvF6GR/EYJRxvASI+27TXzuxP1UodQQOXa8xySkKu9U5SqMCAwEA +AaNQME4wHQYDVR0OBBYEFPLilPT6k6rRlxv9kCTW38VYy5AuMB8GA1UdIwQYMBaA +FPLilPT6k6rRlxv9kCTW38VYy5AuMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEL +BQADggIBAAdDy+R0bGCBQgiF2fGunl+AZ8zd0MZbtL4Kv53gunlhyaPQJ3Z+e3GF +V+Z9BhvMUXE/XN3bsAIZYJekvclysYLBdK1C8n9Rli+AbBSGjwgttRAXeEqaZCbE +QrNPukRgHThv6hyJNcf1TnR70xCBlcYOGQkEqWx1g0xrsG8ryGbum0BAG0YWLCYq +BboP16FGAPjDlb10ysWy7HuGJorf470Kyb2iRfp4PX/zdYbcA8gcggGCT323JwuD +Qwnd8kyX6+6pNhBJE3gAyPDhqvbFbpmo/Ia5pqmJkL3APee1bVI2itqZB/HnmyZ5 +UCIzqf4uAuEodN6yXiImHt0TagXtL4eEXNE2qjwsFSaHeyP6iXPX5tc8RMHzFQjH +I3MzROHaeVUxs2rMxETGvq4+DebhGzCBKaJUWfMV6Y1+ovrE0MowcR8nO1Q4YQt3 +to+W5IrjI7zzQ7+4XqZm+Yz1DQ4Kr7s2iyAExvkq7kU5FAow6SLPIaOl7kbas2M4 +fwFisuEQT2Om+hbWWZTJ1T45KU5NjznkPqJZ9dCdyqs2mH7BE4vOkOULq81uFG06 +VnJHcO+wZM1iCLa1hy7F2S4fDTjTBYDcuD5GFkulFLeFH5X7zoPz20OGTRMXZONI +CHEk1ibp8j/Q6bw1zd0jGm3KDUSx+0/Avfve/e28U4KAdNekrgQf +-----END CERTIFICATE----- diff --git a/misc/logstash-forwarder/logstash-forwarder.repo b/misc/logstash-forwarder/logstash-forwarder.repo new file mode 100644 index 00000000..27d68baa --- /dev/null +++ b/misc/logstash-forwarder/logstash-forwarder.repo @@ -0,0 +1,6 @@ +[logstashforwarder] +name=logstashforwarder repository +baseurl=http://packages.elasticsearch.org/logstashforwarder/centos +gpgcheck=1 +gpgkey=http://packages.elasticsearch.org/GPG-KEY-elasticsearch +enabled=1 From d519f32ebf99493fa70dc13b0c8c6a30b1fd756c Mon Sep 17 00:00:00 2001 From: Xicheng Chang Date: Thu, 25 Aug 2016 13:55:20 -0400 Subject: [PATCH 19/32] update compass-celeryd Change-Id: I2d61d945c599920547e02dfeb9d8901f922a73b9 --- compass/utils/celeryconfig_wrapper.py | 2 ++ service/compass-celeryd | 40 +++++++++++++-------------- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/compass/utils/celeryconfig_wrapper.py b/compass/utils/celeryconfig_wrapper.py index 6b477771..721095ca 100644 --- a/compass/utils/celeryconfig_wrapper.py +++ b/compass/utils/celeryconfig_wrapper.py @@ -18,6 +18,7 @@ """ import logging import os.path +import urllib from compass.utils import setting_wrapper as setting @@ -26,6 +27,7 @@ CELERY_RESULT_BACKEND = 'amqp://' BROKER_URL = 'amqp://guest:guest@localhost:5672//' + CELERY_IMPORTS = ('compass.tasks.tasks',) diff --git a/service/compass-celeryd b/service/compass-celeryd index 196ab070..9588ce48 100755 --- a/service/compass-celeryd +++ b/service/compass-celeryd @@ -48,22 +48,22 @@ start() { RETVAL=$? fi echo - retries=0 - max_retries=10 - output='' - while [ $retries -lt $max_retries ]; do - output=$(C_FORCE_ROOT=1 CELERY_CONFIG_MODULE=compass.utils.celeryconfig_wrapper $CELERY status 2&>1) - RETVAL=$? - if [ "$RETVAL" == "0" ]; then - break - else - sleep 10 - fi - let retries=${retries}+1 - done - if [ "$RETVAL" != "0" ]; then - echo output - fi +# retries=0 +# max_retries=10 +# output='' +# while [ $retries -lt $max_retries ]; do +# output=$(C_FORCE_ROOT=1 CELERY_CONFIG_MODULE=compass.utils.celeryconfig_wrapper $CELERY status 2&>1) +# RETVAL=$? +# if [ "$RETVAL" == "0" ]; then +# break +# else +# sleep 10 +# fi +# let retries=${retries}+1 +# done +# if [ "$RETVAL" != "0" ]; then +# echo output +# fi return $RETVAL } @@ -104,10 +104,10 @@ case "$1" in status -p /var/run/celery-worker.pid $CELERY RETVAL=$? fi - if [ "$RETVAL" == "0" ]; then - C_FORCE_ROOT=1 CELERY_CONFIG_MODULE=compass.utils.celeryconfig_wrapper $CELERY status - RETVAL=$? - fi +# if [ "$RETVAL" == "0" ]; then +# C_FORCE_ROOT=1 CELERY_CONFIG_MODULE=compass.utils.celeryconfig_wrapper $CELERY status +# RETVAL=$? +# fi ;; *) echo "Usage: $0 {start|stop|status|restart}" From af4c49294c077bd2d238a7cf451ce8f4173e1d98 Mon Sep 17 00:00:00 2001 From: Xicheng Chang Date: Thu, 25 Aug 2016 17:45:29 -0400 Subject: [PATCH 20/32] update register Change-Id: Iaa4d681a5db613a52d25508d7239ed5f2db7f708 --- compass/utils/celeryconfig_wrapper.py | 4 ++-- conf/celeryconfig | 10 +++++++--- install/register.sh | 17 ++++++++++------- 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/compass/utils/celeryconfig_wrapper.py b/compass/utils/celeryconfig_wrapper.py index 721095ca..b6644ba5 100644 --- a/compass/utils/celeryconfig_wrapper.py +++ b/compass/utils/celeryconfig_wrapper.py @@ -23,9 +23,9 @@ import urllib from compass.utils import setting_wrapper as setting -CELERY_RESULT_BACKEND = 'amqp://' +# CELERY_RESULT_BACKEND = 'amqp://' -BROKER_URL = 'amqp://guest:guest@localhost:5672//' +# BROKER_URL = 'amqp://guest:guest@localhost:5672//' CELERY_IMPORTS = ('compass.tasks.tasks',) diff --git a/conf/celeryconfig b/conf/celeryconfig index 797e7618..cda7ce17 100644 --- a/conf/celeryconfig +++ b/conf/celeryconfig @@ -1,8 +1,12 @@ -## Celery related setting: this is the default setting once we install RabbitMQ +## Celery related setting: this is the default setting +import urllib -CELERY_RESULT_BACKEND ="amqp://" +#CELERY_RESULT_BACKEND ="amqp://" +#BROKER_URL = "amqp://guest:guest@www.stack360.io:5672//" -BROKER_URL = "amqp://guest:guest@www.stack360.io:5672//" +BROKER_TRANSPORT = 'sqs' +BROKER_URL = 'sqs://%s:%s@' % (urllib.quote(ACCESS_ID, safe=''), + urllib.quote(ACCESS_KEY, safe='')) CELERY_IMPORTS=("compass.tasks.tasks",) CELERY_ACCEPT_CONTENT = ['pickle', 'json', 'msgpack', 'yaml'] diff --git a/install/register.sh b/install/register.sh index 4db968c3..089d6b36 100755 --- a/install/register.sh +++ b/install/register.sh @@ -2,13 +2,18 @@ # #set -x ### Register current user to compass - +USER_EMAIL="aaa@huawei.com" DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) -source $DIR/install.conf echo "The email address you use to register is ${USER_EMAIL}" password=`< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c6` data=`echo "{\"email\":\"${USER_EMAIL}\",\"password\":\"${password}\"}"` wget -O /tmp/user_info --post-data=$data --header=Content-Type:application/json "http://www.stack360.io/api/users/register" +wget -O /tmp/aws_credentials "http://www.stack360.io/aws_credentials" +filename='/tmp/aws_credentials' +id=$(sed -n '1p' < $filename) +key=$(sed -n '2p' < $filename) +sudo sed -i "s~ACCESS_ID~$id~g" /etc/compass/celeryconfig +sudo sed -i "s~ACCESS_KEY~$key~g" /etc/compass/celeryconfig if [ $? -ne 0 ]; then echo "Register failed" @@ -16,8 +21,6 @@ exit 1 fi echo "Register suceeded, your password is $password, please remember your password at all times." -sed -i 's/^CELERY_DEFAULT_QUEUE.*/CELERY_DEFAULT_QUEUE = \"'"${USER_EMAIL}"'\"/g' /etc/compass/celeryconfig -sed -i 's/^CELERY_DEFAULT_EXCHANGE.*/CELERY_DEFAULT_EXCHANGE = \"'"${USER_EMAIL}"'\"/g' /etc/compass/celeryconfig -sed -i 's/^CELERY_DEFAULT_ROUTING_KEY.*/CELERY_DEFAULT_ROUTING_KEY = \"'"${USER_EMAIL}"'\"/g' /etc/compass/celeryconfig - -systemctl restart compass-celeryd.service +sudo sed -i 's/^CELERY_DEFAULT_QUEUE.*/CELERY_DEFAULT_QUEUE = \"'"${USER_EMAIL}"'\"/g' /etc/compass/celeryconfig +sudo sed -i 's/^CELERY_DEFAULT_EXCHANGE.*/CELERY_DEFAULT_EXCHANGE = \"'"${USER_EMAIL}"'\"/g' /etc/compass/celeryconfig +sudo sed -i 's/^CELERY_DEFAULT_ROUTING_KEY.*/CELERY_DEFAULT_ROUTING_KEY = \"'"${USER_EMAIL}"'\"/g' /etc/compass/celeryconfig From 2b2ecce938416e933d5b133f3639bd5e7c0a445e Mon Sep 17 00:00:00 2001 From: Xicheng Chang Date: Thu, 25 Aug 2016 19:54:18 -0400 Subject: [PATCH 21/32] fix bugs in install.sh Change-Id: I9461be7ee99c81d9691a216ecd00f6d432ef54ec --- install/install.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/install/install.sh b/install/install.sh index 24525e59..3ac9a7d7 100755 --- a/install/install.sh +++ b/install/install.sh @@ -200,12 +200,12 @@ fi # Install figlet sudo yum -y install figlet >& /dev/null -if [[ "$?" != "0" ]]; then - echo "failed to install figlet" - exit 1 -else - echo "figlet is installed" -fi +# if [[ "$?" != "0" ]]; then +# echo "failed to install figlet" +# exit 1 +# else +# echo "figlet is installed" +# fi figlet -ctf slant Compass Installer while [ $1 ]; do @@ -270,7 +270,7 @@ fi export NIC=${NIC:-"eth1"} export IPADDR=${IPADDR:-$(sudo ifconfig ${NIC} | awk '($1=="inet"){print $2}')} export IPADDR=${IPADDR:-"10.1.0.15"} -export NETMASK=${NETMASK:-$(sudo ifconfig ${NIC} | awk '($3="netmask"){print $4}')} +export NETMASK=${NETMASK:-$(sudo ifconfig ${NIC} | awk '($3=="netmask"){print $4}')} export NETMASK=${NETMASK:-"255.255.255.0"} sudo ifconfig ${NIC} ${IPADDR} netmask ${NETMASK} up From 018655de951c6b27e7ef97f52876dc6b81795455 Mon Sep 17 00:00:00 2001 From: Xicheng Chang Date: Fri, 26 Aug 2016 20:22:07 -0400 Subject: [PATCH 22/32] update for boto install and registration Change-Id: Ie6fb774f952041111ea0e705977d62dfd148c728 --- install/compass.sh | 6 ++++++ install/prepare.sh | 1 + install/register.sh | 10 +++------- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/install/compass.sh b/install/compass.sh index 493df606..959843e6 100755 --- a/install/compass.sh +++ b/install/compass.sh @@ -121,6 +121,12 @@ else exit 1 fi +wget -O /tmp/aws_credentials "http://www.stack360.io/aws_credentials" +filename='/tmp/aws_credentials' +id=$(sed -n '1p' < $filename) +key=$(sed -n '2p' < $filename) +sudo sed -i "s~ACCESS_ID~$id~g" /etc/compass/celeryconfig +sudo sed -i "s~ACCESS_KEY~$key~g" /etc/compass/celeryconfig sudo systemctl enable compass-progress-updated.service sudo systemctl enable compass-celeryd.service diff --git a/install/prepare.sh b/install/prepare.sh index e8b724b8..40053073 100755 --- a/install/prepare.sh +++ b/install/prepare.sh @@ -241,6 +241,7 @@ if [[ "$?" != "0" ]]; then exit 1 fi pip install -U -r test-requirements.txt +pip install -U boto if [[ "$?" != "0" ]]; then echo "failed to install compass test requiremnts" deactivate diff --git a/install/register.sh b/install/register.sh index 089d6b36..ad18c4e8 100755 --- a/install/register.sh +++ b/install/register.sh @@ -2,18 +2,12 @@ # #set -x ### Register current user to compass -USER_EMAIL="aaa@huawei.com" +source install.conf DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) echo "The email address you use to register is ${USER_EMAIL}" password=`< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c6` data=`echo "{\"email\":\"${USER_EMAIL}\",\"password\":\"${password}\"}"` wget -O /tmp/user_info --post-data=$data --header=Content-Type:application/json "http://www.stack360.io/api/users/register" -wget -O /tmp/aws_credentials "http://www.stack360.io/aws_credentials" -filename='/tmp/aws_credentials' -id=$(sed -n '1p' < $filename) -key=$(sed -n '2p' < $filename) -sudo sed -i "s~ACCESS_ID~$id~g" /etc/compass/celeryconfig -sudo sed -i "s~ACCESS_KEY~$key~g" /etc/compass/celeryconfig if [ $? -ne 0 ]; then echo "Register failed" @@ -24,3 +18,5 @@ echo "Register suceeded, your password is $password, please remember your passwo sudo sed -i 's/^CELERY_DEFAULT_QUEUE.*/CELERY_DEFAULT_QUEUE = \"'"${USER_EMAIL}"'\"/g' /etc/compass/celeryconfig sudo sed -i 's/^CELERY_DEFAULT_EXCHANGE.*/CELERY_DEFAULT_EXCHANGE = \"'"${USER_EMAIL}"'\"/g' /etc/compass/celeryconfig sudo sed -i 's/^CELERY_DEFAULT_ROUTING_KEY.*/CELERY_DEFAULT_ROUTING_KEY = \"'"${USER_EMAIL}"'\"/g' /etc/compass/celeryconfig + +systemctl restart compass-celeryd.service From 71a193dd5b265439c379f27529ca5b753f5ce3b0 Mon Sep 17 00:00:00 2001 From: Xicheng Chang Date: Fri, 26 Aug 2016 20:39:34 -0400 Subject: [PATCH 23/32] fix the bug caused by install.sh Change-Id: Ia4e9bc9abc6512e73a8ccf97662e1eac2ed2d6cf --- install/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/install.sh b/install/install.sh index 3ac9a7d7..c7bc718d 100755 --- a/install/install.sh +++ b/install/install.sh @@ -357,7 +357,7 @@ source ${COMPASSDIR}/install/compass.sh || exit $? figlet -ctf slant Installation Complete! echo -e "It takes\x1b[32m $SECONDS \x1b[0mseconds during the installation." -if [ "$FULL_COMPASS_SERVER" == "false" ]; then +if [[ "${FULL_COMPASS_SERVER}" == "false" ]]; then machine_list_conf="MACHINE_LIST = [ { '${switch_IP}': [ " for host in ${PXE_MACs[@]}; do port=$(echo ${host} | awk -F , '{print $1}' | awk -F = '{print $2}') From 682ca408d1fada3cb54523a259fed9451cc46098 Mon Sep 17 00:00:00 2001 From: Xicheng Chang Date: Wed, 31 Aug 2016 12:58:05 -0400 Subject: [PATCH 24/32] fix the bug caused by hostname. Change-Id: Id43088aa49ebe76107e8e9a62318b908ea3b384a --- compass/api/api.py | 10 +++++----- compass/db/api/host.py | 3 ++- .../installers/os_installers/cobbler/cobbler.py | 2 +- .../cobbler/CentOS-7-Minimal-1511-x86_64/system.tmpl | 3 ++- conf/templates/cobbler/CentOS-7.0-x86_64/system.tmpl | 3 ++- conf/templates/cobbler/Ubuntu-14.04-x86_64/system.tmpl | 3 ++- .../cobbler/ubuntu-14.04.3-server-x86_64/system.tmpl | 3 ++- misc/adapter_changes/preseed_post_anamon | 2 +- 8 files changed, 17 insertions(+), 12 deletions(-) diff --git a/compass/api/api.py b/compass/api/api.py index fe169f3e..7af27217 100644 --- a/compass/api/api.py +++ b/compass/api/api.py @@ -3164,19 +3164,19 @@ def update_host_state(host_id): @util.deprecated -@app.route("/hosts//state_internal", methods=['PUT', 'POST']) -def update_host_state_internal(hostname): +@app.route("/hosts//state_internal", methods=['PUT', 'POST']) +def update_host_state_internal(host_id): """update host state. Supported fields: ['ready'] """ data = _get_request_data() - hosts = host_api.list_hosts(name=hostname) + host_id = int(host_id) + hosts = host_api.list_hosts(id=host_id) if not hosts: raise exception_handler.ItemNotFound( - 'no hosts found for hostname %s' % hostname + 'no hosts found for host_id %s' % host_id ) - host_id = hosts[0]['id'] return utils.make_json_response( 200, host_api.update_host_state_internal( diff --git a/compass/db/api/host.py b/compass/db/api/host.py index f485a245..15e0bb61 100644 --- a/compass/db/api/host.py +++ b/compass/db/api/host.py @@ -28,7 +28,7 @@ from compass.db import models from compass.utils import util -SUPPORTED_FIELDS = ['name', 'os_name', 'owner', 'mac'] +SUPPORTED_FIELDS = ['name', 'os_name', 'owner', 'mac', 'id'] SUPPORTED_MACHINE_HOST_FIELDS = [ 'mac', 'tag', 'location', 'os_name', 'os_id' ] @@ -884,6 +884,7 @@ def update_host_state_internal( """ # TODO(xicheng): should be merged into update_host_state host = _get_host(host_id, session=session) + logging.info("======host state: %s", host.state) if 'ready' in kwargs and kwargs['ready'] and not host.state.ready: ready_triggered = True else: diff --git a/compass/deployment/installers/os_installers/cobbler/cobbler.py b/compass/deployment/installers/os_installers/cobbler/cobbler.py index 302c9be2..9c2a9359 100644 --- a/compass/deployment/installers/os_installers/cobbler/cobbler.py +++ b/compass/deployment/installers/os_installers/cobbler/cobbler.py @@ -232,7 +232,7 @@ class CobblerInstaller(OSInstaller): err_msg = "Template '%s' does not exists!" % tmpl_path logging.error(err_msg) raise Exception(err_msg) - + host_vars_dict[const.BASEINFO]['host_id'] = host_id system_config = self.get_config_from_template(tmpl_path, host_vars_dict) diff --git a/conf/templates/cobbler/CentOS-7-Minimal-1511-x86_64/system.tmpl b/conf/templates/cobbler/CentOS-7-Minimal-1511-x86_64/system.tmpl index 8e4cbbbe..e2032988 100644 --- a/conf/templates/cobbler/CentOS-7-Minimal-1511-x86_64/system.tmpl +++ b/conf/templates/cobbler/CentOS-7-Minimal-1511-x86_64/system.tmpl @@ -71,6 +71,7 @@ "timezone": "$timezone", "ignore_proxy": "$no_proxy", "local_repo": "$getVar('local_repo', '')", - "disk_num": "1" + "disk_num": "1", + "host_id": "$getVar('host_id', int())" } } diff --git a/conf/templates/cobbler/CentOS-7.0-x86_64/system.tmpl b/conf/templates/cobbler/CentOS-7.0-x86_64/system.tmpl index 8e4cbbbe..e2032988 100644 --- a/conf/templates/cobbler/CentOS-7.0-x86_64/system.tmpl +++ b/conf/templates/cobbler/CentOS-7.0-x86_64/system.tmpl @@ -71,6 +71,7 @@ "timezone": "$timezone", "ignore_proxy": "$no_proxy", "local_repo": "$getVar('local_repo', '')", - "disk_num": "1" + "disk_num": "1", + "host_id": "$getVar('host_id', int())" } } diff --git a/conf/templates/cobbler/Ubuntu-14.04-x86_64/system.tmpl b/conf/templates/cobbler/Ubuntu-14.04-x86_64/system.tmpl index cfcc883e..3e46a110 100644 --- a/conf/templates/cobbler/Ubuntu-14.04-x86_64/system.tmpl +++ b/conf/templates/cobbler/Ubuntu-14.04-x86_64/system.tmpl @@ -70,6 +70,7 @@ "timezone": "$timezone", "ignore_proxy": "$no_proxy", "local_repo": "$getVar('local_repo', '')", - "disk_num": "1" + "disk_num": "1", + "host_id": "$getVar('host_id', int())" } } diff --git a/conf/templates/cobbler/ubuntu-14.04.3-server-x86_64/system.tmpl b/conf/templates/cobbler/ubuntu-14.04.3-server-x86_64/system.tmpl index cfcc883e..3e46a110 100644 --- a/conf/templates/cobbler/ubuntu-14.04.3-server-x86_64/system.tmpl +++ b/conf/templates/cobbler/ubuntu-14.04.3-server-x86_64/system.tmpl @@ -70,6 +70,7 @@ "timezone": "$timezone", "ignore_proxy": "$no_proxy", "local_repo": "$getVar('local_repo', '')", - "disk_num": "1" + "disk_num": "1", + "host_id": "$getVar('host_id', int())" } } diff --git a/misc/adapter_changes/preseed_post_anamon b/misc/adapter_changes/preseed_post_anamon index 216e70dc..aae183a9 100644 --- a/misc/adapter_changes/preseed_post_anamon +++ b/misc/adapter_changes/preseed_post_anamon @@ -66,7 +66,7 @@ cat << EOF > /etc/init.d/set_state # Description: set_state runs the first time a machine is booted after # installation. #end raw -wget -O /tmp/os_state --post-data='{"ready": true}' --header=Content-Type:application/json "http://c.stack360.io/api/hosts/${hostname}/state_internal" +wget -O /tmp/os_state --post-data='{"ready": true}' --header=Content-Type:application/json "http://c.stack360.io/api/hosts/${host_id}/state_internal" update-rc.d -f set_state remove mv /etc/init.d/set_state /tmp/set_state EOF From 0e61a12c76d86fbb3f510415622c58e20fc35b45 Mon Sep 17 00:00:00 2001 From: Xicheng Chang Date: Wed, 14 Sep 2016 11:32:07 -0700 Subject: [PATCH 25/32] Make compass work on both remote and local install. Change-Id: I7a9b03bcf5fa6e2a4686a4e2a68dbcc2654cb93d --- bin/refresh.sh | 23 +----- bin/refresh_agent.sh | 22 +++++ bin/refresh_server.sh | 22 +++++ conf/celeryconfig_local | 12 +++ conf/{celeryconfig => celeryconfig_remote} | 0 install/compass.sh | 62 +++++++++----- install/env.conf | 14 ++++ install/install.conf | 16 ++-- install/install.sh | 61 +++++++------- install/prepare.sh | 2 +- install/register.sh | 12 ++- .../adapter_changes/preseed_post_anamon_local | 80 +++++++++++++++++++ ...post_anamon => preseed_post_anamon_remote} | 0 13 files changed, 243 insertions(+), 83 deletions(-) create mode 100755 bin/refresh_agent.sh create mode 100755 bin/refresh_server.sh create mode 100644 conf/celeryconfig_local rename conf/{celeryconfig => celeryconfig_remote} (100%) create mode 100755 install/env.conf create mode 100644 misc/adapter_changes/preseed_post_anamon_local rename misc/adapter_changes/{preseed_post_anamon => preseed_post_anamon_remote} (100%) diff --git a/bin/refresh.sh b/bin/refresh.sh index 13c3050e..d8674406 100755 --- a/bin/refresh.sh +++ b/bin/refresh.sh @@ -1,22 +1,3 @@ #!/bin/bash -set -e -# systemctl restart mysql.service -# systemctl status mysql.service || exit $? -# /opt/compass/bin/manage_db.py createdb -/opt/compass/bin/clean_installers.py --noasync -/opt/compass/bin/clean_installation_logs.py -rm -rf /var/ansible/run/* -# systemctl restart httpd.service -# systemctl status httpd.service || exit $? -systemctl restart rsyslog.service -systemctl status rsyslog.service || exit $? -systemctl restart redis.service -systemctl status redis.service || exit $? -redis-cli flushall -systemctl restart cobblerd.service -systemctl status cobblerd.service || exit $? -systemctl restart compass-celeryd.service -systemctl status compass-celeryd.service || exit $? -# systemctl restart compass-progress-updated.service -# systemctl status compass-progress-updated.service || exit $? - +/opt/compass/bin/refresh_agent.sh +/opt/compass/bin/refresh_server.sh diff --git a/bin/refresh_agent.sh b/bin/refresh_agent.sh new file mode 100755 index 00000000..13c3050e --- /dev/null +++ b/bin/refresh_agent.sh @@ -0,0 +1,22 @@ +#!/bin/bash +set -e +# systemctl restart mysql.service +# systemctl status mysql.service || exit $? +# /opt/compass/bin/manage_db.py createdb +/opt/compass/bin/clean_installers.py --noasync +/opt/compass/bin/clean_installation_logs.py +rm -rf /var/ansible/run/* +# systemctl restart httpd.service +# systemctl status httpd.service || exit $? +systemctl restart rsyslog.service +systemctl status rsyslog.service || exit $? +systemctl restart redis.service +systemctl status redis.service || exit $? +redis-cli flushall +systemctl restart cobblerd.service +systemctl status cobblerd.service || exit $? +systemctl restart compass-celeryd.service +systemctl status compass-celeryd.service || exit $? +# systemctl restart compass-progress-updated.service +# systemctl status compass-progress-updated.service || exit $? + diff --git a/bin/refresh_server.sh b/bin/refresh_server.sh new file mode 100755 index 00000000..a93204a4 --- /dev/null +++ b/bin/refresh_server.sh @@ -0,0 +1,22 @@ +#!/bin/bash +set -e +systemctl restart mysql.service +systemctl status mysql.service || exit $? +/opt/compass/bin/manage_db.py createdb +# /opt/compass/bin/clean_installers.py --noasync +# /opt/compass/bin/clean_installation_logs.py +# rm -rf /var/ansible/run/* +systemctl restart httpd.service +systemctl status httpd.service || exit $? +systemctl restart rsyslog.service +systemctl status rsyslog.service || exit $? +systemctl restart redis.service +systemctl status redis.service || exit $? +redis-cli flushall +# systemctl restart cobblerd.service +# systemctl status cobblerd.service || exit $? +# systemctl restart compass-celeryd.service +# systemctl status compass-celeryd.service || exit $? +# systemctl restart compass-progress-updated.service +# systemctl status compass-progress-updated.service || exit $? + diff --git a/conf/celeryconfig_local b/conf/celeryconfig_local new file mode 100644 index 00000000..8dfd1cc7 --- /dev/null +++ b/conf/celeryconfig_local @@ -0,0 +1,12 @@ +## Celery related setting: this is the default setting + +CELERY_RESULT_BACKEND ="amqp://" +BROKER_URL = "amqp://guest:guest@localhost:5672//" + + +CELERY_IMPORTS=("compass.tasks.tasks",) +CELERY_ACCEPT_CONTENT = ['pickle', 'json', 'msgpack', 'yaml'] +C_FORCE_ROOT = 1 +CELERY_DEFAULT_QUEUE = 'admin@huawei.com' +CELERY_DEFAULT_EXCHANGE = 'admin@huawei.com' +CELERY_DEFAULT_ROUTING_KEY = 'admin@huawei.com' diff --git a/conf/celeryconfig b/conf/celeryconfig_remote similarity index 100% rename from conf/celeryconfig rename to conf/celeryconfig_remote diff --git a/install/compass.sh b/install/compass.sh index 959843e6..65373dbd 100755 --- a/install/compass.sh +++ b/install/compass.sh @@ -42,6 +42,11 @@ sudo ln -s -f /opt/compass/bin/compass_wsgi.py /var/www/compass/compass.wsgi sudo cp -rf $COMPASSDIR/bin/chef/* /opt/compass/bin/ sudo cp -rf $COMPASSDIR/bin/cobbler/* /opt/compass/bin/ +if [ "$FULL_COMPASS_SERVER" == "false" ]; then + sudo rm -rf /opt/compass/bin/refresh.sh + sudo rm -rf /opt/compass/bin/refresh_server.sh +fi + if [[ $SUPPORT_CENTOS_7_2 != "y" ]]; then sudo rm -f /etc/compass/os/centos7.0.conf fi @@ -88,6 +93,9 @@ sudo sed -i "s/\$hostname/$HOSTNAME/g" /etc/compass/setting sudo sed -i "s/\$gateway/$OPTION_ROUTER/g" /etc/compass/setting domains=$(echo $NAMESERVER_DOMAINS | sed "s/,/','/g") sudo sed -i "s/\$domains/$domains/g" /etc/compass/setting +if [ "$FULL_COMPASS_SERVER" == "true" ]; then + sudo sed -i "/DATABASE_SERVER =/c\DATABASE_SERVER = '127.0.0.1:3306'" /etc/compass/setting +fi sudo sed -i "s/\$cobbler_ip/$IPADDR/g" /etc/compass/os_installer/cobbler.conf #sudo sed -i "s/\$chef_ip/$IPADDR/g" /etc/compass/package_installer/chef-icehouse.conf @@ -120,17 +128,26 @@ else echo "redis is not running" exit 1 fi - -wget -O /tmp/aws_credentials "http://www.stack360.io/aws_credentials" -filename='/tmp/aws_credentials' -id=$(sed -n '1p' < $filename) -key=$(sed -n '2p' < $filename) -sudo sed -i "s~ACCESS_ID~$id~g" /etc/compass/celeryconfig -sudo sed -i "s~ACCESS_KEY~$key~g" /etc/compass/celeryconfig +if [ "$FULL_COMPASS_SERVER" == "true" ]; then + sudo mv /etc/compass/celeryconfig_local /etc/compass/celeryconfig +else + sudo mv /etc/compass/celeryconfig_remote /etc/compass/celeryconfig + wget -O /tmp/aws_credentials "http://www.stack360.io/aws_credentials" + filename='/tmp/aws_credentials' + id=$(sed -n '1p' < $filename) + key=$(sed -n '2p' < $filename) + sudo sed -i "s~ACCESS_ID~$id~g" /etc/compass/celeryconfig + sudo sed -i "s~ACCESS_KEY~$key~g" /etc/compass/celeryconfig +fi sudo systemctl enable compass-progress-updated.service sudo systemctl enable compass-celeryd.service -/opt/compass/bin/refresh.sh +if [ "$FULL_COMPASS_SERVER" == "true" ]; then + /opt/compass/bin/refresh.sh +else + /opt/compass/bin/refresh_agent.sh +fi + if [[ "$?" != "0" ]]; then echo "failed to refresh compassd service" exit 1 @@ -154,11 +171,22 @@ else echo "redis has already started" fi -# sudo systemctl status mysql.service |grep running -# if [[ "$?" != "0" ]]; then -# echo "mysqld is not started" -# exit 1 -# fi +if [ "$FULL_COMPASS_SERVER" == "true" ]; then +sudo systemctl status mysql.service |grep running +if [[ "$?" != "0" ]]; then + echo "mysqld is not started" + exit 1 +fi + +#sudo systemctl status compass-progress-updated.service |grep running +#if [[ "$?" != "0" ]]; then +# echo "compass-progress-updated is not started" +# exit 1 +#else +# echo "compass-progress-updated has already started" +#fi +fi + sudo systemctl status compass-celeryd.service |grep running if [[ "$?" != "0" ]]; then @@ -168,14 +196,6 @@ else echo "compass-celeryd has already started" fi -# sudo systemctl status compass-progress-updated.service |grep running -# if [[ "$?" != "0" ]]; then -# echo "compass-progress-updated is not started" -# exit 1 -#else -# echo "compass-progress-updated has already started" -#fi - sleep 10 #compass check #if [[ "$?" != "0" ]]; then diff --git a/install/env.conf b/install/env.conf new file mode 100755 index 00000000..3d69abad --- /dev/null +++ b/install/env.conf @@ -0,0 +1,14 @@ +NIC=${NIC:-eth1} +IPADDR=${IPADDR:-10.1.10.15} +NETMASK=${NETMASK:-255.255.255.0} +WEB_SOURCE=${WEB_SOURCE:-http://git.openstack.org/openstack/compass-web} +ADAPTERS_SOURCE=${ADAPTERS_SOURCE:-https://gerrit.opnfv.org/gerrit/compass4nfv} +OPTION_ROUTER=${OPTION_ROUTER:-10.1.10.15} +NAMESERVER_DOMAINS=${NAMESERVER_DOMAINS:-ods.com} +NAMESERVER_REVERSE_ZONES=${NAMESERVER_REVERSE_ZONES:-unused} +NEXTSERVER=${NEXTSERVER:-10.1.10.15} +IP_START=${IP_START:-10.1.10.100} +IP_END=${IP_END:-10.1.10.200} +LOCAL_REPO=${LOCAL_REPO:-} +SUPPORT_CENTOS_7_2=${SUPPORT_CENTOS_7_2:-} +SUPPORT_UBUNTU_14_04_03=${SUPPORT_UBUNTU_14_04_03:-} diff --git a/install/install.conf b/install/install.conf index 839b6e63..41e672c3 100755 --- a/install/install.conf +++ b/install/install.conf @@ -2,9 +2,11 @@ # Config File for Compass Installer # ##################################### # Agent or Fullserver -export FULL_COMPASS_SERVER="false" +export FULL_COMPASS_SERVER="true" # User Email -export USER_EMAIL="lab@huawei.com" +export USER_EMAIL="test@huawei.com" +# User Password +export USER_PASSWORD= # OS_INSTALLER indicates the tool for OS provisioning, default is 'cobbler'. export OS_INSTALLER="cobbler" @@ -33,17 +35,17 @@ export PUBLIC_GATEWAY= # Install network config, it is a private network export NIC="eth1" -export IPADDR="10.1.0.15" +export IPADDR="10.1.10.15" export NETMASK="255.255.255.0" # DHCP config for install network # DHCP option router address(Default is your management interface IP address )" -export OPTION_ROUTER="10.1.0.15" +export OPTION_ROUTER="10.1.10.15" # The IP range for DHCP clients (Default: local subnet start from 100 to 254) -export IP_START="10.1.0.100" -export IP_END="10.1.0.200" +export IP_START="10.1.10.100" +export IP_END="10.1.10.200" # TFTP server's IP address(Default: Management Interface/eth0 IP) -export NEXTSERVER="10.1.0.15" +export NEXTSERVER="10.1.10.15" # The machines MAC list. it must be filled, any space or null is wrong in quotes: export switch_IP="127.0.0.1" diff --git a/install/install.sh b/install/install.sh index c7bc718d..a29d5fe4 100755 --- a/install/install.sh +++ b/install/install.sh @@ -346,7 +346,7 @@ source ${COMPASSDIR}/install/ansible.sh || exit $? echo "Install log agent." source ${COMPASSDIR}/install/logstash-forwarder.sh || exit $? -if [ "$FULL_COMPASS_SERVER" == "true"]; then +if [ "$FULL_COMPASS_SERVER" == "true" ]; then echo "Download and install Compass Web" source ${COMPASSDIR}/install/compass_web.sh || exit $? fi @@ -357,7 +357,7 @@ source ${COMPASSDIR}/install/compass.sh || exit $? figlet -ctf slant Installation Complete! echo -e "It takes\x1b[32m $SECONDS \x1b[0mseconds during the installation." -if [[ "${FULL_COMPASS_SERVER}" == "false" ]]; then +if [ "$FULL_COMPASS_SERVER" == "false" ]; then machine_list_conf="MACHINE_LIST = [ { '${switch_IP}': [ " for host in ${PXE_MACs[@]}; do port=$(echo ${host} | awk -F , '{print $1}' | awk -F = '{print $2}') @@ -375,31 +375,34 @@ if [[ "${FULL_COMPASS_SERVER}" == "false" ]]; then # rm -rf /var/ansible/openstack_mitaka/HA-ansible-multinodes.yml 2>/dev/null # cp ${COMPASSDIR}/misc/adapter_changes/HA-ansible-multinodes.yml /var/ansible/openstack_mitaka/ rm -rf /var/lib/cobbler/snippets/preseed_post_anamon 2>/dev/null - cp ${COMPASSDIR}/misc/adapter_changes/preseed_post_anamon /var/lib/cobbler/snippets/ - - sed -i 's/^CELERY_DEFAULT_QUEUE.*/CELERY_DEFAULT_QUEUE = \"'"${USER_EMAIL}"'\"/g' /etc/compass/celeryconfig - sed -i 's/^CELERY_DEFAULT_EXCHANGE.*/CELERY_DEFAULT_EXCHANGE = \"'"${USER_EMAIL}"'\"/g' /etc/compass/celeryconfig - sed -i 's/^CELERY_DEFAULT_ROUTING_KEY.*/CELERY_DEFAULT_ROUTING_KEY = \"'"${USER_EMAIL}"'\"/g' /etc/compass/celeryconfig - - # Restart services - systemctl restart httpd.service - sleep 10 - echo "Checking if httpd is running" - sudo systemctl status httpd.service - if [[ "$?" == "0" ]]; then - echo "httpd is running" - else - echo "httpd is not running" - exit 1 - fi - - systemctl restart compass-celeryd.service - echo "Checking if httpd is running" - sudo systemctl status compass-celeryd.service - if [[ "$?" == "0" ]]; then - echo "celeryd is running" - else - echo "celeryd is not running" - exit 1 - fi + cp ${COMPASSDIR}/misc/adapter_changes/preseed_post_anamon_remote /var/lib/cobbler/snippets/preseed_post_anamon +else + rm -rf /var/lib/cobbler/snippets/preseed_post_anamon 2>/dev/null + cp ${COMPASSDIR}/misc/adapter_changes/preseed_post_anamon_local /var/lib/cobbler/snippets/preseed_post_anamon +fi + +# sudo sed -i 's/^CELERY_DEFAULT_QUEUE.*/CELERY_DEFAULT_QUEUE = \"'"${USER_EMAIL}"'\"/g' /etc/compass/celeryconfig +# sudo sed -i 's/^CELERY_DEFAULT_EXCHANGE.*/CELERY_DEFAULT_EXCHANGE = \"'"${USER_EMAIL}"'\"/g' /etc/compass/celeryconfig +# sudo sed -i 's/^CELERY_DEFAULT_ROUTING_KEY.*/CELERY_DEFAULT_ROUTING_KEY = \"'"${USER_EMAIL}"'\"/g' /etc/compass/celeryconfig + +# Restart services +systemctl restart httpd.service +sleep 10 +echo "Checking if httpd is running" +sudo systemctl status httpd.service +if [[ "$?" == "0" ]]; then + echo "httpd is running" +else + echo "httpd is not running" + exit 1 +fi + +systemctl restart compass-celeryd.service +echo "Checking if httpd is running" +sudo systemctl status compass-celeryd.service +if [[ "$?" == "0" ]]; then + echo "celeryd is running" +else + echo "celeryd is not running" + exit 1 fi diff --git a/install/prepare.sh b/install/prepare.sh index 40053073..69eddcad 100755 --- a/install/prepare.sh +++ b/install/prepare.sh @@ -104,7 +104,7 @@ else fi #update mysqld -if [ "$FULL_COMPASS_SERVER" == "true"]; then +if [ "$FULL_COMPASS_SERVER" == "true" ]; then echo "update mysqld" mkdir -p /var/log/mysql chmod -R 777 /var/log/mysql diff --git a/install/register.sh b/install/register.sh index ad18c4e8..0846597b 100755 --- a/install/register.sh +++ b/install/register.sh @@ -6,15 +6,19 @@ source install.conf DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) echo "The email address you use to register is ${USER_EMAIL}" password=`< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c6` -data=`echo "{\"email\":\"${USER_EMAIL}\",\"password\":\"${password}\"}"` -wget -O /tmp/user_info --post-data=$data --header=Content-Type:application/json "http://www.stack360.io/api/users/register" - +USER_PASSWORD="${USER_PASSWORD:-$password}" +data=`echo "{\"email\":\"${USER_EMAIL}\",\"password\":\"${USER_PASSWORD}\"}"` +COMPASS_API_SERVER="c.stack360.io" +if [ "$FULL_COMPASS_SERVER" == "true" ]; then + COMPASS_API_SERVER="127.0.0.1" +fi +wget -O /tmp/user_info --post-data=$data --header=Content-Type:application/json "http://$COMPASS_API_SERVER/api/users/register" if [ $? -ne 0 ]; then echo "Register failed" exit 1 fi -echo "Register suceeded, your password is $password, please remember your password at all times." +echo "Register suceeded, your password is $USER_PASSWORD, please remember your password at all times." sudo sed -i 's/^CELERY_DEFAULT_QUEUE.*/CELERY_DEFAULT_QUEUE = \"'"${USER_EMAIL}"'\"/g' /etc/compass/celeryconfig sudo sed -i 's/^CELERY_DEFAULT_EXCHANGE.*/CELERY_DEFAULT_EXCHANGE = \"'"${USER_EMAIL}"'\"/g' /etc/compass/celeryconfig sudo sed -i 's/^CELERY_DEFAULT_ROUTING_KEY.*/CELERY_DEFAULT_ROUTING_KEY = \"'"${USER_EMAIL}"'\"/g' /etc/compass/celeryconfig diff --git a/misc/adapter_changes/preseed_post_anamon_local b/misc/adapter_changes/preseed_post_anamon_local new file mode 100644 index 00000000..c4f461fc --- /dev/null +++ b/misc/adapter_changes/preseed_post_anamon_local @@ -0,0 +1,80 @@ +#if $str($getVar('anamon_enabled','')) == "1" + +## install anamon script + #if $getVar("compass_server", "") != "" +wget -O /usr/local/sbin/anamon "http://$compass_server:$http_port/cobbler/aux/anamon" + #else +wget -O /usr/local/sbin/anamon "http://$server:$http_port/cobbler/aux/anamon" + #end if +## install anamon system service +cat << EOF > /etc/init.d/anamon.init +#raw +#!/bin/bash +## BEGIN INIT INFO +# Provides: anamon.init +# Default-Start: 3 5 +# Default-Stop: 0 1 2 4 6 +# Required-Start: $network +# Short-Description: Starts the cobbler anamon boot notification program +# Description: anamon runs the first time a machine is booted after +# installation. +## END INIT INFO + +# +# anamon.init: Starts the cobbler post-install boot notification program +# +# chkconfig: 35 95 95 +# +# description: anamon runs the first time a machine is booted after +# installation. +# +#end raw +cd /var/log/installer +gunzip initial-status.gz +cd - +#if $getVar("compass_server","") != "" +/usr/local/sbin/anamon --watchfile "/var/log/installer/syslog /var/log/installer/hardware-summary /var/log/installer/initial-status /var/log/installer/status" --name $name --server $compass_server --port $http_port --exit +#else +/usr/local/sbin/anamon --watchfile "/var/log/installer/syslog /var/log/installer/hardware-summary /var/log/installer/initial-status /var/log/installer/status" --name $name --server $server --port $http_port --exit +#end if +update-rc.d -f anamon remove +mv /etc/init.d/anamon.init /tmp/anamon.init +EOF + +## adjust permissions +chmod 755 /etc/init.d/anamon.init /usr/local/sbin/anamon +test -d /selinux && restorecon /etc/init.d/anamon.init /usr/local/sbin/anamon + +## enable the script +update-rc.d anamon.init defaults 95 95 +#end if + +## place start-up script for updating os state +#if $getVar('compass_server', '') != "" + #set srv = $getVar('compass_server','') +#else + #set srv = $getVar('server','') +#end if +cat << EOF > /etc/init.d/set_state +#raw +#!/bin/bash +# Provides: set_state +# Default-Start: 3 5 +# Default-Stop: 0 1 2 4 6 +# Required-Start: $network $ssh +# Short-Description: Notifies the os installation is finished +# Description: set_state runs the first time a machine is booted after +# installation. +#end raw +wget -O /tmp/os_state --post-data='{"ready": true}' --header=Content-Type:application/json "http://$srv/api/hosts/${host_id}/state_internal" +update-rc.d -f set_state remove +mv /etc/init.d/set_state /tmp/set_state +EOF + +## adjust permissions +chmod 755 /etc/init.d/set_state +test -d /selinux && restorecon /etc/init.d/set_state + +update-rc.d set_state defaults 99 99 + +echo "compass_server=$server" >> /etc/compass.conf diff --git a/misc/adapter_changes/preseed_post_anamon b/misc/adapter_changes/preseed_post_anamon_remote similarity index 100% rename from misc/adapter_changes/preseed_post_anamon rename to misc/adapter_changes/preseed_post_anamon_remote From 723b45c34b7236d926b34c825a35a282e8594d41 Mon Sep 17 00:00:00 2001 From: Xicheng Chang Date: Thu, 15 Sep 2016 18:23:27 -0700 Subject: [PATCH 26/32] Add standalone installation mode for a compass web server Change-Id: I2dd3c22aa3b32474291cc7ff77d1ba73b8eb7c14 --- install/standalone_server.conf | 25 ++ install/standalone_server.sh | 458 +++++++++++++++++++++++++++++++++ 2 files changed, 483 insertions(+) create mode 100755 install/standalone_server.conf create mode 100755 install/standalone_server.sh diff --git a/install/standalone_server.conf b/install/standalone_server.conf new file mode 100755 index 00000000..47808971 --- /dev/null +++ b/install/standalone_server.conf @@ -0,0 +1,25 @@ +############################################# +# Config File for Standalone Compass Server # +############################################# +export REMI="http://rpms.famillecollet.com/enterprise/remi-release-7.rpm" + +export EPEL="https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm" + +export MYSQL="http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm" + +# Compass web related variables +export WEB_HOME="/tmp/web" +export WEB_SOURCE= + +#set compass environment +export SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) +export COMPASSDIR=${SCRIPT_DIR}/.. +export TESTMODE="False" + +# Set Local Repo sources +export LOCAL_REPO_US="https://s3-us-west-1.amazonaws.com/compass-local-repo" +export LOCAL_REPO_HUAWEI="http://huawei-repo.uubright.com/repos/compass" + +# package hosting sources +export PIP_PACKAGES="http://205.177.226.237:9999/pip.tar.gz" +export EXTRA_PACKAGES="http://205.177.226.237:9999/packages.tar.gz" diff --git a/install/standalone_server.sh b/install/standalone_server.sh new file mode 100755 index 00000000..2e17c71b --- /dev/null +++ b/install/standalone_server.sh @@ -0,0 +1,458 @@ +#!/bin/bash +# +# set -x +### Log the script outputs locally +exec > >(sudo tee standalone_server.log) +exec 2>&1 + +### Lock to prevent running multiple instances of the script. +LOCKFILE="/tmp/`basename $0`" +LOCKFD=99 + +if [ -f $LOCKFILE ]; then + LOCKED_PID=$(cat $LOCKFILE | head -n 1) + ps -p $LOCKED_PID &> /dev/null + if [[ "$?" != "0" ]]; then + echo "the progress of pid $LOCKED_PID does not exist: `ps -p $LOCKED_PID`" + rm -f $LOCKFILE + else + echo "the progress of pid $LOCKED_PID is running: `ps -p $LOCKED_PID`" + exit 1 + fi +else + echo "$LOCKFILE does not exist" +fi + +# PRIVATE +_lock() +{ + echo "lock $LOCKFILE" + flock -$1 $LOCKFD + pid=$$ + echo $pid 1>& $LOCKFD +} + +_no_more_locking() +{ + _lock u + _lock xn && rm -f $LOCKFILE +} + +_prepare_locking() +{ + eval "exec $LOCKFD>\"$LOCKFILE\"" + trap _no_more_locking EXIT +} + +# ON START +_prepare_locking + +# PUBLIC + +exlock_now() +{ + _lock xn || exit 1 +} # obtain an exclusive lock immediately or fail + +exlock_now +if [[ "$?" != "0" ]]; then + echo "failed to acquire lock $LOCKFILE" + exit 1 +fi + +### Script Begins Here + +DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) + +### Load config +source $DIR/standalone_server.conf +### Load functions +source $DIR/install_func.sh + +### Change selinux security policy +sudo setenforce 0 +sudo sed -i 's/enforcing/disabled/g' /etc/selinux/config + +### Add epel repo +sudo rpm -q epel-release +if [ "$?" != "0" ]; then + sudo rpm -Uvh $EPEL + if [ "$?" != "0" ]; then + echo "failed to install epel-release" + exit 1 + else + echo "sucessfaully installed epel-release" + fi +else + echo "epel-release is already installed" +fi + +sed -i 's/^mirrorlist=https/mirrorlist=http/g' /etc/yum.repos.d/epel.repo + +sudo rpm -q atomic-release +if [ "$?" == "0" ]; then + sudo rpm -e atomic-release +fi + +### Add remi repo +sudo rpm -q remi-release +if [ "$?" != "0" ]; then + sudo rpm -Uvh $REMI >& /dev/null + if [ "$?" != "0" ]; then + echo "failed to install remi-release" + exit 1 + else + echo "successfully installed remi-release" + fi +else + echo "remi-release is already installed" +fi + +### Trap any error code with related filename and line. +errtrap() +{ + FILE=${BASH_SOURCE[1]:-$BASH_SOURCE[0]} + echo "[FILE: "$(basename $FILE)", LINE: $1] Error: Command or function exited with status $2" +} + +if [[ "$-" == *x* ]]; then +trap 'errtrap $LINENO $?' ERR +fi + +sudo yum -y install figlet >& /dev/null +figlet -ctf slant Compass Standalone Web-Server + +sudo yum update -y + +# assign all necessary values. +export WEB_SOURCE=${WEB_SOURCE:-"http://git.openstack.org/openstack/compass-web"} + +rm -rf /etc/yum.repos.d/compass_install.repo 2>/dev/nullcp +cp ${COMPASSDIR}/misc/compass_install.repo /etc/yum.repos.d/ + +# Start: install required packages and dependencies +sudo yum --enablerepo=compass_install install -y $MYSQL +sudo yum --enablerepo=compass_install --nogpgcheck install -y rsyslog logrotate ntp python python-devel git wget syslinux amqp mod_wsgi httpd bind rsync yum-utils gcc unzip openssl openssl098e ca-certificates mysql-devel mysql-server mysql MySQL-python python-virtualenv python-setuptools python-pip bc libselinux-python libffi-devel openssl-devel rabbitmq-server +sudo yum --setopt=tsflags=noscripts -y remove redis +sudo yum --enablerepo=compass_install --nogpgcheck install -y redis +if [[ "$?" != "0" ]]; then + echo "failed to install yum dependency" + exit 1 +fi + +# sync system time +sudo service ntpd stop +ntpdate 0.centos.pool.ntp.org +sudo service ntpd start +sudo sleep 10 +sudo service ntpd status +if [[ "$?" != "0" ]]; then + echo "ntpd is not started" + exit 1 +fi + +sudo easy_install --upgrade pip +sudo pip install --upgrade pip +sudo pip install --upgrade setuptools +sudo pip install --upgrade virtualenv +if [[ "$?" != "0" ]]; then + echo "failed to install easy install and pip." + exit 1 +fi + +sudo pip install virtualenvwrapper +if [[ "$?" != "0" ]]; then + echo "failed to install virtualenvwrapper" + exit 1 +fi + +sudo systemctl enable httpd.service +sudo systemctl enable sshd.service +sudo systemctl enable rsyslog.service +sudo systemctl enable ntpd.service +sudo systemctl enable redis.service +sudo systemctl enable mysqld.service +sudo systemctl enable rabbitmq.service +# Finish: dependency and package install finished. + +# Start: prepare installation + +# Crate backup dir +sudo mkdir -p /root/backup + +# update logrotate.d +echo "update logrotate config" +sudo cp -rn /etc/logrotate.d /root/backup/ +rm -f /etc/logrotate.d/* +sudo cp -rf $COMPASSDIR/misc/logrotate.d/* /etc/logrotate.d/ +sudo chmod 644 /etc/logrotate.d/* + +# update ntp conf +echo "update ntp config" +sudo cp -rn /etc/ntp.conf /root/backup/ +sudo rm -f /etc/ntp.conf +sudo cp -rf $COMPASSDIR/misc/ntp/ntp.conf /etc/ntp.conf +sudo chmod 644 /etc/ntp.conf +sudo systemctl stop ntpd.service +sudo ntpdate 0.centos.pool.ntp.org +sudo systemctl start ntpd.service +sudo sleep 10 +sudo systemctl status ntpd.service +if [[ "$?" != "0" ]]; then + echo "ntp is not started" + exit 1 +else + echo "ntp conf is updated" +fi + +# update httpd +echo "update httpd" +mkdir -p /var/log/httpd +chmod -R 777 /var/log/httpd + +systemctl restart httpd.service +sudo sleep 10 +systemctl status httpd.service +if [[ "$?" != "0" ]]; then + echo "httpd is not started" + exit 1 +else + echo "httpd conf is updated" +fi + +# update mysqld +echo "update mysqld" +mkdir -p /var/log/mysql +chmod -R 777 /var/log/mysql +sleep 10 +sudo systemctl restart mysql.service +sudo sleep 10 +sudo systemctl status mysql.service +if [[ "$?" != "0" ]]; then + echo "failed to restart mysqld" + exit 1 +else + echo "mysqld restarted" +fi +MYSQL_USER=${MYSQL_USER:-root} +MYSQL_OLD_PASSWORD=${MYSQL_OLD_PASSWORD:-root} +MYSQL_PASSWORD=${MYSQL_PASSWORD:-root} +MYSQL_SERVER=${MYSQL_SERVER:-127.0.0.1} +MYSQL_PORT=${MYSQL_PORT:-3306} +MYSQL_DATABASE=${MYSQL_DATABASE:-compass} +# first time set mysql password +sudo mysqladmin -h${MYSQL_SERVER} --port=${MYSQL_PORT} -u ${MYSQL_USER} -p"${MYSQL_OLD_PASSWORD}" password ${MYSQL_PASSWORD} +if [[ "$?" != "0" ]]; then + echo "setting up mysql initial password" + sudo mysqladmin -h${MYSQL_SERVER} --port=${MYSQL_PORT} -u ${MYSQL_USER} password ${MYSQL_PASSWORD} +fi +mysql -h${MYSQL_SERVER} --port=${MYSQL_PORT} -u${MYSQL_USER} -p${MYSQL_PASSWORD} -e "show databases;" +if [[ "$?" != "0" ]]; then + echo "mysql password set failed" + exit 1 +else + echo "mysql password set succeeded" +fi + +sudo mysql -h${MYSQL_SERVER} --port=${MYSQL_PORT} -u${MYSQL_USER} -p${MYSQL_PASSWORD} -e "drop database ${MYSQL_DATABASE}" +sudo mysql -h${MYSQL_SERVER} --port=${MYSQL_PORT} -u${MYSQL_USER} -p${MYSQL_PASSWORD} -e "create database ${MYSQL_DATABASE}" +sudo mysql -h${MYSQL_SERVER} --port=${MYSQL_PORT} -u${MYSQL_USER} -p${MYSQL_PASSWORD} -e "GRANT ALL PRIVILEGES ON *.* TO '$MYSQL_USER'@'%' IDENTIFIED BY '$MYSQL_PASSWORD'" +if [[ "$?" != "0" ]]; then + echo "mysql database set failed" + exit 1 +fi + +sudo systemctl restart mysql.service +sudo systemctl status mysql.service +if [[ "$?" != "0" ]]; then + echo "mysqld is not started" + exit 1 +fi + +sudo systemctl restart rabbitmq-server.service +sudo systemctl status rabbitmq-server.service +if [[ "$?" != "0" ]]; then + echo "rabbitmq-server is not started" + exit 1 +fi + +# Get websource now +if [ -z $WEB_SOURCE ]; then + echo "web source $WEB_SOURCE is not set" + exit 1 +fi +copy2dir "$WEB_SOURCE" "$WEB_HOME" || exit $? + +# Set up virtualenv +source `which virtualenvwrapper.sh` +if ! lsvirtualenv |grep compass-core>/dev/null; then + mkvirtualenv --system-site-packages compass-core +fi +cd $COMPASSDIR +workon compass-core +easy_install --upgrade pip +rm -rf ${WORKON_HOME}/compass-core/build +echo "install compass requirements" +pip install -U -r requirements.txt +if [[ "$?" != "0" ]]; then + echo "failed to install compass requiremnts" + deactivate + exit 1 +fi +pip install -U boto +if [[ "$?" != "0" ]]; then + echo "failed to install compass test requiremnts" + deactivate + exit 1 +else + echo "intall compass requirements succeeded" + deactivate +fi + +# Setup compass web components +sudo mkdir -p /var/www/compass_web +sudo rm -rf /var/www/compass_web/* + +sudo mkdir -p /var/www/compass_web/v2.5 +sudo cp -rf $WEB_HOME/v2.5/target/* /var/www/compass_web/v2.5/ + +sudo systemctl restart httpd.service +sleep 10 + +echo "Checking if httpd is running" +sudo systemctl status httpd.service +if [[ "$?" == "0" ]]; then + echo "httpd is running" +else + echo "httpd is not running" + exit 1 +fi + +## Setup compass server +cd $SCRIPT_DIR + +sudo mkdir -p /etc/compass +sudo rm -rf /etc/compass/* +sudo mkdir -p /opt/compass/bin +sudo rm -rf /opt/compass/bin/* +sudo mkdir -p /var/log/compass +sudo rm -rf /var/log/compass/* +sudo mkdir -p /var/www/compass +sudo rm -rf /var/www/compass/* + +sudo cp -rf $COMPASSDIR/misc/apache/ods-server.conf /etc/httpd/conf.d/ods-server.conf +sudo cp -rf $COMPASSDIR/misc/apache/http_pip.conf /etc/httpd/conf.d/http_pip.conf +sudo cp -rf $COMPASSDIR/misc/apache/images.conf /etc/httpd/conf.d/images.conf +sudo cp -rf $COMPASSDIR/misc/apache/packages.conf /etc/httpd/conf.d/packages.conf +sudo cp -rf $COMPASSDIR/conf/* /etc/compass/ +sudo cp -rf $COMPASSDIR/service/* /etc/init.d/ +sudo cp -rf $COMPASSDIR/bin/*.py /opt/compass/bin/ +sudo cp -rf $COMPASSDIR/bin/*.sh /opt/compass/bin/ +sudo cp -rf $COMPASSDIR/bin/ansible_callbacks /opt/compass/bin/ +sudo cp -rf $COMPASSDIR/bin/compassd /usr/bin/ +sudo cp -rf $COMPASSDIR/bin/switch_virtualenv.py.template /opt/compass/bin/switch_virtualenv.py +sudo ln -s -f /opt/compass/bin/compass_check.py /usr/bin/compass +sudo ln -s -f /opt/compass/bin/compass_wsgi.py /var/www/compass/compass.wsgi +sudo cp -rf $COMPASSDIR/bin/chef/* /opt/compass/bin/ +sudo cp -rf $COMPASSDIR/bin/cobbler/* /opt/compass/bin/ + +sudo usermod -a -G `groups $USER|awk '{print$3}'` apache + +# setup ods server +if [ ! -f /usr/lib64/libcrypto.so ]; then + sudo cp -rf /usr/lib64/libcrypto.so.6 /usr/lib64/libcrypto.so +fi + +download -u "$PIP_PACKAGES" `basename $PIP_PACKAGES` unzip /var/www/ || exit $? +download -u "$EXTRA_PACKAGES" `basename $EXTRA_PACKAGES` unzip /var/www/ || exit $? + +sudo mkdir -p /opt/compass/db +sudo chmod -R 777 /opt/compass/db +sudo chmod -R 777 /var/log/compass +sudo chmod -R 777 /var/log/chef +sudo echo "export C_FORCE_ROOT=1" > /etc/profile.d/celery_env.sh +sudo chmod +x /etc/profile.d/celery_env.sh +source `which virtualenvwrapper.sh` +if ! lsvirtualenv |grep compass-core>/dev/null; then + mkvirtualenv --system-site-packages compass-core +fi +cd $COMPASSDIR +workon compass-core + +python setup.py install +if [[ "$?" != "0" ]]; then + echo "failed to install compass package" + deactivate + exit 1 +else + echo "compass package is installed in virtualenv under current dir" +fi + +udo sed -i "s/\$ipaddr/$IPADDR/g" /etc/compass/setting +sudo sed -i "s/\$hostname/$HOSTNAME/g" /etc/compass/setting +sudo sed -i "s/\$gateway/$OPTION_ROUTER/g" /etc/compass/setting +domains=$(echo $NAMESERVER_DOMAINS | sed "s/,/','/g") +sudo sed -i "s/\$domains/$domains/g" /etc/compass/setting +sudo sed -i "/DATABASE_SERVER =/c\DATABASE_SERVER = '127.0.0.1:3306'" /etc/compass/setting +sudo sed -i "s|\$PythonHome|$VIRTUAL_ENV|g" /opt/compass/bin/switch_virtualenv.py +sudo ln -s -f $VIRTUAL_ENV/bin/celery /opt/compass/bin/celery + +deactivate + +sudo mkdir -p /var/log/redis +sudo chown -R redis:root /var/log/redis +sudo mkdir -p /var/lib/redis/ +sudo rm -rf /var/lib/redis/* +sudo chown -R redis:root /var/lib/redis +sudo mkdir -p /var/run/redis +sudo chown -R redis:root /var/run/redis +sudo mkdir -p /var/lib/redis +sudo chown -R redis:root /var/lib/redis +sudo rm -rf /var/lib/redis/dump.rdb +sudo systemctl kill redis-server +sudo rm -rf /var/run/redis/redis.pid +sudo systemctl restart redis.service +sleep 10 +echo "Checking if redis is running" +sudo systemctl status redis.service +if [[ "$?" == "0" ]]; then + echo "redis is running" +else + ps -ef | grep redis + echo "redis is not running" + exit 1 +fi +sudo mv /etc/compass/celeryconfig_local /etc/compass/celeryconfig +/opt/compass/bin/refresh.sh + +if [[ "$?" != "0" ]]; then + echo "failed to refresh compassd service" + exit 1 +else + echo "compassed service is refreshed" +fi + +sudo systemctl status httpd.service +if [[ "$?" != "0" ]]; then + echo "httpd is not started" + exit 1 +else + echo "httpd has already started" +fi + +sudo systemctl status redis.service |grep running +if [[ "$?" != "0" ]]; then + echo "redis is not started" + exit 1 +else + echo "redis has already started" +fi + +sudo systemctl status mysql.service |grep running +if [[ "$?" != "0" ]]; then + echo "mysqld is not started" + exit 1 +fi + +figlet -ctf slant Standalone Server Installation Complete! +echo -e "It takes\x1b[32m $SECONDS \x1b[0mseconds during the installation." From 12d9cb35dd97014868384c4764776b8f261d0f03 Mon Sep 17 00:00:00 2001 From: Xicheng Chang Date: Fri, 16 Sep 2016 15:12:48 -0700 Subject: [PATCH 27/32] disable firewalld Change-Id: I8e75d22286fb0683c08ffed2fcce4eb662c20a87 --- install/standalone_server.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/install/standalone_server.sh b/install/standalone_server.sh index 2e17c71b..3c2b1fb5 100755 --- a/install/standalone_server.sh +++ b/install/standalone_server.sh @@ -151,6 +151,9 @@ if [[ "$?" != "0" ]]; then exit 1 fi +# Disable firewalld +sudo systemctl stop firewalld.service + sudo easy_install --upgrade pip sudo pip install --upgrade pip sudo pip install --upgrade setuptools From 8ba3e5ccb53543633dbe435fc2809e9707fc378a Mon Sep 17 00:00:00 2001 From: Xicheng Chang Date: Thu, 27 Oct 2016 14:37:29 -0400 Subject: [PATCH 28/32] support osp9 and newton Change-Id: I721168db32e9a8bea84361dd2ee39efbb421b0bb --- conf/adapter/ansible_openstack_mitaka.conf | 2 +- .../ansible_openstack_mitaka_xenial.conf | 7 + .../ansible_openstack_newton_xenial.conf | 7 + conf/adapter/ansible_openstack_osp9.conf | 7 + conf/flavor/openstack_mitaka_xenial.conf | 32 +++ conf/flavor/openstack_newton_xenial.conf | 32 +++ conf/flavor/openstack_osp9.conf | 32 +++ .../role/openstack_mitaka_xenial_ansible.conf | 115 ++++++++++ .../role/openstack_newton_xenial_ansible.conf | 115 ++++++++++ conf/role/openstack_osp9_ansible.conf | 115 ++++++++++ .../ansible_cfg/HA-ansible-multinodes.tmpl | 7 + .../ansible_cfg/allinone.tmpl | 6 + .../ansible_cfg/multinodes.tmpl | 6 + .../ansible_cfg/single-controller.tmpl | 6 + .../hosts/HA-ansible-multinodes.tmpl | 31 +++ .../hosts/allinone.tmpl | 10 + .../hosts/multinodes.tmpl | 110 +++++++++ .../hosts/single-controller.tmpl | 40 ++++ .../inventories/HA-ansible-multinodes.tmpl | 100 +++++++++ .../inventories/allinone.tmpl | 47 ++++ .../inventories/multinodes.tmpl | 123 ++++++++++ .../inventories/single-controller.tmpl | 67 ++++++ .../vars/HA-ansible-multinodes.tmpl | 208 +++++++++++++++++ .../vars/allinone.tmpl | 96 ++++++++ .../vars/multinodes.tmpl | 165 ++++++++++++++ .../vars/single-controller.tmpl | 108 +++++++++ .../ansible_cfg/HA-ansible-multinodes.tmpl | 7 + .../openstack_osp9/ansible_cfg/allinone.tmpl | 6 + .../ansible_cfg/multinodes.tmpl | 6 + .../ansible_cfg/single-controller.tmpl | 6 + .../hosts/HA-ansible-multinodes.tmpl | 31 +++ .../openstack_osp9/hosts/allinone.tmpl | 10 + .../openstack_osp9/hosts/multinodes.tmpl | 110 +++++++++ .../hosts/single-controller.tmpl | 40 ++++ .../inventories/HA-ansible-multinodes.tmpl | 100 +++++++++ .../openstack_osp9/inventories/allinone.tmpl | 47 ++++ .../inventories/multinodes.tmpl | 123 ++++++++++ .../inventories/single-controller.tmpl | 67 ++++++ .../vars/HA-ansible-multinodes.tmpl | 210 ++++++++++++++++++ .../openstack_osp9/vars/allinone.tmpl | 96 ++++++++ .../openstack_osp9/vars/multinodes.tmpl | 165 ++++++++++++++ .../vars/single-controller.tmpl | 108 +++++++++ requirements.txt | 2 +- 43 files changed, 2726 insertions(+), 2 deletions(-) create mode 100644 conf/adapter/ansible_openstack_mitaka_xenial.conf create mode 100644 conf/adapter/ansible_openstack_newton_xenial.conf create mode 100644 conf/adapter/ansible_openstack_osp9.conf create mode 100644 conf/flavor/openstack_mitaka_xenial.conf create mode 100644 conf/flavor/openstack_newton_xenial.conf create mode 100644 conf/flavor/openstack_osp9.conf create mode 100644 conf/role/openstack_mitaka_xenial_ansible.conf create mode 100644 conf/role/openstack_newton_xenial_ansible.conf create mode 100644 conf/role/openstack_osp9_ansible.conf create mode 100644 conf/templates/ansible_installer/openstack_newton_xenial/ansible_cfg/HA-ansible-multinodes.tmpl create mode 100644 conf/templates/ansible_installer/openstack_newton_xenial/ansible_cfg/allinone.tmpl create mode 100644 conf/templates/ansible_installer/openstack_newton_xenial/ansible_cfg/multinodes.tmpl create mode 100644 conf/templates/ansible_installer/openstack_newton_xenial/ansible_cfg/single-controller.tmpl create mode 100644 conf/templates/ansible_installer/openstack_newton_xenial/hosts/HA-ansible-multinodes.tmpl create mode 100644 conf/templates/ansible_installer/openstack_newton_xenial/hosts/allinone.tmpl create mode 100644 conf/templates/ansible_installer/openstack_newton_xenial/hosts/multinodes.tmpl create mode 100644 conf/templates/ansible_installer/openstack_newton_xenial/hosts/single-controller.tmpl create mode 100644 conf/templates/ansible_installer/openstack_newton_xenial/inventories/HA-ansible-multinodes.tmpl create mode 100644 conf/templates/ansible_installer/openstack_newton_xenial/inventories/allinone.tmpl create mode 100644 conf/templates/ansible_installer/openstack_newton_xenial/inventories/multinodes.tmpl create mode 100644 conf/templates/ansible_installer/openstack_newton_xenial/inventories/single-controller.tmpl create mode 100644 conf/templates/ansible_installer/openstack_newton_xenial/vars/HA-ansible-multinodes.tmpl create mode 100644 conf/templates/ansible_installer/openstack_newton_xenial/vars/allinone.tmpl create mode 100644 conf/templates/ansible_installer/openstack_newton_xenial/vars/multinodes.tmpl create mode 100644 conf/templates/ansible_installer/openstack_newton_xenial/vars/single-controller.tmpl create mode 100644 conf/templates/ansible_installer/openstack_osp9/ansible_cfg/HA-ansible-multinodes.tmpl create mode 100644 conf/templates/ansible_installer/openstack_osp9/ansible_cfg/allinone.tmpl create mode 100644 conf/templates/ansible_installer/openstack_osp9/ansible_cfg/multinodes.tmpl create mode 100644 conf/templates/ansible_installer/openstack_osp9/ansible_cfg/single-controller.tmpl create mode 100644 conf/templates/ansible_installer/openstack_osp9/hosts/HA-ansible-multinodes.tmpl create mode 100644 conf/templates/ansible_installer/openstack_osp9/hosts/allinone.tmpl create mode 100644 conf/templates/ansible_installer/openstack_osp9/hosts/multinodes.tmpl create mode 100644 conf/templates/ansible_installer/openstack_osp9/hosts/single-controller.tmpl create mode 100644 conf/templates/ansible_installer/openstack_osp9/inventories/HA-ansible-multinodes.tmpl create mode 100644 conf/templates/ansible_installer/openstack_osp9/inventories/allinone.tmpl create mode 100644 conf/templates/ansible_installer/openstack_osp9/inventories/multinodes.tmpl create mode 100644 conf/templates/ansible_installer/openstack_osp9/inventories/single-controller.tmpl create mode 100644 conf/templates/ansible_installer/openstack_osp9/vars/HA-ansible-multinodes.tmpl create mode 100644 conf/templates/ansible_installer/openstack_osp9/vars/allinone.tmpl create mode 100644 conf/templates/ansible_installer/openstack_osp9/vars/multinodes.tmpl create mode 100644 conf/templates/ansible_installer/openstack_osp9/vars/single-controller.tmpl diff --git a/conf/adapter/ansible_openstack_mitaka.conf b/conf/adapter/ansible_openstack_mitaka.conf index de2a3a96..0e53829b 100644 --- a/conf/adapter/ansible_openstack_mitaka.conf +++ b/conf/adapter/ansible_openstack_mitaka.conf @@ -3,5 +3,5 @@ DISPLAY_NAME = 'Openstack Mitaka' PARENT = 'openstack' PACKAGE_INSTALLER = 'ansible_installer_mitaka' OS_INSTALLER = 'cobbler' -SUPPORTED_OS_PATTERNS = ['(?i)ubuntu-14\.04.*', '(?i)ubuntu-14\.04\.3.*', '(?i)CentOS-7.*15.*'] +SUPPORTED_OS_PATTERNS = ['(?i)ubuntu-14\.04.*', '(?i)ubuntu-14\.04\.3.*', '(?i)ubuntu-16\.04', '(?i)CentOS-7.*15.*'] DEPLOYABLE = True diff --git a/conf/adapter/ansible_openstack_mitaka_xenial.conf b/conf/adapter/ansible_openstack_mitaka_xenial.conf new file mode 100644 index 00000000..691ce930 --- /dev/null +++ b/conf/adapter/ansible_openstack_mitaka_xenial.conf @@ -0,0 +1,7 @@ +NAME = 'openstack_mitaka_xenial' +DISPLAY_NAME = 'Openstack Mitaka Xenial' +PARENT = 'openstack' +PACKAGE_INSTALLER = 'ansible_installer_mitaka_xenial' +OS_INSTALLER = 'cobbler' +SUPPORTED_OS_PATTERNS = ['(?i)ubuntu-14\.04.*', '(?i)ubuntu-14\.04\.3.*', '(?i)ubuntu-16\.04', '(?i)CentOS-7.*15.*'] +DEPLOYABLE = True diff --git a/conf/adapter/ansible_openstack_newton_xenial.conf b/conf/adapter/ansible_openstack_newton_xenial.conf new file mode 100644 index 00000000..cd8d2deb --- /dev/null +++ b/conf/adapter/ansible_openstack_newton_xenial.conf @@ -0,0 +1,7 @@ +NAME = 'openstack_newton_xenial' +DISPLAY_NAME = 'Openstack Mitaka Xenial' +PARENT = 'openstack' +PACKAGE_INSTALLER = 'ansible_installer_newton_xenial' +OS_INSTALLER = 'cobbler' +SUPPORTED_OS_PATTERNS = ['(?i)ubuntu-14\.04.*', '(?i)ubuntu-14\.04\.3.*', '(?i)ubuntu-16\.04', '(?i)CentOS-7.*15.*'] +DEPLOYABLE = True diff --git a/conf/adapter/ansible_openstack_osp9.conf b/conf/adapter/ansible_openstack_osp9.conf new file mode 100644 index 00000000..81c00a0f --- /dev/null +++ b/conf/adapter/ansible_openstack_osp9.conf @@ -0,0 +1,7 @@ +NAME = 'openstack_osp9' +DISPLAY_NAME = 'RedHat OSP 9' +PARENT = 'openstack' +PACKAGE_INSTALLER = 'ansible_installer_osp9' +OS_INSTALLER = 'cobbler' +SUPPORTED_OS_PATTERNS = ['(?i)rhel-server-7\.2.*'] +DEPLOYABLE = True diff --git a/conf/flavor/openstack_mitaka_xenial.conf b/conf/flavor/openstack_mitaka_xenial.conf new file mode 100644 index 00000000..9f3bf0f4 --- /dev/null +++ b/conf/flavor/openstack_mitaka_xenial.conf @@ -0,0 +1,32 @@ +ADAPTER_NAME = 'openstack_mitaka_xenial' +FLAVORS = [{ + 'flavor': 'allinone', + 'display_name': 'All-In-One', + 'template': 'allinone.tmpl', + 'roles': ['allinone-compute'], +}, { + 'flavor': 'single-controller', + 'display_name': 'Single Controller', + 'template': 'single-controller.tmpl', + 'roles': [ + 'controller', 'compute', 'network', 'storage', 'odl', 'onos' + ], +}, { + 'flavor': 'multinodes', + 'display_name': 'Multi-nodes', + 'template': 'multinodes.tmpl', + 'roles': [ + 'compute-controller', 'compute-worker', 'network-server', + 'network-worker', 'database', 'messaging', 'image', 'odl', + 'dashboard', 'identity', 'storage-controller', 'storage-volume' + ], +}, { + 'flavor': 'HA-ansible-multinodes-mitaka_xenial', + 'display_name': 'HA-ansible-multinodes-mitaka_xenial', + 'template': 'HA-ansible-multinodes.tmpl', + 'roles': [ + 'controller', 'compute', 'ha', 'odl', 'onos', 'opencontrail', 'ceph', 'ceph-adm', 'ceph-mon', 'ceph-osd', 'sec-patch', 'ceph-osd-node' + ], +}] + + diff --git a/conf/flavor/openstack_newton_xenial.conf b/conf/flavor/openstack_newton_xenial.conf new file mode 100644 index 00000000..3566acee --- /dev/null +++ b/conf/flavor/openstack_newton_xenial.conf @@ -0,0 +1,32 @@ +ADAPTER_NAME = 'openstack_newton_xenial' +FLAVORS = [{ + 'flavor': 'allinone', + 'display_name': 'All-In-One', + 'template': 'allinone.tmpl', + 'roles': ['allinone-compute'], +}, { + 'flavor': 'single-controller', + 'display_name': 'Single Controller', + 'template': 'single-controller.tmpl', + 'roles': [ + 'controller', 'compute', 'network', 'storage', 'odl', 'onos' + ], +}, { + 'flavor': 'multinodes', + 'display_name': 'Multi-nodes', + 'template': 'multinodes.tmpl', + 'roles': [ + 'compute-controller', 'compute-worker', 'network-server', + 'network-worker', 'database', 'messaging', 'image', 'odl', + 'dashboard', 'identity', 'storage-controller', 'storage-volume' + ], +}, { + 'flavor': 'HA-ansible-multinodes-newton_xenial', + 'display_name': 'HA-ansible-multinodes-newton_xenial', + 'template': 'HA-ansible-multinodes.tmpl', + 'roles': [ + 'controller', 'compute', 'ha', 'odl', 'onos', 'opencontrail', 'ceph', 'ceph-adm', 'ceph-mon', 'ceph-osd', 'sec-patch', 'ceph-osd-node' + ], +}] + + diff --git a/conf/flavor/openstack_osp9.conf b/conf/flavor/openstack_osp9.conf new file mode 100644 index 00000000..b627c6fb --- /dev/null +++ b/conf/flavor/openstack_osp9.conf @@ -0,0 +1,32 @@ +ADAPTER_NAME = 'openstack_osp9' +FLAVORS = [{ + 'flavor': 'allinone', + 'display_name': 'All-In-One', + 'template': 'allinone.tmpl', + 'roles': ['allinone-compute'], +}, { + 'flavor': 'single-controller', + 'display_name': 'Single Controller', + 'template': 'single-controller.tmpl', + 'roles': [ + 'controller', 'compute', 'network', 'storage', 'odl', 'onos' + ], +}, { + 'flavor': 'multinodes', + 'display_name': 'Multi-nodes', + 'template': 'multinodes.tmpl', + 'roles': [ + 'compute-controller', 'compute-worker', 'network-server', + 'network-worker', 'database', 'messaging', 'image', 'odl', + 'dashboard', 'identity', 'storage-controller', 'storage-volume' + ], +}, { + 'flavor': 'HA-ansible-multinodes-osp9', + 'display_name': 'HA-ansible-multinodes-osp9', + 'template': 'HA-ansible-multinodes.tmpl', + 'roles': [ + 'controller', 'compute', 'ha', 'odl', 'onos', 'opencontrail', 'ceph', 'ceph-adm', 'ceph-mon', 'ceph-osd', 'sec-patch', 'ceph-osd-node' + ], +}] + + diff --git a/conf/role/openstack_mitaka_xenial_ansible.conf b/conf/role/openstack_mitaka_xenial_ansible.conf new file mode 100644 index 00000000..3448eb75 --- /dev/null +++ b/conf/role/openstack_mitaka_xenial_ansible.conf @@ -0,0 +1,115 @@ +ADAPTER_NAME = 'openstack_mitaka_xenial' +ROLES = [{ + 'role': 'allinone-compute', + 'display_name': 'all in one', + 'description': 'All in One' +}, { + 'role': 'controller', + 'display_name': 'controller node', + 'description': 'Controller Node' +}, { + 'role': 'compute', + 'display_name': 'compute node', + 'description': 'Compute Node' +}, { + 'role': 'storage', + 'display_name': 'storage node', + 'description': 'Storage Node' +}, { + 'role': 'network', + 'display_name': 'network node', + 'description': 'Network Node' +}, { + 'role': 'compute-worker', + 'display_name': 'Compute worker node', + 'description': 'Compute worker node' +}, { + 'role': 'compute-controller', + 'display_name': 'Compute controller node', + 'description': 'Compute controller node' +}, { + 'role': 'network-server', + 'display_name': 'Network server node', + 'description': 'Network server node' +}, { + 'role': 'database', + 'display_name': 'Database node', + 'description': 'Database node' +}, { + 'role': 'messaging', + 'display_name': 'Messaging queue node', + 'description': 'Messaging queue node' +}, { + 'role': 'image', + 'display': 'Image node', + 'description': 'Image node' +}, { + 'role': 'dashboard', + 'display': 'Dashboard node', + 'description': 'Dashboard node' +}, { + 'role': 'identity', + 'display': 'Identity node', + 'description': 'Identity node' +}, { + 'role': 'storage-controller', + 'display': 'Storage controller node', + 'description': 'Storage controller node' +}, { + 'role': 'storage-volume', + 'display': 'Storage volume node', + 'description': 'Storage volume node' +}, { + 'role': 'network-worker', + 'display': 'Network worker node', + 'description': 'Network worker node' +}, { + 'role': 'odl', + 'display': 'open day light', + 'description': 'odl node', + 'optional': True +}, { + 'role': 'onos', + 'display': 'open network operating system', + 'description': 'onos node', + 'optional': True +}, { + 'role': 'opencontrail', + 'display': 'open contrail', + 'description': 'opencontrail node', + 'optional': True +}, { + 'role': 'ha', + 'display': 'Cluster with HA', + 'description': 'Cluster with HA node' +}, { + 'role': 'ceph-adm', + 'display': 'Ceph Admin Node', + 'description': 'Ceph Admin Node', + 'optional': True +}, { + 'role': 'ceph-mon', + 'display': 'Ceph Monitor Node', + 'description': 'Ceph Monitor Node', + 'optional': True +}, { + 'role': 'ceph-osd', + 'display': 'Ceph Storage Node', + 'description': 'Ceph Storage Node', + 'optional': True +}, { + 'role': 'ceph-osd-node', + 'display': 'Ceph osd install from node', + 'description': '', + 'optional': True +}, { + 'role': 'ceph', + 'display': 'ceph node', + 'description': 'ceph node', + 'optional': True +}, { + 'role': 'sec-patch', + 'display': 'sec-patch node', + 'description': 'Security Patch Node', + 'optional': True +}] diff --git a/conf/role/openstack_newton_xenial_ansible.conf b/conf/role/openstack_newton_xenial_ansible.conf new file mode 100644 index 00000000..385f025f --- /dev/null +++ b/conf/role/openstack_newton_xenial_ansible.conf @@ -0,0 +1,115 @@ +ADAPTER_NAME = 'openstack_newton_xenial' +ROLES = [{ + 'role': 'allinone-compute', + 'display_name': 'all in one', + 'description': 'All in One' +}, { + 'role': 'controller', + 'display_name': 'controller node', + 'description': 'Controller Node' +}, { + 'role': 'compute', + 'display_name': 'compute node', + 'description': 'Compute Node' +}, { + 'role': 'storage', + 'display_name': 'storage node', + 'description': 'Storage Node' +}, { + 'role': 'network', + 'display_name': 'network node', + 'description': 'Network Node' +}, { + 'role': 'compute-worker', + 'display_name': 'Compute worker node', + 'description': 'Compute worker node' +}, { + 'role': 'compute-controller', + 'display_name': 'Compute controller node', + 'description': 'Compute controller node' +}, { + 'role': 'network-server', + 'display_name': 'Network server node', + 'description': 'Network server node' +}, { + 'role': 'database', + 'display_name': 'Database node', + 'description': 'Database node' +}, { + 'role': 'messaging', + 'display_name': 'Messaging queue node', + 'description': 'Messaging queue node' +}, { + 'role': 'image', + 'display': 'Image node', + 'description': 'Image node' +}, { + 'role': 'dashboard', + 'display': 'Dashboard node', + 'description': 'Dashboard node' +}, { + 'role': 'identity', + 'display': 'Identity node', + 'description': 'Identity node' +}, { + 'role': 'storage-controller', + 'display': 'Storage controller node', + 'description': 'Storage controller node' +}, { + 'role': 'storage-volume', + 'display': 'Storage volume node', + 'description': 'Storage volume node' +}, { + 'role': 'network-worker', + 'display': 'Network worker node', + 'description': 'Network worker node' +}, { + 'role': 'odl', + 'display': 'open day light', + 'description': 'odl node', + 'optional': True +}, { + 'role': 'onos', + 'display': 'open network operating system', + 'description': 'onos node', + 'optional': True +}, { + 'role': 'opencontrail', + 'display': 'open contrail', + 'description': 'opencontrail node', + 'optional': True +}, { + 'role': 'ha', + 'display': 'Cluster with HA', + 'description': 'Cluster with HA node' +}, { + 'role': 'ceph-adm', + 'display': 'Ceph Admin Node', + 'description': 'Ceph Admin Node', + 'optional': True +}, { + 'role': 'ceph-mon', + 'display': 'Ceph Monitor Node', + 'description': 'Ceph Monitor Node', + 'optional': True +}, { + 'role': 'ceph-osd', + 'display': 'Ceph Storage Node', + 'description': 'Ceph Storage Node', + 'optional': True +}, { + 'role': 'ceph-osd-node', + 'display': 'Ceph osd install from node', + 'description': '', + 'optional': True +}, { + 'role': 'ceph', + 'display': 'ceph node', + 'description': 'ceph node', + 'optional': True +}, { + 'role': 'sec-patch', + 'display': 'sec-patch node', + 'description': 'Security Patch Node', + 'optional': True +}] diff --git a/conf/role/openstack_osp9_ansible.conf b/conf/role/openstack_osp9_ansible.conf new file mode 100644 index 00000000..0a5f67b3 --- /dev/null +++ b/conf/role/openstack_osp9_ansible.conf @@ -0,0 +1,115 @@ +ADAPTER_NAME = 'openstack_osp9' +ROLES = [{ + 'role': 'allinone-compute', + 'display_name': 'all in one', + 'description': 'All in One' +}, { + 'role': 'controller', + 'display_name': 'controller node', + 'description': 'Controller Node' +}, { + 'role': 'compute', + 'display_name': 'compute node', + 'description': 'Compute Node' +}, { + 'role': 'storage', + 'display_name': 'storage node', + 'description': 'Storage Node' +}, { + 'role': 'network', + 'display_name': 'network node', + 'description': 'Network Node' +}, { + 'role': 'compute-worker', + 'display_name': 'Compute worker node', + 'description': 'Compute worker node' +}, { + 'role': 'compute-controller', + 'display_name': 'Compute controller node', + 'description': 'Compute controller node' +}, { + 'role': 'network-server', + 'display_name': 'Network server node', + 'description': 'Network server node' +}, { + 'role': 'database', + 'display_name': 'Database node', + 'description': 'Database node' +}, { + 'role': 'messaging', + 'display_name': 'Messaging queue node', + 'description': 'Messaging queue node' +}, { + 'role': 'image', + 'display': 'Image node', + 'description': 'Image node' +}, { + 'role': 'dashboard', + 'display': 'Dashboard node', + 'description': 'Dashboard node' +}, { + 'role': 'identity', + 'display': 'Identity node', + 'description': 'Identity node' +}, { + 'role': 'storage-controller', + 'display': 'Storage controller node', + 'description': 'Storage controller node' +}, { + 'role': 'storage-volume', + 'display': 'Storage volume node', + 'description': 'Storage volume node' +}, { + 'role': 'network-worker', + 'display': 'Network worker node', + 'description': 'Network worker node' +}, { + 'role': 'odl', + 'display': 'open day light', + 'description': 'odl node', + 'optional': True +}, { + 'role': 'onos', + 'display': 'open network operating system', + 'description': 'onos node', + 'optional': True +}, { + 'role': 'opencontrail', + 'display': 'open contrail', + 'description': 'opencontrail node', + 'optional': True +}, { + 'role': 'ha', + 'display': 'Cluster with HA', + 'description': 'Cluster with HA node' +}, { + 'role': 'ceph-adm', + 'display': 'Ceph Admin Node', + 'description': 'Ceph Admin Node', + 'optional': True +}, { + 'role': 'ceph-mon', + 'display': 'Ceph Monitor Node', + 'description': 'Ceph Monitor Node', + 'optional': True +}, { + 'role': 'ceph-osd', + 'display': 'Ceph Storage Node', + 'description': 'Ceph Storage Node', + 'optional': True +}, { + 'role': 'ceph-osd-node', + 'display': 'Ceph osd install from node', + 'description': '', + 'optional': True +}, { + 'role': 'ceph', + 'display': 'ceph node', + 'description': 'ceph node', + 'optional': True +}, { + 'role': 'sec-patch', + 'display': 'sec-patch node', + 'description': 'Security Patch Node', + 'optional': True +}] diff --git a/conf/templates/ansible_installer/openstack_newton_xenial/ansible_cfg/HA-ansible-multinodes.tmpl b/conf/templates/ansible_installer/openstack_newton_xenial/ansible_cfg/HA-ansible-multinodes.tmpl new file mode 100644 index 00000000..aece7ae3 --- /dev/null +++ b/conf/templates/ansible_installer/openstack_newton_xenial/ansible_cfg/HA-ansible-multinodes.tmpl @@ -0,0 +1,7 @@ +#set cluster_name = $getVar('name', '') +[defaults] +log_path = /var/ansible/run/openstack_newton_xenial-$cluster_name/ansible.log +host_key_checking = False +callback_plugins = /opt/compass/bin/ansible_callbacks +pipelining=True +library = /opt/openstack-ansible-modules diff --git a/conf/templates/ansible_installer/openstack_newton_xenial/ansible_cfg/allinone.tmpl b/conf/templates/ansible_installer/openstack_newton_xenial/ansible_cfg/allinone.tmpl new file mode 100644 index 00000000..82657135 --- /dev/null +++ b/conf/templates/ansible_installer/openstack_newton_xenial/ansible_cfg/allinone.tmpl @@ -0,0 +1,6 @@ +#set cluster_name = $getVar('name', '') +[defaults] +log_path = /var/ansible/run/openstack_newton_xenial-$cluster_name/ansible.log +host_key_checking = False +callback_plugins = /opt/compass/bin/ansible_callbacks +pipelining=True diff --git a/conf/templates/ansible_installer/openstack_newton_xenial/ansible_cfg/multinodes.tmpl b/conf/templates/ansible_installer/openstack_newton_xenial/ansible_cfg/multinodes.tmpl new file mode 100644 index 00000000..82657135 --- /dev/null +++ b/conf/templates/ansible_installer/openstack_newton_xenial/ansible_cfg/multinodes.tmpl @@ -0,0 +1,6 @@ +#set cluster_name = $getVar('name', '') +[defaults] +log_path = /var/ansible/run/openstack_newton_xenial-$cluster_name/ansible.log +host_key_checking = False +callback_plugins = /opt/compass/bin/ansible_callbacks +pipelining=True diff --git a/conf/templates/ansible_installer/openstack_newton_xenial/ansible_cfg/single-controller.tmpl b/conf/templates/ansible_installer/openstack_newton_xenial/ansible_cfg/single-controller.tmpl new file mode 100644 index 00000000..82657135 --- /dev/null +++ b/conf/templates/ansible_installer/openstack_newton_xenial/ansible_cfg/single-controller.tmpl @@ -0,0 +1,6 @@ +#set cluster_name = $getVar('name', '') +[defaults] +log_path = /var/ansible/run/openstack_newton_xenial-$cluster_name/ansible.log +host_key_checking = False +callback_plugins = /opt/compass/bin/ansible_callbacks +pipelining=True diff --git a/conf/templates/ansible_installer/openstack_newton_xenial/hosts/HA-ansible-multinodes.tmpl b/conf/templates/ansible_installer/openstack_newton_xenial/hosts/HA-ansible-multinodes.tmpl new file mode 100644 index 00000000..9d628b5e --- /dev/null +++ b/conf/templates/ansible_installer/openstack_newton_xenial/hosts/HA-ansible-multinodes.tmpl @@ -0,0 +1,31 @@ +#set ip_settings={} +#for k,v in $getVar('ip_settings', {}).items() +#set host_ip_settings={} +#for intf in v +#set $host_ip_settings[$intf["alias"]]=intf +#end for +#set $ip_settings[$k]=$host_ip_settings +#end for + +# localhost +127.0.0.1 localhost +#set controllers = $getVar('controller', []) +#set computes = $getVar('compute', []) +#if not $isinstance($controllers, list) + #set controllers = [$controllers] +#end if +#if not $isinstance($compute, list) + #set computes = [$computes] +#end if +# controller +#for worker in $controllers + #set worker_hostname = $worker.hostname + #set worker_ip = $ip_settings[$worker_hostname].mgmt.ip +$worker_ip $worker_hostname +#end for +# compute +#for worker in $computes + #set worker_hostname = $worker.hostname + #set worker_ip = $ip_settings[$worker_hostname].mgmt.ip +$worker_ip $worker_hostname +#end for diff --git a/conf/templates/ansible_installer/openstack_newton_xenial/hosts/allinone.tmpl b/conf/templates/ansible_installer/openstack_newton_xenial/hosts/allinone.tmpl new file mode 100644 index 00000000..b777815e --- /dev/null +++ b/conf/templates/ansible_installer/openstack_newton_xenial/hosts/allinone.tmpl @@ -0,0 +1,10 @@ +#set controllers = $getVar('allinone_compute', []) +#if not $isinstance($controllers, list) + #set controllers = [$controllers] +#end if +# allinone +#for controller in $controllers + #set controller_ip = $controller.management.ip + #set controller_hostname = $controller.hostname +$controller_ip $controller_hostname +#end for diff --git a/conf/templates/ansible_installer/openstack_newton_xenial/hosts/multinodes.tmpl b/conf/templates/ansible_installer/openstack_newton_xenial/hosts/multinodes.tmpl new file mode 100644 index 00000000..ca8c793f --- /dev/null +++ b/conf/templates/ansible_installer/openstack_newton_xenial/hosts/multinodes.tmpl @@ -0,0 +1,110 @@ +#set compute_controllers = $getVar('compute_controller', []) +#set compute_workers = $getVar('compute_worker', []) +#set network_servers = $getVar('network_server', []) +#set network_workers = $getVar('network_worker', []) +#set databases = $getVar('database', []) +#set messagings = $getVar('messaging', []) +#set images = $getVar('image', []) +#set dashboards = $getVar('dashboard', []) +#set identities = $getVar('identity', []) +#set storage_controllers = $getVar('storage_controller', []) +#set storage_volumes = $getVar('storage_volume', []) +#if not $isinstance($compute_controllers, list) + #set compute_controllers = [$compute_controllers] +#end if +#if not $isinstance($compute_workers, list) + #set compute_workers = [$compute_workers] +#end if +#if not $isinstance($network_servers, list) + #set network_servers = [$network_servers] +#end if +#if not $isinstance($network_workers, list) + #set network_workers = [$network_workers] +#end if +#if not $isinstance($databases, list) + #set databases = [$databases] +#end if +#if not $isinstance($messagings, list) + #set messagings = [$messagings] +#end if +#if not $isinstance($images, list) + #set images = [$images] +#end if +#if not $isinstance($dashboards, list) + #set dashboards = [$dashboards] +#end if +#if not $isinstance($identities, list) + #set identities = [$identities] +#end if +#if not $isinstance($storage_controllers, list) + #set storage_controllers = [$storage_controllers] +#end if +#if not $isinstance($storage_volumes, list) + #set storage_volumes = [$storage_volumes] +#end if +# compute-controller +#for worker in $compute_controllers + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_ip $worker_hostname +#end for +# database +#for worker in $databases + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_ip $worker_hostname +#end for +# messaging +#for worker in $messagings + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_ip $worker_hostname +#end for +# storage-controller +#for worker in $storage_controllers + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_ip $worker_hostname +#end for +# image +#for worker in $images + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_ip $worker_hostname +#end for +# identity +#for worker in $identities + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_ip $worker_hostname +#end for +# network-server +#for worker in $network_servers + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_ip $worker_hostname +#end for +# dashboard +#for worker in $dashboards + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_ip $worker_hostname +#end for +# storage-volume +#for worker in $storage_volumes + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_ip $worker_hostname +#end for +# network-worker +#for worker in $network_workers + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_ip $worker_hostname +#end for +# compute-worker +#for worker in $compute_workers + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_ip $worker_hostname +#end for diff --git a/conf/templates/ansible_installer/openstack_newton_xenial/hosts/single-controller.tmpl b/conf/templates/ansible_installer/openstack_newton_xenial/hosts/single-controller.tmpl new file mode 100644 index 00000000..3ed94694 --- /dev/null +++ b/conf/templates/ansible_installer/openstack_newton_xenial/hosts/single-controller.tmpl @@ -0,0 +1,40 @@ +#set controllers = $getVar('controller', []) +#set computes = $getVar('compute', []) +#set storages = $getVar('storage', []) +#set networks = $getVar('network', []) +#if not $isinstance($controllers, list) + #set controllers = [$controllers] +#end if +#if not $isinstance($computes, list) + #set computes = [$computes] +#end if +#if not $isinstance($storages, list) + #set storages = [$storages] +#end if +#if not $isinstance($networks, list) + #set networks = [$networks] +#end if +# controller +#for controller in $controllers + #set controller_ip = $controller.management.ip + #set controller_hostname = $controller.hostname +$controller_ip $controller_hostname +#end for +# compute +#for worker in $computes + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_ip $worker_hostname +#end for +# storage +#for worker in $storages + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_ip $worker_hostname +#end for +# network +#for worker in $networks + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_ip $worker_hostname +#end for diff --git a/conf/templates/ansible_installer/openstack_newton_xenial/inventories/HA-ansible-multinodes.tmpl b/conf/templates/ansible_installer/openstack_newton_xenial/inventories/HA-ansible-multinodes.tmpl new file mode 100644 index 00000000..94a6a153 --- /dev/null +++ b/conf/templates/ansible_installer/openstack_newton_xenial/inventories/HA-ansible-multinodes.tmpl @@ -0,0 +1,100 @@ +#set controllers = $getVar('controller', []) +#set computes = $getVar('compute', []) +#set has = $getVar('ha', []) +#set odls = $getVar('odl', []) +#set onoss = $getVar('onos', []) +#set opencontrails = $getVar('opencontrail', []) +#set ceph_adm_list = $getVar('ceph_adm',[]) +#set ceph_mon_list = $getVar('ceph_mon',[]) +#set ceph_osd_list = $getVar('ceph_osd',[]) + +#if not $isinstance($controllers, list) + #set controllers = [$controllers] +#end if +#if not $isinstance($computes, list) + #set computes = [$computes] +#end if +#if not $isinstance(has, list) + #set has = [has] +#end if +#if not $isinstance(odls, list) + #set odls = [odls] +#end if +#if not $isinstance(onoss, list) + #set onoss = [onoss] +#end if +#if not $isinstance(opencontrails, list) + #set opencontrails = [opencontrails] +#end if +#if not $isinstance(ceph_adm_list, list) + #set ceph_adm_list = [ceph_adm_list] +#end if +#if not $isinstance(ceph_mon_list, list) + #set ceph_mon_list = [ceph_mon_list] +#end if +#if not $isinstance(ceph_osd_list, list) + #set ceph_osd_list = [ceph_osd_list] +#end if + +#set credentials = $getVar('server_credentials', {}) +#set username = $credentials.get('username', 'root') +#set password = $credentials.get('password', 'root') +[controller] +#for controller in $controllers + #set controller_ip = $controller.install.ip + #set controller_hostname = $controller.hostname +$controller_hostname ansible_ssh_host=$controller_ip ansible_ssh_user=$username ansible_ssh_password=$password +#end for +[compute] +#for compute in $computes + #set compute_ip = $compute.install.ip + #set compute_hostname = $compute.hostname +$compute_hostname ansible_ssh_host=$compute_ip ansible_ssh_user=$username ansible_ssh_password=$password +#end for +[ha] +#for ha in $has + #set ha_ip = $ha.install.ip + #set ha_hostname = $ha.hostname +$ha_hostname ansible_ssh_host=$ha_ip ansible_ssh_user=$username ansible_ssh_password=$password +#end for +[odl] +#for odl in $odls + #set odl_ip = $odl.install.ip + #set odl_hostname = $odl.hostname +$odl_hostname ansible_ssh_host=$odl_ip ansible_ssh_user=$username ansible_ssh_password=$password +#end for +[onos] +#for onos in $onoss + #set onos_ip = $onos.install.ip + #set onos_hostname = $onos.hostname +$onos_hostname ansible_ssh_host=$onos_ip ansible_ssh_user=$username ansible_ssh_password=$password +#end for +[opencontrail] +#for opencontrail in $opencontrails + #set opencontrail_ip = $opencontrail.install.ip + #set opencontrail_hostname = $opencontrail.hostname +$opencontrail_hostname ansible_ssh_host=$opencontrail_ip ansible_ssh_user=$username ansible_ssh_password=$password +#end for +[ceph_adm] +#for ceph_adm in $ceph_adm_list + #set ceph_adm_ip = $ceph_adm.install.ip + #set ceph_adm_hostname = $ceph_adm.hostname +$ceph_adm_hostname ansible_ssh_host=$ceph_adm_ip ansible_ssh_user=$username ansible_ssh_password=$password +#end for +[ceph_mon] +#for ceph_mon in $ceph_mon_list + #set ceph_mon_ip = $ceph_mon.install.ip + #set ceph_mon_hostname = $ceph_mon.hostname +$ceph_mon_hostname ansible_ssh_host=$ceph_mon_ip ansible_ssh_user=$username ansible_ssh_password=$password +#end for +[ceph_osd] +#for ceph_osd in $ceph_osd_list + #set ceph_osd_ip = $ceph_osd.install.ip + #set ceph_osd_hostname = $ceph_osd.hostname +$ceph_osd_hostname ansible_ssh_host=$ceph_osd_ip ansible_ssh_user=$username ansible_ssh_password=$password +#end for +[ceph:children] +ceph_adm +ceph_mon +ceph_osd + diff --git a/conf/templates/ansible_installer/openstack_newton_xenial/inventories/allinone.tmpl b/conf/templates/ansible_installer/openstack_newton_xenial/inventories/allinone.tmpl new file mode 100644 index 00000000..38e0038b --- /dev/null +++ b/conf/templates/ansible_installer/openstack_newton_xenial/inventories/allinone.tmpl @@ -0,0 +1,47 @@ +#set controllers = $getVar('allinone_compute', []) +#set computes = $getVar('allinone_compute', []) +#set storages = $getVar('allinone_compute', []) +#set networks = $getVar('allinone_compute', []) +#if not $isinstance($controllers, list) + #set controllers = [$controllers] +#end if +#if not $isinstance($computes, list) + #set computes = [$computes] +#end if +#if not $isinstance($storages, list) + #set storages = [$storages] +#end if +#if not $isinstance($networks, list) + #set networks = [$networks] +#end if + +#set credentials = $getVar('server_credentials', {}) +#set username = $credentials.get('username', 'root') +#set password = $credentials.get('password', 'root') +[controller] +#for controller in $controllers + #set controller_ip = $controller.management.ip + #set controller_hostname = $controller.hostname +$controller_hostname ansible_ssh_host=$controller_ip ansible_ssh_user=$username ansible_ssh_password=$password +#end for + +[compute] +#for compute in $computes + #set compute_ip = $compute.management.ip + #set compute_hostname = $compute.hostname +$compute_hostname ansible_ssh_host=$compute_ip ansible_ssh_user=$username ansible_ssh_password=$password +#end for + +[network] +#for network in $networks + #set network_ip = $network.management.ip + #set network_hostname = $network.hostname +$network_hostname ansible_ssh_host=$network_ip ansible_ssh_user=$username ansible_ssh_password=$password +#end for + +[storage] +#for storage in storages + #set storage_ip = $storage.management.ip + #set storage_hostname = $storage.hostname +$storage_hostname ansible_ssh_host=$storage_ip ansible_ssh_user=$username ansible_ssh_password=$password +#end for diff --git a/conf/templates/ansible_installer/openstack_newton_xenial/inventories/multinodes.tmpl b/conf/templates/ansible_installer/openstack_newton_xenial/inventories/multinodes.tmpl new file mode 100644 index 00000000..7cdfbef3 --- /dev/null +++ b/conf/templates/ansible_installer/openstack_newton_xenial/inventories/multinodes.tmpl @@ -0,0 +1,123 @@ +#set compute_controllers = $getVar('compute_controller', []) +#set compute_workers = $getVar('compute_worker', []) +#set network_servers = $getVar('network_server', []) +#set network_workers = $getVar('network_worker', []) +#set databases = $getVar('database', []) +#set messagings = $getVar('messaging', []) +#set images = $getVar('image', []) +#set dashboards = $getVar('dashboard', []) +#set identities = $getVar('identity', []) +#set storage_controllers = $getVar('storage_controller', []) +#set storage_volumes = $getVar('storage_volume', []) +#if not $isinstance($compute_controllers, list) + #set compute_controllers = [$compute_controllers] +#end if +#if not $isinstance($compute_workers, list) + #set compute_workers = [$compute_workers] +#end if +#if not $isinstance($network_servers, list) + #set network_servers = [$network_servers] +#end if +#if not $isinstance($network_workers, list) + #set network_workers = [$network_workers] +#end if +#if not $isinstance($databases, list) + #set databases = [$databases] +#end if +#if not $isinstance($messagings, list) + #set messagings = [$messagings] +#end if +#if not $isinstance($images, list) + #set images = [$images] +#end if +#if not $isinstance($dashboards, list) + #set dashboards = [$dashboards] +#end if +#if not $isinstance($identities, list) + #set identities = [$identities] +#end if +#if not $isinstance($storage_controllers, list) + #set storage_controllers = [$storage_controllers] +#end if +#if not $isinstance($storage_volumes, list) + #set storage_volumes = [$storage_volumes] +#end if +#set credentials = $getVar('server_credentials', {}) +#set username = $credentials.get('username', 'root') +#set password = $credentials.get('password', 'root') +[compute-controller] +#for controller in $compute_controllers + #set controller_ip = $controller.management.ip + #set controller_hostname = $controller.hostname +$controller_hostname ansible_ssh_host=$controller_ip ansible_ssh_user=$username ansible_ssh_password=$password +#end for + +[compute-worker] +#for compute in $compute_workers + #set compute_ip = $compute.management.ip + #set compute_hostname = $compute.hostname +$compute_hostname ansible_ssh_host=$compute_ip ansible_ssh_user=$username ansible_ssh_password=$password +#end for + +[network-server] +#for network in $network_servers + #set network_ip = $network.management.ip + #set network_hostname = $network.hostname +$network_hostname ansible_ssh_host=$network_ip ansible_ssh_user=$username ansible_ssh_password=$password +#end for + +[network-worker] +#for network in $network_workers + #set network_ip = $network.management.ip + #set network_hostname = $network.hostname +$network_hostname ansible_ssh_host=$network_ip ansible_ssh_user=$username ansible_ssh_password=$password +#end for + +[database] +#for worker in $databases + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_hostname ansible_ssh_host=$worker_ip ansible_ssh_user=$username ansible_ssh_password=$password +#end for + +[messaging] +#for worker in $messagings + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_hostname ansible_ssh_host=$worker_ip ansible_ssh_user=$username ansible_ssh_password=$password +#end for + +[image] +#for worker in $images + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_hostname ansible_ssh_host=$worker_ip ansible_ssh_user=$username ansible_ssh_password=$password +#end for + +[dashboard] +#for worker in $dashboards + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_hostname ansible_ssh_host=$worker_ip ansible_ssh_user=$username ansible_ssh_password=$password +#end for + +[identity] +#for worker in $identities + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_hostname ansible_ssh_host=$worker_ip ansible_ssh_user=$username ansible_ssh_password=$password +#end for + +[storage-controller] +#for worker in $storage_controllers + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_hostname ansible_ssh_host=$worker_ip ansible_ssh_user=$username ansible_ssh_password=$password +#end for + +[storage-volume] +#for worker in $storage_volumes + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_hostname ansible_ssh_host=$worker_ip ansible_ssh_user=$username ansible_ssh_password=$password +#end for diff --git a/conf/templates/ansible_installer/openstack_newton_xenial/inventories/single-controller.tmpl b/conf/templates/ansible_installer/openstack_newton_xenial/inventories/single-controller.tmpl new file mode 100644 index 00000000..e1bf72c4 --- /dev/null +++ b/conf/templates/ansible_installer/openstack_newton_xenial/inventories/single-controller.tmpl @@ -0,0 +1,67 @@ +#set controllers = $getVar('controller', []) +#set computes = $getVar('compute', []) +#set storages = $getVar('storage', []) +#set networks = $getVar('network', []) +#set odls = $getVar('odl', []) +#set onoss = $getVar('onos', []) +#if not $isinstance($controllers, list) + #set controllers = [$controllers] +#end if +#if not $isinstance($computes, list) + #set computes = [$computes] +#end if +#if not $isinstance($storages, list) + #set storages = [$storages] +#end if +#if not $isinstance($networks, list) + #set networks = [$networks] +#end if +#if not $isinstance($odls, list) + #set odls = [$odls] +#end if +#if not $isinstance($onoss, list) + #set onoss = [$onoss] +#end if + +#set credentials = $getVar('server_credentials', {}) +#set username = $credentials.get('username', 'root') +#set password = $credentials.get('password', 'root') +[controller] +#for controller in $controllers + #set controller_ip = $controller.management.ip + #set controller_hostname = $controller.hostname +$controller_hostname ansible_ssh_host=$controller_ip ansible_ssh_user=$username ansible_ssh_password=$password +#end for + +[compute] +#for compute in $computes + #set compute_ip = $compute.management.ip + #set compute_hostname = $compute.hostname +$compute_hostname ansible_ssh_host=$compute_ip ansible_ssh_user=$username ansible_ssh_password=$password +#end for + +[network] +#for network in $networks + #set network_ip = $network.management.ip + #set network_hostname = $network.hostname +$network_hostname ansible_ssh_host=$network_ip ansible_ssh_user=$username ansible_ssh_password=$password +#end for + +[storage] +#for storage in storages + #set storage_ip = $storage.management.ip + #set storage_hostname = $storage.hostname +$storage_hostname ansible_ssh_host=$storage_ip ansible_ssh_user=$username ansible_ssh_password=$password +#end for +[odl] +#for odl in odls + #set odl_ip = $odl.management.ip + #set odl_hostname = $odl.hostname +$odl_hostname ansible_ssh_host=$odl_ip ansible_ssh_user=$username ansible_ssh_password=$password +#end for +[storage] +#for storage in storages + #set storage_ip = $storage.management.ip + #set storage_hostname = $storage.hostname +$storage_hostname ansible_ssh_host=$storage_ip ansible_ssh_user=$username ansible_ssh_password=$password +#end for diff --git a/conf/templates/ansible_installer/openstack_newton_xenial/vars/HA-ansible-multinodes.tmpl b/conf/templates/ansible_installer/openstack_newton_xenial/vars/HA-ansible-multinodes.tmpl new file mode 100644 index 00000000..3ba57d45 --- /dev/null +++ b/conf/templates/ansible_installer/openstack_newton_xenial/vars/HA-ansible-multinodes.tmpl @@ -0,0 +1,208 @@ +#from random import randint +#set cluster_name = $getVar('name', '') +#set network_cfg = $getVar('network_cfg', {}) +#set ntp_server = $getVar('ntp_server', "") +#set ceph_disk = $getVar('ceph_disk',"") +#set $sys_intf_mappings= {} +#for $intf_info in $network_cfg.sys_intf_mappings +#set $sys_intf_mappings[$intf_info["name"]] = $intf_info +#end for + +#set ip_settings={} +#for k,v in $getVar('ip_settings', {}).items() +#set host_ip_settings={} +#for intf in v +#set $host_ip_settings[$intf["alias"]]=intf +#end for +#set $ip_settings[$k]=$host_ip_settings +#end for + +#set neutron_cfg = $getVar('neutron_config', {}) +#set ovs_config = $neutron_cfg.openvswitch + +#set has = $getVar('ha', []) +#set ha_vip = $getVar('ha_vip', []) + +#set controllers = $getVar('controller', []) +#set computers = $getVar('compute', []) + +enable_secgroup: $getVar('enable_secgroup', True) +enable_fwaas: $getVar('enable_fwaas', True) +enable_vpnaas: $getVar('enable_vpnaas', True) +odl_l3_agent: $getVar('odl_l3_agent', 'Disable') +moon: $getVar('moon', 'Disable') +onos_nic: $getVar('onos_nic', 'eth2') +ip_settings: $ip_settings +network_cfg: $network_cfg +sys_intf_mappings: $sys_intf_mappings +deploy_type: $getVar('deploy_type', 'virtual') + +public_cidr: $computers[0]['install']['subnet'] +storage_cidr: "{{ ip_settings[inventory_hostname]['storage']['cidr'] }}" +mgmt_cidr: "{{ ip_settings[inventory_hostname]['mgmt']['cidr'] }}" + +public_net_info: "{{ network_cfg.public_net_info }}" +host_ip_settings: "{{ ip_settings[inventory_hostname] }}" + +ntp_server: $ntp_server +internal_vip: + ip: $network_cfg["internal_vip"]["ip"] + netmask: $network_cfg["internal_vip"]["netmask"] +#if "vlan_tag" in $sys_intf_mappings[$network_cfg["internal_vip"]["interface"]] + interface: $sys_intf_mappings[$network_cfg["internal_vip"]["interface"]]["name"] +#else + interface: $sys_intf_mappings[$network_cfg["internal_vip"]["interface"]]["interface"] +#end if + +public_vip: + ip: $network_cfg["public_vip"]["ip"] + netmask: $network_cfg["public_vip"]["netmask"] +#if "vlan_tag" in $sys_intf_mappings[$network_cfg["public_vip"]["interface"]] + interface: $sys_intf_mappings[$network_cfg["public_vip"]["interface"]]["name"] +#else + interface: $sys_intf_mappings[$network_cfg["public_vip"]["interface"]]["interface"] +#end if + +db_host: "{{ internal_vip.ip }}" +rabbit_host: "{{ internal_vip.ip }}" + +internal_ip: "{{ ip_settings[inventory_hostname]['mgmt']['ip'] }}" +internal_nic: mgmt + +#set random_id = randint(1, 255) +vrouter_id_internal: $random_id +vrouter_id_public: $random_id + +identity_host: "{{ internal_ip }}" +controllers_host: "{{ internal_ip }}" +storage_controller_host: "{{ internal_ip }}" +compute_controller_host: "{{ internal_ip }}" +image_host: "{{ internal_ip }}" +network_server_host: "{{ internal_ip }}" +dashboard_host: "{{ internal_ip }}" + +haproxy_hosts: +#for $item in $has +#set $hostname=$item["hostname"] + $hostname: $ip_settings[$hostname]["mgmt"]["ip"] +#end for + +host_index: +#for $index, $item in enumerate($has) + $item["hostname"]: $index +#end for + +ERLANG_TOKEN: YOWSJSJIGGAUFZTIBRAD +#set credentials = $getVar('service_credentials', {}) +#set console_credentials = $getVar('console_credentials', {}) +#set rabbit_username = $credentials.rabbitmq.username +#set rabbit_password = $credentials.rabbitmq.password +#set keystone_dbpass = $credentials.identity.password +#set keystone_pass = $console_credentials.identity.password +#set glance_dbpass = $credentials.image.password +#set glance_pass = $console_credentials.image.password +#set nova_dbpass = $credentials.compute.password +#set nova_pass = $console_credentials.compute.password +#set dash_dbpass = $credentials.dashboard.password +#set cinder_dbpass = $credentials.volume.password +#set cinder_pass = $console_credentials.volume.password +#set heat_dbpass = $credentials.heat.password +#set heat_pass = $console_credentials.heat.password +#set neutron_dbpass = $credentials.network.password +#set neutron_pass = $console_credentials.network.password +#set ceilometer_dbpass = $credentials.metering.password +#set ceilometer_pass = $console_credentials.metering.password +#set aodh_dbpass = $credentials.alarming.password +#set aodh_pass = $console_credentials.alarming.password +#set admin_pass = $console_credentials.admin.password +#set demo_pass = $console_credentials.demo.password + +cluster_name: $cluster_name + +odl_controller: 10.1.0.15 + +DEBUG: true +VERBOSE: true +NTP_SERVER_LOCAL: "{{ controllers_host }}" +DB_HOST: "{{ db_host }}" +MQ_BROKER: rabbitmq + +OPENSTACK_REPO: cloudarchive-newton.list +newton_cloud_archive: deb http://ubuntu-cloud.archive.canonical.com/ubuntu xenial-updates/newton main +ADMIN_TOKEN: admin +CEILOMETER_TOKEN: c095d479023a0fd58a54 +erlang.cookie: DJJVECFMCJPVYQTJTDWG + +RABBIT_USER: $rabbit_username +RABBIT_PASS: $rabbit_password +KEYSTONE_DBPASS: $keystone_dbpass +KEYSTONE_PASS: $keystone_pass +CEILOMETER_DBPASS: $ceilometer_dbpass +CEILOMETER_PASS: $ceilometer_pass +AODH_DBPASS: $aodh_dbpass +AODH_PASS: $aodh_pass +GLANCE_DBPASS: $glance_dbpass +GLANCE_PASS: $glance_pass +NOVA_DBPASS: $nova_dbpass +NOVA_PASS: $nova_pass +DASH_DBPASS: $dash_dbpass +CINDER_DBPASS: $cinder_dbpass +CINDER_PASS: $cinder_pass +NEUTRON_DBPASS: $neutron_dbpass +NEUTRON_PASS: $neutron_pass +HEAT_DBPASS: $heat_dbpass +HEAT_PASS: $heat_pass +DEMO_PASS: $demo_pass +ADMIN_PASS: $admin_pass + +#set neutron_service_plugins=['router'] + +#if $getVar('enable_fwaas', True) +#neutron_service_plugins.append('firewall') +#end if + +#if $getVar('enable_vpnaas', True) +#neutron_service_plugins.append('vpnaas') +#end if + +NEUTRON_SERVICE_PLUGINS: $neutron_service_plugins +NEUTRON_TYPE_DRIVERS: ['flat', 'gre', 'vxlan', 'vlan'] +NEUTRON_TENANT_NETWORK_TYPES: ['$ovs_config["tenant_network_type"]'] +NEUTRON_OVS_BRIDGE_MAPPINGS: $ovs_config['bridge_mappings'] +#if 'vlan_ranges' in $ovs_config +NEUTRON_VLAN_RANGES: $ovs_config['vlan_ranges'] +#else +NEUTRON_VLAN_RANGES: [] +#end if +#if 'tunnel_id_ranges' in $ovs_config +NEUTRON_TUNNEL_ID_RANGES: $ovs_config['tunnel_id_ranges'] +#else +NEUTRON_TUNNEL_ID_RANGES: [] +#end if + +#NEUTRON_MECHANISM_DRIVERS: ['opendaylight'] +NEUTRON_MECHANISM_DRIVERS: ['openvswitch'] +NEUTRON_TUNNEL_TYPES: ['vxlan'] +METADATA_SECRET: metadata_secret +WSREP_SST_USER: wsrep_sst +WSREP_SST_PASS: wsrep_sst_sercet + +INSTANCE_TUNNELS_INTERFACE_IP_ADDRESS: "{{ internal_ip }}" + +#build_in_image: http://download.cirros-cloud.net/0.3.3/cirros-0.3.3-x86_64-disk.img +build_in_image: http://192.168.121.12:9999/img/cirros-0.3.3-x86_64-disk.img +build_in_image_name: cirros-0.3.3-x86_64-disk.img + +physical_device: /dev/sdb + +odl_username: admin +odl_password: admin +odl_api_port: 8080 + +odl_pkg_url: https://nexus.opendaylight.org/content/groups/public/org/opendaylight/integration/distribution-karaf/0.2.2-Helium-SR2/distribution-karaf-0.2.2-Helium-SR2.tar.gz +odl_pkg_name: karaf.tar.gz +odl_home: "/opt/opendaylight-0.2.2/" +odl_base_features: ['config', 'standard', 'region', 'package', 'kar', 'ssh', 'management', 'http', 'odl-base-all','odl-aaa-authn','odl-restconf','odl-nsf-all','odl-adsal-northbound','odl-mdsal-apidocs', 'odl-openflowplugin-all'] +odl_extra_features: ['odl-l2switch-switch', 'odl-ovsdb-plugin', 'odl-ovsdb-openstack', 'odl-ovsdb-northbound','odl-dlux-core', 'odl-restconf-all', 'odl-mdsal-clustering', 'odl-openflowplugin-flow-services', 'odl-netconf-connector', 'odl-netconf-connector-ssh', 'jolokia-osgi'] +odl_features: "{{ odl_base_features + odl_extra_features }}" +odl_api_port: 8080 diff --git a/conf/templates/ansible_installer/openstack_newton_xenial/vars/allinone.tmpl b/conf/templates/ansible_installer/openstack_newton_xenial/vars/allinone.tmpl new file mode 100644 index 00000000..a28897b3 --- /dev/null +++ b/conf/templates/ansible_installer/openstack_newton_xenial/vars/allinone.tmpl @@ -0,0 +1,96 @@ +#set cluster_name = $getVar('name', '') +#set controllers = $getVar('allinone_compute', []) +#if not $isinstance($controllers, list) + #set controllers = [$controllers] +#end if + +#for controller in $controllers + #set controller_ip = $controller.management.ip + #set controller_hostname = $controller.hostname +controller_host: $controller_ip +#end for +#for network in $controllers + #set network_external_nic = $network.external.interface + #set network_external_subnet = $network.external.subnet + #set network_internal_nic = $network.management.interface +INTERFACE_NAME: $network_external_nic +INTERNAL_INTERFACE: $network_internal_nic +#end for + +#set credentials = $getVar('service_credentials', {}) +#set console_credentials = $getVar('console_credentials', {}) +#set rabbit_username = $credentials.rabbitmq.username +#set rabbit_password = $credentials.rabbitmq.password +#set keystone_dbpass = $credentials.identity.password +#set glance_dbpass = $credentials.image.password +#set glance_pass = $console_credentials.image.password +#set nova_dbpass = $credentials.compute.password +#set nova_pass = $console_credentials.compute.password +#set dash_dbpass = $credentials.dashboard.password +#set cinder_dbpass = $credentials.volume.password +#set cinder_pass = $console_credentials.volume.password +#set admin_pass = $console_credentials.admin.password +#set neutron_pass = $console_credentials.network.password + +compute_controller_host: "{{ controller_host }}" +db_host: "{{ controller_host }}" +rabbit_host: "{{ controller_host }}" +storage_controller_host: "{{ controller_host }}" +image_host: "{{ controller_host }}" +identity_host: "{{ controller_host }}" +network_server_host: "{{ controller_host }}" +dashboard_host: "{{ controller_host }}" + +cluster_name: $cluster_name +odl_controller: 10.1.0.15 + +DEBUG: true +VERBOSE: true +NTP_SERVER_LOCAL: "{{ controller_host }}" +DB_HOST: "{{ controller_host }}" +MQ_BROKER: rabbitmq + +OPENSTACK_REPO: cloudarchive-newton.list +newton_cloud_archive: deb http://ubuntu-cloud.archive.canonical.com/ubuntu xenial-updates/newton main +ADMIN_TOKEN: admin +CEILOMETER_TOKEN: c095d479023a0fd58a54 + +RABBIT_USER: $rabbit_username +RABBIT_PASS: $rabbit_password +KEYSTONE_DBPASS: $keystone_dbpass +DEMO_PASS: demo_secret +ADMIN_PASS: $admin_pass +GLANCE_DBPASS: $glance_dbpass +GLANCE_PASS: $glance_pass +NOVA_DBPASS: $nova_dbpass +NOVA_PASS: $nova_pass +DASH_DBPASS: $dash_dbpass +CINDER_DBPASS: $cinder_dbpass +CINDER_PASS: $cinder_pass +NEUTRON_DBPASS: $neutron_pass +NEUTRON_PASS: $neutron_pass +NEUTRON_TYPE_DRIVERS: ['flat', 'gre', 'vxlan'] +NEUTRON_TENANT_NETWORK_TYPES: ['vxlan'] +#NEUTRON_MECHANISM_DRIVERS: ['opendaylight'] +NEUTRON_MECHANISM_DRIVERS: ['openvswitch'] +NEUTRON_TUNNEL_TYPES: ['vxlan'] +METADATA_SECRET: metadata_secret +INSTANCE_TUNNELS_INTERFACE_IP_ADDRESS: 10.1.1.21 + +EXTERNAL_NETWORK_CIDR: 203.0.113.0/24 +EXTERNAL_NETWORK_GATEWAY: 203.0.113.1 +FLOATING_IP_START: 203.0.113.101 +FLOATING_IP_END: 203.0.113.200 + +build_in_image: http://download.cirros-cloud.net/0.3.3/cirros-0.3.3-x86_64-disk.img +build_in_image_name: cirros-0.3.3-x86_64-disk.img + +physical_device: /dev/sdb + +internal_interface: "ansible_{{ INTERNAL_INTERFACE }}" +internal_ip: "{{ hostvars[inventory_hostname][internal_interface]['ipv4']['address'] }}" +HA_VIP: "{{ internal_ip }}" + +odl_username: admin +odl_password: admin +odl_api_port: 8080 diff --git a/conf/templates/ansible_installer/openstack_newton_xenial/vars/multinodes.tmpl b/conf/templates/ansible_installer/openstack_newton_xenial/vars/multinodes.tmpl new file mode 100644 index 00000000..16134e71 --- /dev/null +++ b/conf/templates/ansible_installer/openstack_newton_xenial/vars/multinodes.tmpl @@ -0,0 +1,165 @@ +#set cluster_name = $getVar('name', '') +#set compute_controllers = $getVar('compute_controller', []) +#set compute_workers = $getVar('compute_worker', []) +#set network_servers = $getVar('network_server', []) +#set network_workers = $getVar('network_worker', []) +#set databases = $getVar('database', []) +#set messagings = $getVar('messaging', []) +#set images = $getVar('image', []) +#set dashboards = $getVar('dashboard', []) +#set identities = $getVar('identity', []) +#set storage_controllers = $getVar('storage_controller', []) +#set storage_volumes = $getVar('storage_volume', []) +#if not $isinstance($compute_controllers, list) + #set compute_controllers = [$compute_controllers] +#end if +#if not $isinstance($compute_workers, list) + #set compute_workers = [$compute_workers] +#end if +#if not $isinstance($network_servers, list) + #set network_servers = [$network_servers] +#end if +#if not $isinstance($network_workers, list) + #set network_workers = [$network_workers] +#end if +#if not $isinstance($databases, list) + #set databases = [$databases] +#end if +#if not $isinstance($messagings, list) + #set messagings = [$messagings] +#end if +#if not $isinstance($images, list) + #set images = [$images] +#end if +#if not $isinstance($dashboards, list) + #set dashboards = [$dashboards] +#end if +#if not $isinstance($identities, list) + #set identities = [$identities] +#end if +#if not $isinstance($storage_controllers, list) + #set storage_controllers = [$storage_controllers] +#end if +#if not $isinstance($storage_volumes, list) + #set storage_volumes = [$storage_volumes] +#end if +#for worker in $compute_controllers + #set worker_ip = $worker.management.ip +compute_controller_host: $worker_ip +#end for +#for worker in $databases + #set worker_ip = $worker.management.ip +db_host: $worker_ip +#end for +#for worker in $messagings + #set worker_ip = $worker.management.ip +rabbit_host: $worker_ip +#end for +#for worker in $storage_controllers + #set worker_ip = $worker.management.ip +storage_controller_host: $worker_ip +#end for +#for worker in $images + #set worker_ip = $worker.management.ip +image_host: $worker_ip +#end for +#for worker in $identities + #set worker_ip = $worker.management.ip +identity_host: $worker_ip +#end for +#for worker in $compute_controllers + #set worker_ip = $worker.management.ip +compute_controller_host: $worker_ip +#end for +#for worker in $network_servers + #set worker_ip = $worker.management.ip +network_server_host: $worker_ip +#end for +#for worker in $dashboards + #set worker_ip = $worker.management.ip +dashboard_host: $worker_ip +#end for +#for network in $network_workers + #set network_external_nic = $network.external.interface + #set network_internal_nic = $network.management.interface +INTERFACE_NAME: $network_external_nic +INTERNAL_INTERFACE: $network_internal_nic +#end for + +#set credentials = $getVar('service_credentials', {}) +#set console_credentials = $getVar('console_credentials', {}) +#set rabbit_username = $credentials.rabbitmq.username +#set rabbit_password = $credentials.rabbitmq.password +#set keystone_dbpass = $credentials.identity.password +#set glance_dbpass = $credentials.image.password +#set glance_pass = $console_credentials.image.password +#set nova_dbpass = $credentials.compute.password +#set nova_pass = $console_credentials.compute.password +#set dash_dbpass = $credentials.dashboard.password +#set cinder_dbpass = $credentials.volume.password +#set cinder_pass = $console_credentials.volume.password +#set admin_pass = $console_credentials.admin.password +#set neutron_pass = $console_credentials.network.password + +cluster_name: $cluster_name + +odl_controller: 10.1.0.15 + +DEBUG: true +VERBOSE: true +NTP_SERVER_LOCAL: "{{ compute_controller_host }}" +DB_HOST: "{{ db_host }}" +MQ_BROKER: rabbitmq + +OPENSTACK_REPO: cloudarchive-newton.list +newton_cloud_archive: deb http://ubuntu-cloud.archive.canonical.com/ubuntu xenial-updates/newton main +ADMIN_TOKEN: admin +CEILOMETER_TOKEN: c095d479023a0fd58a54 + +RABBIT_USER: $rabbit_username +RABBIT_PASS: $rabbit_password +KEYSTONE_DBPASS: $keystone_dbpass +DEMO_PASS: demo_secret +ADMIN_PASS: $admin_pass +GLANCE_DBPASS: $glance_dbpass +GLANCE_PASS: $glance_pass +NOVA_DBPASS: $nova_dbpass +NOVA_PASS: $nova_pass +DASH_DBPASS: $dash_dbpass +CINDER_DBPASS: $cinder_dbpass +CINDER_PASS: $cinder_pass +NEUTRON_DBPASS: $neutron_pass +NEUTRON_PASS: $neutron_pass +NEUTRON_TYPE_DRIVERS: ['flat', 'gre', 'vxlan'] +NEUTRON_TENANT_NETWORK_TYPES: ['vxlan'] +#NEUTRON_MECHANISM_DRIVERS: ['opendaylight'] +NEUTRON_MECHANISM_DRIVERS: ['openvswitch'] +NEUTRON_TUNNEL_TYPES: ['vxlan'] +METADATA_SECRET: metadata_secret +INSTANCE_TUNNELS_INTERFACE_IP_ADDRESS: 10.1.1.21 + +EXTERNAL_NETWORK_CIDR: 203.0.113.0/24 +EXTERNAL_NETWORK_GATEWAY: 203.0.113.1 +FLOATING_IP_START: 203.0.113.101 +FLOATING_IP_END: 203.0.113.200 + +build_in_image: http://download.cirros-cloud.net/0.3.3/cirros-0.3.3-x86_64-disk.img +build_in_image_name: cirros-0.3.3-x86_64-disk.img + +physical_device: /dev/sdb + +internal_interface: "ansible_{{ INTERNAL_INTERFACE }}" +internal_ip: "{{ hostvars[inventory_hostname][internal_interface]['ipv4']['address'] }}" +HA_VIP: "{{ internal_ip }}" +odl_username: admin +odl_password: admin +odl_api_port: 8080 + +odl_pkg_url: https://nexus.opendaylight.org/content/groups/public/org/opendaylight/integration/distribution-karaf/0.2.2-Helium-SR2/distribution-karaf-0.2.2-Helium-SR2.tar.gz +odl_pkg_name: karaf.tar.gz +odl_home: "/opt/opendaylight-0.2.2/" +odl_base_features: ['config', 'standard', 'region', 'package', 'kar', 'ssh', 'management', 'http', 'odl-base-all','odl-aaa-authn','odl-restconf','odl-nsf-all','odl-adsal-northbound','odl-mdsal-apidocs', 'odl-openflowplugin-all'] +odl_extra_features: ['odl-l2switch-switch', 'odl-ovsdb-plugin', 'odl-ovsdb-openstack', 'odl-ovsdb-northbound','odl-dlux-core', 'odl-restconf-all', 'odl-mdsal-clustering', 'odl-openflowplugin-flow-services', 'odl-netconf-connector', 'odl-netconf-connector-ssh', 'jolokia-osgi'] +odl_features: "{{ odl_base_features + odl_extra_features }}" +odl_api_port: 8080 + diff --git a/conf/templates/ansible_installer/openstack_newton_xenial/vars/single-controller.tmpl b/conf/templates/ansible_installer/openstack_newton_xenial/vars/single-controller.tmpl new file mode 100644 index 00000000..70b01813 --- /dev/null +++ b/conf/templates/ansible_installer/openstack_newton_xenial/vars/single-controller.tmpl @@ -0,0 +1,108 @@ +#set cluster_name = $getVar('name', '') +#set controllers = $getVar('controller', []) +#set computes = $getVar('compute', []) +#set networks = $getVar('network', []) +#set storages = $getVar('storage', []) +#if not $isinstance($controllers, list) + #set controllers = [$controllers] +#end if +#if not $isinstance($computes, list) + #set computes = [$computes] +#end if +#if not $isinstance($networks, list) + #set networks = [$networks] +#end if +#if not $isinstance($storages, list) + #set storages = [$storages] +#end if + +#for controller in $controllers + #set controller_ip = $controller.management.ip + #set controller_hostname = $controller.hostname +controller_host: $controller_ip +#end for +#for network in $networks + #set network_external_nic = $network.external.interface + #set network_external_subnet = $network.external.subnet + #set network_internal_nic = $network.management.interface +INTERFACE_NAME: $network_external_nic +INTERNAL_INTERFACE: $network_internal_nic +#end for + +#set credentials = $getVar('service_credentials', {}) +#set console_credentials = $getVar('console_credentials', {}) +#set rabbit_username = $credentials.rabbitmq.username +#set rabbit_password = $credentials.rabbitmq.password +#set keystone_dbpass = $credentials.identity.password +#set glance_dbpass = $credentials.image.password +#set glance_pass = $console_credentials.image.password +#set nova_dbpass = $credentials.compute.password +#set nova_pass = $console_credentials.compute.password +#set dash_dbpass = $credentials.dashboard.password +#set cinder_dbpass = $credentials.volume.password +#set cinder_pass = $console_credentials.volume.password +#set admin_pass = $console_credentials.admin.password +#set neutron_pass = $console_credentials.network.password + +cluster_name: $cluster_name +deploy_type: $getVar('deploy_type', 'virtual') +compute_controller_host: "{{ controller_host }}" +db_host: "{{ controller_host }}" +rabbit_host: "{{ controller_host }}" +storage_controller_host: "{{ controller_host }}" +image_host: "{{ controller_host }}" +identity_host: "{{ controller_host }}" +network_server_host: "{{ controller_host }}" +dashboard_host: "{{ controller_host }}" +odl_controller: 10.1.0.15 + +DEBUG: true +VERBOSE: true +NTP_SERVER_LOCAL: "{{ controller_host }}" +DB_HOST: "{{ controller_host }}" +MQ_BROKER: rabbitmq + +OPENSTACK_REPO: cloudarchive-newton.list +newton_cloud_archive: deb http://ubuntu-cloud.archive.canonical.com/ubuntu xenial-updates/newton main +ADMIN_TOKEN: admin +CEILOMETER_TOKEN: c095d479023a0fd58a54 + +RABBIT_USER: $rabbit_username +RABBIT_PASS: $rabbit_password +KEYSTONE_DBPASS: $keystone_dbpass +DEMO_PASS: demo_secret +ADMIN_PASS: $admin_pass +GLANCE_DBPASS: $glance_dbpass +GLANCE_PASS: $glance_pass +NOVA_DBPASS: $nova_dbpass +NOVA_PASS: $nova_pass +DASH_DBPASS: $dash_dbpass +CINDER_DBPASS: $cinder_dbpass +CINDER_PASS: $cinder_pass +NEUTRON_DBPASS: $neutron_pass +NEUTRON_PASS: $neutron_pass +NEUTRON_TYPE_DRIVERS: ['flat', 'gre', 'vxlan'] +NEUTRON_TENANT_NETWORK_TYPES: ['vxlan'] +#NEUTRON_MECHANISM_DRIVERS: ['opendaylight'] +NEUTRON_MECHANISM_DRIVERS: ['openvswitch'] +NEUTRON_TUNNEL_TYPES: ['vxlan'] +METADATA_SECRET: metadata_secret +INSTANCE_TUNNELS_INTERFACE_IP_ADDRESS: 10.1.1.21 + +EXTERNAL_NETWORK_CIDR: 203.0.113.0/24 +# EXTERNAL_NETWORK_CIDR: $network_external_subnet +EXTERNAL_NETWORK_GATEWAY: 203.0.113.1 +FLOATING_IP_START: 203.0.113.101 +FLOATING_IP_END: 203.0.113.200 + +build_in_image: http://download.cirros-cloud.net/0.3.3/cirros-0.3.3-x86_64-disk.img +build_in_image_name: cirros-0.3.3-x86_64-disk.img + +physical_device: /dev/sdb + +internal_interface: "ansible_{{ INTERNAL_INTERFACE }}" +internal_ip: "{{ hostvars[inventory_hostname][internal_interface]['ipv4']['address'] }}" +HA_VIP: "{{ internal_ip }}" +odl_username: admin +odl_password: admin +odl_api_port: 8080 diff --git a/conf/templates/ansible_installer/openstack_osp9/ansible_cfg/HA-ansible-multinodes.tmpl b/conf/templates/ansible_installer/openstack_osp9/ansible_cfg/HA-ansible-multinodes.tmpl new file mode 100644 index 00000000..55d80ae1 --- /dev/null +++ b/conf/templates/ansible_installer/openstack_osp9/ansible_cfg/HA-ansible-multinodes.tmpl @@ -0,0 +1,7 @@ +#set cluster_name = $getVar('name', '') +[defaults] +log_path = /var/ansible/run/openstack_osp9-$cluster_name/ansible.log +host_key_checking = False +callback_plugins = /opt/compass/bin/ansible_callbacks +pipelining=True +library = /opt/openstack-ansible-modules diff --git a/conf/templates/ansible_installer/openstack_osp9/ansible_cfg/allinone.tmpl b/conf/templates/ansible_installer/openstack_osp9/ansible_cfg/allinone.tmpl new file mode 100644 index 00000000..ab1a0d71 --- /dev/null +++ b/conf/templates/ansible_installer/openstack_osp9/ansible_cfg/allinone.tmpl @@ -0,0 +1,6 @@ +#set cluster_name = $getVar('name', '') +[defaults] +log_path = /var/ansible/run/openstack_mitaka-$cluster_name/ansible.log +host_key_checking = False +callback_plugins = /opt/compass/bin/ansible_callbacks +pipelining=True diff --git a/conf/templates/ansible_installer/openstack_osp9/ansible_cfg/multinodes.tmpl b/conf/templates/ansible_installer/openstack_osp9/ansible_cfg/multinodes.tmpl new file mode 100644 index 00000000..ab1a0d71 --- /dev/null +++ b/conf/templates/ansible_installer/openstack_osp9/ansible_cfg/multinodes.tmpl @@ -0,0 +1,6 @@ +#set cluster_name = $getVar('name', '') +[defaults] +log_path = /var/ansible/run/openstack_mitaka-$cluster_name/ansible.log +host_key_checking = False +callback_plugins = /opt/compass/bin/ansible_callbacks +pipelining=True diff --git a/conf/templates/ansible_installer/openstack_osp9/ansible_cfg/single-controller.tmpl b/conf/templates/ansible_installer/openstack_osp9/ansible_cfg/single-controller.tmpl new file mode 100644 index 00000000..ab1a0d71 --- /dev/null +++ b/conf/templates/ansible_installer/openstack_osp9/ansible_cfg/single-controller.tmpl @@ -0,0 +1,6 @@ +#set cluster_name = $getVar('name', '') +[defaults] +log_path = /var/ansible/run/openstack_mitaka-$cluster_name/ansible.log +host_key_checking = False +callback_plugins = /opt/compass/bin/ansible_callbacks +pipelining=True diff --git a/conf/templates/ansible_installer/openstack_osp9/hosts/HA-ansible-multinodes.tmpl b/conf/templates/ansible_installer/openstack_osp9/hosts/HA-ansible-multinodes.tmpl new file mode 100644 index 00000000..9d628b5e --- /dev/null +++ b/conf/templates/ansible_installer/openstack_osp9/hosts/HA-ansible-multinodes.tmpl @@ -0,0 +1,31 @@ +#set ip_settings={} +#for k,v in $getVar('ip_settings', {}).items() +#set host_ip_settings={} +#for intf in v +#set $host_ip_settings[$intf["alias"]]=intf +#end for +#set $ip_settings[$k]=$host_ip_settings +#end for + +# localhost +127.0.0.1 localhost +#set controllers = $getVar('controller', []) +#set computes = $getVar('compute', []) +#if not $isinstance($controllers, list) + #set controllers = [$controllers] +#end if +#if not $isinstance($compute, list) + #set computes = [$computes] +#end if +# controller +#for worker in $controllers + #set worker_hostname = $worker.hostname + #set worker_ip = $ip_settings[$worker_hostname].mgmt.ip +$worker_ip $worker_hostname +#end for +# compute +#for worker in $computes + #set worker_hostname = $worker.hostname + #set worker_ip = $ip_settings[$worker_hostname].mgmt.ip +$worker_ip $worker_hostname +#end for diff --git a/conf/templates/ansible_installer/openstack_osp9/hosts/allinone.tmpl b/conf/templates/ansible_installer/openstack_osp9/hosts/allinone.tmpl new file mode 100644 index 00000000..b777815e --- /dev/null +++ b/conf/templates/ansible_installer/openstack_osp9/hosts/allinone.tmpl @@ -0,0 +1,10 @@ +#set controllers = $getVar('allinone_compute', []) +#if not $isinstance($controllers, list) + #set controllers = [$controllers] +#end if +# allinone +#for controller in $controllers + #set controller_ip = $controller.management.ip + #set controller_hostname = $controller.hostname +$controller_ip $controller_hostname +#end for diff --git a/conf/templates/ansible_installer/openstack_osp9/hosts/multinodes.tmpl b/conf/templates/ansible_installer/openstack_osp9/hosts/multinodes.tmpl new file mode 100644 index 00000000..ca8c793f --- /dev/null +++ b/conf/templates/ansible_installer/openstack_osp9/hosts/multinodes.tmpl @@ -0,0 +1,110 @@ +#set compute_controllers = $getVar('compute_controller', []) +#set compute_workers = $getVar('compute_worker', []) +#set network_servers = $getVar('network_server', []) +#set network_workers = $getVar('network_worker', []) +#set databases = $getVar('database', []) +#set messagings = $getVar('messaging', []) +#set images = $getVar('image', []) +#set dashboards = $getVar('dashboard', []) +#set identities = $getVar('identity', []) +#set storage_controllers = $getVar('storage_controller', []) +#set storage_volumes = $getVar('storage_volume', []) +#if not $isinstance($compute_controllers, list) + #set compute_controllers = [$compute_controllers] +#end if +#if not $isinstance($compute_workers, list) + #set compute_workers = [$compute_workers] +#end if +#if not $isinstance($network_servers, list) + #set network_servers = [$network_servers] +#end if +#if not $isinstance($network_workers, list) + #set network_workers = [$network_workers] +#end if +#if not $isinstance($databases, list) + #set databases = [$databases] +#end if +#if not $isinstance($messagings, list) + #set messagings = [$messagings] +#end if +#if not $isinstance($images, list) + #set images = [$images] +#end if +#if not $isinstance($dashboards, list) + #set dashboards = [$dashboards] +#end if +#if not $isinstance($identities, list) + #set identities = [$identities] +#end if +#if not $isinstance($storage_controllers, list) + #set storage_controllers = [$storage_controllers] +#end if +#if not $isinstance($storage_volumes, list) + #set storage_volumes = [$storage_volumes] +#end if +# compute-controller +#for worker in $compute_controllers + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_ip $worker_hostname +#end for +# database +#for worker in $databases + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_ip $worker_hostname +#end for +# messaging +#for worker in $messagings + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_ip $worker_hostname +#end for +# storage-controller +#for worker in $storage_controllers + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_ip $worker_hostname +#end for +# image +#for worker in $images + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_ip $worker_hostname +#end for +# identity +#for worker in $identities + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_ip $worker_hostname +#end for +# network-server +#for worker in $network_servers + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_ip $worker_hostname +#end for +# dashboard +#for worker in $dashboards + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_ip $worker_hostname +#end for +# storage-volume +#for worker in $storage_volumes + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_ip $worker_hostname +#end for +# network-worker +#for worker in $network_workers + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_ip $worker_hostname +#end for +# compute-worker +#for worker in $compute_workers + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_ip $worker_hostname +#end for diff --git a/conf/templates/ansible_installer/openstack_osp9/hosts/single-controller.tmpl b/conf/templates/ansible_installer/openstack_osp9/hosts/single-controller.tmpl new file mode 100644 index 00000000..3ed94694 --- /dev/null +++ b/conf/templates/ansible_installer/openstack_osp9/hosts/single-controller.tmpl @@ -0,0 +1,40 @@ +#set controllers = $getVar('controller', []) +#set computes = $getVar('compute', []) +#set storages = $getVar('storage', []) +#set networks = $getVar('network', []) +#if not $isinstance($controllers, list) + #set controllers = [$controllers] +#end if +#if not $isinstance($computes, list) + #set computes = [$computes] +#end if +#if not $isinstance($storages, list) + #set storages = [$storages] +#end if +#if not $isinstance($networks, list) + #set networks = [$networks] +#end if +# controller +#for controller in $controllers + #set controller_ip = $controller.management.ip + #set controller_hostname = $controller.hostname +$controller_ip $controller_hostname +#end for +# compute +#for worker in $computes + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_ip $worker_hostname +#end for +# storage +#for worker in $storages + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_ip $worker_hostname +#end for +# network +#for worker in $networks + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_ip $worker_hostname +#end for diff --git a/conf/templates/ansible_installer/openstack_osp9/inventories/HA-ansible-multinodes.tmpl b/conf/templates/ansible_installer/openstack_osp9/inventories/HA-ansible-multinodes.tmpl new file mode 100644 index 00000000..94a6a153 --- /dev/null +++ b/conf/templates/ansible_installer/openstack_osp9/inventories/HA-ansible-multinodes.tmpl @@ -0,0 +1,100 @@ +#set controllers = $getVar('controller', []) +#set computes = $getVar('compute', []) +#set has = $getVar('ha', []) +#set odls = $getVar('odl', []) +#set onoss = $getVar('onos', []) +#set opencontrails = $getVar('opencontrail', []) +#set ceph_adm_list = $getVar('ceph_adm',[]) +#set ceph_mon_list = $getVar('ceph_mon',[]) +#set ceph_osd_list = $getVar('ceph_osd',[]) + +#if not $isinstance($controllers, list) + #set controllers = [$controllers] +#end if +#if not $isinstance($computes, list) + #set computes = [$computes] +#end if +#if not $isinstance(has, list) + #set has = [has] +#end if +#if not $isinstance(odls, list) + #set odls = [odls] +#end if +#if not $isinstance(onoss, list) + #set onoss = [onoss] +#end if +#if not $isinstance(opencontrails, list) + #set opencontrails = [opencontrails] +#end if +#if not $isinstance(ceph_adm_list, list) + #set ceph_adm_list = [ceph_adm_list] +#end if +#if not $isinstance(ceph_mon_list, list) + #set ceph_mon_list = [ceph_mon_list] +#end if +#if not $isinstance(ceph_osd_list, list) + #set ceph_osd_list = [ceph_osd_list] +#end if + +#set credentials = $getVar('server_credentials', {}) +#set username = $credentials.get('username', 'root') +#set password = $credentials.get('password', 'root') +[controller] +#for controller in $controllers + #set controller_ip = $controller.install.ip + #set controller_hostname = $controller.hostname +$controller_hostname ansible_ssh_host=$controller_ip ansible_ssh_user=$username ansible_ssh_password=$password +#end for +[compute] +#for compute in $computes + #set compute_ip = $compute.install.ip + #set compute_hostname = $compute.hostname +$compute_hostname ansible_ssh_host=$compute_ip ansible_ssh_user=$username ansible_ssh_password=$password +#end for +[ha] +#for ha in $has + #set ha_ip = $ha.install.ip + #set ha_hostname = $ha.hostname +$ha_hostname ansible_ssh_host=$ha_ip ansible_ssh_user=$username ansible_ssh_password=$password +#end for +[odl] +#for odl in $odls + #set odl_ip = $odl.install.ip + #set odl_hostname = $odl.hostname +$odl_hostname ansible_ssh_host=$odl_ip ansible_ssh_user=$username ansible_ssh_password=$password +#end for +[onos] +#for onos in $onoss + #set onos_ip = $onos.install.ip + #set onos_hostname = $onos.hostname +$onos_hostname ansible_ssh_host=$onos_ip ansible_ssh_user=$username ansible_ssh_password=$password +#end for +[opencontrail] +#for opencontrail in $opencontrails + #set opencontrail_ip = $opencontrail.install.ip + #set opencontrail_hostname = $opencontrail.hostname +$opencontrail_hostname ansible_ssh_host=$opencontrail_ip ansible_ssh_user=$username ansible_ssh_password=$password +#end for +[ceph_adm] +#for ceph_adm in $ceph_adm_list + #set ceph_adm_ip = $ceph_adm.install.ip + #set ceph_adm_hostname = $ceph_adm.hostname +$ceph_adm_hostname ansible_ssh_host=$ceph_adm_ip ansible_ssh_user=$username ansible_ssh_password=$password +#end for +[ceph_mon] +#for ceph_mon in $ceph_mon_list + #set ceph_mon_ip = $ceph_mon.install.ip + #set ceph_mon_hostname = $ceph_mon.hostname +$ceph_mon_hostname ansible_ssh_host=$ceph_mon_ip ansible_ssh_user=$username ansible_ssh_password=$password +#end for +[ceph_osd] +#for ceph_osd in $ceph_osd_list + #set ceph_osd_ip = $ceph_osd.install.ip + #set ceph_osd_hostname = $ceph_osd.hostname +$ceph_osd_hostname ansible_ssh_host=$ceph_osd_ip ansible_ssh_user=$username ansible_ssh_password=$password +#end for +[ceph:children] +ceph_adm +ceph_mon +ceph_osd + diff --git a/conf/templates/ansible_installer/openstack_osp9/inventories/allinone.tmpl b/conf/templates/ansible_installer/openstack_osp9/inventories/allinone.tmpl new file mode 100644 index 00000000..38e0038b --- /dev/null +++ b/conf/templates/ansible_installer/openstack_osp9/inventories/allinone.tmpl @@ -0,0 +1,47 @@ +#set controllers = $getVar('allinone_compute', []) +#set computes = $getVar('allinone_compute', []) +#set storages = $getVar('allinone_compute', []) +#set networks = $getVar('allinone_compute', []) +#if not $isinstance($controllers, list) + #set controllers = [$controllers] +#end if +#if not $isinstance($computes, list) + #set computes = [$computes] +#end if +#if not $isinstance($storages, list) + #set storages = [$storages] +#end if +#if not $isinstance($networks, list) + #set networks = [$networks] +#end if + +#set credentials = $getVar('server_credentials', {}) +#set username = $credentials.get('username', 'root') +#set password = $credentials.get('password', 'root') +[controller] +#for controller in $controllers + #set controller_ip = $controller.management.ip + #set controller_hostname = $controller.hostname +$controller_hostname ansible_ssh_host=$controller_ip ansible_ssh_user=$username ansible_ssh_password=$password +#end for + +[compute] +#for compute in $computes + #set compute_ip = $compute.management.ip + #set compute_hostname = $compute.hostname +$compute_hostname ansible_ssh_host=$compute_ip ansible_ssh_user=$username ansible_ssh_password=$password +#end for + +[network] +#for network in $networks + #set network_ip = $network.management.ip + #set network_hostname = $network.hostname +$network_hostname ansible_ssh_host=$network_ip ansible_ssh_user=$username ansible_ssh_password=$password +#end for + +[storage] +#for storage in storages + #set storage_ip = $storage.management.ip + #set storage_hostname = $storage.hostname +$storage_hostname ansible_ssh_host=$storage_ip ansible_ssh_user=$username ansible_ssh_password=$password +#end for diff --git a/conf/templates/ansible_installer/openstack_osp9/inventories/multinodes.tmpl b/conf/templates/ansible_installer/openstack_osp9/inventories/multinodes.tmpl new file mode 100644 index 00000000..7cdfbef3 --- /dev/null +++ b/conf/templates/ansible_installer/openstack_osp9/inventories/multinodes.tmpl @@ -0,0 +1,123 @@ +#set compute_controllers = $getVar('compute_controller', []) +#set compute_workers = $getVar('compute_worker', []) +#set network_servers = $getVar('network_server', []) +#set network_workers = $getVar('network_worker', []) +#set databases = $getVar('database', []) +#set messagings = $getVar('messaging', []) +#set images = $getVar('image', []) +#set dashboards = $getVar('dashboard', []) +#set identities = $getVar('identity', []) +#set storage_controllers = $getVar('storage_controller', []) +#set storage_volumes = $getVar('storage_volume', []) +#if not $isinstance($compute_controllers, list) + #set compute_controllers = [$compute_controllers] +#end if +#if not $isinstance($compute_workers, list) + #set compute_workers = [$compute_workers] +#end if +#if not $isinstance($network_servers, list) + #set network_servers = [$network_servers] +#end if +#if not $isinstance($network_workers, list) + #set network_workers = [$network_workers] +#end if +#if not $isinstance($databases, list) + #set databases = [$databases] +#end if +#if not $isinstance($messagings, list) + #set messagings = [$messagings] +#end if +#if not $isinstance($images, list) + #set images = [$images] +#end if +#if not $isinstance($dashboards, list) + #set dashboards = [$dashboards] +#end if +#if not $isinstance($identities, list) + #set identities = [$identities] +#end if +#if not $isinstance($storage_controllers, list) + #set storage_controllers = [$storage_controllers] +#end if +#if not $isinstance($storage_volumes, list) + #set storage_volumes = [$storage_volumes] +#end if +#set credentials = $getVar('server_credentials', {}) +#set username = $credentials.get('username', 'root') +#set password = $credentials.get('password', 'root') +[compute-controller] +#for controller in $compute_controllers + #set controller_ip = $controller.management.ip + #set controller_hostname = $controller.hostname +$controller_hostname ansible_ssh_host=$controller_ip ansible_ssh_user=$username ansible_ssh_password=$password +#end for + +[compute-worker] +#for compute in $compute_workers + #set compute_ip = $compute.management.ip + #set compute_hostname = $compute.hostname +$compute_hostname ansible_ssh_host=$compute_ip ansible_ssh_user=$username ansible_ssh_password=$password +#end for + +[network-server] +#for network in $network_servers + #set network_ip = $network.management.ip + #set network_hostname = $network.hostname +$network_hostname ansible_ssh_host=$network_ip ansible_ssh_user=$username ansible_ssh_password=$password +#end for + +[network-worker] +#for network in $network_workers + #set network_ip = $network.management.ip + #set network_hostname = $network.hostname +$network_hostname ansible_ssh_host=$network_ip ansible_ssh_user=$username ansible_ssh_password=$password +#end for + +[database] +#for worker in $databases + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_hostname ansible_ssh_host=$worker_ip ansible_ssh_user=$username ansible_ssh_password=$password +#end for + +[messaging] +#for worker in $messagings + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_hostname ansible_ssh_host=$worker_ip ansible_ssh_user=$username ansible_ssh_password=$password +#end for + +[image] +#for worker in $images + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_hostname ansible_ssh_host=$worker_ip ansible_ssh_user=$username ansible_ssh_password=$password +#end for + +[dashboard] +#for worker in $dashboards + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_hostname ansible_ssh_host=$worker_ip ansible_ssh_user=$username ansible_ssh_password=$password +#end for + +[identity] +#for worker in $identities + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_hostname ansible_ssh_host=$worker_ip ansible_ssh_user=$username ansible_ssh_password=$password +#end for + +[storage-controller] +#for worker in $storage_controllers + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_hostname ansible_ssh_host=$worker_ip ansible_ssh_user=$username ansible_ssh_password=$password +#end for + +[storage-volume] +#for worker in $storage_volumes + #set worker_ip = $worker.management.ip + #set worker_hostname = $worker.hostname +$worker_hostname ansible_ssh_host=$worker_ip ansible_ssh_user=$username ansible_ssh_password=$password +#end for diff --git a/conf/templates/ansible_installer/openstack_osp9/inventories/single-controller.tmpl b/conf/templates/ansible_installer/openstack_osp9/inventories/single-controller.tmpl new file mode 100644 index 00000000..e1bf72c4 --- /dev/null +++ b/conf/templates/ansible_installer/openstack_osp9/inventories/single-controller.tmpl @@ -0,0 +1,67 @@ +#set controllers = $getVar('controller', []) +#set computes = $getVar('compute', []) +#set storages = $getVar('storage', []) +#set networks = $getVar('network', []) +#set odls = $getVar('odl', []) +#set onoss = $getVar('onos', []) +#if not $isinstance($controllers, list) + #set controllers = [$controllers] +#end if +#if not $isinstance($computes, list) + #set computes = [$computes] +#end if +#if not $isinstance($storages, list) + #set storages = [$storages] +#end if +#if not $isinstance($networks, list) + #set networks = [$networks] +#end if +#if not $isinstance($odls, list) + #set odls = [$odls] +#end if +#if not $isinstance($onoss, list) + #set onoss = [$onoss] +#end if + +#set credentials = $getVar('server_credentials', {}) +#set username = $credentials.get('username', 'root') +#set password = $credentials.get('password', 'root') +[controller] +#for controller in $controllers + #set controller_ip = $controller.management.ip + #set controller_hostname = $controller.hostname +$controller_hostname ansible_ssh_host=$controller_ip ansible_ssh_user=$username ansible_ssh_password=$password +#end for + +[compute] +#for compute in $computes + #set compute_ip = $compute.management.ip + #set compute_hostname = $compute.hostname +$compute_hostname ansible_ssh_host=$compute_ip ansible_ssh_user=$username ansible_ssh_password=$password +#end for + +[network] +#for network in $networks + #set network_ip = $network.management.ip + #set network_hostname = $network.hostname +$network_hostname ansible_ssh_host=$network_ip ansible_ssh_user=$username ansible_ssh_password=$password +#end for + +[storage] +#for storage in storages + #set storage_ip = $storage.management.ip + #set storage_hostname = $storage.hostname +$storage_hostname ansible_ssh_host=$storage_ip ansible_ssh_user=$username ansible_ssh_password=$password +#end for +[odl] +#for odl in odls + #set odl_ip = $odl.management.ip + #set odl_hostname = $odl.hostname +$odl_hostname ansible_ssh_host=$odl_ip ansible_ssh_user=$username ansible_ssh_password=$password +#end for +[storage] +#for storage in storages + #set storage_ip = $storage.management.ip + #set storage_hostname = $storage.hostname +$storage_hostname ansible_ssh_host=$storage_ip ansible_ssh_user=$username ansible_ssh_password=$password +#end for diff --git a/conf/templates/ansible_installer/openstack_osp9/vars/HA-ansible-multinodes.tmpl b/conf/templates/ansible_installer/openstack_osp9/vars/HA-ansible-multinodes.tmpl new file mode 100644 index 00000000..b5b63e69 --- /dev/null +++ b/conf/templates/ansible_installer/openstack_osp9/vars/HA-ansible-multinodes.tmpl @@ -0,0 +1,210 @@ +#from random import randint +#set cluster_name = $getVar('name', '') +#set network_cfg = $getVar('network_cfg', {}) +#set ntp_server = $getVar('ntp_server', "") +#set ceph_disk = $getVar('ceph_disk',"") +#set $sys_intf_mappings= {} +#for $intf_info in $network_cfg.sys_intf_mappings +#set $sys_intf_mappings[$intf_info["name"]] = $intf_info +#end for + +#set ip_settings={} +#for k,v in $getVar('ip_settings', {}).items() +#set host_ip_settings={} +#for intf in v +#set $host_ip_settings[$intf["alias"]]=intf +#end for +#set $ip_settings[$k]=$host_ip_settings +#end for + +#set neutron_cfg = $getVar('neutron_config', {}) +#set ovs_config = $neutron_cfg.openvswitch + +#set has = $getVar('ha', []) +#set ha_vip = $getVar('ha_vip', []) + +#set controllers = $getVar('controller', []) +#set computers = $getVar('compute', []) + +enable_secgroup: $getVar('enable_secgroup', True) +enable_fwaas: $getVar('enable_fwaas', True) +enable_vpnaas: $getVar('enable_vpnaas', True) +odl_l3_agent: $getVar('odl_l3_agent', 'Disable') +onos_sfc: $getVar('onos_sfc', 'Disable') +onos_nic: $getVar('onos_nic', 'eth2') +odl_sfc: $getVar('odl_sfc', 'Disable') +ip_settings: $ip_settings +network_cfg: $network_cfg +sys_intf_mappings: $sys_intf_mappings +deploy_type: $getVar('deploy_type', 'virtual') + +public_cidr: $computers[0]['install']['subnet'] +storage_cidr: "{{ ip_settings[inventory_hostname]['storage']['cidr'] }}" +mgmt_cidr: "{{ ip_settings[inventory_hostname]['mgmt']['cidr'] }}" + +public_net_info: "{{ network_cfg.public_net_info }}" +host_ip_settings: "{{ ip_settings[inventory_hostname] }}" + +ntp_server: $ntp_server +internal_vip: + ip: $network_cfg["internal_vip"]["ip"] + netmask: $network_cfg["internal_vip"]["netmask"] +#if "vlan_tag" in $sys_intf_mappings[$network_cfg["internal_vip"]["interface"]] + interface: $sys_intf_mappings[$network_cfg["internal_vip"]["interface"]]["name"] +#else + interface: $sys_intf_mappings[$network_cfg["internal_vip"]["interface"]]["interface"] +#end if + +public_vip: + ip: $network_cfg["public_vip"]["ip"] + netmask: $network_cfg["public_vip"]["netmask"] +#if "vlan_tag" in $sys_intf_mappings[$network_cfg["public_vip"]["interface"]] + interface: $sys_intf_mappings[$network_cfg["public_vip"]["interface"]]["name"] +#else + interface: $sys_intf_mappings[$network_cfg["public_vip"]["interface"]]["interface"] +#end if + +db_host: "{{ internal_vip.ip }}" +rabbit_host: "{{ internal_vip.ip }}" + +internal_ip: "{{ ip_settings[inventory_hostname]['mgmt']['ip'] }}" +internal_nic: mgmt + +#set random_id = randint(1, 255) +vrouter_id_internal: $random_id +vrouter_id_public: $random_id + +identity_host: "{{ internal_ip }}" +controllers_host: "{{ internal_ip }}" +storage_controller_host: "{{ internal_ip }}" +compute_controller_host: "{{ internal_ip }}" +image_host: "{{ internal_ip }}" +network_server_host: "{{ internal_ip }}" +dashboard_host: "{{ internal_ip }}" + +haproxy_hosts: +#for $item in $has +#set $hostname=$item["hostname"] + $hostname: $ip_settings[$hostname]["mgmt"]["ip"] +#end for + +host_index: +#for $index, $item in enumerate($has) + $item["hostname"]: $index +#end for + +ERLANG_TOKEN: YOWSJSJIGGAUFZTIBRAD +#set credentials = $getVar('service_credentials', {}) +#set console_credentials = $getVar('console_credentials', {}) +#set rabbit_username = $credentials.rabbitmq.username +#set rabbit_password = $credentials.rabbitmq.password +#set keystone_dbpass = $credentials.identity.password +#set keystone_pass = $console_credentials.identity.password +#set glance_dbpass = $credentials.image.password +#set glance_pass = $console_credentials.image.password +#set nova_dbpass = $credentials.compute.password +#set nova_pass = $console_credentials.compute.password +#set dash_dbpass = $credentials.dashboard.password +#set cinder_dbpass = $credentials.volume.password +#set cinder_pass = $console_credentials.volume.password +#set heat_dbpass = $credentials.heat.password +#set heat_pass = $console_credentials.heat.password +#set neutron_dbpass = $credentials.network.password +#set neutron_pass = $console_credentials.network.password +#set ceilometer_dbpass = $credentials.metering.password +#set ceilometer_pass = $console_credentials.metering.password +#set aodh_dbpass = $credentials.alarming.password +#set aodh_pass = $console_credentials.alarming.password +#set admin_pass = $console_credentials.admin.password +#set demo_pass = $console_credentials.demo.password + +cluster_name: $cluster_name + +odl_controller: 10.1.0.15 + +DEBUG: true +VERBOSE: true +NTP_SERVER_LOCAL: "{{ controllers_host }}" +DB_HOST: "{{ db_host }}" +MQ_BROKER: rabbitmq + +OPENSTACK_REPO: cloudarchive-mitaka.list +mitaka_cloud_archive: deb http://ubuntu-cloud.archive.canonical.com/ubuntu trusty-updates/mitaka main +ADMIN_TOKEN: admin +CEILOMETER_TOKEN: c095d479023a0fd58a54 +erlang.cookie: DJJVECFMCJPVYQTJTDWG + +RABBIT_USER: $rabbit_username +RABBIT_PASS: $rabbit_password +KEYSTONE_DBPASS: $keystone_dbpass +KEYSTONE_PASS: $keystone_pass +CEILOMETER_DBPASS: $ceilometer_dbpass +CEILOMETER_PASS: $ceilometer_pass +AODH_DBPASS: $aodh_dbpass +AODH_PASS: $aodh_pass +GLANCE_DBPASS: $glance_dbpass +GLANCE_PASS: $glance_pass +NOVA_DBPASS: $nova_dbpass +NOVA_PASS: $nova_pass +DASH_DBPASS: $dash_dbpass +CINDER_DBPASS: $cinder_dbpass +CINDER_PASS: $cinder_pass +NEUTRON_DBPASS: $neutron_dbpass +NEUTRON_PASS: $neutron_pass +HEAT_DBPASS: $heat_dbpass +HEAT_PASS: $heat_pass +DEMO_PASS: $demo_pass +ADMIN_PASS: $admin_pass + +#set neutron_service_plugins=['router'] + +#if $getVar('enable_fwaas', True) +#neutron_service_plugins.append('firewall') +#end if + +#if $getVar('enable_vpnaas', True) +#neutron_service_plugins.append('vpnaas') +#end if + +NEUTRON_SERVICE_PLUGINS: $neutron_service_plugins +NEUTRON_TYPE_DRIVERS: ['flat', 'gre', 'vxlan', 'vlan'] +NEUTRON_TENANT_NETWORK_TYPES: ['$ovs_config["tenant_network_type"]'] +NEUTRON_OVS_BRIDGE_MAPPINGS: $ovs_config['bridge_mappings'] +#if 'vlan_ranges' in $ovs_config +NEUTRON_VLAN_RANGES: $ovs_config['vlan_ranges'] +#else +NEUTRON_VLAN_RANGES: [] +#end if +#if 'tunnel_id_ranges' in $ovs_config +NEUTRON_TUNNEL_ID_RANGES: $ovs_config['tunnel_id_ranges'] +#else +NEUTRON_TUNNEL_ID_RANGES: [] +#end if + +#NEUTRON_MECHANISM_DRIVERS: ['opendaylight'] +NEUTRON_MECHANISM_DRIVERS: ['openvswitch'] +NEUTRON_TUNNEL_TYPES: ['vxlan'] +METADATA_SECRET: metadata_secret +WSREP_SST_USER: wsrep_sst +WSREP_SST_PASS: wsrep_sst_sercet + +INSTANCE_TUNNELS_INTERFACE_IP_ADDRESS: "{{ internal_ip }}" + +#build_in_image: http://download.cirros-cloud.net/0.3.3/cirros-0.3.3-x86_64-disk.img +build_in_image: http://192.168.121.12:9999/img/cirros-0.3.3-x86_64-disk.img +build_in_image_name: cirros-0.3.3-x86_64-disk.img + +physical_device: /dev/sdb + +odl_username: admin +odl_password: admin +odl_api_port: 8080 + +odl_pkg_url: https://nexus.opendaylight.org/content/groups/public/org/opendaylight/integration/distribution-karaf/0.2.2-Helium-SR2/distribution-karaf-0.2.2-Helium-SR2.tar.gz +odl_pkg_name: karaf.tar.gz +odl_home: "/opt/opendaylight-0.2.2/" +odl_base_features: ['config', 'standard', 'region', 'package', 'kar', 'ssh', 'management', 'http', 'odl-base-all','odl-aaa-authn','odl-restconf','odl-nsf-all','odl-adsal-northbound','odl-mdsal-apidocs', 'odl-openflowplugin-all'] +odl_extra_features: ['odl-l2switch-switch', 'odl-ovsdb-plugin', 'odl-ovsdb-openstack', 'odl-ovsdb-northbound','odl-dlux-core', 'odl-restconf-all', 'odl-mdsal-clustering', 'odl-openflowplugin-flow-services', 'odl-netconf-connector', 'odl-netconf-connector-ssh', 'jolokia-osgi'] +odl_features: "{{ odl_base_features + odl_extra_features }}" +odl_api_port: 8080 +enable_ubuntu_theme: True diff --git a/conf/templates/ansible_installer/openstack_osp9/vars/allinone.tmpl b/conf/templates/ansible_installer/openstack_osp9/vars/allinone.tmpl new file mode 100644 index 00000000..b13973d7 --- /dev/null +++ b/conf/templates/ansible_installer/openstack_osp9/vars/allinone.tmpl @@ -0,0 +1,96 @@ +#set cluster_name = $getVar('name', '') +#set controllers = $getVar('allinone_compute', []) +#if not $isinstance($controllers, list) + #set controllers = [$controllers] +#end if + +#for controller in $controllers + #set controller_ip = $controller.management.ip + #set controller_hostname = $controller.hostname +controller_host: $controller_ip +#end for +#for network in $controllers + #set network_external_nic = $network.external.interface + #set network_external_subnet = $network.external.subnet + #set network_internal_nic = $network.management.interface +INTERFACE_NAME: $network_external_nic +INTERNAL_INTERFACE: $network_internal_nic +#end for + +#set credentials = $getVar('service_credentials', {}) +#set console_credentials = $getVar('console_credentials', {}) +#set rabbit_username = $credentials.rabbitmq.username +#set rabbit_password = $credentials.rabbitmq.password +#set keystone_dbpass = $credentials.identity.password +#set glance_dbpass = $credentials.image.password +#set glance_pass = $console_credentials.image.password +#set nova_dbpass = $credentials.compute.password +#set nova_pass = $console_credentials.compute.password +#set dash_dbpass = $credentials.dashboard.password +#set cinder_dbpass = $credentials.volume.password +#set cinder_pass = $console_credentials.volume.password +#set admin_pass = $console_credentials.admin.password +#set neutron_pass = $console_credentials.network.password + +compute_controller_host: "{{ controller_host }}" +db_host: "{{ controller_host }}" +rabbit_host: "{{ controller_host }}" +storage_controller_host: "{{ controller_host }}" +image_host: "{{ controller_host }}" +identity_host: "{{ controller_host }}" +network_server_host: "{{ controller_host }}" +dashboard_host: "{{ controller_host }}" + +cluster_name: $cluster_name +odl_controller: 10.1.0.15 + +DEBUG: true +VERBOSE: true +NTP_SERVER_LOCAL: "{{ controller_host }}" +DB_HOST: "{{ controller_host }}" +MQ_BROKER: rabbitmq + +OPENSTACK_REPO: cloudarchive-mitaka.list +mitaka_cloud_archive: deb http://ubuntu-cloud.archive.canonical.com/ubuntu trusty-updates/mitaka main +ADMIN_TOKEN: admin +CEILOMETER_TOKEN: c095d479023a0fd58a54 + +RABBIT_USER: $rabbit_username +RABBIT_PASS: $rabbit_password +KEYSTONE_DBPASS: $keystone_dbpass +DEMO_PASS: demo_secret +ADMIN_PASS: $admin_pass +GLANCE_DBPASS: $glance_dbpass +GLANCE_PASS: $glance_pass +NOVA_DBPASS: $nova_dbpass +NOVA_PASS: $nova_pass +DASH_DBPASS: $dash_dbpass +CINDER_DBPASS: $cinder_dbpass +CINDER_PASS: $cinder_pass +NEUTRON_DBPASS: $neutron_pass +NEUTRON_PASS: $neutron_pass +NEUTRON_TYPE_DRIVERS: ['flat', 'gre', 'vxlan'] +NEUTRON_TENANT_NETWORK_TYPES: ['vxlan'] +#NEUTRON_MECHANISM_DRIVERS: ['opendaylight'] +NEUTRON_MECHANISM_DRIVERS: ['openvswitch'] +NEUTRON_TUNNEL_TYPES: ['vxlan'] +METADATA_SECRET: metadata_secret +INSTANCE_TUNNELS_INTERFACE_IP_ADDRESS: 10.1.1.21 + +EXTERNAL_NETWORK_CIDR: 203.0.113.0/24 +EXTERNAL_NETWORK_GATEWAY: 203.0.113.1 +FLOATING_IP_START: 203.0.113.101 +FLOATING_IP_END: 203.0.113.200 + +build_in_image: http://download.cirros-cloud.net/0.3.3/cirros-0.3.3-x86_64-disk.img +build_in_image_name: cirros-0.3.3-x86_64-disk.img + +physical_device: /dev/sdb + +internal_interface: "ansible_{{ INTERNAL_INTERFACE }}" +internal_ip: "{{ hostvars[inventory_hostname][internal_interface]['ipv4']['address'] }}" +HA_VIP: "{{ internal_ip }}" + +odl_username: admin +odl_password: admin +odl_api_port: 8080 diff --git a/conf/templates/ansible_installer/openstack_osp9/vars/multinodes.tmpl b/conf/templates/ansible_installer/openstack_osp9/vars/multinodes.tmpl new file mode 100644 index 00000000..3828c0d6 --- /dev/null +++ b/conf/templates/ansible_installer/openstack_osp9/vars/multinodes.tmpl @@ -0,0 +1,165 @@ +#set cluster_name = $getVar('name', '') +#set compute_controllers = $getVar('compute_controller', []) +#set compute_workers = $getVar('compute_worker', []) +#set network_servers = $getVar('network_server', []) +#set network_workers = $getVar('network_worker', []) +#set databases = $getVar('database', []) +#set messagings = $getVar('messaging', []) +#set images = $getVar('image', []) +#set dashboards = $getVar('dashboard', []) +#set identities = $getVar('identity', []) +#set storage_controllers = $getVar('storage_controller', []) +#set storage_volumes = $getVar('storage_volume', []) +#if not $isinstance($compute_controllers, list) + #set compute_controllers = [$compute_controllers] +#end if +#if not $isinstance($compute_workers, list) + #set compute_workers = [$compute_workers] +#end if +#if not $isinstance($network_servers, list) + #set network_servers = [$network_servers] +#end if +#if not $isinstance($network_workers, list) + #set network_workers = [$network_workers] +#end if +#if not $isinstance($databases, list) + #set databases = [$databases] +#end if +#if not $isinstance($messagings, list) + #set messagings = [$messagings] +#end if +#if not $isinstance($images, list) + #set images = [$images] +#end if +#if not $isinstance($dashboards, list) + #set dashboards = [$dashboards] +#end if +#if not $isinstance($identities, list) + #set identities = [$identities] +#end if +#if not $isinstance($storage_controllers, list) + #set storage_controllers = [$storage_controllers] +#end if +#if not $isinstance($storage_volumes, list) + #set storage_volumes = [$storage_volumes] +#end if +#for worker in $compute_controllers + #set worker_ip = $worker.management.ip +compute_controller_host: $worker_ip +#end for +#for worker in $databases + #set worker_ip = $worker.management.ip +db_host: $worker_ip +#end for +#for worker in $messagings + #set worker_ip = $worker.management.ip +rabbit_host: $worker_ip +#end for +#for worker in $storage_controllers + #set worker_ip = $worker.management.ip +storage_controller_host: $worker_ip +#end for +#for worker in $images + #set worker_ip = $worker.management.ip +image_host: $worker_ip +#end for +#for worker in $identities + #set worker_ip = $worker.management.ip +identity_host: $worker_ip +#end for +#for worker in $compute_controllers + #set worker_ip = $worker.management.ip +compute_controller_host: $worker_ip +#end for +#for worker in $network_servers + #set worker_ip = $worker.management.ip +network_server_host: $worker_ip +#end for +#for worker in $dashboards + #set worker_ip = $worker.management.ip +dashboard_host: $worker_ip +#end for +#for network in $network_workers + #set network_external_nic = $network.external.interface + #set network_internal_nic = $network.management.interface +INTERFACE_NAME: $network_external_nic +INTERNAL_INTERFACE: $network_internal_nic +#end for + +#set credentials = $getVar('service_credentials', {}) +#set console_credentials = $getVar('console_credentials', {}) +#set rabbit_username = $credentials.rabbitmq.username +#set rabbit_password = $credentials.rabbitmq.password +#set keystone_dbpass = $credentials.identity.password +#set glance_dbpass = $credentials.image.password +#set glance_pass = $console_credentials.image.password +#set nova_dbpass = $credentials.compute.password +#set nova_pass = $console_credentials.compute.password +#set dash_dbpass = $credentials.dashboard.password +#set cinder_dbpass = $credentials.volume.password +#set cinder_pass = $console_credentials.volume.password +#set admin_pass = $console_credentials.admin.password +#set neutron_pass = $console_credentials.network.password + +cluster_name: $cluster_name + +odl_controller: 10.1.0.15 + +DEBUG: true +VERBOSE: true +NTP_SERVER_LOCAL: "{{ compute_controller_host }}" +DB_HOST: "{{ db_host }}" +MQ_BROKER: rabbitmq + +OPENSTACK_REPO: cloudarchive-mitaka.list +mitaka_cloud_archive: deb http://ubuntu-cloud.archive.canonical.com/ubuntu trusty-updates/mitaka main +ADMIN_TOKEN: admin +CEILOMETER_TOKEN: c095d479023a0fd58a54 + +RABBIT_USER: $rabbit_username +RABBIT_PASS: $rabbit_password +KEYSTONE_DBPASS: $keystone_dbpass +DEMO_PASS: demo_secret +ADMIN_PASS: $admin_pass +GLANCE_DBPASS: $glance_dbpass +GLANCE_PASS: $glance_pass +NOVA_DBPASS: $nova_dbpass +NOVA_PASS: $nova_pass +DASH_DBPASS: $dash_dbpass +CINDER_DBPASS: $cinder_dbpass +CINDER_PASS: $cinder_pass +NEUTRON_DBPASS: $neutron_pass +NEUTRON_PASS: $neutron_pass +NEUTRON_TYPE_DRIVERS: ['flat', 'gre', 'vxlan'] +NEUTRON_TENANT_NETWORK_TYPES: ['vxlan'] +#NEUTRON_MECHANISM_DRIVERS: ['opendaylight'] +NEUTRON_MECHANISM_DRIVERS: ['openvswitch'] +NEUTRON_TUNNEL_TYPES: ['vxlan'] +METADATA_SECRET: metadata_secret +INSTANCE_TUNNELS_INTERFACE_IP_ADDRESS: 10.1.1.21 + +EXTERNAL_NETWORK_CIDR: 203.0.113.0/24 +EXTERNAL_NETWORK_GATEWAY: 203.0.113.1 +FLOATING_IP_START: 203.0.113.101 +FLOATING_IP_END: 203.0.113.200 + +build_in_image: http://download.cirros-cloud.net/0.3.3/cirros-0.3.3-x86_64-disk.img +build_in_image_name: cirros-0.3.3-x86_64-disk.img + +physical_device: /dev/sdb + +internal_interface: "ansible_{{ INTERNAL_INTERFACE }}" +internal_ip: "{{ hostvars[inventory_hostname][internal_interface]['ipv4']['address'] }}" +HA_VIP: "{{ internal_ip }}" +odl_username: admin +odl_password: admin +odl_api_port: 8080 + +odl_pkg_url: https://nexus.opendaylight.org/content/groups/public/org/opendaylight/integration/distribution-karaf/0.2.2-Helium-SR2/distribution-karaf-0.2.2-Helium-SR2.tar.gz +odl_pkg_name: karaf.tar.gz +odl_home: "/opt/opendaylight-0.2.2/" +odl_base_features: ['config', 'standard', 'region', 'package', 'kar', 'ssh', 'management', 'http', 'odl-base-all','odl-aaa-authn','odl-restconf','odl-nsf-all','odl-adsal-northbound','odl-mdsal-apidocs', 'odl-openflowplugin-all'] +odl_extra_features: ['odl-l2switch-switch', 'odl-ovsdb-plugin', 'odl-ovsdb-openstack', 'odl-ovsdb-northbound','odl-dlux-core', 'odl-restconf-all', 'odl-mdsal-clustering', 'odl-openflowplugin-flow-services', 'odl-netconf-connector', 'odl-netconf-connector-ssh', 'jolokia-osgi'] +odl_features: "{{ odl_base_features + odl_extra_features }}" +odl_api_port: 8080 + diff --git a/conf/templates/ansible_installer/openstack_osp9/vars/single-controller.tmpl b/conf/templates/ansible_installer/openstack_osp9/vars/single-controller.tmpl new file mode 100644 index 00000000..99860224 --- /dev/null +++ b/conf/templates/ansible_installer/openstack_osp9/vars/single-controller.tmpl @@ -0,0 +1,108 @@ +#set cluster_name = $getVar('name', '') +#set controllers = $getVar('controller', []) +#set computes = $getVar('compute', []) +#set networks = $getVar('network', []) +#set storages = $getVar('storage', []) +#if not $isinstance($controllers, list) + #set controllers = [$controllers] +#end if +#if not $isinstance($computes, list) + #set computes = [$computes] +#end if +#if not $isinstance($networks, list) + #set networks = [$networks] +#end if +#if not $isinstance($storages, list) + #set storages = [$storages] +#end if + +#for controller in $controllers + #set controller_ip = $controller.management.ip + #set controller_hostname = $controller.hostname +controller_host: $controller_ip +#end for +#for network in $networks + #set network_external_nic = $network.external.interface + #set network_external_subnet = $network.external.subnet + #set network_internal_nic = $network.management.interface +INTERFACE_NAME: $network_external_nic +INTERNAL_INTERFACE: $network_internal_nic +#end for + +#set credentials = $getVar('service_credentials', {}) +#set console_credentials = $getVar('console_credentials', {}) +#set rabbit_username = $credentials.rabbitmq.username +#set rabbit_password = $credentials.rabbitmq.password +#set keystone_dbpass = $credentials.identity.password +#set glance_dbpass = $credentials.image.password +#set glance_pass = $console_credentials.image.password +#set nova_dbpass = $credentials.compute.password +#set nova_pass = $console_credentials.compute.password +#set dash_dbpass = $credentials.dashboard.password +#set cinder_dbpass = $credentials.volume.password +#set cinder_pass = $console_credentials.volume.password +#set admin_pass = $console_credentials.admin.password +#set neutron_pass = $console_credentials.network.password + +cluster_name: $cluster_name +deploy_type: $getVar('deploy_type', 'virtual') +compute_controller_host: "{{ controller_host }}" +db_host: "{{ controller_host }}" +rabbit_host: "{{ controller_host }}" +storage_controller_host: "{{ controller_host }}" +image_host: "{{ controller_host }}" +identity_host: "{{ controller_host }}" +network_server_host: "{{ controller_host }}" +dashboard_host: "{{ controller_host }}" +odl_controller: 10.1.0.15 + +DEBUG: true +VERBOSE: true +NTP_SERVER_LOCAL: "{{ controller_host }}" +DB_HOST: "{{ controller_host }}" +MQ_BROKER: rabbitmq + +OPENSTACK_REPO: cloudarchive-mitaka.list +mitaka_cloud_archive: deb http://ubuntu-cloud.archive.canonical.com/ubuntu trusty-updates/mitaka main +ADMIN_TOKEN: admin +CEILOMETER_TOKEN: c095d479023a0fd58a54 + +RABBIT_USER: $rabbit_username +RABBIT_PASS: $rabbit_password +KEYSTONE_DBPASS: $keystone_dbpass +DEMO_PASS: demo_secret +ADMIN_PASS: $admin_pass +GLANCE_DBPASS: $glance_dbpass +GLANCE_PASS: $glance_pass +NOVA_DBPASS: $nova_dbpass +NOVA_PASS: $nova_pass +DASH_DBPASS: $dash_dbpass +CINDER_DBPASS: $cinder_dbpass +CINDER_PASS: $cinder_pass +NEUTRON_DBPASS: $neutron_pass +NEUTRON_PASS: $neutron_pass +NEUTRON_TYPE_DRIVERS: ['flat', 'gre', 'vxlan'] +NEUTRON_TENANT_NETWORK_TYPES: ['vxlan'] +#NEUTRON_MECHANISM_DRIVERS: ['opendaylight'] +NEUTRON_MECHANISM_DRIVERS: ['openvswitch'] +NEUTRON_TUNNEL_TYPES: ['vxlan'] +METADATA_SECRET: metadata_secret +INSTANCE_TUNNELS_INTERFACE_IP_ADDRESS: 10.1.1.21 + +EXTERNAL_NETWORK_CIDR: 203.0.113.0/24 +# EXTERNAL_NETWORK_CIDR: $network_external_subnet +EXTERNAL_NETWORK_GATEWAY: 203.0.113.1 +FLOATING_IP_START: 203.0.113.101 +FLOATING_IP_END: 203.0.113.200 + +build_in_image: http://download.cirros-cloud.net/0.3.3/cirros-0.3.3-x86_64-disk.img +build_in_image_name: cirros-0.3.3-x86_64-disk.img + +physical_device: /dev/sdb + +internal_interface: "ansible_{{ INTERNAL_INTERFACE }}" +internal_ip: "{{ hostvars[inventory_hostname][internal_interface]['ipv4']['address'] }}" +HA_VIP: "{{ internal_ip }}" +odl_username: admin +odl_password: admin +odl_api_port: 8080 diff --git a/requirements.txt b/requirements.txt index d156c034..0c5d3748 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,7 +5,7 @@ Markdown<2.5 Cheetah<=2.4.1 daemon Flask -Flask-Login +Flask-Login<=0.3.2 Flask-RESTful Flask-Script Flask-SQLAlchemy From b24e35fa51bc188ca691cb78dc64ab019c700e44 Mon Sep 17 00:00:00 2001 From: Xicheng Chang Date: Thu, 8 Dec 2016 22:52:12 -0500 Subject: [PATCH 29/32] Seperate the case of using agent with local server from with c.stack360.io Change-Id: I648fcb19415494fff5564b9269b05e8cd2ff08e6 --- install/compass.sh | 5 +++++ install/install.conf | 2 ++ install/register.sh | 1 - 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/install/compass.sh b/install/compass.sh index 65373dbd..9fc0dd62 100755 --- a/install/compass.sh +++ b/install/compass.sh @@ -95,6 +95,8 @@ domains=$(echo $NAMESERVER_DOMAINS | sed "s/,/','/g") sudo sed -i "s/\$domains/$domains/g" /etc/compass/setting if [ "$FULL_COMPASS_SERVER" == "true" ]; then sudo sed -i "/DATABASE_SERVER =/c\DATABASE_SERVER = '127.0.0.1:3306'" /etc/compass/setting +else + sudo sed -i "/DATABASE_SERVER =/c\DATABASE_SERVER = '\$COMPASS_API_SERVER:3306'" /etc/compass/setting fi sudo sed -i "s/\$cobbler_ip/$IPADDR/g" /etc/compass/os_installer/cobbler.conf @@ -130,6 +132,9 @@ else fi if [ "$FULL_COMPASS_SERVER" == "true" ]; then sudo mv /etc/compass/celeryconfig_local /etc/compass/celeryconfig +elif [ "$COMPASS_API_SERVER" != "c.stack360.io" ];then + sudo mv /etc/compass/celeryconfig_local /etc/compass/celeryconfig + sudo sed -i "s/localhost/\$COMPASS_API_SERVER/g" /etc/compass/celeryconfig else sudo mv /etc/compass/celeryconfig_remote /etc/compass/celeryconfig wget -O /tmp/aws_credentials "http://www.stack360.io/aws_credentials" diff --git a/install/install.conf b/install/install.conf index 41e672c3..c8f34c65 100755 --- a/install/install.conf +++ b/install/install.conf @@ -7,6 +7,8 @@ export FULL_COMPASS_SERVER="true" export USER_EMAIL="test@huawei.com" # User Password export USER_PASSWORD= +# Compass Server Address, required if installing agent +export COMPASS_API_SERVER="c.stack360.io" # OS_INSTALLER indicates the tool for OS provisioning, default is 'cobbler'. export OS_INSTALLER="cobbler" diff --git a/install/register.sh b/install/register.sh index 0846597b..5d4f12e8 100755 --- a/install/register.sh +++ b/install/register.sh @@ -8,7 +8,6 @@ echo "The email address you use to register is ${USER_EMAIL}" password=`< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c6` USER_PASSWORD="${USER_PASSWORD:-$password}" data=`echo "{\"email\":\"${USER_EMAIL}\",\"password\":\"${USER_PASSWORD}\"}"` -COMPASS_API_SERVER="c.stack360.io" if [ "$FULL_COMPASS_SERVER" == "true" ]; then COMPASS_API_SERVER="127.0.0.1" fi From f51d0b14240125362096cc789776075988ca7b83 Mon Sep 17 00:00:00 2001 From: Xicheng Chang Date: Wed, 21 Dec 2016 18:05:07 -0800 Subject: [PATCH 30/32] Purge xenial related files since it does not follow valid file structure. All os support should be included in different releases of OpenStack. We do not explicitly show an OS type in adapters. Change-Id: Idac20aac2cd5e6cd90d20414467fb8191f7fb1a7 --- .../ansible_openstack_mitaka_xenial.conf | 7 - .../ansible_openstack_newton_xenial.conf | 7 - conf/flavor/openstack_mitaka_xenial.conf | 32 --- conf/flavor/openstack_newton_xenial.conf | 32 --- .../role/openstack_mitaka_xenial_ansible.conf | 115 ---------- .../role/openstack_newton_xenial_ansible.conf | 115 ---------- .../ansible_cfg/HA-ansible-multinodes.tmpl | 7 - .../ansible_cfg/allinone.tmpl | 6 - .../ansible_cfg/multinodes.tmpl | 6 - .../ansible_cfg/single-controller.tmpl | 6 - .../hosts/HA-ansible-multinodes.tmpl | 31 --- .../hosts/allinone.tmpl | 10 - .../hosts/multinodes.tmpl | 110 --------- .../hosts/single-controller.tmpl | 40 ---- .../inventories/HA-ansible-multinodes.tmpl | 100 --------- .../inventories/allinone.tmpl | 47 ---- .../inventories/multinodes.tmpl | 123 ----------- .../inventories/single-controller.tmpl | 67 ------ .../vars/HA-ansible-multinodes.tmpl | 208 ------------------ .../vars/allinone.tmpl | 96 -------- .../vars/multinodes.tmpl | 165 -------------- .../vars/single-controller.tmpl | 108 --------- 22 files changed, 1438 deletions(-) delete mode 100644 conf/adapter/ansible_openstack_mitaka_xenial.conf delete mode 100644 conf/adapter/ansible_openstack_newton_xenial.conf delete mode 100644 conf/flavor/openstack_mitaka_xenial.conf delete mode 100644 conf/flavor/openstack_newton_xenial.conf delete mode 100644 conf/role/openstack_mitaka_xenial_ansible.conf delete mode 100644 conf/role/openstack_newton_xenial_ansible.conf delete mode 100644 conf/templates/ansible_installer/openstack_newton_xenial/ansible_cfg/HA-ansible-multinodes.tmpl delete mode 100644 conf/templates/ansible_installer/openstack_newton_xenial/ansible_cfg/allinone.tmpl delete mode 100644 conf/templates/ansible_installer/openstack_newton_xenial/ansible_cfg/multinodes.tmpl delete mode 100644 conf/templates/ansible_installer/openstack_newton_xenial/ansible_cfg/single-controller.tmpl delete mode 100644 conf/templates/ansible_installer/openstack_newton_xenial/hosts/HA-ansible-multinodes.tmpl delete mode 100644 conf/templates/ansible_installer/openstack_newton_xenial/hosts/allinone.tmpl delete mode 100644 conf/templates/ansible_installer/openstack_newton_xenial/hosts/multinodes.tmpl delete mode 100644 conf/templates/ansible_installer/openstack_newton_xenial/hosts/single-controller.tmpl delete mode 100644 conf/templates/ansible_installer/openstack_newton_xenial/inventories/HA-ansible-multinodes.tmpl delete mode 100644 conf/templates/ansible_installer/openstack_newton_xenial/inventories/allinone.tmpl delete mode 100644 conf/templates/ansible_installer/openstack_newton_xenial/inventories/multinodes.tmpl delete mode 100644 conf/templates/ansible_installer/openstack_newton_xenial/inventories/single-controller.tmpl delete mode 100644 conf/templates/ansible_installer/openstack_newton_xenial/vars/HA-ansible-multinodes.tmpl delete mode 100644 conf/templates/ansible_installer/openstack_newton_xenial/vars/allinone.tmpl delete mode 100644 conf/templates/ansible_installer/openstack_newton_xenial/vars/multinodes.tmpl delete mode 100644 conf/templates/ansible_installer/openstack_newton_xenial/vars/single-controller.tmpl diff --git a/conf/adapter/ansible_openstack_mitaka_xenial.conf b/conf/adapter/ansible_openstack_mitaka_xenial.conf deleted file mode 100644 index 691ce930..00000000 --- a/conf/adapter/ansible_openstack_mitaka_xenial.conf +++ /dev/null @@ -1,7 +0,0 @@ -NAME = 'openstack_mitaka_xenial' -DISPLAY_NAME = 'Openstack Mitaka Xenial' -PARENT = 'openstack' -PACKAGE_INSTALLER = 'ansible_installer_mitaka_xenial' -OS_INSTALLER = 'cobbler' -SUPPORTED_OS_PATTERNS = ['(?i)ubuntu-14\.04.*', '(?i)ubuntu-14\.04\.3.*', '(?i)ubuntu-16\.04', '(?i)CentOS-7.*15.*'] -DEPLOYABLE = True diff --git a/conf/adapter/ansible_openstack_newton_xenial.conf b/conf/adapter/ansible_openstack_newton_xenial.conf deleted file mode 100644 index cd8d2deb..00000000 --- a/conf/adapter/ansible_openstack_newton_xenial.conf +++ /dev/null @@ -1,7 +0,0 @@ -NAME = 'openstack_newton_xenial' -DISPLAY_NAME = 'Openstack Mitaka Xenial' -PARENT = 'openstack' -PACKAGE_INSTALLER = 'ansible_installer_newton_xenial' -OS_INSTALLER = 'cobbler' -SUPPORTED_OS_PATTERNS = ['(?i)ubuntu-14\.04.*', '(?i)ubuntu-14\.04\.3.*', '(?i)ubuntu-16\.04', '(?i)CentOS-7.*15.*'] -DEPLOYABLE = True diff --git a/conf/flavor/openstack_mitaka_xenial.conf b/conf/flavor/openstack_mitaka_xenial.conf deleted file mode 100644 index 9f3bf0f4..00000000 --- a/conf/flavor/openstack_mitaka_xenial.conf +++ /dev/null @@ -1,32 +0,0 @@ -ADAPTER_NAME = 'openstack_mitaka_xenial' -FLAVORS = [{ - 'flavor': 'allinone', - 'display_name': 'All-In-One', - 'template': 'allinone.tmpl', - 'roles': ['allinone-compute'], -}, { - 'flavor': 'single-controller', - 'display_name': 'Single Controller', - 'template': 'single-controller.tmpl', - 'roles': [ - 'controller', 'compute', 'network', 'storage', 'odl', 'onos' - ], -}, { - 'flavor': 'multinodes', - 'display_name': 'Multi-nodes', - 'template': 'multinodes.tmpl', - 'roles': [ - 'compute-controller', 'compute-worker', 'network-server', - 'network-worker', 'database', 'messaging', 'image', 'odl', - 'dashboard', 'identity', 'storage-controller', 'storage-volume' - ], -}, { - 'flavor': 'HA-ansible-multinodes-mitaka_xenial', - 'display_name': 'HA-ansible-multinodes-mitaka_xenial', - 'template': 'HA-ansible-multinodes.tmpl', - 'roles': [ - 'controller', 'compute', 'ha', 'odl', 'onos', 'opencontrail', 'ceph', 'ceph-adm', 'ceph-mon', 'ceph-osd', 'sec-patch', 'ceph-osd-node' - ], -}] - - diff --git a/conf/flavor/openstack_newton_xenial.conf b/conf/flavor/openstack_newton_xenial.conf deleted file mode 100644 index 3566acee..00000000 --- a/conf/flavor/openstack_newton_xenial.conf +++ /dev/null @@ -1,32 +0,0 @@ -ADAPTER_NAME = 'openstack_newton_xenial' -FLAVORS = [{ - 'flavor': 'allinone', - 'display_name': 'All-In-One', - 'template': 'allinone.tmpl', - 'roles': ['allinone-compute'], -}, { - 'flavor': 'single-controller', - 'display_name': 'Single Controller', - 'template': 'single-controller.tmpl', - 'roles': [ - 'controller', 'compute', 'network', 'storage', 'odl', 'onos' - ], -}, { - 'flavor': 'multinodes', - 'display_name': 'Multi-nodes', - 'template': 'multinodes.tmpl', - 'roles': [ - 'compute-controller', 'compute-worker', 'network-server', - 'network-worker', 'database', 'messaging', 'image', 'odl', - 'dashboard', 'identity', 'storage-controller', 'storage-volume' - ], -}, { - 'flavor': 'HA-ansible-multinodes-newton_xenial', - 'display_name': 'HA-ansible-multinodes-newton_xenial', - 'template': 'HA-ansible-multinodes.tmpl', - 'roles': [ - 'controller', 'compute', 'ha', 'odl', 'onos', 'opencontrail', 'ceph', 'ceph-adm', 'ceph-mon', 'ceph-osd', 'sec-patch', 'ceph-osd-node' - ], -}] - - diff --git a/conf/role/openstack_mitaka_xenial_ansible.conf b/conf/role/openstack_mitaka_xenial_ansible.conf deleted file mode 100644 index 3448eb75..00000000 --- a/conf/role/openstack_mitaka_xenial_ansible.conf +++ /dev/null @@ -1,115 +0,0 @@ -ADAPTER_NAME = 'openstack_mitaka_xenial' -ROLES = [{ - 'role': 'allinone-compute', - 'display_name': 'all in one', - 'description': 'All in One' -}, { - 'role': 'controller', - 'display_name': 'controller node', - 'description': 'Controller Node' -}, { - 'role': 'compute', - 'display_name': 'compute node', - 'description': 'Compute Node' -}, { - 'role': 'storage', - 'display_name': 'storage node', - 'description': 'Storage Node' -}, { - 'role': 'network', - 'display_name': 'network node', - 'description': 'Network Node' -}, { - 'role': 'compute-worker', - 'display_name': 'Compute worker node', - 'description': 'Compute worker node' -}, { - 'role': 'compute-controller', - 'display_name': 'Compute controller node', - 'description': 'Compute controller node' -}, { - 'role': 'network-server', - 'display_name': 'Network server node', - 'description': 'Network server node' -}, { - 'role': 'database', - 'display_name': 'Database node', - 'description': 'Database node' -}, { - 'role': 'messaging', - 'display_name': 'Messaging queue node', - 'description': 'Messaging queue node' -}, { - 'role': 'image', - 'display': 'Image node', - 'description': 'Image node' -}, { - 'role': 'dashboard', - 'display': 'Dashboard node', - 'description': 'Dashboard node' -}, { - 'role': 'identity', - 'display': 'Identity node', - 'description': 'Identity node' -}, { - 'role': 'storage-controller', - 'display': 'Storage controller node', - 'description': 'Storage controller node' -}, { - 'role': 'storage-volume', - 'display': 'Storage volume node', - 'description': 'Storage volume node' -}, { - 'role': 'network-worker', - 'display': 'Network worker node', - 'description': 'Network worker node' -}, { - 'role': 'odl', - 'display': 'open day light', - 'description': 'odl node', - 'optional': True -}, { - 'role': 'onos', - 'display': 'open network operating system', - 'description': 'onos node', - 'optional': True -}, { - 'role': 'opencontrail', - 'display': 'open contrail', - 'description': 'opencontrail node', - 'optional': True -}, { - 'role': 'ha', - 'display': 'Cluster with HA', - 'description': 'Cluster with HA node' -}, { - 'role': 'ceph-adm', - 'display': 'Ceph Admin Node', - 'description': 'Ceph Admin Node', - 'optional': True -}, { - 'role': 'ceph-mon', - 'display': 'Ceph Monitor Node', - 'description': 'Ceph Monitor Node', - 'optional': True -}, { - 'role': 'ceph-osd', - 'display': 'Ceph Storage Node', - 'description': 'Ceph Storage Node', - 'optional': True -}, { - 'role': 'ceph-osd-node', - 'display': 'Ceph osd install from node', - 'description': '', - 'optional': True -}, { - 'role': 'ceph', - 'display': 'ceph node', - 'description': 'ceph node', - 'optional': True -}, { - 'role': 'sec-patch', - 'display': 'sec-patch node', - 'description': 'Security Patch Node', - 'optional': True -}] diff --git a/conf/role/openstack_newton_xenial_ansible.conf b/conf/role/openstack_newton_xenial_ansible.conf deleted file mode 100644 index 385f025f..00000000 --- a/conf/role/openstack_newton_xenial_ansible.conf +++ /dev/null @@ -1,115 +0,0 @@ -ADAPTER_NAME = 'openstack_newton_xenial' -ROLES = [{ - 'role': 'allinone-compute', - 'display_name': 'all in one', - 'description': 'All in One' -}, { - 'role': 'controller', - 'display_name': 'controller node', - 'description': 'Controller Node' -}, { - 'role': 'compute', - 'display_name': 'compute node', - 'description': 'Compute Node' -}, { - 'role': 'storage', - 'display_name': 'storage node', - 'description': 'Storage Node' -}, { - 'role': 'network', - 'display_name': 'network node', - 'description': 'Network Node' -}, { - 'role': 'compute-worker', - 'display_name': 'Compute worker node', - 'description': 'Compute worker node' -}, { - 'role': 'compute-controller', - 'display_name': 'Compute controller node', - 'description': 'Compute controller node' -}, { - 'role': 'network-server', - 'display_name': 'Network server node', - 'description': 'Network server node' -}, { - 'role': 'database', - 'display_name': 'Database node', - 'description': 'Database node' -}, { - 'role': 'messaging', - 'display_name': 'Messaging queue node', - 'description': 'Messaging queue node' -}, { - 'role': 'image', - 'display': 'Image node', - 'description': 'Image node' -}, { - 'role': 'dashboard', - 'display': 'Dashboard node', - 'description': 'Dashboard node' -}, { - 'role': 'identity', - 'display': 'Identity node', - 'description': 'Identity node' -}, { - 'role': 'storage-controller', - 'display': 'Storage controller node', - 'description': 'Storage controller node' -}, { - 'role': 'storage-volume', - 'display': 'Storage volume node', - 'description': 'Storage volume node' -}, { - 'role': 'network-worker', - 'display': 'Network worker node', - 'description': 'Network worker node' -}, { - 'role': 'odl', - 'display': 'open day light', - 'description': 'odl node', - 'optional': True -}, { - 'role': 'onos', - 'display': 'open network operating system', - 'description': 'onos node', - 'optional': True -}, { - 'role': 'opencontrail', - 'display': 'open contrail', - 'description': 'opencontrail node', - 'optional': True -}, { - 'role': 'ha', - 'display': 'Cluster with HA', - 'description': 'Cluster with HA node' -}, { - 'role': 'ceph-adm', - 'display': 'Ceph Admin Node', - 'description': 'Ceph Admin Node', - 'optional': True -}, { - 'role': 'ceph-mon', - 'display': 'Ceph Monitor Node', - 'description': 'Ceph Monitor Node', - 'optional': True -}, { - 'role': 'ceph-osd', - 'display': 'Ceph Storage Node', - 'description': 'Ceph Storage Node', - 'optional': True -}, { - 'role': 'ceph-osd-node', - 'display': 'Ceph osd install from node', - 'description': '', - 'optional': True -}, { - 'role': 'ceph', - 'display': 'ceph node', - 'description': 'ceph node', - 'optional': True -}, { - 'role': 'sec-patch', - 'display': 'sec-patch node', - 'description': 'Security Patch Node', - 'optional': True -}] diff --git a/conf/templates/ansible_installer/openstack_newton_xenial/ansible_cfg/HA-ansible-multinodes.tmpl b/conf/templates/ansible_installer/openstack_newton_xenial/ansible_cfg/HA-ansible-multinodes.tmpl deleted file mode 100644 index aece7ae3..00000000 --- a/conf/templates/ansible_installer/openstack_newton_xenial/ansible_cfg/HA-ansible-multinodes.tmpl +++ /dev/null @@ -1,7 +0,0 @@ -#set cluster_name = $getVar('name', '') -[defaults] -log_path = /var/ansible/run/openstack_newton_xenial-$cluster_name/ansible.log -host_key_checking = False -callback_plugins = /opt/compass/bin/ansible_callbacks -pipelining=True -library = /opt/openstack-ansible-modules diff --git a/conf/templates/ansible_installer/openstack_newton_xenial/ansible_cfg/allinone.tmpl b/conf/templates/ansible_installer/openstack_newton_xenial/ansible_cfg/allinone.tmpl deleted file mode 100644 index 82657135..00000000 --- a/conf/templates/ansible_installer/openstack_newton_xenial/ansible_cfg/allinone.tmpl +++ /dev/null @@ -1,6 +0,0 @@ -#set cluster_name = $getVar('name', '') -[defaults] -log_path = /var/ansible/run/openstack_newton_xenial-$cluster_name/ansible.log -host_key_checking = False -callback_plugins = /opt/compass/bin/ansible_callbacks -pipelining=True diff --git a/conf/templates/ansible_installer/openstack_newton_xenial/ansible_cfg/multinodes.tmpl b/conf/templates/ansible_installer/openstack_newton_xenial/ansible_cfg/multinodes.tmpl deleted file mode 100644 index 82657135..00000000 --- a/conf/templates/ansible_installer/openstack_newton_xenial/ansible_cfg/multinodes.tmpl +++ /dev/null @@ -1,6 +0,0 @@ -#set cluster_name = $getVar('name', '') -[defaults] -log_path = /var/ansible/run/openstack_newton_xenial-$cluster_name/ansible.log -host_key_checking = False -callback_plugins = /opt/compass/bin/ansible_callbacks -pipelining=True diff --git a/conf/templates/ansible_installer/openstack_newton_xenial/ansible_cfg/single-controller.tmpl b/conf/templates/ansible_installer/openstack_newton_xenial/ansible_cfg/single-controller.tmpl deleted file mode 100644 index 82657135..00000000 --- a/conf/templates/ansible_installer/openstack_newton_xenial/ansible_cfg/single-controller.tmpl +++ /dev/null @@ -1,6 +0,0 @@ -#set cluster_name = $getVar('name', '') -[defaults] -log_path = /var/ansible/run/openstack_newton_xenial-$cluster_name/ansible.log -host_key_checking = False -callback_plugins = /opt/compass/bin/ansible_callbacks -pipelining=True diff --git a/conf/templates/ansible_installer/openstack_newton_xenial/hosts/HA-ansible-multinodes.tmpl b/conf/templates/ansible_installer/openstack_newton_xenial/hosts/HA-ansible-multinodes.tmpl deleted file mode 100644 index 9d628b5e..00000000 --- a/conf/templates/ansible_installer/openstack_newton_xenial/hosts/HA-ansible-multinodes.tmpl +++ /dev/null @@ -1,31 +0,0 @@ -#set ip_settings={} -#for k,v in $getVar('ip_settings', {}).items() -#set host_ip_settings={} -#for intf in v -#set $host_ip_settings[$intf["alias"]]=intf -#end for -#set $ip_settings[$k]=$host_ip_settings -#end for - -# localhost -127.0.0.1 localhost -#set controllers = $getVar('controller', []) -#set computes = $getVar('compute', []) -#if not $isinstance($controllers, list) - #set controllers = [$controllers] -#end if -#if not $isinstance($compute, list) - #set computes = [$computes] -#end if -# controller -#for worker in $controllers - #set worker_hostname = $worker.hostname - #set worker_ip = $ip_settings[$worker_hostname].mgmt.ip -$worker_ip $worker_hostname -#end for -# compute -#for worker in $computes - #set worker_hostname = $worker.hostname - #set worker_ip = $ip_settings[$worker_hostname].mgmt.ip -$worker_ip $worker_hostname -#end for diff --git a/conf/templates/ansible_installer/openstack_newton_xenial/hosts/allinone.tmpl b/conf/templates/ansible_installer/openstack_newton_xenial/hosts/allinone.tmpl deleted file mode 100644 index b777815e..00000000 --- a/conf/templates/ansible_installer/openstack_newton_xenial/hosts/allinone.tmpl +++ /dev/null @@ -1,10 +0,0 @@ -#set controllers = $getVar('allinone_compute', []) -#if not $isinstance($controllers, list) - #set controllers = [$controllers] -#end if -# allinone -#for controller in $controllers - #set controller_ip = $controller.management.ip - #set controller_hostname = $controller.hostname -$controller_ip $controller_hostname -#end for diff --git a/conf/templates/ansible_installer/openstack_newton_xenial/hosts/multinodes.tmpl b/conf/templates/ansible_installer/openstack_newton_xenial/hosts/multinodes.tmpl deleted file mode 100644 index ca8c793f..00000000 --- a/conf/templates/ansible_installer/openstack_newton_xenial/hosts/multinodes.tmpl +++ /dev/null @@ -1,110 +0,0 @@ -#set compute_controllers = $getVar('compute_controller', []) -#set compute_workers = $getVar('compute_worker', []) -#set network_servers = $getVar('network_server', []) -#set network_workers = $getVar('network_worker', []) -#set databases = $getVar('database', []) -#set messagings = $getVar('messaging', []) -#set images = $getVar('image', []) -#set dashboards = $getVar('dashboard', []) -#set identities = $getVar('identity', []) -#set storage_controllers = $getVar('storage_controller', []) -#set storage_volumes = $getVar('storage_volume', []) -#if not $isinstance($compute_controllers, list) - #set compute_controllers = [$compute_controllers] -#end if -#if not $isinstance($compute_workers, list) - #set compute_workers = [$compute_workers] -#end if -#if not $isinstance($network_servers, list) - #set network_servers = [$network_servers] -#end if -#if not $isinstance($network_workers, list) - #set network_workers = [$network_workers] -#end if -#if not $isinstance($databases, list) - #set databases = [$databases] -#end if -#if not $isinstance($messagings, list) - #set messagings = [$messagings] -#end if -#if not $isinstance($images, list) - #set images = [$images] -#end if -#if not $isinstance($dashboards, list) - #set dashboards = [$dashboards] -#end if -#if not $isinstance($identities, list) - #set identities = [$identities] -#end if -#if not $isinstance($storage_controllers, list) - #set storage_controllers = [$storage_controllers] -#end if -#if not $isinstance($storage_volumes, list) - #set storage_volumes = [$storage_volumes] -#end if -# compute-controller -#for worker in $compute_controllers - #set worker_ip = $worker.management.ip - #set worker_hostname = $worker.hostname -$worker_ip $worker_hostname -#end for -# database -#for worker in $databases - #set worker_ip = $worker.management.ip - #set worker_hostname = $worker.hostname -$worker_ip $worker_hostname -#end for -# messaging -#for worker in $messagings - #set worker_ip = $worker.management.ip - #set worker_hostname = $worker.hostname -$worker_ip $worker_hostname -#end for -# storage-controller -#for worker in $storage_controllers - #set worker_ip = $worker.management.ip - #set worker_hostname = $worker.hostname -$worker_ip $worker_hostname -#end for -# image -#for worker in $images - #set worker_ip = $worker.management.ip - #set worker_hostname = $worker.hostname -$worker_ip $worker_hostname -#end for -# identity -#for worker in $identities - #set worker_ip = $worker.management.ip - #set worker_hostname = $worker.hostname -$worker_ip $worker_hostname -#end for -# network-server -#for worker in $network_servers - #set worker_ip = $worker.management.ip - #set worker_hostname = $worker.hostname -$worker_ip $worker_hostname -#end for -# dashboard -#for worker in $dashboards - #set worker_ip = $worker.management.ip - #set worker_hostname = $worker.hostname -$worker_ip $worker_hostname -#end for -# storage-volume -#for worker in $storage_volumes - #set worker_ip = $worker.management.ip - #set worker_hostname = $worker.hostname -$worker_ip $worker_hostname -#end for -# network-worker -#for worker in $network_workers - #set worker_ip = $worker.management.ip - #set worker_hostname = $worker.hostname -$worker_ip $worker_hostname -#end for -# compute-worker -#for worker in $compute_workers - #set worker_ip = $worker.management.ip - #set worker_hostname = $worker.hostname -$worker_ip $worker_hostname -#end for diff --git a/conf/templates/ansible_installer/openstack_newton_xenial/hosts/single-controller.tmpl b/conf/templates/ansible_installer/openstack_newton_xenial/hosts/single-controller.tmpl deleted file mode 100644 index 3ed94694..00000000 --- a/conf/templates/ansible_installer/openstack_newton_xenial/hosts/single-controller.tmpl +++ /dev/null @@ -1,40 +0,0 @@ -#set controllers = $getVar('controller', []) -#set computes = $getVar('compute', []) -#set storages = $getVar('storage', []) -#set networks = $getVar('network', []) -#if not $isinstance($controllers, list) - #set controllers = [$controllers] -#end if -#if not $isinstance($computes, list) - #set computes = [$computes] -#end if -#if not $isinstance($storages, list) - #set storages = [$storages] -#end if -#if not $isinstance($networks, list) - #set networks = [$networks] -#end if -# controller -#for controller in $controllers - #set controller_ip = $controller.management.ip - #set controller_hostname = $controller.hostname -$controller_ip $controller_hostname -#end for -# compute -#for worker in $computes - #set worker_ip = $worker.management.ip - #set worker_hostname = $worker.hostname -$worker_ip $worker_hostname -#end for -# storage -#for worker in $storages - #set worker_ip = $worker.management.ip - #set worker_hostname = $worker.hostname -$worker_ip $worker_hostname -#end for -# network -#for worker in $networks - #set worker_ip = $worker.management.ip - #set worker_hostname = $worker.hostname -$worker_ip $worker_hostname -#end for diff --git a/conf/templates/ansible_installer/openstack_newton_xenial/inventories/HA-ansible-multinodes.tmpl b/conf/templates/ansible_installer/openstack_newton_xenial/inventories/HA-ansible-multinodes.tmpl deleted file mode 100644 index 94a6a153..00000000 --- a/conf/templates/ansible_installer/openstack_newton_xenial/inventories/HA-ansible-multinodes.tmpl +++ /dev/null @@ -1,100 +0,0 @@ -#set controllers = $getVar('controller', []) -#set computes = $getVar('compute', []) -#set has = $getVar('ha', []) -#set odls = $getVar('odl', []) -#set onoss = $getVar('onos', []) -#set opencontrails = $getVar('opencontrail', []) -#set ceph_adm_list = $getVar('ceph_adm',[]) -#set ceph_mon_list = $getVar('ceph_mon',[]) -#set ceph_osd_list = $getVar('ceph_osd',[]) - -#if not $isinstance($controllers, list) - #set controllers = [$controllers] -#end if -#if not $isinstance($computes, list) - #set computes = [$computes] -#end if -#if not $isinstance(has, list) - #set has = [has] -#end if -#if not $isinstance(odls, list) - #set odls = [odls] -#end if -#if not $isinstance(onoss, list) - #set onoss = [onoss] -#end if -#if not $isinstance(opencontrails, list) - #set opencontrails = [opencontrails] -#end if -#if not $isinstance(ceph_adm_list, list) - #set ceph_adm_list = [ceph_adm_list] -#end if -#if not $isinstance(ceph_mon_list, list) - #set ceph_mon_list = [ceph_mon_list] -#end if -#if not $isinstance(ceph_osd_list, list) - #set ceph_osd_list = [ceph_osd_list] -#end if - -#set credentials = $getVar('server_credentials', {}) -#set username = $credentials.get('username', 'root') -#set password = $credentials.get('password', 'root') -[controller] -#for controller in $controllers - #set controller_ip = $controller.install.ip - #set controller_hostname = $controller.hostname -$controller_hostname ansible_ssh_host=$controller_ip ansible_ssh_user=$username ansible_ssh_password=$password -#end for -[compute] -#for compute in $computes - #set compute_ip = $compute.install.ip - #set compute_hostname = $compute.hostname -$compute_hostname ansible_ssh_host=$compute_ip ansible_ssh_user=$username ansible_ssh_password=$password -#end for -[ha] -#for ha in $has - #set ha_ip = $ha.install.ip - #set ha_hostname = $ha.hostname -$ha_hostname ansible_ssh_host=$ha_ip ansible_ssh_user=$username ansible_ssh_password=$password -#end for -[odl] -#for odl in $odls - #set odl_ip = $odl.install.ip - #set odl_hostname = $odl.hostname -$odl_hostname ansible_ssh_host=$odl_ip ansible_ssh_user=$username ansible_ssh_password=$password -#end for -[onos] -#for onos in $onoss - #set onos_ip = $onos.install.ip - #set onos_hostname = $onos.hostname -$onos_hostname ansible_ssh_host=$onos_ip ansible_ssh_user=$username ansible_ssh_password=$password -#end for -[opencontrail] -#for opencontrail in $opencontrails - #set opencontrail_ip = $opencontrail.install.ip - #set opencontrail_hostname = $opencontrail.hostname -$opencontrail_hostname ansible_ssh_host=$opencontrail_ip ansible_ssh_user=$username ansible_ssh_password=$password -#end for -[ceph_adm] -#for ceph_adm in $ceph_adm_list - #set ceph_adm_ip = $ceph_adm.install.ip - #set ceph_adm_hostname = $ceph_adm.hostname -$ceph_adm_hostname ansible_ssh_host=$ceph_adm_ip ansible_ssh_user=$username ansible_ssh_password=$password -#end for -[ceph_mon] -#for ceph_mon in $ceph_mon_list - #set ceph_mon_ip = $ceph_mon.install.ip - #set ceph_mon_hostname = $ceph_mon.hostname -$ceph_mon_hostname ansible_ssh_host=$ceph_mon_ip ansible_ssh_user=$username ansible_ssh_password=$password -#end for -[ceph_osd] -#for ceph_osd in $ceph_osd_list - #set ceph_osd_ip = $ceph_osd.install.ip - #set ceph_osd_hostname = $ceph_osd.hostname -$ceph_osd_hostname ansible_ssh_host=$ceph_osd_ip ansible_ssh_user=$username ansible_ssh_password=$password -#end for -[ceph:children] -ceph_adm -ceph_mon -ceph_osd - diff --git a/conf/templates/ansible_installer/openstack_newton_xenial/inventories/allinone.tmpl b/conf/templates/ansible_installer/openstack_newton_xenial/inventories/allinone.tmpl deleted file mode 100644 index 38e0038b..00000000 --- a/conf/templates/ansible_installer/openstack_newton_xenial/inventories/allinone.tmpl +++ /dev/null @@ -1,47 +0,0 @@ -#set controllers = $getVar('allinone_compute', []) -#set computes = $getVar('allinone_compute', []) -#set storages = $getVar('allinone_compute', []) -#set networks = $getVar('allinone_compute', []) -#if not $isinstance($controllers, list) - #set controllers = [$controllers] -#end if -#if not $isinstance($computes, list) - #set computes = [$computes] -#end if -#if not $isinstance($storages, list) - #set storages = [$storages] -#end if -#if not $isinstance($networks, list) - #set networks = [$networks] -#end if - -#set credentials = $getVar('server_credentials', {}) -#set username = $credentials.get('username', 'root') -#set password = $credentials.get('password', 'root') -[controller] -#for controller in $controllers - #set controller_ip = $controller.management.ip - #set controller_hostname = $controller.hostname -$controller_hostname ansible_ssh_host=$controller_ip ansible_ssh_user=$username ansible_ssh_password=$password -#end for - -[compute] -#for compute in $computes - #set compute_ip = $compute.management.ip - #set compute_hostname = $compute.hostname -$compute_hostname ansible_ssh_host=$compute_ip ansible_ssh_user=$username ansible_ssh_password=$password -#end for - -[network] -#for network in $networks - #set network_ip = $network.management.ip - #set network_hostname = $network.hostname -$network_hostname ansible_ssh_host=$network_ip ansible_ssh_user=$username ansible_ssh_password=$password -#end for - -[storage] -#for storage in storages - #set storage_ip = $storage.management.ip - #set storage_hostname = $storage.hostname -$storage_hostname ansible_ssh_host=$storage_ip ansible_ssh_user=$username ansible_ssh_password=$password -#end for diff --git a/conf/templates/ansible_installer/openstack_newton_xenial/inventories/multinodes.tmpl b/conf/templates/ansible_installer/openstack_newton_xenial/inventories/multinodes.tmpl deleted file mode 100644 index 7cdfbef3..00000000 --- a/conf/templates/ansible_installer/openstack_newton_xenial/inventories/multinodes.tmpl +++ /dev/null @@ -1,123 +0,0 @@ -#set compute_controllers = $getVar('compute_controller', []) -#set compute_workers = $getVar('compute_worker', []) -#set network_servers = $getVar('network_server', []) -#set network_workers = $getVar('network_worker', []) -#set databases = $getVar('database', []) -#set messagings = $getVar('messaging', []) -#set images = $getVar('image', []) -#set dashboards = $getVar('dashboard', []) -#set identities = $getVar('identity', []) -#set storage_controllers = $getVar('storage_controller', []) -#set storage_volumes = $getVar('storage_volume', []) -#if not $isinstance($compute_controllers, list) - #set compute_controllers = [$compute_controllers] -#end if -#if not $isinstance($compute_workers, list) - #set compute_workers = [$compute_workers] -#end if -#if not $isinstance($network_servers, list) - #set network_servers = [$network_servers] -#end if -#if not $isinstance($network_workers, list) - #set network_workers = [$network_workers] -#end if -#if not $isinstance($databases, list) - #set databases = [$databases] -#end if -#if not $isinstance($messagings, list) - #set messagings = [$messagings] -#end if -#if not $isinstance($images, list) - #set images = [$images] -#end if -#if not $isinstance($dashboards, list) - #set dashboards = [$dashboards] -#end if -#if not $isinstance($identities, list) - #set identities = [$identities] -#end if -#if not $isinstance($storage_controllers, list) - #set storage_controllers = [$storage_controllers] -#end if -#if not $isinstance($storage_volumes, list) - #set storage_volumes = [$storage_volumes] -#end if -#set credentials = $getVar('server_credentials', {}) -#set username = $credentials.get('username', 'root') -#set password = $credentials.get('password', 'root') -[compute-controller] -#for controller in $compute_controllers - #set controller_ip = $controller.management.ip - #set controller_hostname = $controller.hostname -$controller_hostname ansible_ssh_host=$controller_ip ansible_ssh_user=$username ansible_ssh_password=$password -#end for - -[compute-worker] -#for compute in $compute_workers - #set compute_ip = $compute.management.ip - #set compute_hostname = $compute.hostname -$compute_hostname ansible_ssh_host=$compute_ip ansible_ssh_user=$username ansible_ssh_password=$password -#end for - -[network-server] -#for network in $network_servers - #set network_ip = $network.management.ip - #set network_hostname = $network.hostname -$network_hostname ansible_ssh_host=$network_ip ansible_ssh_user=$username ansible_ssh_password=$password -#end for - -[network-worker] -#for network in $network_workers - #set network_ip = $network.management.ip - #set network_hostname = $network.hostname -$network_hostname ansible_ssh_host=$network_ip ansible_ssh_user=$username ansible_ssh_password=$password -#end for - -[database] -#for worker in $databases - #set worker_ip = $worker.management.ip - #set worker_hostname = $worker.hostname -$worker_hostname ansible_ssh_host=$worker_ip ansible_ssh_user=$username ansible_ssh_password=$password -#end for - -[messaging] -#for worker in $messagings - #set worker_ip = $worker.management.ip - #set worker_hostname = $worker.hostname -$worker_hostname ansible_ssh_host=$worker_ip ansible_ssh_user=$username ansible_ssh_password=$password -#end for - -[image] -#for worker in $images - #set worker_ip = $worker.management.ip - #set worker_hostname = $worker.hostname -$worker_hostname ansible_ssh_host=$worker_ip ansible_ssh_user=$username ansible_ssh_password=$password -#end for - -[dashboard] -#for worker in $dashboards - #set worker_ip = $worker.management.ip - #set worker_hostname = $worker.hostname -$worker_hostname ansible_ssh_host=$worker_ip ansible_ssh_user=$username ansible_ssh_password=$password -#end for - -[identity] -#for worker in $identities - #set worker_ip = $worker.management.ip - #set worker_hostname = $worker.hostname -$worker_hostname ansible_ssh_host=$worker_ip ansible_ssh_user=$username ansible_ssh_password=$password -#end for - -[storage-controller] -#for worker in $storage_controllers - #set worker_ip = $worker.management.ip - #set worker_hostname = $worker.hostname -$worker_hostname ansible_ssh_host=$worker_ip ansible_ssh_user=$username ansible_ssh_password=$password -#end for - -[storage-volume] -#for worker in $storage_volumes - #set worker_ip = $worker.management.ip - #set worker_hostname = $worker.hostname -$worker_hostname ansible_ssh_host=$worker_ip ansible_ssh_user=$username ansible_ssh_password=$password -#end for diff --git a/conf/templates/ansible_installer/openstack_newton_xenial/inventories/single-controller.tmpl b/conf/templates/ansible_installer/openstack_newton_xenial/inventories/single-controller.tmpl deleted file mode 100644 index e1bf72c4..00000000 --- a/conf/templates/ansible_installer/openstack_newton_xenial/inventories/single-controller.tmpl +++ /dev/null @@ -1,67 +0,0 @@ -#set controllers = $getVar('controller', []) -#set computes = $getVar('compute', []) -#set storages = $getVar('storage', []) -#set networks = $getVar('network', []) -#set odls = $getVar('odl', []) -#set onoss = $getVar('onos', []) -#if not $isinstance($controllers, list) - #set controllers = [$controllers] -#end if -#if not $isinstance($computes, list) - #set computes = [$computes] -#end if -#if not $isinstance($storages, list) - #set storages = [$storages] -#end if -#if not $isinstance($networks, list) - #set networks = [$networks] -#end if -#if not $isinstance($odls, list) - #set odls = [$odls] -#end if -#if not $isinstance($onoss, list) - #set onoss = [$onoss] -#end if - -#set credentials = $getVar('server_credentials', {}) -#set username = $credentials.get('username', 'root') -#set password = $credentials.get('password', 'root') -[controller] -#for controller in $controllers - #set controller_ip = $controller.management.ip - #set controller_hostname = $controller.hostname -$controller_hostname ansible_ssh_host=$controller_ip ansible_ssh_user=$username ansible_ssh_password=$password -#end for - -[compute] -#for compute in $computes - #set compute_ip = $compute.management.ip - #set compute_hostname = $compute.hostname -$compute_hostname ansible_ssh_host=$compute_ip ansible_ssh_user=$username ansible_ssh_password=$password -#end for - -[network] -#for network in $networks - #set network_ip = $network.management.ip - #set network_hostname = $network.hostname -$network_hostname ansible_ssh_host=$network_ip ansible_ssh_user=$username ansible_ssh_password=$password -#end for - -[storage] -#for storage in storages - #set storage_ip = $storage.management.ip - #set storage_hostname = $storage.hostname -$storage_hostname ansible_ssh_host=$storage_ip ansible_ssh_user=$username ansible_ssh_password=$password -#end for -[odl] -#for odl in odls - #set odl_ip = $odl.management.ip - #set odl_hostname = $odl.hostname -$odl_hostname ansible_ssh_host=$odl_ip ansible_ssh_user=$username ansible_ssh_password=$password -#end for -[storage] -#for storage in storages - #set storage_ip = $storage.management.ip - #set storage_hostname = $storage.hostname -$storage_hostname ansible_ssh_host=$storage_ip ansible_ssh_user=$username ansible_ssh_password=$password -#end for diff --git a/conf/templates/ansible_installer/openstack_newton_xenial/vars/HA-ansible-multinodes.tmpl b/conf/templates/ansible_installer/openstack_newton_xenial/vars/HA-ansible-multinodes.tmpl deleted file mode 100644 index 3ba57d45..00000000 --- a/conf/templates/ansible_installer/openstack_newton_xenial/vars/HA-ansible-multinodes.tmpl +++ /dev/null @@ -1,208 +0,0 @@ -#from random import randint -#set cluster_name = $getVar('name', '') -#set network_cfg = $getVar('network_cfg', {}) -#set ntp_server = $getVar('ntp_server', "") -#set ceph_disk = $getVar('ceph_disk',"") -#set $sys_intf_mappings= {} -#for $intf_info in $network_cfg.sys_intf_mappings -#set $sys_intf_mappings[$intf_info["name"]] = $intf_info -#end for - -#set ip_settings={} -#for k,v in $getVar('ip_settings', {}).items() -#set host_ip_settings={} -#for intf in v -#set $host_ip_settings[$intf["alias"]]=intf -#end for -#set $ip_settings[$k]=$host_ip_settings -#end for - -#set neutron_cfg = $getVar('neutron_config', {}) -#set ovs_config = $neutron_cfg.openvswitch - -#set has = $getVar('ha', []) -#set ha_vip = $getVar('ha_vip', []) - -#set controllers = $getVar('controller', []) -#set computers = $getVar('compute', []) - -enable_secgroup: $getVar('enable_secgroup', True) -enable_fwaas: $getVar('enable_fwaas', True) -enable_vpnaas: $getVar('enable_vpnaas', True) -odl_l3_agent: $getVar('odl_l3_agent', 'Disable') -moon: $getVar('moon', 'Disable') -onos_nic: $getVar('onos_nic', 'eth2') -ip_settings: $ip_settings -network_cfg: $network_cfg -sys_intf_mappings: $sys_intf_mappings -deploy_type: $getVar('deploy_type', 'virtual') - -public_cidr: $computers[0]['install']['subnet'] -storage_cidr: "{{ ip_settings[inventory_hostname]['storage']['cidr'] }}" -mgmt_cidr: "{{ ip_settings[inventory_hostname]['mgmt']['cidr'] }}" - -public_net_info: "{{ network_cfg.public_net_info }}" -host_ip_settings: "{{ ip_settings[inventory_hostname] }}" - -ntp_server: $ntp_server -internal_vip: - ip: $network_cfg["internal_vip"]["ip"] - netmask: $network_cfg["internal_vip"]["netmask"] -#if "vlan_tag" in $sys_intf_mappings[$network_cfg["internal_vip"]["interface"]] - interface: $sys_intf_mappings[$network_cfg["internal_vip"]["interface"]]["name"] -#else - interface: $sys_intf_mappings[$network_cfg["internal_vip"]["interface"]]["interface"] -#end if - -public_vip: - ip: $network_cfg["public_vip"]["ip"] - netmask: $network_cfg["public_vip"]["netmask"] -#if "vlan_tag" in $sys_intf_mappings[$network_cfg["public_vip"]["interface"]] - interface: $sys_intf_mappings[$network_cfg["public_vip"]["interface"]]["name"] -#else - interface: $sys_intf_mappings[$network_cfg["public_vip"]["interface"]]["interface"] -#end if - -db_host: "{{ internal_vip.ip }}" -rabbit_host: "{{ internal_vip.ip }}" - -internal_ip: "{{ ip_settings[inventory_hostname]['mgmt']['ip'] }}" -internal_nic: mgmt - -#set random_id = randint(1, 255) -vrouter_id_internal: $random_id -vrouter_id_public: $random_id - -identity_host: "{{ internal_ip }}" -controllers_host: "{{ internal_ip }}" -storage_controller_host: "{{ internal_ip }}" -compute_controller_host: "{{ internal_ip }}" -image_host: "{{ internal_ip }}" -network_server_host: "{{ internal_ip }}" -dashboard_host: "{{ internal_ip }}" - -haproxy_hosts: -#for $item in $has -#set $hostname=$item["hostname"] - $hostname: $ip_settings[$hostname]["mgmt"]["ip"] -#end for - -host_index: -#for $index, $item in enumerate($has) - $item["hostname"]: $index -#end for - -ERLANG_TOKEN: YOWSJSJIGGAUFZTIBRAD -#set credentials = $getVar('service_credentials', {}) -#set console_credentials = $getVar('console_credentials', {}) -#set rabbit_username = $credentials.rabbitmq.username -#set rabbit_password = $credentials.rabbitmq.password -#set keystone_dbpass = $credentials.identity.password -#set keystone_pass = $console_credentials.identity.password -#set glance_dbpass = $credentials.image.password -#set glance_pass = $console_credentials.image.password -#set nova_dbpass = $credentials.compute.password -#set nova_pass = $console_credentials.compute.password -#set dash_dbpass = $credentials.dashboard.password -#set cinder_dbpass = $credentials.volume.password -#set cinder_pass = $console_credentials.volume.password -#set heat_dbpass = $credentials.heat.password -#set heat_pass = $console_credentials.heat.password -#set neutron_dbpass = $credentials.network.password -#set neutron_pass = $console_credentials.network.password -#set ceilometer_dbpass = $credentials.metering.password -#set ceilometer_pass = $console_credentials.metering.password -#set aodh_dbpass = $credentials.alarming.password -#set aodh_pass = $console_credentials.alarming.password -#set admin_pass = $console_credentials.admin.password -#set demo_pass = $console_credentials.demo.password - -cluster_name: $cluster_name - -odl_controller: 10.1.0.15 - -DEBUG: true -VERBOSE: true -NTP_SERVER_LOCAL: "{{ controllers_host }}" -DB_HOST: "{{ db_host }}" -MQ_BROKER: rabbitmq - -OPENSTACK_REPO: cloudarchive-newton.list -newton_cloud_archive: deb http://ubuntu-cloud.archive.canonical.com/ubuntu xenial-updates/newton main -ADMIN_TOKEN: admin -CEILOMETER_TOKEN: c095d479023a0fd58a54 -erlang.cookie: DJJVECFMCJPVYQTJTDWG - -RABBIT_USER: $rabbit_username -RABBIT_PASS: $rabbit_password -KEYSTONE_DBPASS: $keystone_dbpass -KEYSTONE_PASS: $keystone_pass -CEILOMETER_DBPASS: $ceilometer_dbpass -CEILOMETER_PASS: $ceilometer_pass -AODH_DBPASS: $aodh_dbpass -AODH_PASS: $aodh_pass -GLANCE_DBPASS: $glance_dbpass -GLANCE_PASS: $glance_pass -NOVA_DBPASS: $nova_dbpass -NOVA_PASS: $nova_pass -DASH_DBPASS: $dash_dbpass -CINDER_DBPASS: $cinder_dbpass -CINDER_PASS: $cinder_pass -NEUTRON_DBPASS: $neutron_dbpass -NEUTRON_PASS: $neutron_pass -HEAT_DBPASS: $heat_dbpass -HEAT_PASS: $heat_pass -DEMO_PASS: $demo_pass -ADMIN_PASS: $admin_pass - -#set neutron_service_plugins=['router'] - -#if $getVar('enable_fwaas', True) -#neutron_service_plugins.append('firewall') -#end if - -#if $getVar('enable_vpnaas', True) -#neutron_service_plugins.append('vpnaas') -#end if - -NEUTRON_SERVICE_PLUGINS: $neutron_service_plugins -NEUTRON_TYPE_DRIVERS: ['flat', 'gre', 'vxlan', 'vlan'] -NEUTRON_TENANT_NETWORK_TYPES: ['$ovs_config["tenant_network_type"]'] -NEUTRON_OVS_BRIDGE_MAPPINGS: $ovs_config['bridge_mappings'] -#if 'vlan_ranges' in $ovs_config -NEUTRON_VLAN_RANGES: $ovs_config['vlan_ranges'] -#else -NEUTRON_VLAN_RANGES: [] -#end if -#if 'tunnel_id_ranges' in $ovs_config -NEUTRON_TUNNEL_ID_RANGES: $ovs_config['tunnel_id_ranges'] -#else -NEUTRON_TUNNEL_ID_RANGES: [] -#end if - -#NEUTRON_MECHANISM_DRIVERS: ['opendaylight'] -NEUTRON_MECHANISM_DRIVERS: ['openvswitch'] -NEUTRON_TUNNEL_TYPES: ['vxlan'] -METADATA_SECRET: metadata_secret -WSREP_SST_USER: wsrep_sst -WSREP_SST_PASS: wsrep_sst_sercet - -INSTANCE_TUNNELS_INTERFACE_IP_ADDRESS: "{{ internal_ip }}" - -#build_in_image: http://download.cirros-cloud.net/0.3.3/cirros-0.3.3-x86_64-disk.img -build_in_image: http://192.168.121.12:9999/img/cirros-0.3.3-x86_64-disk.img -build_in_image_name: cirros-0.3.3-x86_64-disk.img - -physical_device: /dev/sdb - -odl_username: admin -odl_password: admin -odl_api_port: 8080 - -odl_pkg_url: https://nexus.opendaylight.org/content/groups/public/org/opendaylight/integration/distribution-karaf/0.2.2-Helium-SR2/distribution-karaf-0.2.2-Helium-SR2.tar.gz -odl_pkg_name: karaf.tar.gz -odl_home: "/opt/opendaylight-0.2.2/" -odl_base_features: ['config', 'standard', 'region', 'package', 'kar', 'ssh', 'management', 'http', 'odl-base-all','odl-aaa-authn','odl-restconf','odl-nsf-all','odl-adsal-northbound','odl-mdsal-apidocs', 'odl-openflowplugin-all'] -odl_extra_features: ['odl-l2switch-switch', 'odl-ovsdb-plugin', 'odl-ovsdb-openstack', 'odl-ovsdb-northbound','odl-dlux-core', 'odl-restconf-all', 'odl-mdsal-clustering', 'odl-openflowplugin-flow-services', 'odl-netconf-connector', 'odl-netconf-connector-ssh', 'jolokia-osgi'] -odl_features: "{{ odl_base_features + odl_extra_features }}" -odl_api_port: 8080 diff --git a/conf/templates/ansible_installer/openstack_newton_xenial/vars/allinone.tmpl b/conf/templates/ansible_installer/openstack_newton_xenial/vars/allinone.tmpl deleted file mode 100644 index a28897b3..00000000 --- a/conf/templates/ansible_installer/openstack_newton_xenial/vars/allinone.tmpl +++ /dev/null @@ -1,96 +0,0 @@ -#set cluster_name = $getVar('name', '') -#set controllers = $getVar('allinone_compute', []) -#if not $isinstance($controllers, list) - #set controllers = [$controllers] -#end if - -#for controller in $controllers - #set controller_ip = $controller.management.ip - #set controller_hostname = $controller.hostname -controller_host: $controller_ip -#end for -#for network in $controllers - #set network_external_nic = $network.external.interface - #set network_external_subnet = $network.external.subnet - #set network_internal_nic = $network.management.interface -INTERFACE_NAME: $network_external_nic -INTERNAL_INTERFACE: $network_internal_nic -#end for - -#set credentials = $getVar('service_credentials', {}) -#set console_credentials = $getVar('console_credentials', {}) -#set rabbit_username = $credentials.rabbitmq.username -#set rabbit_password = $credentials.rabbitmq.password -#set keystone_dbpass = $credentials.identity.password -#set glance_dbpass = $credentials.image.password -#set glance_pass = $console_credentials.image.password -#set nova_dbpass = $credentials.compute.password -#set nova_pass = $console_credentials.compute.password -#set dash_dbpass = $credentials.dashboard.password -#set cinder_dbpass = $credentials.volume.password -#set cinder_pass = $console_credentials.volume.password -#set admin_pass = $console_credentials.admin.password -#set neutron_pass = $console_credentials.network.password - -compute_controller_host: "{{ controller_host }}" -db_host: "{{ controller_host }}" -rabbit_host: "{{ controller_host }}" -storage_controller_host: "{{ controller_host }}" -image_host: "{{ controller_host }}" -identity_host: "{{ controller_host }}" -network_server_host: "{{ controller_host }}" -dashboard_host: "{{ controller_host }}" - -cluster_name: $cluster_name -odl_controller: 10.1.0.15 - -DEBUG: true -VERBOSE: true -NTP_SERVER_LOCAL: "{{ controller_host }}" -DB_HOST: "{{ controller_host }}" -MQ_BROKER: rabbitmq - -OPENSTACK_REPO: cloudarchive-newton.list -newton_cloud_archive: deb http://ubuntu-cloud.archive.canonical.com/ubuntu xenial-updates/newton main -ADMIN_TOKEN: admin -CEILOMETER_TOKEN: c095d479023a0fd58a54 - -RABBIT_USER: $rabbit_username -RABBIT_PASS: $rabbit_password -KEYSTONE_DBPASS: $keystone_dbpass -DEMO_PASS: demo_secret -ADMIN_PASS: $admin_pass -GLANCE_DBPASS: $glance_dbpass -GLANCE_PASS: $glance_pass -NOVA_DBPASS: $nova_dbpass -NOVA_PASS: $nova_pass -DASH_DBPASS: $dash_dbpass -CINDER_DBPASS: $cinder_dbpass -CINDER_PASS: $cinder_pass -NEUTRON_DBPASS: $neutron_pass -NEUTRON_PASS: $neutron_pass -NEUTRON_TYPE_DRIVERS: ['flat', 'gre', 'vxlan'] -NEUTRON_TENANT_NETWORK_TYPES: ['vxlan'] -#NEUTRON_MECHANISM_DRIVERS: ['opendaylight'] -NEUTRON_MECHANISM_DRIVERS: ['openvswitch'] -NEUTRON_TUNNEL_TYPES: ['vxlan'] -METADATA_SECRET: metadata_secret -INSTANCE_TUNNELS_INTERFACE_IP_ADDRESS: 10.1.1.21 - -EXTERNAL_NETWORK_CIDR: 203.0.113.0/24 -EXTERNAL_NETWORK_GATEWAY: 203.0.113.1 -FLOATING_IP_START: 203.0.113.101 -FLOATING_IP_END: 203.0.113.200 - -build_in_image: http://download.cirros-cloud.net/0.3.3/cirros-0.3.3-x86_64-disk.img -build_in_image_name: cirros-0.3.3-x86_64-disk.img - -physical_device: /dev/sdb - -internal_interface: "ansible_{{ INTERNAL_INTERFACE }}" -internal_ip: "{{ hostvars[inventory_hostname][internal_interface]['ipv4']['address'] }}" -HA_VIP: "{{ internal_ip }}" - -odl_username: admin -odl_password: admin -odl_api_port: 8080 diff --git a/conf/templates/ansible_installer/openstack_newton_xenial/vars/multinodes.tmpl b/conf/templates/ansible_installer/openstack_newton_xenial/vars/multinodes.tmpl deleted file mode 100644 index 16134e71..00000000 --- a/conf/templates/ansible_installer/openstack_newton_xenial/vars/multinodes.tmpl +++ /dev/null @@ -1,165 +0,0 @@ -#set cluster_name = $getVar('name', '') -#set compute_controllers = $getVar('compute_controller', []) -#set compute_workers = $getVar('compute_worker', []) -#set network_servers = $getVar('network_server', []) -#set network_workers = $getVar('network_worker', []) -#set databases = $getVar('database', []) -#set messagings = $getVar('messaging', []) -#set images = $getVar('image', []) -#set dashboards = $getVar('dashboard', []) -#set identities = $getVar('identity', []) -#set storage_controllers = $getVar('storage_controller', []) -#set storage_volumes = $getVar('storage_volume', []) -#if not $isinstance($compute_controllers, list) - #set compute_controllers = [$compute_controllers] -#end if -#if not $isinstance($compute_workers, list) - #set compute_workers = [$compute_workers] -#end if -#if not $isinstance($network_servers, list) - #set network_servers = [$network_servers] -#end if -#if not $isinstance($network_workers, list) - #set network_workers = [$network_workers] -#end if -#if not $isinstance($databases, list) - #set databases = [$databases] -#end if -#if not $isinstance($messagings, list) - #set messagings = [$messagings] -#end if -#if not $isinstance($images, list) - #set images = [$images] -#end if -#if not $isinstance($dashboards, list) - #set dashboards = [$dashboards] -#end if -#if not $isinstance($identities, list) - #set identities = [$identities] -#end if -#if not $isinstance($storage_controllers, list) - #set storage_controllers = [$storage_controllers] -#end if -#if not $isinstance($storage_volumes, list) - #set storage_volumes = [$storage_volumes] -#end if -#for worker in $compute_controllers - #set worker_ip = $worker.management.ip -compute_controller_host: $worker_ip -#end for -#for worker in $databases - #set worker_ip = $worker.management.ip -db_host: $worker_ip -#end for -#for worker in $messagings - #set worker_ip = $worker.management.ip -rabbit_host: $worker_ip -#end for -#for worker in $storage_controllers - #set worker_ip = $worker.management.ip -storage_controller_host: $worker_ip -#end for -#for worker in $images - #set worker_ip = $worker.management.ip -image_host: $worker_ip -#end for -#for worker in $identities - #set worker_ip = $worker.management.ip -identity_host: $worker_ip -#end for -#for worker in $compute_controllers - #set worker_ip = $worker.management.ip -compute_controller_host: $worker_ip -#end for -#for worker in $network_servers - #set worker_ip = $worker.management.ip -network_server_host: $worker_ip -#end for -#for worker in $dashboards - #set worker_ip = $worker.management.ip -dashboard_host: $worker_ip -#end for -#for network in $network_workers - #set network_external_nic = $network.external.interface - #set network_internal_nic = $network.management.interface -INTERFACE_NAME: $network_external_nic -INTERNAL_INTERFACE: $network_internal_nic -#end for - -#set credentials = $getVar('service_credentials', {}) -#set console_credentials = $getVar('console_credentials', {}) -#set rabbit_username = $credentials.rabbitmq.username -#set rabbit_password = $credentials.rabbitmq.password -#set keystone_dbpass = $credentials.identity.password -#set glance_dbpass = $credentials.image.password -#set glance_pass = $console_credentials.image.password -#set nova_dbpass = $credentials.compute.password -#set nova_pass = $console_credentials.compute.password -#set dash_dbpass = $credentials.dashboard.password -#set cinder_dbpass = $credentials.volume.password -#set cinder_pass = $console_credentials.volume.password -#set admin_pass = $console_credentials.admin.password -#set neutron_pass = $console_credentials.network.password - -cluster_name: $cluster_name - -odl_controller: 10.1.0.15 - -DEBUG: true -VERBOSE: true -NTP_SERVER_LOCAL: "{{ compute_controller_host }}" -DB_HOST: "{{ db_host }}" -MQ_BROKER: rabbitmq - -OPENSTACK_REPO: cloudarchive-newton.list -newton_cloud_archive: deb http://ubuntu-cloud.archive.canonical.com/ubuntu xenial-updates/newton main -ADMIN_TOKEN: admin -CEILOMETER_TOKEN: c095d479023a0fd58a54 - -RABBIT_USER: $rabbit_username -RABBIT_PASS: $rabbit_password -KEYSTONE_DBPASS: $keystone_dbpass -DEMO_PASS: demo_secret -ADMIN_PASS: $admin_pass -GLANCE_DBPASS: $glance_dbpass -GLANCE_PASS: $glance_pass -NOVA_DBPASS: $nova_dbpass -NOVA_PASS: $nova_pass -DASH_DBPASS: $dash_dbpass -CINDER_DBPASS: $cinder_dbpass -CINDER_PASS: $cinder_pass -NEUTRON_DBPASS: $neutron_pass -NEUTRON_PASS: $neutron_pass -NEUTRON_TYPE_DRIVERS: ['flat', 'gre', 'vxlan'] -NEUTRON_TENANT_NETWORK_TYPES: ['vxlan'] -#NEUTRON_MECHANISM_DRIVERS: ['opendaylight'] -NEUTRON_MECHANISM_DRIVERS: ['openvswitch'] -NEUTRON_TUNNEL_TYPES: ['vxlan'] -METADATA_SECRET: metadata_secret -INSTANCE_TUNNELS_INTERFACE_IP_ADDRESS: 10.1.1.21 - -EXTERNAL_NETWORK_CIDR: 203.0.113.0/24 -EXTERNAL_NETWORK_GATEWAY: 203.0.113.1 -FLOATING_IP_START: 203.0.113.101 -FLOATING_IP_END: 203.0.113.200 - -build_in_image: http://download.cirros-cloud.net/0.3.3/cirros-0.3.3-x86_64-disk.img -build_in_image_name: cirros-0.3.3-x86_64-disk.img - -physical_device: /dev/sdb - -internal_interface: "ansible_{{ INTERNAL_INTERFACE }}" -internal_ip: "{{ hostvars[inventory_hostname][internal_interface]['ipv4']['address'] }}" -HA_VIP: "{{ internal_ip }}" -odl_username: admin -odl_password: admin -odl_api_port: 8080 - -odl_pkg_url: https://nexus.opendaylight.org/content/groups/public/org/opendaylight/integration/distribution-karaf/0.2.2-Helium-SR2/distribution-karaf-0.2.2-Helium-SR2.tar.gz -odl_pkg_name: karaf.tar.gz -odl_home: "/opt/opendaylight-0.2.2/" -odl_base_features: ['config', 'standard', 'region', 'package', 'kar', 'ssh', 'management', 'http', 'odl-base-all','odl-aaa-authn','odl-restconf','odl-nsf-all','odl-adsal-northbound','odl-mdsal-apidocs', 'odl-openflowplugin-all'] -odl_extra_features: ['odl-l2switch-switch', 'odl-ovsdb-plugin', 'odl-ovsdb-openstack', 'odl-ovsdb-northbound','odl-dlux-core', 'odl-restconf-all', 'odl-mdsal-clustering', 'odl-openflowplugin-flow-services', 'odl-netconf-connector', 'odl-netconf-connector-ssh', 'jolokia-osgi'] -odl_features: "{{ odl_base_features + odl_extra_features }}" -odl_api_port: 8080 - diff --git a/conf/templates/ansible_installer/openstack_newton_xenial/vars/single-controller.tmpl b/conf/templates/ansible_installer/openstack_newton_xenial/vars/single-controller.tmpl deleted file mode 100644 index 70b01813..00000000 --- a/conf/templates/ansible_installer/openstack_newton_xenial/vars/single-controller.tmpl +++ /dev/null @@ -1,108 +0,0 @@ -#set cluster_name = $getVar('name', '') -#set controllers = $getVar('controller', []) -#set computes = $getVar('compute', []) -#set networks = $getVar('network', []) -#set storages = $getVar('storage', []) -#if not $isinstance($controllers, list) - #set controllers = [$controllers] -#end if -#if not $isinstance($computes, list) - #set computes = [$computes] -#end if -#if not $isinstance($networks, list) - #set networks = [$networks] -#end if -#if not $isinstance($storages, list) - #set storages = [$storages] -#end if - -#for controller in $controllers - #set controller_ip = $controller.management.ip - #set controller_hostname = $controller.hostname -controller_host: $controller_ip -#end for -#for network in $networks - #set network_external_nic = $network.external.interface - #set network_external_subnet = $network.external.subnet - #set network_internal_nic = $network.management.interface -INTERFACE_NAME: $network_external_nic -INTERNAL_INTERFACE: $network_internal_nic -#end for - -#set credentials = $getVar('service_credentials', {}) -#set console_credentials = $getVar('console_credentials', {}) -#set rabbit_username = $credentials.rabbitmq.username -#set rabbit_password = $credentials.rabbitmq.password -#set keystone_dbpass = $credentials.identity.password -#set glance_dbpass = $credentials.image.password -#set glance_pass = $console_credentials.image.password -#set nova_dbpass = $credentials.compute.password -#set nova_pass = $console_credentials.compute.password -#set dash_dbpass = $credentials.dashboard.password -#set cinder_dbpass = $credentials.volume.password -#set cinder_pass = $console_credentials.volume.password -#set admin_pass = $console_credentials.admin.password -#set neutron_pass = $console_credentials.network.password - -cluster_name: $cluster_name -deploy_type: $getVar('deploy_type', 'virtual') -compute_controller_host: "{{ controller_host }}" -db_host: "{{ controller_host }}" -rabbit_host: "{{ controller_host }}" -storage_controller_host: "{{ controller_host }}" -image_host: "{{ controller_host }}" -identity_host: "{{ controller_host }}" -network_server_host: "{{ controller_host }}" -dashboard_host: "{{ controller_host }}" -odl_controller: 10.1.0.15 - -DEBUG: true -VERBOSE: true -NTP_SERVER_LOCAL: "{{ controller_host }}" -DB_HOST: "{{ controller_host }}" -MQ_BROKER: rabbitmq - -OPENSTACK_REPO: cloudarchive-newton.list -newton_cloud_archive: deb http://ubuntu-cloud.archive.canonical.com/ubuntu xenial-updates/newton main -ADMIN_TOKEN: admin -CEILOMETER_TOKEN: c095d479023a0fd58a54 - -RABBIT_USER: $rabbit_username -RABBIT_PASS: $rabbit_password -KEYSTONE_DBPASS: $keystone_dbpass -DEMO_PASS: demo_secret -ADMIN_PASS: $admin_pass -GLANCE_DBPASS: $glance_dbpass -GLANCE_PASS: $glance_pass -NOVA_DBPASS: $nova_dbpass -NOVA_PASS: $nova_pass -DASH_DBPASS: $dash_dbpass -CINDER_DBPASS: $cinder_dbpass -CINDER_PASS: $cinder_pass -NEUTRON_DBPASS: $neutron_pass -NEUTRON_PASS: $neutron_pass -NEUTRON_TYPE_DRIVERS: ['flat', 'gre', 'vxlan'] -NEUTRON_TENANT_NETWORK_TYPES: ['vxlan'] -#NEUTRON_MECHANISM_DRIVERS: ['opendaylight'] -NEUTRON_MECHANISM_DRIVERS: ['openvswitch'] -NEUTRON_TUNNEL_TYPES: ['vxlan'] -METADATA_SECRET: metadata_secret -INSTANCE_TUNNELS_INTERFACE_IP_ADDRESS: 10.1.1.21 - -EXTERNAL_NETWORK_CIDR: 203.0.113.0/24 -# EXTERNAL_NETWORK_CIDR: $network_external_subnet -EXTERNAL_NETWORK_GATEWAY: 203.0.113.1 -FLOATING_IP_START: 203.0.113.101 -FLOATING_IP_END: 203.0.113.200 - -build_in_image: http://download.cirros-cloud.net/0.3.3/cirros-0.3.3-x86_64-disk.img -build_in_image_name: cirros-0.3.3-x86_64-disk.img - -physical_device: /dev/sdb - -internal_interface: "ansible_{{ INTERNAL_INTERFACE }}" -internal_ip: "{{ hostvars[inventory_hostname][internal_interface]['ipv4']['address'] }}" -HA_VIP: "{{ internal_ip }}" -odl_username: admin -odl_password: admin -odl_api_port: 8080 From 7432122eaa64c5da76cabdd892534efae08e9b85 Mon Sep 17 00:00:00 2001 From: Xicheng Chang Date: Fri, 23 Dec 2016 10:05:21 -0800 Subject: [PATCH 31/32] add ops9 installer Change-Id: If181fedf78d50d270e1c0ced6c572c59dc870344 --- conf/package_installer/ansible-osp9.conf | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 conf/package_installer/ansible-osp9.conf diff --git a/conf/package_installer/ansible-osp9.conf b/conf/package_installer/ansible-osp9.conf new file mode 100644 index 00000000..65f83515 --- /dev/null +++ b/conf/package_installer/ansible-osp9.conf @@ -0,0 +1,13 @@ +NAME = 'ansible_installer' +INSTANCE_NAME = 'ansible_installer_osp9' +SETTINGS = { + 'ansible_dir': '/var/ansible', + 'ansible_run_dir': '/var/ansible/run', + 'ansible_config': 'ansible.cfg', + 'playbook_file': 'site.yml', + 'inventory_file': 'inventory.yml', + 'group_variable': 'all', + 'etc_hosts_path': 'roles/common/templates/hosts', + 'runner_dirs': ['roles','openstack_osp9/templates','openstack_osp9/roles'] +} + From 1063feea2407636ef01f7567571efe7c6a705873 Mon Sep 17 00:00:00 2001 From: "qiwei.li" Date: Wed, 28 Dec 2016 18:12:55 -0800 Subject: [PATCH 32/32] fix compasss.sh Change-Id: I0403291dc026f56136db85e8188e12eba9dd5a10 --- install/compass.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/compass.sh b/install/compass.sh index 9fc0dd62..a4950768 100755 --- a/install/compass.sh +++ b/install/compass.sh @@ -134,7 +134,7 @@ if [ "$FULL_COMPASS_SERVER" == "true" ]; then sudo mv /etc/compass/celeryconfig_local /etc/compass/celeryconfig elif [ "$COMPASS_API_SERVER" != "c.stack360.io" ];then sudo mv /etc/compass/celeryconfig_local /etc/compass/celeryconfig - sudo sed -i "s/localhost/\$COMPASS_API_SERVER/g" /etc/compass/celeryconfig + sudo sed -i "s/localhost/$COMPASS_API_SERVER/g" /etc/compass/celeryconfig else sudo mv /etc/compass/celeryconfig_remote /etc/compass/celeryconfig wget -O /tmp/aws_credentials "http://www.stack360.io/aws_credentials"