- api_uri: 'https://jenkins.ceph.com'
- jenkins_credentials_uuid: 'jenkins-build'
- nodename: '{{ nodename }}'
- - labels: "{{ jenkins_labels[inventory_hostname] }}"
+ - label: "{{ jenkins_labels[inventory_hostname] }}"
- grant_sudo: true
- osc_user: 'username'
- osc_pass: 'password'
# mapping from Jenkins back to whatever service created the current
# node
name: "{{ ansible_default_ipv4.address }}+{{ nodename }}"
- labels: "{{ labels | default('') }}"
+ label: "{{ label | default('') }}"
host: "{{ ansible_default_ipv4.address }}"
credentialsId: "{{ jenkins_credentials_uuid }}"
remoteFS: '/home/{{ jenkins_user }}/build'
# mapping from Jenkins back to whatever service created the current
# node
name: "{{ ansible_default_ipv4.address }}+{{ ansible_hostname }}"
- labels: "{{ labels }}"
+ label: "{{ label }}"
host: "{{ ansible_default_ipv4.address }}"
credentialsId: "{{ jenkins_credentials_uuid }}"
launcher: 'hudson.slaves.JNLPLauncher'
required: false
default: null
- labels:
+ label:
description:
- - Labels to associate with a node, like "amd64" or "python"
+ - List of labels in a string, space-separated, to associate with a node, like "amd64" or "python"
required: false
default: null
def sanitize_update_params(kw):
- def translate_labels(labels):
- return 'label', ' '.join(labels)
-
# this list may be smaller than it needs to be, but these are
# the only ones I want to support for now
VALID_UPDATE_PARAMS = {
'name': None,
'remoteFS': None,
'numExecutors': None,
- 'labels': translate_labels,
+ 'label': None,
}
update_kws = dict()
invalid = list()
for k, v in kw.items():
- v = maybe_convert_string_to_list(v)
if k not in VALID_UPDATE_PARAMS:
invalid.append(k)
else:
j.reconfig_node(name, new_xconfig)
else:
+ if 'label' in params:
+ params['labels'] = params['label']
+ params.pop('label')
j.create_node(name, launcher_params=launcher_params, **params)
if not j.node_exists(name):
return False, "Failed to create node '%s'." % name
name=dict(required=True),
executors=dict(required=False, default=2),
description=dict(required=False, default=None),
- labels=dict(required=False, default=None),
+ label=dict(required=False, default=None),
host=dict(required=False, default=None),
credentialsId=dict(required=False, default=None),
launcher=dict(required=False, default='hudson.plugins.sshslaves.SSHLauncher'),
name = module.params['name']
executors = module.params['executors']
description = module.params.get('description')
- labels = module.params.get('labels')
+ label = module.params.get('label')
exclusive = module.params.get('exclusive', False)
host = module.params.get('host')
remoteFS = module.params.get('remoteFS')
name,
executors=executors,
description=description,
- labels=labels,
+ label=label,
exclusive=exclusive,
host=host,
credentialsId=credentialsId,