9e4ea666b5
There were a few instances of trailing whitespace. This patch removes them. Change-Id: Ia2f978a23336e9e7b43049812152cd9538a702e9
17 lines
567 B
YAML
17 lines
567 B
YAML
---
|
|
# Set hostname and /etc/hosts
|
|
# Inspired by:
|
|
# https://github.com/ansible/ansible/pull/8482)
|
|
# https://gist.github.com/rothgar/8793800
|
|
- name: Set /etc/hostname
|
|
hostname: name="{{ inventory_hostname.split('.', 1)[0] }}"
|
|
|
|
# " lovely lonely double-quote for fixing vim highlighting
|
|
|
|
- name: Add all infra hosts to /etc/hosts
|
|
lineinfile: dest=/etc/hosts
|
|
line='{{ hostvars[item]['openstack']['private_v4'] }} {{ item }} {{ item.split('.', 1)[0] }}'
|
|
insertafter='^127\.0\.0\.1'
|
|
state=present
|
|
with_items: groups['infra']
|