#!/bin/bash if [ "${DIB_DEBUG_TRACE:-0}" -gt 0 ]; then set -x fi set -eu set -o pipefail ANSIBLE_DEPLOY_HOSTAME="ironic-ansible-deploy" echo $ANSIBLE_DEPLOY_HOSTAME > /etc/hostname # not having a hostname in hosts produces an extra output # on every "sudo" command like the following: # # sudo: unable to resolve host \r\n # # which as of Ansible 2.0.1.0 fails JSON parsing # in case of tasks using become+async. # Ansible issues #13965 (fixed in 2.0.1.0), #14568, #14714 # ensure /etc/hosts has hostname in it echo "127.0.0.1 $ANSIBLE_DEPLOY_HOSTAME" >> /etc/hosts