)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":15197,"name":"Pierre Riteau","email":"pierre@stackhpc.com","username":"priteau","status":"StackHPC"},"change_message_id":"8503e3ec72beb5f86598df5265163aaa856b5f9e","unresolved":true,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Check storage capacity for swap files"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"When configuring a swap file, the swap role task creates the swap file before checking if there is capacity in the selected destination."},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"This change checks the target host\u0027s available storage at the targeted directory and evaluates it against the requested swap file."},{"line_number":12,"context_line":"If the available volume is smaller than the requested swap file the playbook will now fail."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Closes-Bug: #2095078"},{"line_number":15,"context_line":"Change-Id: Ibca90cb16ef8ba962c6bf10bfca43330cd6ba508"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"c68a8eed_85fd6015","line":12,"range":{"start_line":9,"start_character":0,"end_line":12,"end_character":91},"updated":"2025-02-14 16:03:49.000000000","message":"Thanks for your first contribution. Please wrap your lines at 72 characters: https://wiki.openstack.org/wiki/GitCommitMessages#Summary_of_Git_commit_message_structure","commit_id":"7ba7e61a1ec116b6a69257b0b4a55ab7fe7f2f6e"},{"author":{"_account_id":36781,"name":"Massimiliano Favaro-Bedford","display_name":"Max","email":"max@stackhpc.com","username":"MaxBed4d"},"change_message_id":"2e0ef59c4c26bdedf7b60e7049b3b30f8965fc9b","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Check storage capacity for swap files"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"When configuring a swap file, the swap role task creates the swap file before checking if there is capacity in the selected destination."},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"This change checks the target host\u0027s available storage at the targeted directory and evaluates it against the requested swap file."},{"line_number":12,"context_line":"If the available volume is smaller than the requested swap file the playbook will now fail."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Closes-Bug: #2095078"},{"line_number":15,"context_line":"Change-Id: Ibca90cb16ef8ba962c6bf10bfca43330cd6ba508"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"0b0e46f9_90de1520","line":12,"range":{"start_line":9,"start_character":0,"end_line":12,"end_character":91},"in_reply_to":"c68a8eed_85fd6015","updated":"2025-02-18 13:30:38.000000000","message":"Thank you, Pierre, and thank you for pointing this out. I have amended it and it is now done.","commit_id":"7ba7e61a1ec116b6a69257b0b4a55ab7fe7f2f6e"}],"/PATCHSET_LEVEL":[{"author":{"_account_id":28048,"name":"Will Szumski","email":"will@stackhpc.com","username":"jovial"},"change_message_id":"680eaaae077697bd6788009c6dd58368af197453","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":6,"id":"80b0b773_387557ed","updated":"2025-11-17 16:50:26.000000000","message":"Genuine failure: \u0027Task failed: Error while evaluating conditional: \u0027\u0027active_swaps\u0027\u0027 is undefined\u0027. Perhaps needs updating for ansible 12?","commit_id":"e125efb691ed48101d1f7c95662c8e68d9ce502b"},{"author":{"_account_id":28048,"name":"Will Szumski","email":"will@stackhpc.com","username":"jovial"},"change_message_id":"55af9c8e75a2a25f717f1dec9631bd3840a81298","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":6,"id":"87a3fdac_f15fd84f","updated":"2025-11-17 12:06:52.000000000","message":"recheck","commit_id":"e125efb691ed48101d1f7c95662c8e68d9ce502b"},{"author":{"_account_id":36781,"name":"Massimiliano Favaro-Bedford","display_name":"Max","email":"max@stackhpc.com","username":"MaxBed4d"},"change_message_id":"f12c4a3f06a3f5646b0bdd0bea1fba0a0b133613","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":6,"id":"af31db03_5c146b4a","in_reply_to":"3f89eeda_c23e9d08","updated":"2025-12-30 13:20:51.000000000","message":"This issue should now be resolved as I have replaced ``active_swap`` with a working var.","commit_id":"e125efb691ed48101d1f7c95662c8e68d9ce502b"},{"author":{"_account_id":36781,"name":"Massimiliano Favaro-Bedford","display_name":"Max","email":"max@stackhpc.com","username":"MaxBed4d"},"change_message_id":"6a933468953fe3a8fe955c6ec2f5bdfec36a8188","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":6,"id":"3f89eeda_c23e9d08","in_reply_to":"500fd437_a7f1856d","updated":"2025-11-18 15:01:12.000000000","message":"Picking this back up now and looking into this.","commit_id":"e125efb691ed48101d1f7c95662c8e68d9ce502b"},{"author":{"_account_id":28048,"name":"Will Szumski","email":"will@stackhpc.com","username":"jovial"},"change_message_id":"b122a399ca8398d92dc48bf2c5b1c04c975153b7","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":6,"id":"500fd437_a7f1856d","in_reply_to":"80b0b773_387557ed","updated":"2025-11-17 16:51:47.000000000","message":"Sorry, didn\u0027t mean to mark that as resolved","commit_id":"e125efb691ed48101d1f7c95662c8e68d9ce502b"},{"author":{"_account_id":28048,"name":"Will Szumski","email":"will@stackhpc.com","username":"jovial"},"change_message_id":"68df6c90c857993e6e80970bf89d7116253fee28","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":8,"id":"ac96ad26_3fe75122","updated":"2026-01-27 14:50:33.000000000","message":"Potentially, you could just clean up the partially allocated file in a rescue block to avoid the tricky logic? There is a potential race between the check and the creation anyway. Otherwise, perhaps you could check the exact path with something like: `df --output\u003davail -B 1 /path/to/swap/dir` to avoid needing to lookup into ansible facts.","commit_id":"b27fb7a6719b3d64faadce2f7225c215429f83da"}],"ansible/roles/swap/tasks/main.yml":[{"author":{"_account_id":15197,"name":"Pierre Riteau","email":"pierre@stackhpc.com","username":"priteau","status":"StackHPC"},"change_message_id":"8503e3ec72beb5f86598df5265163aaa856b5f9e","unresolved":true,"context_lines":[{"line_number":5,"context_line":"    criteria: \"{{ lookup(\u0027file\u0027, \u0027schema.json\u0027) }}\""},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"- name: Check current storage available"},{"line_number":8,"context_line":"  shell: df \"{{ item.path|dirname }}\" --output\\\u003davail | tail -1 | awk \u0027{print int($1/1000)}\u0027"},{"line_number":9,"context_line":"  register: path_freespace"},{"line_number":10,"context_line":"  loop: \"{{ swap }}\""},{"line_number":11,"context_line":"  when: item.path is defined"}],"source_content_type":"text/x-yaml","patch_set":1,"id":"7b3e9a6e_d00e34e1","line":8,"range":{"start_line":8,"start_character":9,"end_line":8,"end_character":92},"updated":"2025-02-14 16:03:49.000000000","message":"Is there a more Ansible-native way to do this?","commit_id":"7ba7e61a1ec116b6a69257b0b4a55ab7fe7f2f6e"},{"author":{"_account_id":36781,"name":"Massimiliano Favaro-Bedford","display_name":"Max","email":"max@stackhpc.com","username":"MaxBed4d"},"change_message_id":"2e0ef59c4c26bdedf7b60e7049b3b30f8965fc9b","unresolved":true,"context_lines":[{"line_number":5,"context_line":"    criteria: \"{{ lookup(\u0027file\u0027, \u0027schema.json\u0027) }}\""},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"- name: Check current storage available"},{"line_number":8,"context_line":"  shell: df \"{{ item.path|dirname }}\" --output\\\u003davail | tail -1 | awk \u0027{print int($1/1000)}\u0027"},{"line_number":9,"context_line":"  register: path_freespace"},{"line_number":10,"context_line":"  loop: \"{{ swap }}\""},{"line_number":11,"context_line":"  when: item.path is defined"}],"source_content_type":"text/x-yaml","patch_set":1,"id":"d74699d9_a8c45651","line":8,"range":{"start_line":8,"start_character":9,"end_line":8,"end_character":92},"in_reply_to":"7b3e9a6e_d00e34e1","updated":"2025-02-18 13:30:38.000000000","message":"I will have a look into it to see if there is a better way to do this! Thank you for the review.\n\nUPDATE 17/02/25\nChanged the method in which the available volume is determined using more Ansible-native methods.\n\nP.S. Sorry about the seemingly late reply, didn\u0027t realise that these stay as \u0027Drafts\u0027 if directly replying to the comment.","commit_id":"7ba7e61a1ec116b6a69257b0b4a55ab7fe7f2f6e"},{"author":{"_account_id":36781,"name":"Massimiliano Favaro-Bedford","display_name":"Max","email":"max@stackhpc.com","username":"MaxBed4d"},"change_message_id":"feef621cf8d46ca31a903893ea0eab59b71e8ea1","unresolved":false,"context_lines":[{"line_number":5,"context_line":"    criteria: \"{{ lookup(\u0027file\u0027, \u0027schema.json\u0027) }}\""},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"- name: Check current storage available"},{"line_number":8,"context_line":"  shell: df \"{{ item.path|dirname }}\" --output\\\u003davail | tail -1 | awk \u0027{print int($1/1000)}\u0027"},{"line_number":9,"context_line":"  register: path_freespace"},{"line_number":10,"context_line":"  loop: \"{{ swap }}\""},{"line_number":11,"context_line":"  when: item.path is defined"}],"source_content_type":"text/x-yaml","patch_set":1,"id":"d4ddb2e8_245aa63c","line":8,"range":{"start_line":8,"start_character":9,"end_line":8,"end_character":92},"in_reply_to":"d74699d9_a8c45651","updated":"2025-05-01 12:45:21.000000000","message":"This is I came up with and it achieves the same end goal.","commit_id":"7ba7e61a1ec116b6a69257b0b4a55ab7fe7f2f6e"},{"author":{"_account_id":35264,"name":"Alex Welsh","email":"alex@stackhpc.com","username":"alex-welsh"},"change_message_id":"fec1137edde870903b7959dd9df28e560a5f5e4d","unresolved":true,"context_lines":[{"line_number":19,"context_line":"        storage_available | default({}) | combine({"},{"line_number":20,"context_line":"          item.path: ("},{"line_number":21,"context_line":"            ansible_facts.mounts"},{"line_number":22,"context_line":"            | selectattr(\u0027mount\u0027, \u0027equalto\u0027, item.path | dirname)"},{"line_number":23,"context_line":"            | map(attribute\u003d\u0027size_available\u0027)"},{"line_number":24,"context_line":"            | first | default(0) // (1024 | pow(2))"},{"line_number":25,"context_line":"          )"}],"source_content_type":"text/x-yaml","patch_set":8,"id":"8532f63c_19e56cff","line":22,"updated":"2026-01-02 15:32:24.000000000","message":"This won\u0027t match if the swap file is in a subdir e.g. /foo/bar/swap doesn\u0027t work if it\u0027s mounted at /foo","commit_id":"b27fb7a6719b3d64faadce2f7225c215429f83da"},{"author":{"_account_id":35264,"name":"Alex Welsh","email":"alex@stackhpc.com","username":"alex-welsh"},"change_message_id":"fec1137edde870903b7959dd9df28e560a5f5e4d","unresolved":true,"context_lines":[{"line_number":42,"context_line":"  loop: \"{{ swap }}\""},{"line_number":43,"context_line":"  when:"},{"line_number":44,"context_line":"    - item.path is defined"},{"line_number":45,"context_line":"    - swap_output.stdout | select(\u0027search\u0027, item.path.split(\u0027/\u0027)[-1]) | list | length \u003d\u003d 0"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"- name: Compare requested vs available storage per host"},{"line_number":48,"context_line":"  fail:"}],"source_content_type":"text/x-yaml","patch_set":8,"id":"9b2f0fbb_ddd6dce9","line":45,"updated":"2026-01-02 15:32:24.000000000","message":"This search is a bit risky. Searching for \"swapfile\" would also match \"old_swapfile_do_not_use_or_the_computer_explodes\"","commit_id":"b27fb7a6719b3d64faadce2f7225c215429f83da"}]}
