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
Added ignore unreachable option to the serial variable Feature #37309 #37587
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -216,6 +216,23 @@ the pool. | |
In the event of a problem, fix the few servers that fail using Ansible's automatically generated | ||
retry file to repeat the deploy on just those servers. | ||
|
||
You can also ignore unreachable node to go ahead with your job, suppose for example you have 6 nodes and you | ||
want to dived it in groups of 2, an example of serialization option should be:: | ||
|
||
--- | ||
|
||
- hosts: webservers | ||
serial: [[2, 1], 2, 2] | ||
|
||
|
||
In this case, the first group represented by the list [2, 1] has a value of 1 (True) regarding the question | ||
"Do you want to ignroe unreachable?". For others groups the implicit answer to the question is 0 (False). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. More typos here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @dharmabumstead review more wording/style here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jimi-c Thank you, let me know what do you like to modify, if necessary I will do a new push request for the merge. |
||
At this point if one or both machines in the first group of 2 are unreachable, ansible go ahead with the | ||
second group and does not stop the job. If in the second group one machine is unreachable, ansible does not | ||
stop (this is the default behavoir also in old versions of ansible). If in the second group both machines | ||
are unreachable, ansible stop the job. | ||
|
||
|
||
Achieving Continuous Deployment | ||
``````````````````````````````` | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -111,6 +111,32 @@ You can also mix and match the values:: | |
.. note:: | ||
No matter how small the percentage, the number of hosts per pass will always be 1 or greater. | ||
|
||
You can also ignore unreachable node to go ahead with your job, suppose for example you have 6 nodes and you | ||
want to divide it in groups of 2, an example of serialization option should be:: | ||
|
||
--- | ||
|
||
- hosts: webservers | ||
serial: [[2, 1], 2, 2] | ||
|
||
|
||
In this case, the first group represented by the list [2, 1] has a value of 1 (True) regarding the question | ||
"Do you want to ignroe unreachable?". For others groups the implicit answer to the question is 0 (False). | ||
At this point if one or both machines in the first group of 2 are unreachable, ansible go ahead with the | ||
second group and does not stop the play. If in the second group one machine is unreachable, ansible does not | ||
stop (this is the default behavoir also in old versions of ansible). If in the second group both machines | ||
are unreachable, ansible stop the play. | ||
|
||
.. note:: | ||
Valid value are only 0 and 1, False and True, other values will be ignored and 0 will be used. Example:: | ||
|
||
--- | ||
|
||
- hosts: webservers | ||
serial: [[2, 1], [2,0], 2, [4, False], [3, True], [2, "False"]] | ||
|
||
|
||
Last value will result as [2, 0] because "False" in this case is a string and not a boolean. | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would like to modify the note to .. note::
The second list [2, 2] is not valid and ansible will replace it with [2, 0] |
||
.. _maximum_failure_percentage: | ||
|
||
|
@@ -132,6 +158,7 @@ In the above example, if more than 3 of the 10 servers in the group were to fail | |
|
||
The percentage set must be exceeded, not equaled. For example, if serial were set to 4 and you wanted the task to abort | ||
when 2 of the systems failed, the percentage should be set at 49 rather than 50. | ||
Unreachables machine are always not considered as failed if you use max_fail_percentage. | ||
|
||
.. _delegation: | ||
|
||
|
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.
Grammar, typos here. Suggested fix:
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.
Hi @jimi-c , what do you think about this modification?
If this is ok for you, I will do same modification in the other files. Eventually I could open a new clean merge request and we will close this one.
You can also ignore unreachable nodes to go ahead with your job. For example, if you have six (6) nodes and you want to divide it into groups of two (2), an example of the serialization option should be::
This is also equivalent to::
We have three (3) groups of nodes and every group contains two (2) nodes:
The first group is represented by the list [2, 1] and has a value of 1 (True).
This boolean value represents the answer to the question "Do you want to ignore unreachable machines?".
The second and third group are both represented by [2, 0] and the implicit answer to the previous question is 0 (False).
If you do not explicitly set 1 (True) the default value will be 0 (False).
At this point, the ansible run will have this behavior:
If in the first group one or both nodes are unreachable, ansible will not stop and continue with the
second group.
If in the second group one node is unreachable, ansible will not stop and continue with the third group;
this is the default behavior, also in old versions of ansible.
If in the second group both nodes are unreachable, ansible will stop the job.