)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":23084,"name":"Bartosz Bezak","email":"bartosz@stackhpc.com","username":"b.bezak"},"change_message_id":"477b8a7d71db3c7ede67a1b3ebe8eb88c6edef48","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"c4676719_699d07b9","updated":"2024-02-08 14:27:29.000000000","message":"I\u0027ve tested it locally and it is working without limit, but failing with limit:\n\nfatal: [HOSTNAME]: FAILED! \u003d\u003e\n  msg: |-\n    The task includes an option with an undefined variable. The error was: \u0027dict object\u0027 has no attribute \u0027nodename\u0027. \u0027dict object\u0027 has no attribute \u0027nodename\u0027\n\n    The error appears to be in \u0027/home/kayobe/deployment/src/kayobe/ansible/roles/etc-hosts/tasks/etc-hosts.yml\u0027: line 27, column 3, but may\n    be elsewhere in the file depending on the exact syntax problem.\n\n    The offending line appears to be:\n\n\n    - name: Generate /etc/hosts for all of the nodes\n      ^ here","commit_id":"4921531762eccae52a0871ac40f4b5b65cdb0657"},{"author":{"_account_id":23084,"name":"Bartosz Bezak","email":"bartosz@stackhpc.com","username":"b.bezak"},"change_message_id":"477b8a7d71db3c7ede67a1b3ebe8eb88c6edef48","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"32e517bf_de4b3214","updated":"2024-02-08 14:27:29.000000000","message":"did you test that?","commit_id":"4921531762eccae52a0871ac40f4b5b65cdb0657"},{"author":{"_account_id":15197,"name":"Pierre Riteau","email":"pierre@stackhpc.com","username":"priteau","status":"StackHPC"},"change_message_id":"253cd40852cddeff8a0f3404033c2140259e56a2","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"598e39b4_00e80f1a","updated":"2024-02-08 08:35:42.000000000","message":"recheck\n\nbuild-openstack-releasenotes should be fixed","commit_id":"4921531762eccae52a0871ac40f4b5b65cdb0657"},{"author":{"_account_id":35263,"name":"Matt Crees","email":"mattc@stackhpc.com","username":"mattcrees"},"change_message_id":"a92ac2f0dce2686d4886b350d16b82621588c495","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"f8d7e301_f356b847","updated":"2024-02-07 16:15:07.000000000","message":"recheck build failed","commit_id":"4921531762eccae52a0871ac40f4b5b65cdb0657"},{"author":{"_account_id":28048,"name":"Will Szumski","email":"will@stackhpc.com","username":"jovial"},"change_message_id":"fdd96f5f99a7cb82abd893682cd3406db9f09ee5","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"7e5066cc_7f090093","updated":"2024-02-02 10:37:20.000000000","message":"recheck: CI should be fixed","commit_id":"4921531762eccae52a0871ac40f4b5b65cdb0657"},{"author":{"_account_id":35263,"name":"Matt Crees","email":"mattc@stackhpc.com","username":"mattcrees"},"change_message_id":"f43d95ed8bcfb0a3da193bfd2cae73f267b27eaf","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"b422dfbd_1f4ea24e","in_reply_to":"30984a91_c8544946","updated":"2024-02-12 13:55:16.000000000","message":"This is ready for review again, the gather-facts-delegated role needed to be updated.","commit_id":"4921531762eccae52a0871ac40f4b5b65cdb0657"},{"author":{"_account_id":35263,"name":"Matt Crees","email":"mattc@stackhpc.com","username":"mattcrees"},"change_message_id":"531ed75db8e9e6930a320c16d97269756c3f7786","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":1,"id":"5b2fa45d_f574bded","in_reply_to":"444ac47d_96957ccc","updated":"2024-02-08 14:59:16.000000000","message":"I did test this, in Yoga though IIRC. Will -1 and try to recreate this failure","commit_id":"4921531762eccae52a0871ac40f4b5b65cdb0657"},{"author":{"_account_id":35263,"name":"Matt Crees","email":"mattc@stackhpc.com","username":"mattcrees"},"change_message_id":"01acf585d62e935628a242218ed0f86cd02da941","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":1,"id":"daff74e8_a7137ee9","in_reply_to":"5b2fa45d_f574bded","updated":"2024-02-08 15:01:38.000000000","message":"(actually this can\u0027t have been in yoga, the role was introduced in antelope)","commit_id":"4921531762eccae52a0871ac40f4b5b65cdb0657"},{"author":{"_account_id":23084,"name":"Bartosz Bezak","email":"bartosz@stackhpc.com","username":"b.bezak"},"change_message_id":"596b14744431703b8e3ce7f4e0c2340ed0a3d93d","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":1,"id":"444ac47d_96957ccc","in_reply_to":"c4676719_699d07b9","updated":"2024-02-08 14:31:26.000000000","message":"I tested it on antelope though","commit_id":"4921531762eccae52a0871ac40f4b5b65cdb0657"},{"author":{"_account_id":35263,"name":"Matt Crees","email":"mattc@stackhpc.com","username":"mattcrees"},"change_message_id":"8f75bf55008c870b0a421496face59cb0c6902ee","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":1,"id":"30984a91_c8544946","in_reply_to":"daff74e8_a7137ee9","updated":"2024-02-09 12:34:56.000000000","message":"I\u0027ve been able to recreate this issue. It seems that the gather-facts-delegated task is being skipped, even though it should run when using --limit. Let\u0027s keep this workflow -1 while I look to fix this.\n\n```\nTASK [gather-facts-delegated : Gather facts for all hosts (if using --limit)]\n********************************\nskipping: [controller0] \u003d\u003e (item\u003dcontroller0)\nskipping: [controller0]\n```","commit_id":"4921531762eccae52a0871ac40f4b5b65cdb0657"},{"author":{"_account_id":28048,"name":"Will Szumski","email":"will@stackhpc.com","username":"jovial"},"change_message_id":"86c9dabf644453e6463395452cf9a1067ccf97fc","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"eb3add6b_a7584528","updated":"2024-02-15 15:45:35.000000000","message":"Nice, and good catch with facts gathering failing when there was a limit!","commit_id":"6c9c7fa0cb10576d7c5bfe7c8c8017d69097db80"},{"author":{"_account_id":28048,"name":"Will Szumski","email":"will@stackhpc.com","username":"jovial"},"change_message_id":"3a673465edc0cbd01c7d22d808d814f3ddc491c4","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"2e1677ab_c67b9481","updated":"2024-02-15 15:55:56.000000000","message":"Sorry, just going to review the batching code a little more closely.","commit_id":"6c9c7fa0cb10576d7c5bfe7c8c8017d69097db80"},{"author":{"_account_id":28048,"name":"Will Szumski","email":"will@stackhpc.com","username":"jovial"},"change_message_id":"e868a22a1d3a9d28e89a656126a4a3edd140e07b","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"c2952121_ce5d618c","updated":"2024-02-16 11:16:55.000000000","message":"Thanks, I\u0027ve tested and it seem to work 👍","commit_id":"acde9066ecbb9b0066a732b01f8d8189051ecd67"},{"author":{"_account_id":14826,"name":"Mark Goddard","email":"markgoddard86@gmail.com","username":"mgoddard"},"change_message_id":"fb647d1236030819f93ba358f43b3894e65d7976","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"74729849_cb21ce5f","updated":"2024-02-26 16:45:28.000000000","message":"Looks good, just a few points.","commit_id":"f005afabff3e958ac14a39b70fb33c9981043a92"},{"author":{"_account_id":35263,"name":"Matt Crees","email":"mattc@stackhpc.com","username":"mattcrees"},"change_message_id":"846a11b9e19c5dd869cf40293f20e364cca2d51d","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":6,"id":"7cfb6046_0ea35c32","updated":"2024-03-13 09:05:18.000000000","message":"recheck: ci is working again","commit_id":"498de81efe88707e5fd91dba24cdee2a529dedbc"}],"ansible/roles/etc-hosts/defaults/main.yml":[{"author":{"_account_id":28048,"name":"Will Szumski","email":"will@stackhpc.com","username":"jovial"},"change_message_id":"9b1b29280366182c7433613e397f0e3a0151ce23","unresolved":true,"context_lines":[{"line_number":3,"context_line":"customize_etc_hosts: true"},{"line_number":4,"context_line":""},{"line_number":5,"context_line":"# List of hosts to add to /etc/hosts."},{"line_number":6,"context_line":"etc_hosts_hosts: \"{{ groups[\u0027overcloud\u0027] }}\""}],"source_content_type":"text/x-yaml","patch_set":2,"id":"031b6191_d1fc0240","line":6,"updated":"2024-02-15 18:15:15.000000000","message":"Also I guess we have to bare in mind that this role may be used with other groups such as the seed?","commit_id":"6c9c7fa0cb10576d7c5bfe7c8c8017d69097db80"},{"author":{"_account_id":35263,"name":"Matt Crees","email":"mattc@stackhpc.com","username":"mattcrees"},"change_message_id":"94f2148a2d447bded132decdf98b84b881eb08d5","unresolved":false,"context_lines":[{"line_number":3,"context_line":"customize_etc_hosts: true"},{"line_number":4,"context_line":""},{"line_number":5,"context_line":"# List of hosts to add to /etc/hosts."},{"line_number":6,"context_line":"etc_hosts_hosts: \"{{ groups[\u0027overcloud\u0027] }}\""}],"source_content_type":"text/x-yaml","patch_set":2,"id":"40cde71b_e9858d3e","line":6,"in_reply_to":"031b6191_d1fc0240","updated":"2024-02-16 09:51:05.000000000","message":"Right now the role is only used in the overcloud host configure. If there are plans to change this, then imo ``etc_hosts_hosts`` can be overridden for those new use cases.","commit_id":"6c9c7fa0cb10576d7c5bfe7c8c8017d69097db80"}],"ansible/roles/gather-facts-delegated/defaults/main.yml":[{"author":{"_account_id":14826,"name":"Mark Goddard","email":"markgoddard86@gmail.com","username":"mgoddard"},"change_message_id":"fb647d1236030819f93ba358f43b3894e65d7976","unresolved":true,"context_lines":[{"line_number":1,"context_line":"---"},{"line_number":2,"context_line":"gather_facts_delegated_limit_hosts: \"{{ groups[\u0027overcloud\u0027] }}\""},{"line_number":3,"context_line":"gather_facts_delegated_batch_index: \"{{ ansible_play_hosts_all.index(inventory_hostname) }}\""},{"line_number":4,"context_line":"gather_facts_delegated_batch_count: \"{{ ansible_play_hosts_all | length }}\""},{"line_number":5,"context_line":"# Use a python list slice to divide the group up."},{"line_number":6,"context_line":"# Syntax: [\u003cstart index\u003e:\u003cend index\u003e:\u003cstep size\u003e]"}],"source_content_type":"text/x-yaml","patch_set":4,"id":"20095248_53ea0d4d","line":3,"range":{"start_line":3,"start_character":40,"end_line":3,"end_character":62},"updated":"2024-02-26 16:45:28.000000000","message":"This list includes failed and unreachable hosts. Should we instead use `ansible_play_batch`?\n\nWe might also want to set any_errors_fatal on the play to ensure we break if we don\u0027t have all the necessary info.","commit_id":"f005afabff3e958ac14a39b70fb33c9981043a92"},{"author":{"_account_id":35263,"name":"Matt Crees","email":"mattc@stackhpc.com","username":"mattcrees"},"change_message_id":"e9fd5cf9b4e937353f8c7c8b7761d79e62d68627","unresolved":true,"context_lines":[{"line_number":1,"context_line":"---"},{"line_number":2,"context_line":"gather_facts_delegated_limit_hosts: \"{{ groups[\u0027overcloud\u0027] }}\""},{"line_number":3,"context_line":"gather_facts_delegated_batch_index: \"{{ ansible_play_hosts_all.index(inventory_hostname) }}\""},{"line_number":4,"context_line":"gather_facts_delegated_batch_count: \"{{ ansible_play_hosts_all | length }}\""},{"line_number":5,"context_line":"# Use a python list slice to divide the group up."},{"line_number":6,"context_line":"# Syntax: [\u003cstart index\u003e:\u003cend index\u003e:\u003cstep size\u003e]"}],"source_content_type":"text/x-yaml","patch_set":4,"id":"c485bc6b_6056f064","line":3,"range":{"start_line":3,"start_character":40,"end_line":3,"end_character":62},"in_reply_to":"20095248_53ea0d4d","updated":"2024-02-27 16:48:10.000000000","message":"Do we actually want to exclude failed and unreachable hosts? This would mean that they would be removed from /etc/hosts if they are temporarily unavailable, so any hosts that are reconfigured would not be able to resolve them once they\u0027re back.\n\nIMO we should be breaking out if a host is failed.","commit_id":"f005afabff3e958ac14a39b70fb33c9981043a92"},{"author":{"_account_id":28048,"name":"Will Szumski","email":"will@stackhpc.com","username":"jovial"},"change_message_id":"42fe30afe85be9370d618b9388ca7575c34a0c49","unresolved":true,"context_lines":[{"line_number":1,"context_line":"---"},{"line_number":2,"context_line":"gather_facts_delegated_limit_hosts: \"{{ groups[\u0027overcloud\u0027] }}\""},{"line_number":3,"context_line":"gather_facts_delegated_batch_index: \"{{ ansible_play_hosts_all.index(inventory_hostname) }}\""},{"line_number":4,"context_line":"gather_facts_delegated_batch_count: \"{{ ansible_play_hosts_all | length }}\""},{"line_number":5,"context_line":"# Use a python list slice to divide the group up."},{"line_number":6,"context_line":"# Syntax: [\u003cstart index\u003e:\u003cend index\u003e:\u003cstep size\u003e]"}],"source_content_type":"text/x-yaml","patch_set":4,"id":"f1a72a92_29c8e23a","line":3,"range":{"start_line":3,"start_character":40,"end_line":3,"end_character":62},"in_reply_to":"c485bc6b_6056f064","updated":"2024-03-01 14:30:04.000000000","message":"I think you\u0027ll still add all hosts to /etc/hosts as that is determined by gather_facts_delegated_limit_hosts. I think Mark\u0027s suggestions would help in the scenario where one host has dropped out the play e.g due to an undefined variable, but will still able to run the setup module to gather the facts. Otherwise, we won\u0027t gather the facts for the batch assigned to host that dropped out of the play.","commit_id":"f005afabff3e958ac14a39b70fb33c9981043a92"},{"author":{"_account_id":35263,"name":"Matt Crees","email":"mattc@stackhpc.com","username":"mattcrees"},"change_message_id":"5897e97a6bcbffc47fbd8debe6947a1964444a6e","unresolved":true,"context_lines":[{"line_number":1,"context_line":"---"},{"line_number":2,"context_line":"gather_facts_delegated_limit_hosts: \"{{ groups[\u0027overcloud\u0027] }}\""},{"line_number":3,"context_line":"gather_facts_delegated_batch_index: \"{{ ansible_play_hosts_all.index(inventory_hostname) }}\""},{"line_number":4,"context_line":"gather_facts_delegated_batch_count: \"{{ ansible_play_hosts_all | length }}\""},{"line_number":5,"context_line":"# Use a python list slice to divide the group up."},{"line_number":6,"context_line":"# Syntax: [\u003cstart index\u003e:\u003cend index\u003e:\u003cstep size\u003e]"}],"source_content_type":"text/x-yaml","patch_set":4,"id":"db8a7c94_50137885","line":3,"range":{"start_line":3,"start_character":40,"end_line":3,"end_character":62},"in_reply_to":"c485bc6b_6056f064","updated":"2024-03-01 14:24:47.000000000","message":"I\u0027ve added ``any_errors_fatal``, would still like to hear your thoughts host failures Mark. There\u0027s a trade-off here as hosts being absent from /etc/hosts can cause issues (eg with Prometheus exporters), but I also know you\u0027re working towards Kayobe being more lenient around failures here: https://review.opendev.org/c/openstack/kayobe/+/910509","commit_id":"f005afabff3e958ac14a39b70fb33c9981043a92"},{"author":{"_account_id":35263,"name":"Matt Crees","email":"mattc@stackhpc.com","username":"mattcrees"},"change_message_id":"886b029815708bb066e9d7142c2846bc9f332837","unresolved":false,"context_lines":[{"line_number":1,"context_line":"---"},{"line_number":2,"context_line":"gather_facts_delegated_limit_hosts: \"{{ groups[\u0027overcloud\u0027] }}\""},{"line_number":3,"context_line":"gather_facts_delegated_batch_index: \"{{ ansible_play_hosts_all.index(inventory_hostname) }}\""},{"line_number":4,"context_line":"gather_facts_delegated_batch_count: \"{{ ansible_play_hosts_all | length }}\""},{"line_number":5,"context_line":"# Use a python list slice to divide the group up."},{"line_number":6,"context_line":"# Syntax: [\u003cstart index\u003e:\u003cend index\u003e:\u003cstep size\u003e]"}],"source_content_type":"text/x-yaml","patch_set":4,"id":"ded0e082_a22f3587","line":3,"range":{"start_line":3,"start_character":40,"end_line":3,"end_character":62},"in_reply_to":"f1a72a92_29c8e23a","updated":"2024-03-01 15:18:56.000000000","message":"Right I understand now, I\u0027ve made the change and done some testing. Seems good to me.","commit_id":"f005afabff3e958ac14a39b70fb33c9981043a92"},{"author":{"_account_id":14826,"name":"Mark Goddard","email":"markgoddard86@gmail.com","username":"mgoddard"},"change_message_id":"fb647d1236030819f93ba358f43b3894e65d7976","unresolved":true,"context_lines":[{"line_number":1,"context_line":"---"},{"line_number":2,"context_line":"gather_facts_delegated_limit_hosts: \"{{ groups[\u0027overcloud\u0027] }}\""},{"line_number":3,"context_line":"gather_facts_delegated_batch_index: \"{{ ansible_play_hosts_all.index(inventory_hostname) }}\""},{"line_number":4,"context_line":"gather_facts_delegated_batch_count: \"{{ ansible_play_hosts_all | length }}\""},{"line_number":5,"context_line":"# Use a python list slice to divide the group up."},{"line_number":6,"context_line":"# Syntax: [\u003cstart index\u003e:\u003cend index\u003e:\u003cstep size\u003e]"},{"line_number":7,"context_line":"gather_facts_delegated_delegate_hosts: \u003e-"}],"source_content_type":"text/x-yaml","patch_set":4,"id":"4334243d_98236927","line":4,"updated":"2024-02-26 16:45:28.000000000","message":"and here","commit_id":"f005afabff3e958ac14a39b70fb33c9981043a92"},{"author":{"_account_id":35263,"name":"Matt Crees","email":"mattc@stackhpc.com","username":"mattcrees"},"change_message_id":"61f38d08ea98dcbfc66198df38f6b7d5f8457a58","unresolved":false,"context_lines":[{"line_number":1,"context_line":"---"},{"line_number":2,"context_line":"gather_facts_delegated_limit_hosts: \"{{ groups[\u0027overcloud\u0027] }}\""},{"line_number":3,"context_line":"gather_facts_delegated_batch_index: \"{{ ansible_play_hosts_all.index(inventory_hostname) }}\""},{"line_number":4,"context_line":"gather_facts_delegated_batch_count: \"{{ ansible_play_hosts_all | length }}\""},{"line_number":5,"context_line":"# Use a python list slice to divide the group up."},{"line_number":6,"context_line":"# Syntax: [\u003cstart index\u003e:\u003cend index\u003e:\u003cstep size\u003e]"},{"line_number":7,"context_line":"gather_facts_delegated_delegate_hosts: \u003e-"}],"source_content_type":"text/x-yaml","patch_set":4,"id":"82daac65_5ae429ec","line":4,"in_reply_to":"4334243d_98236927","updated":"2024-03-01 15:54:56.000000000","message":"Done","commit_id":"f005afabff3e958ac14a39b70fb33c9981043a92"}],"ansible/roles/gather-facts-delegated/tasks/main.yml":[{"author":{"_account_id":28048,"name":"Will Szumski","email":"will@stackhpc.com","username":"jovial"},"change_message_id":"d35a24327b412336f2fcc82b69ffcedc6d46d235","unresolved":true,"context_lines":[{"line_number":4,"context_line":"  vars:"},{"line_number":5,"context_line":"    delegated_host: \"{{ gather_facts_delegated_delegate_hosts[item | int] }}\""},{"line_number":6,"context_line":"  # Loop over the batch size, so tasks are not included serially."},{"line_number":7,"context_line":"  with_sequence: start\u003d0 end\u003d\"{{ gather_facts_delegated_batch_size | int - 1 }}\""},{"line_number":8,"context_line":"  when:"},{"line_number":9,"context_line":"    - item | int \u003c gather_facts_delegated_delegate_hosts | length"},{"line_number":10,"context_line":"    - not hostvars[gather_facts_delegated_delegate_hosts[item | int]].ansible_facts"}],"source_content_type":"text/x-yaml","patch_set":2,"id":"cacc0bd2_088b6eb6","line":7,"updated":"2024-02-15 16:03:16.000000000","message":"The bit that is worrying me here is that we are always iterating from 0. I think this works when the batch size is all the hosts, but does it work with smaller batch sizes?","commit_id":"6c9c7fa0cb10576d7c5bfe7c8c8017d69097db80"},{"author":{"_account_id":28048,"name":"Will Szumski","email":"will@stackhpc.com","username":"jovial"},"change_message_id":"013599160d8b76ab719f9dc19bbe55b2447cfc63","unresolved":true,"context_lines":[{"line_number":4,"context_line":"  vars:"},{"line_number":5,"context_line":"    delegated_host: \"{{ gather_facts_delegated_delegate_hosts[item | int] }}\""},{"line_number":6,"context_line":"  # Loop over the batch size, so tasks are not included serially."},{"line_number":7,"context_line":"  with_sequence: start\u003d0 end\u003d\"{{ gather_facts_delegated_batch_size | int - 1 }}\""},{"line_number":8,"context_line":"  when:"},{"line_number":9,"context_line":"    - item | int \u003c gather_facts_delegated_delegate_hosts | length"},{"line_number":10,"context_line":"    - not hostvars[gather_facts_delegated_delegate_hosts[item | int]].ansible_facts"}],"source_content_type":"text/x-yaml","patch_set":2,"id":"6bc475f5_572270cd","line":7,"in_reply_to":"021ea0a3_0e9b00c3","updated":"2024-02-15 18:12:38.000000000","message":"Of course, I could have missed something that completely kills the parallelism 😄","commit_id":"6c9c7fa0cb10576d7c5bfe7c8c8017d69097db80"},{"author":{"_account_id":28048,"name":"Will Szumski","email":"will@stackhpc.com","username":"jovial"},"change_message_id":"e868a22a1d3a9d28e89a656126a4a3edd140e07b","unresolved":true,"context_lines":[{"line_number":4,"context_line":"  vars:"},{"line_number":5,"context_line":"    delegated_host: \"{{ gather_facts_delegated_delegate_hosts[item | int] }}\""},{"line_number":6,"context_line":"  # Loop over the batch size, so tasks are not included serially."},{"line_number":7,"context_line":"  with_sequence: start\u003d0 end\u003d\"{{ gather_facts_delegated_batch_size | int - 1 }}\""},{"line_number":8,"context_line":"  when:"},{"line_number":9,"context_line":"    - item | int \u003c gather_facts_delegated_delegate_hosts | length"},{"line_number":10,"context_line":"    - not hostvars[gather_facts_delegated_delegate_hosts[item | int]].ansible_facts"}],"source_content_type":"text/x-yaml","patch_set":2,"id":"ac2dee1e_a56e4550","line":7,"in_reply_to":"434bb3bc_dcc06438","updated":"2024-02-16 11:16:55.000000000","message":"variable name looks good to me - thanks.","commit_id":"6c9c7fa0cb10576d7c5bfe7c8c8017d69097db80"},{"author":{"_account_id":35263,"name":"Matt Crees","email":"mattc@stackhpc.com","username":"mattcrees"},"change_message_id":"83c264dfce6423cf07c50910730c9b3c76d6a144","unresolved":true,"context_lines":[{"line_number":4,"context_line":"  vars:"},{"line_number":5,"context_line":"    delegated_host: \"{{ gather_facts_delegated_delegate_hosts[item | int] }}\""},{"line_number":6,"context_line":"  # Loop over the batch size, so tasks are not included serially."},{"line_number":7,"context_line":"  with_sequence: start\u003d0 end\u003d\"{{ gather_facts_delegated_batch_size | int - 1 }}\""},{"line_number":8,"context_line":"  when:"},{"line_number":9,"context_line":"    - item | int \u003c gather_facts_delegated_delegate_hosts | length"},{"line_number":10,"context_line":"    - not hostvars[gather_facts_delegated_delegate_hosts[item | int]].ansible_facts"}],"source_content_type":"text/x-yaml","patch_set":2,"id":"b810fde7_46a12009","line":7,"in_reply_to":"6a8646c2_27c3dcba","updated":"2024-02-15 16:56:01.000000000","message":"I think I see what you mean.  So we would want to instead iterate over number of hosts in a batch. Something like ``(gather_facts_delegated_limit_hosts | length) / (gather_facts_delegated_batch_size | length)`` rounded up.","commit_id":"6c9c7fa0cb10576d7c5bfe7c8c8017d69097db80"},{"author":{"_account_id":28048,"name":"Will Szumski","email":"will@stackhpc.com","username":"jovial"},"change_message_id":"3a6b306394395eab15d3fc01467e967bf83626cf","unresolved":true,"context_lines":[{"line_number":4,"context_line":"  vars:"},{"line_number":5,"context_line":"    delegated_host: \"{{ gather_facts_delegated_delegate_hosts[item | int] }}\""},{"line_number":6,"context_line":"  # Loop over the batch size, so tasks are not included serially."},{"line_number":7,"context_line":"  with_sequence: start\u003d0 end\u003d\"{{ gather_facts_delegated_batch_size | int - 1 }}\""},{"line_number":8,"context_line":"  when:"},{"line_number":9,"context_line":"    - item | int \u003c gather_facts_delegated_delegate_hosts | length"},{"line_number":10,"context_line":"    - not hostvars[gather_facts_delegated_delegate_hosts[item | int]].ansible_facts"}],"source_content_type":"text/x-yaml","patch_set":2,"id":"021ea0a3_0e9b00c3","line":7,"in_reply_to":"6a8646c2_27c3dcba","updated":"2024-02-15 18:11:24.000000000","message":"Maybe I\u0027ve missed something, but does something like:\n\n    gather_facts_delegated_limit_hosts: \"{{ groups[\u0027overcloud\u0027] }}\"\n    gather_facts_delegated_batch_index: \"{{ ansible_play_hosts_all.index(inventory_hostname) }}\"\n    gather_facts_chunks: \"{{ (gather_facts_delegated_limit_hosts | length / ansible_play_hosts_all | length) | round(0, \u0027ceil\u0027) }}\"\n    gather_facts_delegated_delegate_hosts: \"{{ (gather_facts_delegated_limit_hosts | batch(gather_facts_chunks | int ))[gather_facts_deleg\n    ated_batch_index | int]  }}\"\n\nwork?","commit_id":"6c9c7fa0cb10576d7c5bfe7c8c8017d69097db80"},{"author":{"_account_id":28048,"name":"Will Szumski","email":"will@stackhpc.com","username":"jovial"},"change_message_id":"5a634059b481626dadf8fac068601f35a856bc2a","unresolved":true,"context_lines":[{"line_number":4,"context_line":"  vars:"},{"line_number":5,"context_line":"    delegated_host: \"{{ gather_facts_delegated_delegate_hosts[item | int] }}\""},{"line_number":6,"context_line":"  # Loop over the batch size, so tasks are not included serially."},{"line_number":7,"context_line":"  with_sequence: start\u003d0 end\u003d\"{{ gather_facts_delegated_batch_size | int - 1 }}\""},{"line_number":8,"context_line":"  when:"},{"line_number":9,"context_line":"    - item | int \u003c gather_facts_delegated_delegate_hosts | length"},{"line_number":10,"context_line":"    - not hostvars[gather_facts_delegated_delegate_hosts[item | int]].ansible_facts"}],"source_content_type":"text/x-yaml","patch_set":2,"id":"90285cc6_9417df95","line":7,"in_reply_to":"6bc475f5_572270cd","updated":"2024-02-16 09:08:50.000000000","message":"If we consider gather_facts_delegated_batch_size as an internal variable (not to be modified), your current patch works if we iterate to the end of gather_facts_delegated_delegate_hosts. I was getting a bit confused as gather_facts_delegated_batch_size seems to be badly named (it seems to actually be the number of batches and not the size of each batch).","commit_id":"6c9c7fa0cb10576d7c5bfe7c8c8017d69097db80"},{"author":{"_account_id":35263,"name":"Matt Crees","email":"mattc@stackhpc.com","username":"mattcrees"},"change_message_id":"94f2148a2d447bded132decdf98b84b881eb08d5","unresolved":true,"context_lines":[{"line_number":4,"context_line":"  vars:"},{"line_number":5,"context_line":"    delegated_host: \"{{ gather_facts_delegated_delegate_hosts[item | int] }}\""},{"line_number":6,"context_line":"  # Loop over the batch size, so tasks are not included serially."},{"line_number":7,"context_line":"  with_sequence: start\u003d0 end\u003d\"{{ gather_facts_delegated_batch_size | int - 1 }}\""},{"line_number":8,"context_line":"  when:"},{"line_number":9,"context_line":"    - item | int \u003c gather_facts_delegated_delegate_hosts | length"},{"line_number":10,"context_line":"    - not hostvars[gather_facts_delegated_delegate_hosts[item | int]].ansible_facts"}],"source_content_type":"text/x-yaml","patch_set":2,"id":"434bb3bc_dcc06438","line":7,"in_reply_to":"90285cc6_9417df95","updated":"2024-02-16 09:51:05.000000000","message":"I\u0027ve tried testing the setup you proposed, the issue is that parallelism is broken when we try to directly loop over ``gather_facts_delegated_delegate_hosts`` as each host in the batch has a different definition of this list. I\u0027ve updated my approach so it works with larger amounts of hosts, and have changed the batch size var name to hopefully be less confusing. \n\nDoes this seem appropriate to you?","commit_id":"6c9c7fa0cb10576d7c5bfe7c8c8017d69097db80"},{"author":{"_account_id":35263,"name":"Matt Crees","email":"mattc@stackhpc.com","username":"mattcrees"},"change_message_id":"db3a9f70d2e54080b3df467ca0692b8ed62e004b","unresolved":false,"context_lines":[{"line_number":4,"context_line":"  vars:"},{"line_number":5,"context_line":"    delegated_host: \"{{ gather_facts_delegated_delegate_hosts[item | int] }}\""},{"line_number":6,"context_line":"  # Loop over the batch size, so tasks are not included serially."},{"line_number":7,"context_line":"  with_sequence: start\u003d0 end\u003d\"{{ gather_facts_delegated_batch_size | int - 1 }}\""},{"line_number":8,"context_line":"  when:"},{"line_number":9,"context_line":"    - item | int \u003c gather_facts_delegated_delegate_hosts | length"},{"line_number":10,"context_line":"    - not hostvars[gather_facts_delegated_delegate_hosts[item | int]].ansible_facts"}],"source_content_type":"text/x-yaml","patch_set":2,"id":"2f2a366a_1be3d800","line":7,"in_reply_to":"ac2dee1e_a56e4550","updated":"2024-02-16 11:31:27.000000000","message":"Done","commit_id":"6c9c7fa0cb10576d7c5bfe7c8c8017d69097db80"},{"author":{"_account_id":28048,"name":"Will Szumski","email":"will@stackhpc.com","username":"jovial"},"change_message_id":"e92b5615ca7f0beffbb84af5a5ce0437e2289d2a","unresolved":true,"context_lines":[{"line_number":4,"context_line":"  vars:"},{"line_number":5,"context_line":"    delegated_host: \"{{ gather_facts_delegated_delegate_hosts[item | int] }}\""},{"line_number":6,"context_line":"  # Loop over the batch size, so tasks are not included serially."},{"line_number":7,"context_line":"  with_sequence: start\u003d0 end\u003d\"{{ gather_facts_delegated_batch_size | int - 1 }}\""},{"line_number":8,"context_line":"  when:"},{"line_number":9,"context_line":"    - item | int \u003c gather_facts_delegated_delegate_hosts | length"},{"line_number":10,"context_line":"    - not hostvars[gather_facts_delegated_delegate_hosts[item | int]].ansible_facts"}],"source_content_type":"text/x-yaml","patch_set":2,"id":"6a8646c2_27c3dcba","line":7,"in_reply_to":"cacc0bd2_088b6eb6","updated":"2024-02-15 16:28:27.000000000","message":"OK, I think I finally groked that starting at zero does work as gather_facts_delegated_delegate_hosts is unique per host in the play, but now I\u0027m not convinced that gather_facts_delegated_batch_size would fully iterate over gather_facts_delegated_delegate_hosts if the inventory was large and the batch size was small. I\u0027m thinking gather_facts_delegated_delegate_hosts could end up be longer than gather_facts_delegated_batch_size since we do:\n\ngather_facts_delegated_limit_hosts[gather_facts_delegated_batch_index | int::gather_facts_delegated_batch_size | int] \n\ni.e the step size is gather_facts_delegated_batch_size, but that doesn\u0027t limit the length of gather_facts_delegated_limit_host","commit_id":"6c9c7fa0cb10576d7c5bfe7c8c8017d69097db80"},{"author":{"_account_id":28048,"name":"Will Szumski","email":"will@stackhpc.com","username":"jovial"},"change_message_id":"c765b8c34db4a0316b79430fab07a318db93fe1b","unresolved":true,"context_lines":[{"line_number":4,"context_line":"  vars:"},{"line_number":5,"context_line":"    delegated_host: \"{{ gather_facts_delegated_delegate_hosts[item | int] }}\""},{"line_number":6,"context_line":"  # Loop over the batch count, so tasks are not all included serially."},{"line_number":7,"context_line":"  with_sequence: start\u003d0 end\u003d\"{{ (gather_facts_delegated_limit_hosts | length / gather_facts_delegated_batch_count | length) | round(0, \u0027ceil\u0027) | int }}\""},{"line_number":8,"context_line":"  when:"},{"line_number":9,"context_line":"    - item | int \u003c gather_facts_delegated_delegate_hosts | length"},{"line_number":10,"context_line":"    - not hostvars[gather_facts_delegated_delegate_hosts[item | int]].ansible_facts"}],"source_content_type":"text/x-yaml","patch_set":3,"id":"f199e091_ef6bcafb","line":7,"updated":"2024-02-16 10:14:51.000000000","message":"Think you can just iterate to the end here?\n\n    with_sequence: start\u003d0 end\u003d\"{{ gather_facts_delegated_delegate_hosts | length | int - 1 }}\"\n\nCould also add:\n\n    loop_control:\n      label: \"{{ delegated_host }}\"\n\nto make it more obvious which host is being iterated on (currently shows the sequence number):\n\n    skipping: [cpt02] \u003d\u003e (item\u003d4)\n    skipping: [ctrl1] \u003d\u003e (item\u003d20)\n    skipping: [ctrl0] \u003d\u003e (item\u003d21)\n\nI did notice that it seems to collect them in quite a serial fashion:\n\n    TASK [gather-facts-delegated : Gather facts for delegated host] ***************************************************************************************************************************************************************************************************************\n    Friday 16 February 2024  10:48:18 +0100 (0:00:02.112)       0:00:15.896 *******\n    ok: [cpt10 -\u003e ceph0({{ hostvars[delegated_host].ansible_host | default(delegated_host) }})]\n\n    TASK [gather-facts-delegated : Gather facts for delegated host] ***************************************************************************************************************************************************************************************************************\n    Friday 16 February 2024  10:48:21 +0100 (0:00:02.541)       0:00:18.438 *******\n    ok: [gpu0 -\u003e ceph1({{ hostvars[delegated_host].ansible_host | default(delegated_host) }})]\n\nBut does seem to work.","commit_id":"acde9066ecbb9b0066a732b01f8d8189051ecd67"},{"author":{"_account_id":35263,"name":"Matt Crees","email":"mattc@stackhpc.com","username":"mattcrees"},"change_message_id":"6d1257bfde8824bb5b6c4d9c1a24bfc9c7cbd931","unresolved":true,"context_lines":[{"line_number":4,"context_line":"  vars:"},{"line_number":5,"context_line":"    delegated_host: \"{{ gather_facts_delegated_delegate_hosts[item | int] }}\""},{"line_number":6,"context_line":"  # Loop over the batch count, so tasks are not all included serially."},{"line_number":7,"context_line":"  with_sequence: start\u003d0 end\u003d\"{{ (gather_facts_delegated_limit_hosts | length / gather_facts_delegated_batch_count | length) | round(0, \u0027ceil\u0027) | int }}\""},{"line_number":8,"context_line":"  when:"},{"line_number":9,"context_line":"    - item | int \u003c gather_facts_delegated_delegate_hosts | length"},{"line_number":10,"context_line":"    - not hostvars[gather_facts_delegated_delegate_hosts[item | int]].ansible_facts"}],"source_content_type":"text/x-yaml","patch_set":3,"id":"a08db1cb_e674f078","line":7,"in_reply_to":"27f3637f_8c7ab93d","updated":"2024-02-16 11:08:22.000000000","message":"Right I understand now. Yes this does work, I\u0027ve made the change.","commit_id":"acde9066ecbb9b0066a732b01f8d8189051ecd67"},{"author":{"_account_id":28048,"name":"Will Szumski","email":"will@stackhpc.com","username":"jovial"},"change_message_id":"2044fc6f0c1dbb0b19be6f5c3838c859c9035f5a","unresolved":true,"context_lines":[{"line_number":4,"context_line":"  vars:"},{"line_number":5,"context_line":"    delegated_host: \"{{ gather_facts_delegated_delegate_hosts[item | int] }}\""},{"line_number":6,"context_line":"  # Loop over the batch count, so tasks are not all included serially."},{"line_number":7,"context_line":"  with_sequence: start\u003d0 end\u003d\"{{ (gather_facts_delegated_limit_hosts | length / gather_facts_delegated_batch_count | length) | round(0, \u0027ceil\u0027) | int }}\""},{"line_number":8,"context_line":"  when:"},{"line_number":9,"context_line":"    - item | int \u003c gather_facts_delegated_delegate_hosts | length"},{"line_number":10,"context_line":"    - not hostvars[gather_facts_delegated_delegate_hosts[item | int]].ansible_facts"}],"source_content_type":"text/x-yaml","patch_set":3,"id":"27f3637f_8c7ab93d","line":7,"in_reply_to":"37f18a20_dc357f29","updated":"2024-02-16 10:54:35.000000000","message":"I see it is the label that kills the parallelism  - my bad :-/","commit_id":"acde9066ecbb9b0066a732b01f8d8189051ecd67"},{"author":{"_account_id":28048,"name":"Will Szumski","email":"will@stackhpc.com","username":"jovial"},"change_message_id":"290e85a100d3f04d468b2df6bd1b407ba8cf7e5b","unresolved":true,"context_lines":[{"line_number":4,"context_line":"  vars:"},{"line_number":5,"context_line":"    delegated_host: \"{{ gather_facts_delegated_delegate_hosts[item | int] }}\""},{"line_number":6,"context_line":"  # Loop over the batch count, so tasks are not all included serially."},{"line_number":7,"context_line":"  with_sequence: start\u003d0 end\u003d\"{{ (gather_facts_delegated_limit_hosts | length / gather_facts_delegated_batch_count | length) | round(0, \u0027ceil\u0027) | int }}\""},{"line_number":8,"context_line":"  when:"},{"line_number":9,"context_line":"    - item | int \u003c gather_facts_delegated_delegate_hosts | length"},{"line_number":10,"context_line":"    - not hostvars[gather_facts_delegated_delegate_hosts[item | int]].ansible_facts"}],"source_content_type":"text/x-yaml","patch_set":3,"id":"37f18a20_dc357f29","line":7,"in_reply_to":"5167239e_6090c723","updated":"2024-02-16 10:50:22.000000000","message":"By end I meant this:\n\n    with_sequence: start\u003d0 end\u003d\"{{ gather_facts_delegated_delegate_hosts | length | int - 1 }}\"\n\nMy understanding of how it works is that each host in the play gets a non-overlapping subset of the hosts in groups.overcloud; this is stored in gather_facts_delegated_delegate_hosts. There is no further batching as far as I can tell (and I\u0027m not sure why you would want to do anything else than to divide them equally between all hosts that are in the limit). We therefore have to iterate over all hosts in gather_facts_delegated_delegate_hosts otherwise we will miss some.","commit_id":"acde9066ecbb9b0066a732b01f8d8189051ecd67"},{"author":{"_account_id":35263,"name":"Matt Crees","email":"mattc@stackhpc.com","username":"mattcrees"},"change_message_id":"db3a9f70d2e54080b3df467ca0692b8ed62e004b","unresolved":false,"context_lines":[{"line_number":4,"context_line":"  vars:"},{"line_number":5,"context_line":"    delegated_host: \"{{ gather_facts_delegated_delegate_hosts[item | int] }}\""},{"line_number":6,"context_line":"  # Loop over the batch count, so tasks are not all included serially."},{"line_number":7,"context_line":"  with_sequence: start\u003d0 end\u003d\"{{ (gather_facts_delegated_limit_hosts | length / gather_facts_delegated_batch_count | length) | round(0, \u0027ceil\u0027) | int }}\""},{"line_number":8,"context_line":"  when:"},{"line_number":9,"context_line":"    - item | int \u003c gather_facts_delegated_delegate_hosts | length"},{"line_number":10,"context_line":"    - not hostvars[gather_facts_delegated_delegate_hosts[item | int]].ansible_facts"}],"source_content_type":"text/x-yaml","patch_set":3,"id":"bc671d62_65aa3852","line":7,"in_reply_to":"a08db1cb_e674f078","updated":"2024-02-16 11:31:27.000000000","message":"Done","commit_id":"acde9066ecbb9b0066a732b01f8d8189051ecd67"},{"author":{"_account_id":35263,"name":"Matt Crees","email":"mattc@stackhpc.com","username":"mattcrees"},"change_message_id":"a7586366c4d47f90b6837557708248fc9c6eaba3","unresolved":true,"context_lines":[{"line_number":4,"context_line":"  vars:"},{"line_number":5,"context_line":"    delegated_host: \"{{ gather_facts_delegated_delegate_hosts[item | int] }}\""},{"line_number":6,"context_line":"  # Loop over the batch count, so tasks are not all included serially."},{"line_number":7,"context_line":"  with_sequence: start\u003d0 end\u003d\"{{ (gather_facts_delegated_limit_hosts | length / gather_facts_delegated_batch_count | length) | round(0, \u0027ceil\u0027) | int }}\""},{"line_number":8,"context_line":"  when:"},{"line_number":9,"context_line":"    - item | int \u003c gather_facts_delegated_delegate_hosts | length"},{"line_number":10,"context_line":"    - not hostvars[gather_facts_delegated_delegate_hosts[item | int]].ansible_facts"}],"source_content_type":"text/x-yaml","patch_set":3,"id":"5167239e_6090c723","line":7,"in_reply_to":"f199e091_ef6bcafb","updated":"2024-02-16 10:34:02.000000000","message":"\u003e Think you can just iterate to the end here?\n\nThe end of what? This is just looping over numbers 0-\u003eN where N is the largest number of delegated hosts in a batch. \n\nThe label sounds like a good idea, but it actually also break parallelism as it\u0027s assigning a unique value to each host again.\n\nI also noticed the serial behaviour, but even with the old approach (if that had worked as intended) limiting to one host would have facts gathered sequentially for all other hosts. As the batch size increases, i.e. a limit with multiple hosts, the parallelism is much better.","commit_id":"acde9066ecbb9b0066a732b01f8d8189051ecd67"},{"author":{"_account_id":14826,"name":"Mark Goddard","email":"markgoddard86@gmail.com","username":"mgoddard"},"change_message_id":"fb647d1236030819f93ba358f43b3894e65d7976","unresolved":true,"context_lines":[{"line_number":3,"context_line":"  include_tasks: gather-facts-delegated.yml"},{"line_number":4,"context_line":"  vars:"},{"line_number":5,"context_line":"    delegated_host: \"{{ gather_facts_delegated_delegate_hosts[item | int] }}\""},{"line_number":6,"context_line":"  # Loop over the batch count, so tasks are not all included serially."},{"line_number":7,"context_line":"  with_sequence: start\u003d0 end\u003d\"{{ gather_facts_delegated_delegate_hosts | length | int - 1 }}\""},{"line_number":8,"context_line":"  when:"},{"line_number":9,"context_line":"    - item | int \u003c gather_facts_delegated_delegate_hosts | length"}],"source_content_type":"text/x-yaml","patch_set":4,"id":"0a65a084_4b286d14","line":6,"updated":"2024-02-26 16:45:28.000000000","message":"nit: we\u0027re using batch count to mean the number of hosts gathering facts. This is the index into each host\u0027s batch","commit_id":"f005afabff3e958ac14a39b70fb33c9981043a92"},{"author":{"_account_id":35263,"name":"Matt Crees","email":"mattc@stackhpc.com","username":"mattcrees"},"change_message_id":"5897e97a6bcbffc47fbd8debe6947a1964444a6e","unresolved":false,"context_lines":[{"line_number":3,"context_line":"  include_tasks: gather-facts-delegated.yml"},{"line_number":4,"context_line":"  vars:"},{"line_number":5,"context_line":"    delegated_host: \"{{ gather_facts_delegated_delegate_hosts[item | int] }}\""},{"line_number":6,"context_line":"  # Loop over the batch count, so tasks are not all included serially."},{"line_number":7,"context_line":"  with_sequence: start\u003d0 end\u003d\"{{ gather_facts_delegated_delegate_hosts | length | int - 1 }}\""},{"line_number":8,"context_line":"  when:"},{"line_number":9,"context_line":"    - item | int \u003c gather_facts_delegated_delegate_hosts | length"}],"source_content_type":"text/x-yaml","patch_set":4,"id":"268191bc_b47e1807","line":6,"in_reply_to":"0a65a084_4b286d14","updated":"2024-03-01 14:24:47.000000000","message":"Done","commit_id":"f005afabff3e958ac14a39b70fb33c9981043a92"}]}
