Stop writing nodepool bash variable on nodes

Like the previous commit, we can move this process into zuulv3 and use
ansible.

Change-Id: I49f84c3e633a601f05977cc9dca5a5b37769ed2f
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
Paul Belanger 2017-03-14 12:40:44 -04:00
parent 89de79e730
commit ad68eb827d
3 changed files with 0 additions and 86 deletions

View File

@ -13,7 +13,6 @@ Contents:
installation installation
configuration configuration
scripts
operation operation
devguide devguide

View File

@ -1,45 +0,0 @@
.. _scripts:
Node Ready Scripts
==================
Each label can specify a ready script with `ready-script`. This script can be
used to perform any last minute changes to a node after it has been launched
but before it is put in the READY state to receive jobs. In particular, it
can read the files in /etc/nodepool to perform multi-node related setup.
Those files include:
**/etc/nodepool/role**
Either the string ``primary`` or ``sub`` indicating whether this
node is the primary (the node added to the target and which will run
the job), or a sub-node.
**/etc/nodepool/node**
The IP address of this node.
**/etc/nodepool/node_private**
The private IP address of this node.
**/etc/nodepool/primary_node**
The IP address of the primary node, usable for external access.
**/etc/nodepool/primary_node_private**
The Private IP address of the primary node, for internal communication.
**/etc/nodepool/sub_nodes**
The IP addresses of the sub nodes, one on each line,
usable for external access.
**/etc/nodepool/sub_nodes_private**
The Private IP addresses of the sub nodes, one on each line.
**/etc/nodepool/id_rsa**
An OpenSSH private key generated specifically for this node group.
**/etc/nodepool/id_rsa.pub**
The corresponding public key.
**/etc/nodepool/provider**
Information about the provider in a shell-usable form. This
includes the following information:
**NODEPOOL_PROVIDER**
The name of the provider
**NODEPOOL_CLOUD**
The name of the cloud
**NODEPOOL_REGION**
The name of the region
**NODEPOOL_AZ**
The name of the availability zone (if available)

View File

@ -19,7 +19,6 @@
import logging import logging
import os import os
import os.path import os.path
import paramiko
import pprint import pprint
import random import random
import socket import socket
@ -368,45 +367,6 @@ class NodeLauncher(threading.Thread, StatsReporter):
self._node.host_keys = host_keys self._node.host_keys = host_keys
self._zk.storeNode(self._node) self._zk.storeNode(self._node)
self._writeNodepoolInfo(host, preferred_ip, self._node)
def _writeNodepoolInfo(self, host, preferred_ip, node):
key = paramiko.RSAKey.generate(2048)
public_key = key.get_name() + ' ' + key.get_base64()
host.ssh("test for config dir", "ls /etc/nodepool")
ftp = host.client.open_sftp()
# The IP of this node
f = ftp.open('/etc/nodepool/node', 'w')
f.write(preferred_ip + '\n')
f.close()
# The private IP of this node
f = ftp.open('/etc/nodepool/node_private', 'w')
f.write(node.private_ipv4 + '\n')
f.close()
# The SSH key for this node set
f = ftp.open('/etc/nodepool/id_rsa', 'w')
key.write_private_key(f)
f.close()
f = ftp.open('/etc/nodepool/id_rsa.pub', 'w')
f.write(public_key + '\n')
f.close()
# Provider information for this node set
f = ftp.open('/etc/nodepool/provider', 'w')
f.write('NODEPOOL_PROVIDER=%s\n' % self._provider.name)
f.write('NODEPOOL_CLOUD=%s\n' % self._provider.cloud_config.name)
f.write('NODEPOOL_REGION=%s\n' % (
self._provider.region_name or '',))
f.write('NODEPOOL_AZ=%s\n' % (node.az or '',))
f.close()
# The instance UUID for this node
f = ftp.open('/etc/nodepool/uuid', 'w')
f.write(node.external_id + '\n')
f.close()
ftp.close()
def _run(self): def _run(self):
attempts = 1 attempts = 1
while attempts <= self._retries: while attempts <= self._retries: