Browse Source

Generate the /etc/hosts content once.

This resolves a performance penalty of rendering many
hosts files for large deployments. Since they should
all match, we now generate the hosts block once and then
push it out to all of the nodes.

Change-Id: Iff6db6a520b9ff7fbb737a1ddb69c66cc2008ea7
Closes-Bug: #1860146
Signed-off-by: Luke Short <ekultails@gmail.com>
(cherry picked from commit dac34d302c)
changes/52/704152/1
Luke Short 1 month ago
parent
commit
213072ca63
1 changed files with 13 additions and 6 deletions
  1. +13
    -6
      tripleo_ansible/roles/tripleo-hosts-entries/tasks/main.yml

+ 13
- 6
tripleo_ansible/roles/tripleo-hosts-entries/tasks/main.yml View File

@@ -27,12 +27,10 @@
tags:
- tripleo_hosts_entries

- name: Update /etc/hosts
become: true
blockinfile:
create: true
path: "{{ tripleo_hosts_entries_hosts_path }}"
block: |
- name: Render out the hosts entries
run_once: true
set_fact:
tripleo_hosts_entries_block: |
{{ tripleo_hosts_entries_undercloud_hosts_entries | join('') }}

{{ tripleo_hosts_entries_vip_hosts_entries | join('') }}
@@ -55,3 +53,12 @@
{{ tripleo_hosts_entries_extra_hosts_entries | join('') }}
tags:
- tripleo_hosts_entries

- name: Update /etc/hosts
become: true
blockinfile:
create: true
path: "{{ tripleo_hosts_entries_hosts_path }}"
block: "{{ tripleo_hosts_entries_block }}"
tags:
- tripleo_hosts_entries

Loading…
Cancel
Save