)]}'
{"playbooks/roles/configure_swap/tasks/ephemeral.yaml":[{"author":{"_account_id":4146,"name":"Clark Boylan","email":"cboylan@sapwetik.org","username":"cboylan"},"change_message_id":"58a4150ba63a719442a86d342fd46f0ba688aa98","unresolved":false,"context_lines":[{"line_number":24,"context_line":"    unit: MiB"},{"line_number":25,"context_line":"  register: ephemeral_partitions"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"- name: Remove any existing partitions"},{"line_number":28,"context_line":"  become: yes"},{"line_number":29,"context_line":"  parted:"},{"line_number":30,"context_line":"    device: \"{{ ephemeral_device }}\""},{"line_number":31,"context_line":"    number: \"{{ item.num }}\""},{"line_number":32,"context_line":"    state: absent"},{"line_number":33,"context_line":"  with_items:"},{"line_number":34,"context_line":"    - \"{{ ephemeral_partitions.partitions }}\""},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"- name: Create new disk label"},{"line_number":37,"context_line":"  become: yes"}],"source_content_type":"text/x-yaml","patch_set":8,"id":"7f287b81_8937184e","line":34,"range":{"start_line":27,"start_character":0,"end_line":34,"end_character":45},"updated":"2017-09-06 16:26:31.000000000","message":"Is this step necessary? We don\u0027t seem to do it in the old script and writing a new disk label and new partitions should overwrite any preexisting partition table?\n\nMostly just worried that every additional invocation of parted is a potential race which could result in failure.","commit_id":"aee53c39ed713557df987efb9bab93e8c7cf6b1f"},{"author":{"_account_id":7118,"name":"Ian Wienand","email":"iwienand@redhat.com","username":"iwienand"},"change_message_id":"e12b722d59dfc84ff6d0200e3229af4ce1cca698","unresolved":false,"context_lines":[{"line_number":24,"context_line":"    unit: MiB"},{"line_number":25,"context_line":"  register: ephemeral_partitions"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"- name: Remove any existing partitions"},{"line_number":28,"context_line":"  become: yes"},{"line_number":29,"context_line":"  parted:"},{"line_number":30,"context_line":"    device: \"{{ ephemeral_device }}\""},{"line_number":31,"context_line":"    number: \"{{ item.num }}\""},{"line_number":32,"context_line":"    state: absent"},{"line_number":33,"context_line":"  with_items:"},{"line_number":34,"context_line":"    - \"{{ ephemeral_partitions.partitions }}\""},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"- name: Create new disk label"},{"line_number":37,"context_line":"  become: yes"}],"source_content_type":"text/x-yaml","patch_set":8,"id":"7f287b81_88a02892","line":34,"range":{"start_line":27,"start_character":0,"end_line":34,"end_character":45},"in_reply_to":"7f287b81_8937184e","updated":"2017-09-06 22:04:29.000000000","message":"Yes, required because the \"Create new disk label\" task doesn\u0027t trigger if there is an existing, matching disk label (i.e. it won\u0027t wipe out the disk label)\n\nThis is for idempotence to avoid destroying things if the partition hasn\u0027t changed, I guess.  While I don\u0027t believe these list of tasks are idempotent, the \"include\" of them does give idempotence (we won\u0027t do any of this if swap is setup)","commit_id":"aee53c39ed713557df987efb9bab93e8c7cf6b1f"},{"author":{"_account_id":4146,"name":"Clark Boylan","email":"cboylan@sapwetik.org","username":"cboylan"},"change_message_id":"58a4150ba63a719442a86d342fd46f0ba688aa98","unresolved":false,"context_lines":[{"line_number":64,"context_line":"- name: Write swap to fstab"},{"line_number":65,"context_line":"  become: yes"},{"line_number":66,"context_line":"  mount:"},{"line_number":67,"context_line":"    name: none"},{"line_number":68,"context_line":"    src: \"{{ swap_partition }}\""},{"line_number":69,"context_line":"    fstype: swap"},{"line_number":70,"context_line":"    opts: sw"}],"source_content_type":"text/x-yaml","patch_set":8,"id":"7f287b81_895ef873","line":67,"range":{"start_line":67,"start_character":4,"end_line":67,"end_character":14},"updated":"2017-09-06 16:26:31.000000000","message":"Minor nit, this parameter is apparently now called \u0027path\u0027 starting with ansible 2.3.","commit_id":"aee53c39ed713557df987efb9bab93e8c7cf6b1f"},{"author":{"_account_id":7118,"name":"Ian Wienand","email":"iwienand@redhat.com","username":"iwienand"},"change_message_id":"e12b722d59dfc84ff6d0200e3229af4ce1cca698","unresolved":false,"context_lines":[{"line_number":64,"context_line":"- name: Write swap to fstab"},{"line_number":65,"context_line":"  become: yes"},{"line_number":66,"context_line":"  mount:"},{"line_number":67,"context_line":"    name: none"},{"line_number":68,"context_line":"    src: \"{{ swap_partition }}\""},{"line_number":69,"context_line":"    fstype: swap"},{"line_number":70,"context_line":"    opts: sw"}],"source_content_type":"text/x-yaml","patch_set":8,"id":"7f287b81_68c29c36","line":67,"range":{"start_line":67,"start_character":4,"end_line":67,"end_character":14},"in_reply_to":"7f287b81_895ef873","updated":"2017-09-06 22:04:29.000000000","message":"Done","commit_id":"aee53c39ed713557df987efb9bab93e8c7cf6b1f"},{"author":{"_account_id":4146,"name":"Clark Boylan","email":"cboylan@sapwetik.org","username":"cboylan"},"change_message_id":"58a4150ba63a719442a86d342fd46f0ba688aa98","unresolved":false,"context_lines":[{"line_number":108,"context_line":"    path: /opt"},{"line_number":109,"context_line":"    src: \"{{ opt_partition }}\""},{"line_number":110,"context_line":"    fstype: ext4"},{"line_number":111,"context_line":"    state: mounted"}],"source_content_type":"text/x-yaml","patch_set":8,"id":"7f287b81_6903cc43","line":111,"updated":"2017-09-06 16:26:31.000000000","message":"Not a regression because old code didn\u0027t do this but should we mount this noatime?","commit_id":"aee53c39ed713557df987efb9bab93e8c7cf6b1f"},{"author":{"_account_id":7118,"name":"Ian Wienand","email":"iwienand@redhat.com","username":"iwienand"},"change_message_id":"e12b722d59dfc84ff6d0200e3229af4ce1cca698","unresolved":false,"context_lines":[{"line_number":108,"context_line":"    path: /opt"},{"line_number":109,"context_line":"    src: \"{{ opt_partition }}\""},{"line_number":110,"context_line":"    fstype: ext4"},{"line_number":111,"context_line":"    state: mounted"}],"source_content_type":"text/x-yaml","patch_set":8,"id":"7f287b81_2807f484","line":111,"in_reply_to":"7f287b81_6903cc43","updated":"2017-09-06 22:04:29.000000000","message":"seems like a good idea, done","commit_id":"aee53c39ed713557df987efb9bab93e8c7cf6b1f"},{"author":{"_account_id":1,"name":"James E. Blair","email":"jim@acmegating.com","username":"corvus"},"change_message_id":"67a379c8d92abd763433c0078403d3b6211811da","unresolved":false,"context_lines":[{"line_number":46,"context_line":"    number: 1"},{"line_number":47,"context_line":"    state: present"},{"line_number":48,"context_line":"    part_start: \u00270%\u0027"},{"line_number":49,"context_line":"    part_end: \"{{ SWAP_SIZE }}MiB\""},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"- name: Create opt partition"},{"line_number":52,"context_line":"  become: yes"}],"source_content_type":"text/x-yaml","patch_set":10,"id":"5f2577a7_293938a3","line":49,"updated":"2017-09-14 17:19:22.000000000","message":"Based on the value used, 8192, this should maybe be GiB?","commit_id":"2c8aca40a5cc7a25513ccb7ddfd318932e0e9542"},{"author":{"_account_id":1,"name":"James E. Blair","email":"jim@acmegating.com","username":"corvus"},"change_message_id":"c608585f187d8ec92e70881f9723883753c478c7","unresolved":false,"context_lines":[{"line_number":46,"context_line":"    number: 1"},{"line_number":47,"context_line":"    state: present"},{"line_number":48,"context_line":"    part_start: \u00270%\u0027"},{"line_number":49,"context_line":"    part_end: \"{{ SWAP_SIZE }}MiB\""},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"- name: Create opt partition"},{"line_number":52,"context_line":"  become: yes"}],"source_content_type":"text/x-yaml","patch_set":10,"id":"5f2577a7_15da0f4b","line":49,"updated":"2017-09-14 19:44:56.000000000","message":"Wow, I\u0027m really wrong about this, sorry.","commit_id":"2c8aca40a5cc7a25513ccb7ddfd318932e0e9542"},{"author":{"_account_id":1,"name":"James E. Blair","email":"jim@acmegating.com","username":"corvus"},"change_message_id":"67a379c8d92abd763433c0078403d3b6211811da","unresolved":false,"context_lines":[{"line_number":54,"context_line":"    device: \"{{ ephemeral_device }}\""},{"line_number":55,"context_line":"    number: 2"},{"line_number":56,"context_line":"    state: present"},{"line_number":57,"context_line":"    part_start: \"{{ SWAP_SIZE }}MiB\""},{"line_number":58,"context_line":"    part_end: \"100%\""},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"- name: Make swap on partition"}],"source_content_type":"text/x-yaml","patch_set":10,"id":"5f2577a7_093e7c8b","line":57,"updated":"2017-09-14 17:19:22.000000000","message":"ditto","commit_id":"2c8aca40a5cc7a25513ccb7ddfd318932e0e9542"}],"playbooks/roles/configure_swap/tasks/main.yaml":[{"author":{"_account_id":9061,"name":"David Moreau Simard","email":"moi@dmsimard.com","username":"dmsimard"},"change_message_id":"c0d7dbdbeeb6f7019fc91938f744aa2276c5da19","unresolved":false,"context_lines":[{"line_number":27,"context_line":"    set_fact:"},{"line_number":28,"context_line":"      ephemeral_device: \"{{ ephemeral0.stdout }}\""},{"line_number":29,"context_line":"    when: \"\u0027ephemeral0\u0027 in blkid.stdout\""},{"line_number":30,"context_line":"  when: ephemeral_device is undefined"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"- include: configure_ephemeral.yaml"},{"line_number":33,"context_line":"  when:"}],"source_content_type":"text/x-yaml","patch_set":4,"id":"7f287b81_d29f6b63","line":30,"range":{"start_line":30,"start_character":2,"end_line":30,"end_character":37},"updated":"2017-09-01 16:52:24.000000000","message":"Nit, when using blocks, we typically put extra bits like conditionals right below the blocks like so:\n\n\n    - block:\n      when: ephemeral_device is undefined\n        - name: Find ...\n\nThis is more readable, especially when the block is large.","commit_id":"d1c5e849a28a3a9c00ab0cea6d1ca7218a09bb38"},{"author":{"_account_id":9061,"name":"David Moreau Simard","email":"moi@dmsimard.com","username":"dmsimard"},"change_message_id":"4f0a82d22a03cca7c3fe9b145050f9394c2bf303","unresolved":false,"context_lines":[{"line_number":27,"context_line":"    set_fact:"},{"line_number":28,"context_line":"      ephemeral_device: \"{{ ephemeral0.stdout }}\""},{"line_number":29,"context_line":"    when: \"\u0027ephemeral0\u0027 in blkid.stdout\""},{"line_number":30,"context_line":"  when: ephemeral_device is undefined"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"- include: configure_ephemeral.yaml"},{"line_number":33,"context_line":"  when:"}],"source_content_type":"text/x-yaml","patch_set":4,"id":"7f287b81_fc2912f2","line":30,"range":{"start_line":30,"start_character":2,"end_line":30,"end_character":37},"in_reply_to":"7f287b81_4144c0b7","updated":"2017-09-02 16:31:42.000000000","message":"Oops, the syntax is reversed with blocks. You need to put the \"when\" before:\n\n    - when: something is defined\n      block:\n        - task..\n\nI learned this from the openshift-ansible folks, they use it a lot, example: https://github.com/openshift/openshift-ansible/blob/20cf3396e4aae5aef6485a23e6cc3134c7a2d1be/roles/openshift_repos/tasks/main.yaml#L7","commit_id":"d1c5e849a28a3a9c00ab0cea6d1ca7218a09bb38"},{"author":{"_account_id":7118,"name":"Ian Wienand","email":"iwienand@redhat.com","username":"iwienand"},"change_message_id":"946a95572897d2f34e200124be6eecbdfce56981","unresolved":false,"context_lines":[{"line_number":27,"context_line":"    set_fact:"},{"line_number":28,"context_line":"      ephemeral_device: \"{{ ephemeral0.stdout }}\""},{"line_number":29,"context_line":"    when: \"\u0027ephemeral0\u0027 in blkid.stdout\""},{"line_number":30,"context_line":"  when: ephemeral_device is undefined"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"- include: configure_ephemeral.yaml"},{"line_number":33,"context_line":"  when:"}],"source_content_type":"text/x-yaml","patch_set":4,"id":"7f287b81_4144c0b7","line":30,"range":{"start_line":30,"start_character":2,"end_line":30,"end_character":37},"in_reply_to":"7f287b81_d29f6b63","updated":"2017-09-02 02:00:05.000000000","message":"Actually it seems the syntax is to have this after the tasks inside, as it then applies the when to each task","commit_id":"d1c5e849a28a3a9c00ab0cea6d1ca7218a09bb38"},{"author":{"_account_id":7118,"name":"Ian Wienand","email":"iwienand@redhat.com","username":"iwienand"},"change_message_id":"6ca160010787ee9425b4aadab2eeb376eb4e28db","unresolved":false,"context_lines":[{"line_number":27,"context_line":"    set_fact:"},{"line_number":28,"context_line":"      ephemeral_device: \"{{ ephemeral0.stdout }}\""},{"line_number":29,"context_line":"    when: \"\u0027ephemeral0\u0027 in blkid.stdout\""},{"line_number":30,"context_line":"  when: ephemeral_device is undefined"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"- include: configure_ephemeral.yaml"},{"line_number":33,"context_line":"  when:"}],"source_content_type":"text/x-yaml","patch_set":4,"id":"7f287b81_a16804ba","line":30,"range":{"start_line":30,"start_character":2,"end_line":30,"end_character":37},"in_reply_to":"7f287b81_d29f6b63","updated":"2017-09-02 01:16:11.000000000","message":"Done","commit_id":"d1c5e849a28a3a9c00ab0cea6d1ca7218a09bb38"},{"author":{"_account_id":7118,"name":"Ian Wienand","email":"iwienand@redhat.com","username":"iwienand"},"change_message_id":"976b952c1a322f76eabb62617478aa51d8d53fb8","unresolved":false,"context_lines":[{"line_number":27,"context_line":"    set_fact:"},{"line_number":28,"context_line":"      ephemeral_device: \"{{ ephemeral0.stdout }}\""},{"line_number":29,"context_line":"    when: \"\u0027ephemeral0\u0027 in blkid.stdout\""},{"line_number":30,"context_line":"  when: ephemeral_device is undefined"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"- include: configure_ephemeral.yaml"},{"line_number":33,"context_line":"  when:"}],"source_content_type":"text/x-yaml","patch_set":4,"id":"7f287b81_9453fae2","line":30,"range":{"start_line":30,"start_character":2,"end_line":30,"end_character":37},"in_reply_to":"7f287b81_fc2912f2","updated":"2017-09-04 00:58:19.000000000","message":"ahh, i totally mis-read this; it\u0027s easier when you put a name in there\n\n- name: task name\n  when: foo\n  block:\n    - list\n    - of\n    - tasks","commit_id":"d1c5e849a28a3a9c00ab0cea6d1ca7218a09bb38"},{"author":{"_account_id":9061,"name":"David Moreau Simard","email":"moi@dmsimard.com","username":"dmsimard"},"change_message_id":"c0d7dbdbeeb6f7019fc91938f744aa2276c5da19","unresolved":false,"context_lines":[{"line_number":29,"context_line":"    when: \"\u0027ephemeral0\u0027 in blkid.stdout\""},{"line_number":30,"context_line":"  when: ephemeral_device is undefined"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"- include: configure_ephemeral.yaml"},{"line_number":33,"context_line":"  when:"},{"line_number":34,"context_line":"    - ephemeral_device is defined"},{"line_number":35,"context_line":"    - ansible_memory_mb[\u0027swap\u0027][\u0027total\u0027] | int + 10 \u003c\u003d SWAP_SIZE"}],"source_content_type":"text/x-yaml","patch_set":4,"id":"7f287b81_72879711","line":32,"range":{"start_line":32,"start_character":2,"end_line":32,"end_character":9},"updated":"2017-09-01 16:52:24.000000000","message":"Include tasks that have conditionals attached to them need to carry the \"static: no\" attribute.\n\nhttp://docs.ansible.com/ansible/latest/playbooks_roles.html#dynamic-versus-static-includes","commit_id":"d1c5e849a28a3a9c00ab0cea6d1ca7218a09bb38"},{"author":{"_account_id":7118,"name":"Ian Wienand","email":"iwienand@redhat.com","username":"iwienand"},"change_message_id":"6ca160010787ee9425b4aadab2eeb376eb4e28db","unresolved":false,"context_lines":[{"line_number":29,"context_line":"    when: \"\u0027ephemeral0\u0027 in blkid.stdout\""},{"line_number":30,"context_line":"  when: ephemeral_device is undefined"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"- include: configure_ephemeral.yaml"},{"line_number":33,"context_line":"  when:"},{"line_number":34,"context_line":"    - ephemeral_device is defined"},{"line_number":35,"context_line":"    - ansible_memory_mb[\u0027swap\u0027][\u0027total\u0027] | int + 10 \u003c\u003d SWAP_SIZE"}],"source_content_type":"text/x-yaml","patch_set":4,"id":"7f287b81_816508e4","line":32,"range":{"start_line":32,"start_character":2,"end_line":32,"end_character":9},"in_reply_to":"7f287b81_72879711","updated":"2017-09-02 01:16:11.000000000","message":"Done","commit_id":"d1c5e849a28a3a9c00ab0cea6d1ca7218a09bb38"},{"author":{"_account_id":9061,"name":"David Moreau Simard","email":"moi@dmsimard.com","username":"dmsimard"},"change_message_id":"c0d7dbdbeeb6f7019fc91938f744aa2276c5da19","unresolved":false,"context_lines":[{"line_number":32,"context_line":"- include: configure_ephemeral.yaml"},{"line_number":33,"context_line":"  when:"},{"line_number":34,"context_line":"    - ephemeral_device is defined"},{"line_number":35,"context_line":"    - ansible_memory_mb[\u0027swap\u0027][\u0027total\u0027] | int + 10 \u003c\u003d SWAP_SIZE"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"# If no ephemeral device, then we will setup some swap space on the"},{"line_number":38,"context_line":"# root device to ensure all hosts a consistent amount of swap"}],"source_content_type":"text/x-yaml","patch_set":4,"id":"7f287b81_72b557cd","line":35,"range":{"start_line":35,"start_character":6,"end_line":35,"end_character":64},"updated":"2017-09-01 16:52:24.000000000","message":"It feels like we shouldn\u0027t bother to run *any* of those tasks at all if we have enough swap -- that\u0027s why in my draft [1] I had put it at the playbook level.\n\n(Note, my draft doesn\u0027t have a static:no, and it\u0027s an include task with a conditional so it probably needs one)\n\n[1]: https://gist.github.com/dmsimard/d3d818462292faf92dded7e2caf67bab","commit_id":"d1c5e849a28a3a9c00ab0cea6d1ca7218a09bb38"},{"author":{"_account_id":7118,"name":"Ian Wienand","email":"iwienand@redhat.com","username":"iwienand"},"change_message_id":"6ca160010787ee9425b4aadab2eeb376eb4e28db","unresolved":false,"context_lines":[{"line_number":32,"context_line":"- include: configure_ephemeral.yaml"},{"line_number":33,"context_line":"  when:"},{"line_number":34,"context_line":"    - ephemeral_device is defined"},{"line_number":35,"context_line":"    - ansible_memory_mb[\u0027swap\u0027][\u0027total\u0027] | int + 10 \u003c\u003d SWAP_SIZE"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"# If no ephemeral device, then we will setup some swap space on the"},{"line_number":38,"context_line":"# root device to ensure all hosts a consistent amount of swap"}],"source_content_type":"text/x-yaml","patch_set":4,"id":"7f287b81_61533ce4","line":35,"range":{"start_line":35,"start_character":6,"end_line":35,"end_character":64},"in_reply_to":"7f287b81_72b557cd","updated":"2017-09-02 01:16:11.000000000","message":"So my thinking behind this was that we want to have idempotence as \"low\" as possible in the hierarchy; this also kind of plays into your comment on the sysctl\n\nI like that the top level file is unconditional and just always runs.  Keeping things totally unconditional seems best as a strategy, however these two playbooks aren\u0027t quite idempotent -- I think the partitioning will redo itself on every run which is not what we want.  Longer term we could make these more idempotent and remove this check all together ... but I think this keeps us closer to the original code logic so let\u0027s not bite off more than we can chew at once :)","commit_id":"d1c5e849a28a3a9c00ab0cea6d1ca7218a09bb38"},{"author":{"_account_id":9061,"name":"David Moreau Simard","email":"moi@dmsimard.com","username":"dmsimard"},"change_message_id":"c0d7dbdbeeb6f7019fc91938f744aa2276c5da19","unresolved":false,"context_lines":[{"line_number":36,"context_line":""},{"line_number":37,"context_line":"# If no ephemeral device, then we will setup some swap space on the"},{"line_number":38,"context_line":"# root device to ensure all hosts a consistent amount of swap"},{"line_number":39,"context_line":"- include: configure_root.yaml"},{"line_number":40,"context_line":"  when:"},{"line_number":41,"context_line":"    - ephemeral_device is undefined"},{"line_number":42,"context_line":"    - ansible_memory_mb[\u0027swap\u0027][\u0027total\u0027] | int + 10 \u003c\u003d SWAP_SIZE"}],"source_content_type":"text/x-yaml","patch_set":4,"id":"7f287b81_d28d2b2b","line":39,"range":{"start_line":39,"start_character":2,"end_line":39,"end_character":9},"updated":"2017-09-01 16:52:24.000000000","message":"Ditto","commit_id":"d1c5e849a28a3a9c00ab0cea6d1ca7218a09bb38"},{"author":{"_account_id":7118,"name":"Ian Wienand","email":"iwienand@redhat.com","username":"iwienand"},"change_message_id":"6ca160010787ee9425b4aadab2eeb376eb4e28db","unresolved":false,"context_lines":[{"line_number":36,"context_line":""},{"line_number":37,"context_line":"# If no ephemeral device, then we will setup some swap space on the"},{"line_number":38,"context_line":"# root device to ensure all hosts a consistent amount of swap"},{"line_number":39,"context_line":"- include: configure_root.yaml"},{"line_number":40,"context_line":"  when:"},{"line_number":41,"context_line":"    - ephemeral_device is undefined"},{"line_number":42,"context_line":"    - ansible_memory_mb[\u0027swap\u0027][\u0027total\u0027] | int + 10 \u003c\u003d SWAP_SIZE"}],"source_content_type":"text/x-yaml","patch_set":4,"id":"7f287b81_415040d5","line":39,"range":{"start_line":39,"start_character":2,"end_line":39,"end_character":9},"in_reply_to":"7f287b81_d28d2b2b","updated":"2017-09-02 01:16:11.000000000","message":"Done","commit_id":"d1c5e849a28a3a9c00ab0cea6d1ca7218a09bb38"},{"author":{"_account_id":9061,"name":"David Moreau Simard","email":"moi@dmsimard.com","username":"dmsimard"},"change_message_id":"c0d7dbdbeeb6f7019fc91938f744aa2276c5da19","unresolved":false,"context_lines":[{"line_number":41,"context_line":"    - ephemeral_device is undefined"},{"line_number":42,"context_line":"    - ansible_memory_mb[\u0027swap\u0027][\u0027total\u0027] | int + 10 \u003c\u003d SWAP_SIZE"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"# ensure a standard level of swappiness.  Some platforms"},{"line_number":45,"context_line":"# (rax+centos7) come with swappiness of 0 (presumably because the"},{"line_number":46,"context_line":"# vm doesn\u0027t come with swap setup ... but we just did that above),"},{"line_number":47,"context_line":"# which depending on the kernel version can lead to the OOM killer"},{"line_number":48,"context_line":"# kicking in on some processes despite swap being available;"},{"line_number":49,"context_line":"# particularly things like mysql which have very high ratio of"},{"line_number":50,"context_line":"# anonymous-memory to file-backed mappings."},{"line_number":51,"context_line":"#"},{"line_number":52,"context_line":"# This sets swappiness low; we really don\u0027t want to be relying on"},{"line_number":53,"context_line":"# cloud I/O based swap during our runs if we can help it"},{"line_number":54,"context_line":"- name: Set swappiness"},{"line_number":55,"context_line":"  become: yes"},{"line_number":56,"context_line":"  sysctl:"},{"line_number":57,"context_line":"    name: vm.swappiness"},{"line_number":58,"context_line":"    value: 30"},{"line_number":59,"context_line":"    state: present"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"- debug:  var\u003dephemeral_device"}],"source_content_type":"text/x-yaml","patch_set":4,"id":"7f287b81_d229abf2","line":59,"range":{"start_line":44,"start_character":0,"end_line":59,"end_character":18},"updated":"2017-09-01 16:52:24.000000000","message":"How about we take this out to a different role where we could end up setting different/various sysctl parameters ?\nOtherwise, if we want to make sure this runs (ex: if we go with my idea at the playbook level) we\u0027d need to put it outside the conditional. Maybe before the include_role task ?","commit_id":"d1c5e849a28a3a9c00ab0cea6d1ca7218a09bb38"},{"author":{"_account_id":7118,"name":"Ian Wienand","email":"iwienand@redhat.com","username":"iwienand"},"change_message_id":"6ca160010787ee9425b4aadab2eeb376eb4e28db","unresolved":false,"context_lines":[{"line_number":41,"context_line":"    - ephemeral_device is undefined"},{"line_number":42,"context_line":"    - ansible_memory_mb[\u0027swap\u0027][\u0027total\u0027] | int + 10 \u003c\u003d SWAP_SIZE"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"# ensure a standard level of swappiness.  Some platforms"},{"line_number":45,"context_line":"# (rax+centos7) come with swappiness of 0 (presumably because the"},{"line_number":46,"context_line":"# vm doesn\u0027t come with swap setup ... but we just did that above),"},{"line_number":47,"context_line":"# which depending on the kernel version can lead to the OOM killer"},{"line_number":48,"context_line":"# kicking in on some processes despite swap being available;"},{"line_number":49,"context_line":"# particularly things like mysql which have very high ratio of"},{"line_number":50,"context_line":"# anonymous-memory to file-backed mappings."},{"line_number":51,"context_line":"#"},{"line_number":52,"context_line":"# This sets swappiness low; we really don\u0027t want to be relying on"},{"line_number":53,"context_line":"# cloud I/O based swap during our runs if we can help it"},{"line_number":54,"context_line":"- name: Set swappiness"},{"line_number":55,"context_line":"  become: yes"},{"line_number":56,"context_line":"  sysctl:"},{"line_number":57,"context_line":"    name: vm.swappiness"},{"line_number":58,"context_line":"    value: 30"},{"line_number":59,"context_line":"    state: present"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"- debug:  var\u003dephemeral_device"}],"source_content_type":"text/x-yaml","patch_set":4,"id":"7f287b81_c15d50ea","line":59,"range":{"start_line":44,"start_character":0,"end_line":59,"end_character":18},"in_reply_to":"7f287b81_d229abf2","updated":"2017-09-02 01:16:11.000000000","message":"As mentioned above, this seems to fit in here ... in the (very theoretical) case of a 3rd party doing this on their own host,  with 8gb of swap already setup we would still want to do this for consistency.\n\nSince it\u0027s so easy to drop a sysctl: call in anywhere, I think it\u0027s best to leave things close by and rely on the idempotence again.","commit_id":"d1c5e849a28a3a9c00ab0cea6d1ca7218a09bb38"},{"author":{"_account_id":4146,"name":"Clark Boylan","email":"cboylan@sapwetik.org","username":"cboylan"},"change_message_id":"58a4150ba63a719442a86d342fd46f0ba688aa98","unresolved":false,"context_lines":[{"line_number":16,"context_line":"- name: Set ephemeral device by label"},{"line_number":17,"context_line":"  when: ephemeral_device is undefined"},{"line_number":18,"context_line":"  block:"},{"line_number":19,"context_line":"    - name: Find ephemeral0 device"},{"line_number":20,"context_line":"      command: /sbin/blkid"},{"line_number":21,"context_line":"      register: blkid"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"    - name: Get ephemeral0 device node"},{"line_number":24,"context_line":"      when: \"\u0027ephemeral0\u0027 in blkid.stdout\""}],"source_content_type":"text/x-yaml","patch_set":8,"id":"7f287b81_8916f854","line":21,"range":{"start_line":19,"start_character":0,"end_line":21,"end_character":21},"updated":"2017-09-06 16:26:31.000000000","message":"I think this command task can be dropped entirely. Then below you could just have:\n\n    - name: Get ephemeral0 device node\n      command: /sbin/blkid -L ephemeral0\n      register: ephemeral0\n      changed_when: False\n\n    - name: Set ephemeral device if LABEL exists\n      when: \"ephemeral0.rc \u003d\u003d 0\"\n      set_fact:\n        ephemeral_device: \"{{ ephemeral0.stdout }}\"\n\nSince blkid -L will return non zero when label does not exist.","commit_id":"aee53c39ed713557df987efb9bab93e8c7cf6b1f"},{"author":{"_account_id":7118,"name":"Ian Wienand","email":"iwienand@redhat.com","username":"iwienand"},"change_message_id":"e12b722d59dfc84ff6d0200e3229af4ce1cca698","unresolved":false,"context_lines":[{"line_number":16,"context_line":"- name: Set ephemeral device by label"},{"line_number":17,"context_line":"  when: ephemeral_device is undefined"},{"line_number":18,"context_line":"  block:"},{"line_number":19,"context_line":"    - name: Find ephemeral0 device"},{"line_number":20,"context_line":"      command: /sbin/blkid"},{"line_number":21,"context_line":"      register: blkid"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"    - name: Get ephemeral0 device node"},{"line_number":24,"context_line":"      when: \"\u0027ephemeral0\u0027 in blkid.stdout\""}],"source_content_type":"text/x-yaml","patch_set":8,"id":"7f287b81_8825c80b","line":21,"range":{"start_line":19,"start_character":0,"end_line":21,"end_character":21},"in_reply_to":"7f287b81_8916f854","updated":"2017-09-06 22:04:29.000000000","message":"nice idea, done","commit_id":"aee53c39ed713557df987efb9bab93e8c7cf6b1f"}],"playbooks/roles/configure_swap/tasks/root.yaml":[{"author":{"_account_id":4146,"name":"Clark Boylan","email":"cboylan@sapwetik.org","username":"cboylan"},"change_message_id":"58a4150ba63a719442a86d342fd46f0ba688aa98","unresolved":false,"context_lines":[{"line_number":47,"context_line":"  become: yes"},{"line_number":48,"context_line":"  command: mkswap /root/swapfile"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"- name: Enable swapfile"},{"line_number":51,"context_line":"  become: yes"},{"line_number":52,"context_line":"  command: swapon /root/swapfile"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"- debug: var\u003dswap_required"}],"source_content_type":"text/x-yaml","patch_set":8,"id":"7f287b81_2463a9de","line":52,"range":{"start_line":50,"start_character":0,"end_line":52,"end_character":32},"updated":"2017-09-06 16:26:31.000000000","message":"For symmetry with the partition case and ability to survive reboots (which is not an issue with zuulv2 but will be desirable with v3) should we use the mount module here as well to edit fstab?","commit_id":"aee53c39ed713557df987efb9bab93e8c7cf6b1f"},{"author":{"_account_id":7118,"name":"Ian Wienand","email":"iwienand@redhat.com","username":"iwienand"},"change_message_id":"e12b722d59dfc84ff6d0200e3229af4ce1cca698","unresolved":false,"context_lines":[{"line_number":47,"context_line":"  become: yes"},{"line_number":48,"context_line":"  command: mkswap /root/swapfile"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"- name: Enable swapfile"},{"line_number":51,"context_line":"  become: yes"},{"line_number":52,"context_line":"  command: swapon /root/swapfile"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"- debug: var\u003dswap_required"}],"source_content_type":"text/x-yaml","patch_set":8,"id":"7f287b81_a8dbe4ea","line":52,"range":{"start_line":50,"start_character":0,"end_line":52,"end_character":32},"in_reply_to":"7f287b81_2463a9de","updated":"2017-09-06 22:04:29.000000000","message":"Thanks, i meant to do that but forgot!","commit_id":"aee53c39ed713557df987efb9bab93e8c7cf6b1f"}]}
