Skip to content

Commit

Permalink
Changes to pass openstack service DB users password
Browse files Browse the repository at this point in the history
as input to the  provisioing scripts.
Also making it configurable from testbed.py

Change-Id: Ia4c30aa0f5fd356b72c644e67d11f82066c7cb3b
Closes-Bug: 1537314
  • Loading branch information
cijohnson committed Feb 10, 2016
1 parent 18b3080 commit 1d43985
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fabfile/tasks/storage/provision.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,11 @@ def create_storage_setup_cmd(mode):
# storage-replica-size - Replica size for Ceph storage
# openstack-ip - IP address of the first openstack node
# orig-hostnames - Original hostnames
# service-dbpass - DB password for cinder(and all service) db user
# WARNING: If anything is added in the arguments, make sure it
# doesn't break add_storage_node task.
cmd = "PASSWORD=%s setup-vnc-storage --storage-setup-mode %s --storage-master %s --storage-hostnames %s --storage-hosts %s --storage-host-tokens %s --storage-disk-config %s --storage-ssd-disk-config %s --storage-journal-config %s --storage-local-disk-config %s --storage-local-ssd-disk-config %s --storage-nfs-disk-config %s --storage-directory-config %s --storage-chassis-config %s --live-migration %s --collector-hosts %s --collector-host-tokens %s --cfg-host %s --cinder-vip %s --config-hosts %s --storage-os-hosts %s --storage-os-host-tokens %s --storage-mon-hosts %s --cfg-vip %s --storage-compute-hostnames %s --storage-replica-size %s --openstack-ip %s --orig-hostnames %s" \
%(storage_master_password, mode, storage_master_ip, ' '.join(storage_hostnames), ' '.join(storage_host_list), ' '.join(storage_pass_list), ' '.join(get_storage_disk_config()), ' '.join(get_storage_ssd_disk_config()), ' '.join(get_storage_journal_config()), ' '.join(get_storage_local_disk_config()), ' '.join(get_storage_local_ssd_disk_config()), ' '.join(get_storage_nfs_disk_config()), ' '.join(get_storage_directory_config()), ' '.join(get_storage_chassis_config()), get_live_migration_opts(), ' '.join(collector_host_list), ' '.join(collector_pass_list), cfm_ip, get_cinder_ha_vip(), ' '.join(cfg_host_list), ' '.join(storage_os_host_list), ' '.join(storage_os_pass_list), ' '.join(get_storage_mon_hosts()), get_cfg_ha_vip(), ' '.join(storage_compute_hostnames), get_storage_replica_size(), openstack_ip, ' '.join(orig_hostnames))
cmd = "PASSWORD=%s setup-vnc-storage --storage-setup-mode %s --storage-master %s --storage-hostnames %s --storage-hosts %s --storage-host-tokens %s --storage-disk-config %s --storage-ssd-disk-config %s --storage-journal-config %s --storage-local-disk-config %s --storage-local-ssd-disk-config %s --storage-nfs-disk-config %s --storage-directory-config %s --storage-chassis-config %s --live-migration %s --collector-hosts %s --collector-host-tokens %s --cfg-host %s --cinder-vip %s --config-hosts %s --storage-os-hosts %s --storage-os-host-tokens %s --storage-mon-hosts %s --cfg-vip %s --storage-compute-hostnames %s --storage-replica-size %s --openstack-ip %s --orig-hostnames %s --service-dbpass %s" \
%(storage_master_password, mode, storage_master_ip, ' '.join(storage_hostnames), ' '.join(storage_host_list), ' '.join(storage_pass_list), ' '.join(get_storage_disk_config()), ' '.join(get_storage_ssd_disk_config()), ' '.join(get_storage_journal_config()), ' '.join(get_storage_local_disk_config()), ' '.join(get_storage_local_ssd_disk_config()), ' '.join(get_storage_nfs_disk_config()), ' '.join(get_storage_directory_config()), ' '.join(get_storage_chassis_config()), get_live_migration_opts(), ' '.join(collector_host_list), ' '.join(collector_pass_list), cfm_ip, get_cinder_ha_vip(), ' '.join(cfg_host_list), ' '.join(storage_os_host_list), ' '.join(storage_os_pass_list), ' '.join(get_storage_mon_hosts()), get_cfg_ha_vip(), ' '.join(storage_compute_hostnames), get_storage_replica_size(), openstack_ip, ' '.join(orig_hostnames), get_service_dbpass())
return cmd


