From df56ea4ea3a68ed81e2cc7d313a44d0a59e5baa4 Mon Sep 17 00:00:00 2001
From: Monty Taylor <mordred@inaugust.com>
Date: Fri, 6 Oct 2017 13:54:27 -0500
Subject: [PATCH] Add sub_nodes and node_private files in /etc/nodepool

TripleO-CI uses these for things.

Change-Id: Id2fd8d0a0aeedfaedf84004dbab61e9988163fa7
---
 playbooks/legacy/pre.yaml | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/playbooks/legacy/pre.yaml b/playbooks/legacy/pre.yaml
index 490dcb3c..ecec58be 100644
--- a/playbooks/legacy/pre.yaml
+++ b/playbooks/legacy/pre.yaml
@@ -8,7 +8,13 @@
       copy:
         dest: /etc/nodepool/sub_nodes_private
         content: ""
-    - name: Populate nodepool subnodes file
+    - name: Populate nodepool sub_nodes file
+      lineinfile:
+        path: /etc/nodepool/sub_nodes
+        line: "{{ hostvars[item]['nodepool']['public_ipv4'] }}"
+      with_items: "{{ groups['subnodes'] }}"
+      when: groups['subnodes'] is defined
+    - name: Populate nodepool sub_nodes_private file
       lineinfile:
         path: /etc/nodepool/sub_nodes_private
         line: "{{ hostvars[item]['nodepool']['private_ipv4'] }}"
@@ -19,6 +25,10 @@
         dest: /etc/nodepool/primary_node_private
         content: "{{ hostvars['primary']['nodepool']['private_ipv4'] }}"
       when: hostvars['primary'] is defined
+    - name: Create nodepool node_private for this node
+      copy:
+        dest: /etc/nodepool/node_private
+        content: "{{ nodepool.private_ipv4 }}"
     - name: Copy ssh keys to nodepool directory
       command: "cp .ssh/{{ item }} /etc/nodepool/{{ item }}"
       with_items: