diff --git a/roles/extras-common/defaults/main.yml b/roles/extras-common/defaults/main.yml index 0b41d2f6f..b8158f881 100644 --- a/roles/extras-common/defaults/main.yml +++ b/roles/extras-common/defaults/main.yml @@ -2,6 +2,7 @@ overcloud_ipv6: false containerized_overcloud: false +containerized_undercloud: false containerized_overcloud_upgrade: false local_docker_registry_host: "{{undercloud_network_gateway|default(undercloud_network_cidr|nthhost(1))}}" docker_registry_namespace: tripleoupstream diff --git a/roles/overcloud-prep-images/templates/overcloud-prep-images.sh.j2 b/roles/overcloud-prep-images/templates/overcloud-prep-images.sh.j2 index 747c509c2..e042c38c1 100644 --- a/roles/overcloud-prep-images/templates/overcloud-prep-images.sh.j2 +++ b/roles/overcloud-prep-images/templates/overcloud-prep-images.sh.j2 @@ -52,11 +52,6 @@ glance image-create --container-format bare \ {% endif %} -## .. note:: Workaround for https://bugzilla.redhat.com/show_bug.cgi?id=1391602 -## :: - -sudo systemctl restart openstack-ironic-conductor && sleep 30 - {% if step_register|bool %} ## * Register nodes with Ironic. diff --git a/roles/undercloud-deploy/templates/undercloud-deploy.sh.j2 b/roles/undercloud-deploy/templates/undercloud-deploy.sh.j2 index 01e113bda..442451bed 100644 --- a/roles/undercloud-deploy/templates/undercloud-deploy.sh.j2 +++ b/roles/undercloud-deploy/templates/undercloud-deploy.sh.j2 @@ -49,11 +49,27 @@ EOF_CAT sudo yum update -y {{ undercloud_update_packages }} {% endif %} +# TODO: remove this once we land patch to install them via RPM +sudo yum install -y \ + openstack-heat-api \ + openstack-heat-engine \ + openstack-heat-monolith \ + python-heat-agent \ + python-heat-agent-apply-config \ + python-heat-agent-ansible \ + python-heat-agent-hiera \ + python-heat-agent-puppet \ + python-heat-agent-docker-cmd \ + python-heat-agent-json-file \ + python-ipaddr \ + python-tripleoclient \ + openvswitch \ + openstack-puppet-modules + ## * Start the required services. ## :: sudo systemctl start openvswitch -sudo systemctl start docker #FIXME: do these in the installer? ## * Update the puppet modules or install custom modules. ## NOTE: breaks installed packages, is a pure hack in for dev envs only! @@ -68,6 +84,14 @@ sudo systemctl start docker #FIXME: do these in the installer? #cd "${MODULE_PATH}" #git clone -b dev https://github.com/foo/puppet-bar bar +## * get build id +## :: +{% if get_build_command is defined: %} +BUILD_ID={{ get_build_command }} +{% else %} +BUILD_ID={{ docker_image_tag }} +{% endif %} + # Copy installed/cloned modules and make a symlink #sudo rsync -avxH "${MODULE_PATH}" /usr/share/openstack-puppet/ sudo mkdir -p /etc/puppet/modules/ @@ -85,7 +109,6 @@ openstack overcloud container image prepare \ -e {{overcloud_templates_path}}/environments/docker.yaml \ {% endif %} -r {{undercloud_roles_data}} \ - --namespace {{ undercloud_docker_registry_host }}:{{ undercloud_docker_registry_port }}/{{ undercloud_docker_registry_namespace }} {% else %} openstack overcloud container image prepare \ {% if containerized_undercloud|bool %} @@ -95,6 +118,8 @@ openstack overcloud container image prepare \ -e {{overcloud_templates_path}}/environments/docker.yaml \ {% endif %} -r {{undercloud_roles_data}} \ + --namespace {{ docker_registry_host }}/{{ docker_registry_namespace }} \ + --tag $BUILD_ID \ --env-file {{ working_dir }}/undercloud-containers-default-parameters.yaml {% endif %} @@ -115,6 +140,7 @@ undercloud_local_ip={{ hostvars['undercloud'].undercloud_ip }} # starts supporting 'openstack undercloud deploy -r' option. sudo openstack undercloud deploy \ + --heat-native \ --templates={{overcloud_templates_path}} \ --local-ip=$undercloud_local_ip \ -e {{ working_dir }}/custom_undercloud_deploy.yaml \ diff --git a/roles/undercloud-setup/tasks/hostname.yml b/roles/undercloud-setup/tasks/hostname.yml index 5afd0c967..3f9900d4c 100644 --- a/roles/undercloud-setup/tasks/hostname.yml +++ b/roles/undercloud-setup/tasks/hostname.yml @@ -1,4 +1,15 @@ --- +# sanitize the /etc/hosts file in the same way the overcloud node is. +# https://github.com/openstack-infra/tripleo-ci/blob/master/toci-quickstart/playbooks/multinode.yml#L14-L31 +# for undercloud containers only +- name: Create a clean hosts file on the undercloud/slave + copy: + dest: /etc/hosts + content: | + 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 + ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 + become: true + when: containerized_undercloud|bool - name: Install hostname correcting script template: @@ -10,3 +21,4 @@ shell: > set -o pipefail && {{ working_dir }}/hostname.sh 2>&1 {{ timestamper_cmd }} > {{ working_dir }}/hostname.sh.log + become: true diff --git a/roles/undercloud-setup/templates/hostname.sh.j2 b/roles/undercloud-setup/templates/hostname.sh.j2 index 8e9f2b3de..db8f0fa8a 100644 --- a/roles/undercloud-setup/templates/hostname.sh.j2 +++ b/roles/undercloud-setup/templates/hostname.sh.j2 @@ -3,22 +3,29 @@ set -eux ### --start_docs ## Adjust the hostname as necessary (usually on the undercloud) +## Note.. run this script with sudo or root ## ============================================================ - {% if hostname_correction|bool %} ## * Correct the host's transient hostname to a static one ## :: -sudo hostnamectl set-hostname --transient $(hostnamectl --static) +hostnamectl set-hostname --transient $(hostnamectl --static) {% elif step_set_undercloud_hostname|bool %} ## * Set the host's transient and static hostnames ## :: -sudo hostnamectl set-hostname --transient {{ undercloud_hostname }} -sudo hostnamectl set-hostname --static {{ undercloud_hostname }} +hostnamectl set-hostname --transient {{ undercloud_hostname }} +hostnamectl set-hostname --static {{ undercloud_hostname }} {% endif %} +## * Sanitize the /etc/hosts for duplicate entries +## :: + +cp /etc/hosts /etc/hosts.bak +awk '!seen[$0]++' /etc/hosts > /etc/hosts.new +mv -f /etc/hosts.new /etc/hosts + ### --stop_docs