Expand Down
2 changes: 2 additions & 0 deletions fabfile/testbeds/testbed_multibox_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,13 +324,15 @@
# manage_amqp : Default = 'no', if set to 'yes' provision's amqp in openstack nodes and
# openstack services uses the amqp in openstack nodes instead of config nodes.
# amqp_host is neglected if manage_amqp is set
# service_dbpass: Default = 'c0ntrail123'; DB password of all openstack service users
#
#env.openstack = {
# 'service_token' : '33c57636fbc2c5552fd2', #Common service token for for all openstack services
# 'amqp_host' : '10.204.217.19', #IP of AMQP Server to be used in openstack
# 'manage_amqp' : 'yes', #Default no, Manage seperate AMQP for openstack services in openstack nodes.
# 'osapi_compute_workers' : 40, #Default 40, For low memory system reduce the osapi compute workers thread.
# 'conductor_workers' : 40, #Default 40, For low memory system reduce the conductor workers thread.
# 'service_dbpass' : 'c0ntrail123', #DB password of all openstack service users
#}

#Config node related config knobs
Expand Down
2 changes: 2 additions & 0 deletions fabfile/testbeds/testbed_singlebox_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,13 +219,15 @@
# manage_amqp : Default = 'no', if set to 'yes' provision's amqp in openstack nodes and
# openstack services uses the amqp in openstack nodes instead of config nodes.
# amqp_host is neglected if manage_amqp is set
# service_dbpass: Default = 'c0ntrail123'; DB password of all openstack service users
#
#env.openstack = {
# 'service_token' : '33c57636fbc2c5552fd2', #Common service token for for all openstack services
# 'amqp_host' : '10.204.217.19', #IP of AMQP Server to be used in openstack
# 'manage_amqp' : 'yes', #Default no, Manage seperate AMQP for openstack services in openstack nodes.
# 'osapi_compute_workers' : 40, #Default 40, For low memory system reduce the osapi compute workers thread.
# 'conductor_workers' : 40, #Default 40, For low memory system reduce the conductor workers thread.
# 'service_dbpass' : 'c0ntrail123', #DB password of all openstack service users
#}

#Config node related config knobs
Expand Down
1 change: 1 addition & 0 deletions fabfile/utils/commandline.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ def frame_vnc_openstack_cmd(host_string, cmd="setup-vnc-openstack"):
cmd += " --amqp_server_ip %s" % amqp_server_ip
cmd += " --quantum_service_protocol %s" % get_quantum_service_protocol()
cmd += " --service_token %s" % get_service_token()
cmd += " --service-dbpass %s" % get_service_dbpass()
cmd += " --keystone_service_tenant_name %s" % get_keystone_service_tenant_name()
cmd += " --neutron_password %s" % get_neutron_password()
cmd += " --nova_password %s" % get_nova_password()
Expand Down
5 changes: 5 additions & 0 deletions fabfile/utils/host.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ def get_service_token():
service_token = sudo("sudo cat /etc/contrail/service.token")
return service_token


def get_service_dbpass():
return get_from_testbed_dict('openstack','service_dbpass', 'c0ntrail123')


def copy_openstackrc(role='compute'):
openstackrc = "/etc/contrail/openstackrc"
temprc = "/tmp/openstackrc"
Expand Down

0 comments on commit 1d43985

Please sign in to comment.