Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request is made of 4 commits, each addressing a specific additional feature or bug fix.
1. Added possibility to skip tasks that require privilege escalation (become) [8c322e1]
We might want to run the Ansible playbook without executing any of the tasks that require privilege escalation. For example, if we don't need to deploy any component and only want to push the new tests pipeline into the scheduler and TestAPI.
This change adds a new boolean variable
become_tasks
which defaults totrue
. It is used as a condition for all tasks that required privilege escalation. For tasks where privilege escalation depended on a condition (e.g.become: "{{ ansible_connection is defined }}"
), the skipping condition inwhen
includes the "or" and negation of this condition so that the task is not skipped when privilege escalation was not needed. In that example, the condition will bebecome_tasks or ansible_connection is not defined
.2. Added possibility to change Jenkins agent's name (w/o K8s) [d81816f]
This is necessary if we want to use the Ansible role to deploy multiple Jenkins agents on the same machine. It was not possible because the container name was hardcoded and always the same: "jenkins-agent".
A new variable is added:
jenkins_agent_auto_container_name
, which defaults tojenkins-agent
. It is used in the "Starting Jenkins agent" task, whenkubernetes_deploy
isfalse
.3. Added disjoint URLs for TestAPI deploy and test execution vars [641edf3]
The same variable
testapi_url
was used in two different contexts:A new variable is added:
testapi_deploy_url
, whch defaults to the value oftestapi_url
.It is now possible to use a different endpoint for these two actions, which is useful because if the runner is not located on the machine where the playbook is executed then it may not be able to reach TestAPI via the same URL.
4. Fixed wrong TestAPI pod name registration [90283c0]
There was a discrepancy between the pod name registration and the pod_name used by the container when trying to push results to TestAPI (see https://github.com/opnfv/functest-xtesting/blob/861f79d46397d8bbc5b55b95bc4ca2ac0fb1f247/xtesting/core/testcase.py#L222)
The registration tasks used the value of the
project
variable from the Ansible playbook, whereas the test container used theNODE_NAME
environment variable (defined inrun.yaml.j2
, either equal to the slave name or tonode_name
ifuse_slave
isfalse
).The change proposes to register the pods based on the values of the
slave
variables in the Docker tags if defined (ornode_name
if not defined). It adds a loop in the task and makes it possible to register multiple pods.