-
Notifications
You must be signed in to change notification settings - Fork 168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ansible: dynamically exclude jenkins-workspace
#3816
Conversation
The `ansible/playbooks/jenkins/worker/create.yml` playbook runs some tasks at the end to remove Node.js and check there is no runnable `node` in the path. This is done on all `test` and `release` machines with the exception of the `jenkins-workspace` machines, which need a runnable `node` to run the linters. Previously each `jenkins-workspace` machine was listed as an exclusion to `hosts`. This PR moves the exclusion into the tasks and checks if the host has an alias that begins `jenkins-workspace` (as all of our `jenkins-workspace` machines are defined). This will avoid one place that we have to remember to manually update every time we add/remove a `jenkins-workspace` machine.
This was something I missed reviewing #3815 and meant that the playbook was removing With this PR they now are excluded without having to manually add them:
|
when: os|startswith("win") | ||
when: | ||
- os|startswith("win") | ||
- not (alias is defined and alias is match('jenkins-workspace.*')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically this one isn't needed -- we have no "win*" hosts that are also jenkins-workspace
but I've added it for consistency with all the other tasks.
The
ansible/playbooks/jenkins/worker/create.yml
playbook runs some tasks at the end to remove Node.js and check there is no runnablenode
in the path. This is done on alltest
andrelease
machines with the exception of thejenkins-workspace
machines, which need a runnablenode
to run the linters.Previously each
jenkins-workspace
machine was listed as an exclusion tohosts
. This PR moves the exclusion into the tasks and checks if the host has an alias that beginsjenkins-workspace
(as all of ourjenkins-workspace
machines are defined). This will avoid one place that we have to remember to manually update every time we add/remove ajenkins-workspace
machine.