From 75e02d510313bde9cdf4c5fe8bfd6148eea3ffef Mon Sep 17 00:00:00 2001 From: Mark Goddard Date: Wed, 5 Apr 2017 16:04:10 +0100 Subject: [PATCH] Allow compute nodes being discovered to be limited --- ansible/compute-node-discovery.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ansible/compute-node-discovery.yml b/ansible/compute-node-discovery.yml index 983d26543..51154757e 100644 --- a/ansible/compute-node-discovery.yml +++ b/ansible/compute-node-discovery.yml @@ -2,6 +2,11 @@ - name: Ensure compute nodes are present in the Ansible inventory hosts: config-mgmt gather_facts: no + vars: + # Set this to a colon-separated list of compute node hostnames on which to + # trigger discovery. If unset, all compute nodes will be triggered. + compute_node_limit: + compute_node_limit_list: "{{ compute_node_limit.split(':') }}" tasks: - name: Add hosts for the compute nodes add_host: @@ -12,6 +17,7 @@ when: - "{{ item.key not in groups['all'] }}" - "{{ item.key | replace('-idrac', '') not in groups['all'] }}" + - "{{ not compute_node_limit or item.key | replace('-idrac', '') in compute_node_limit_list }}" run_once: True - name: Ensure compute nodes are PXE booted