Files
tripleo-quickstart-extras/roles/undercloud-setup/tasks/hostname.yml
Dan Prince 86ceb2b356 Fix the undercloud-containers job
The undercloud installer (when using --heat-native) can configure
its own docker settings.

Also, use yum install to add required packages until we can get these
installed via RDO.

Ensure the /etc/hosts file is cleaned out for the undercloud deployment

Co-Authored-By: Wes Hayutin <weshayutin@gmail.com>

Depends-On: I2d569eef136254dc81bdee93a7869fd361a8400d
Change-Id: I583128ef8fb986a08ea372344ed072e506b97d89
2017-11-17 17:01:21 -05:00

25 lines
864 B
YAML

---
# 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:
src: hostname.sh.j2
dest: "{{ working_dir }}/hostname.sh"
mode: 0755
- name: Run the hostname correcting script
shell: >
set -o pipefail &&
{{ working_dir }}/hostname.sh 2>&1 {{ timestamper_cmd }} > {{ working_dir }}/hostname.sh.log
become: true