diff --git a/elements/puppet-stack-config/puppet-stack-config.pp b/elements/puppet-stack-config/puppet-stack-config.pp index 387e61886..259fdf24e 100644 --- a/elements/puppet-stack-config/puppet-stack-config.pp +++ b/elements/puppet-stack-config/puppet-stack-config.pp @@ -19,27 +19,6 @@ class { '::tripleo::network::os_net_config': stage => 'setup', } -# Upgrade packaging. -case $::osfamily { - 'RedHat': { - $pkg_upgrade_cmd = 'yum -y update' - } - default: { - warning('Please specify a package upgrade command for distribution.') - } -} -exec { 'package-upgrade': - command => $pkg_upgrade_cmd, - path => '/usr/bin', - timeout => 0, -} -# Ensure Puppet will update packages using Package provider -# so Puppet OpenStack modules will notify db_sync commands for each service. -Package<| tag == 'openstack' |> { ensure => latest } -# Ensure we upgrade all packages after managing OpenStack packages, so Puppet -# can notify services and db_sync commands. -Package<| tag == 'openstack' |> -> Exec['package-upgrade'] - # Run OpenStack db-sync at every puppet run, in any case. Exec<| title == 'neutron-db-sync' |> { refreshonly => false } Exec<| title == 'keystone-manage db_sync' |> { refreshonly => false } diff --git a/elements/undercloud-install/os-apply-config/root/stackrc b/elements/undercloud-install/os-apply-config/root/stackrc index 4bdc6ce3e..47f705149 100644 --- a/elements/undercloud-install/os-apply-config/root/stackrc +++ b/elements/undercloud-install/os-apply-config/root/stackrc @@ -1,16 +1,28 @@ -export NOVA_VERSION=1.1 -export OS_PASSWORD=$(sudo hiera admin_password) +NOVA_VERSION=1.1 +export NOVA_VERSION +OS_PASSWORD=$(sudo hiera admin_password) +export OS_PASSWORD {{#service_certificate}} -export OS_AUTH_URL=https://{{public_vip}}:13000/v2.0 -export PYTHONWARNINGS="ignore:Certificate has no, ignore:A true SSLContext object is not available" +OS_AUTH_URL=https://{{public_vip}}:13000/v2.0 +PYTHONWARNINGS="ignore:Certificate has no, ignore:A true SSLContext object is not available" +export OS_AUTH_URL +export PYTHONWARNINGS {{/service_certificate}} {{^service_certificate}} -export OS_AUTH_URL=http://{{local-ip}}:5000/v2.0 +OS_AUTH_URL=http://{{local-ip}}:5000/v2.0 +export OS_AUTH_URL {{/service_certificate}} -export OS_USERNAME=admin -export OS_TENANT_NAME=admin -export COMPUTE_API_VERSION=1.1 -export OS_BAREMETAL_API_VERSION=1.15 -export OS_NO_CACHE=True -export OS_CLOUDNAME=undercloud -export OS_IMAGE_API_VERSION=1 +OS_USERNAME=admin +OS_TENANT_NAME=admin +COMPUTE_API_VERSION=1.1 +OS_BAREMETAL_API_VERSION=1.15 +OS_NO_CACHE=True +OS_CLOUDNAME=undercloud +OS_IMAGE_API_VERSION=1 +export OS_USERNAME +export OS_TENANT_NAME +export COMPUTE_API_VERSION +export OS_BAREMETAL +export OS_NO_CACHE +export OS_CLOUDNAME +export OS_IMAGE_API_VERSION diff --git a/elements/undercloud-install/os-refresh-config/post-configure.d/98-undercloud-setup b/elements/undercloud-install/os-refresh-config/post-configure.d/98-undercloud-setup index d1b13ec6f..61dca78e3 100755 --- a/elements/undercloud-install/os-refresh-config/post-configure.d/98-undercloud-setup +++ b/elements/undercloud-install/os-refresh-config/post-configure.d/98-undercloud-setup @@ -5,9 +5,11 @@ set -eux source /root/tripleo-undercloud-passwords source /root/stackrc -export INSTACK_ROOT=${INSTACK_ROOT:-""} +INSTACK_ROOT=${INSTACK_ROOT:-""} +export INSTACK_ROOT if [ -n "$INSTACK_ROOT" ]; then - export PATH=$PATH:$INSTACK_ROOT/instack-undercloud/scripts + PATH=$PATH:$INSTACK_ROOT/instack-undercloud/scripts + export PATH fi if [ ! -f /root/.ssh/authorized_keys ]; then @@ -23,7 +25,8 @@ fi cat /root/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys -export UNDERCLOUD_IP=$(os-apply-config --key local-ip --type netaddress) +UNDERCLOUD_IP=$(os-apply-config --key local-ip --type netaddress) +export UNDERCLOUD_IP DHCP_START=$(os-apply-config --key neutron.dhcp_start --type netaddress) DHCP_END=$(os-apply-config --key neutron.dhcp_end --type netaddress) diff --git a/instack_undercloud/tests/test_undercloud.py b/instack_undercloud/tests/test_undercloud.py index 0ac1fc1fc..ac4bbba9e 100644 --- a/instack_undercloud/tests/test_undercloud.py +++ b/instack_undercloud/tests/test_undercloud.py @@ -45,13 +45,14 @@ class TestUndercloud(BaseTestCase): @mock.patch('instack_undercloud.undercloud._run_command') @mock.patch('instack_undercloud.undercloud._post_config') @mock.patch('instack_undercloud.undercloud._run_orc') + @mock.patch('instack_undercloud.undercloud._run_yum_update') @mock.patch('instack_undercloud.undercloud._run_instack') @mock.patch('instack_undercloud.undercloud._generate_environment') @mock.patch('instack_undercloud.undercloud._load_config') def test_install(self, mock_load_config, mock_generate_environment, - mock_run_instack, mock_run_orc, mock_post_config, - mock_run_command, mock_validate_configuration, - mock_configure_logging): + mock_run_yum_update, mock_run_instack, mock_run_orc, + mock_post_config, mock_run_command, + mock_validate_configuration, mock_configure_logging): fake_env = mock.MagicMock() mock_generate_environment.return_value = fake_env undercloud.install('.') diff --git a/instack_undercloud/undercloud.py b/instack_undercloud/undercloud.py index 525ca9347..2b9ff8c0c 100644 --- a/instack_undercloud/undercloud.py +++ b/instack_undercloud/undercloud.py @@ -990,6 +990,13 @@ def _run_instack(instack_env): LOG.info('Instack completed successfully') +def _run_yum_update(instack_env): + args = ['sudo', 'yum', 'update', '-y'] + LOG.info('Running yum update') + _run_live_command(args, instack_env, 'yum-update') + LOG.info('yum-update completed successfully') + + def _run_orc(instack_env): args = ['sudo', 'os-refresh-config'] LOG.info('Running os-refresh-config') @@ -1202,6 +1209,7 @@ def install(instack_root): _validate_configuration() instack_env = _generate_environment(instack_root) _generate_init_data(instack_env) + _run_yum_update(instack_env) _run_instack(instack_env) _run_orc(instack_env) _post_config(instack_env) diff --git a/scripts/instack-virt-setup b/scripts/instack-virt-setup index 964b67508..da2123001 100755 --- a/scripts/instack-virt-setup +++ b/scripts/instack-virt-setup @@ -183,7 +183,7 @@ while true; do break fi sleep 3 - (( elapsed_seconds += 3 )) + elapsed_seconds=$((elapsed_seconds + 3)) if [ $elapsed_seconds -ge $timeout_seconds ]; then set +x echo "$UNDERCLOUD_VM_NAME never got an IP address from the libvirt default network."