)]}'
{"tasks/nova_vgpu_detect.yml":[{"author":{"_account_id":25023,"name":"Jonathan Rosser","email":"jonathan.rosser@rd.bbc.co.uk","username":"jrosser"},"change_message_id":"ae9cb51da23f84ca72e674ed7cbaf766d70adc1a","unresolved":false,"context_lines":[{"line_number":18,"context_line":"  register: mdev_folder"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"- name: Get mdev info content and store as var"},{"line_number":21,"context_line":"  command: \"/bin/sh -c \u0027ls -1 /sys/class/mdev_bus/*/mdev_supported_types\u0027\""},{"line_number":22,"context_line":"  register: mdev"},{"line_number":23,"context_line":"  when: mdev_folder.stat.exists"},{"line_number":24,"context_line":""}],"source_content_type":"text/x-yaml","patch_set":3,"id":"3f79a3b5_fd30a657","line":21,"range":{"start_line":21,"start_character":27,"end_line":21,"end_character":29},"updated":"2018-09-04 20:36:25.000000000","message":"are you sure you want ls -l? this is not what is in the example in the commit message","commit_id":"55db88fa6937d8db11972ff154f17cdd4e0d1a9e"},{"author":{"_account_id":28716,"name":"Valentin Boucher","email":"Valentin.Boucher@kontron.com","username":"boucherv"},"change_message_id":"fb09a91ebcc8d9708f4bdce19fcd0df5e9e8411b","unresolved":false,"context_lines":[{"line_number":18,"context_line":"  register: mdev_folder"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"- name: Get mdev info content and store as var"},{"line_number":21,"context_line":"  command: \"/bin/sh -c \u0027ls -1 /sys/class/mdev_bus/*/mdev_supported_types\u0027\""},{"line_number":22,"context_line":"  register: mdev"},{"line_number":23,"context_line":"  when: mdev_folder.stat.exists"},{"line_number":24,"context_line":""}],"source_content_type":"text/x-yaml","patch_set":3,"id":"3f79a3b5_2f41f60a","line":21,"range":{"start_line":21,"start_character":27,"end_line":21,"end_character":29},"in_reply_to":"3f79a3b5_fd30a657","updated":"2018-09-05 12:30:06.000000000","message":"It\u0027s not ls -l but ls -1. So, the command output isn\u0027t the same (-1     list one file per line).\n\nThe idea is to build a list in order to use it in the fact after:\nroot@aio1:~# /bin/sh -c \u0027ls -1 /sys/class/mdev_bus/*/mdev_supported_types\u0027\ni915-GVTg_V5_4\ni915-GVTg_V5_8","commit_id":"55db88fa6937d8db11972ff154f17cdd4e0d1a9e"},{"author":{"_account_id":25023,"name":"Jonathan Rosser","email":"jonathan.rosser@rd.bbc.co.uk","username":"jrosser"},"change_message_id":"ae9cb51da23f84ca72e674ed7cbaf766d70adc1a","unresolved":false,"context_lines":[{"line_number":22,"context_line":"  register: mdev"},{"line_number":23,"context_line":"  when: mdev_folder.stat.exists"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"- name: Register a fact for nova enabled_vgpu_types"},{"line_number":26,"context_line":"  set_fact:"},{"line_number":27,"context_line":"    enabled_vgpu_types: \"{{ mdev.stdout_lines }}\""},{"line_number":28,"context_line":"  when: mdev.stdout_lines is defined and mdev.stdout_lines|length\u003e0"}],"source_content_type":"text/x-yaml","patch_set":3,"id":"3f79a3b5_3d793efb","line":28,"range":{"start_line":25,"start_character":0,"end_line":28,"end_character":67},"updated":"2018-09-04 20:36:25.000000000","message":"something feels wrong here - even removing the -l above stdout_lines will contain alternate lines of directory names and gpu types. Would the ansible find module be better suited here replacing all three tasks?","commit_id":"55db88fa6937d8db11972ff154f17cdd4e0d1a9e"},{"author":{"_account_id":28716,"name":"Valentin Boucher","email":"Valentin.Boucher@kontron.com","username":"boucherv"},"change_message_id":"fb09a91ebcc8d9708f4bdce19fcd0df5e9e8411b","unresolved":false,"context_lines":[{"line_number":22,"context_line":"  register: mdev"},{"line_number":23,"context_line":"  when: mdev_folder.stat.exists"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"- name: Register a fact for nova enabled_vgpu_types"},{"line_number":26,"context_line":"  set_fact:"},{"line_number":27,"context_line":"    enabled_vgpu_types: \"{{ mdev.stdout_lines }}\""},{"line_number":28,"context_line":"  when: mdev.stdout_lines is defined and mdev.stdout_lines|length\u003e0"}],"source_content_type":"text/x-yaml","patch_set":3,"id":"3f79a3b5_af13c600","line":28,"range":{"start_line":25,"start_character":0,"end_line":28,"end_character":67},"in_reply_to":"3f79a3b5_3d793efb","updated":"2018-09-05 12:30:06.000000000","message":"I tried ansible find module but I encountered several issues (due to the wildcard etc). These 3 tasks seem to be the best way on a compute with vGPU or compute without.","commit_id":"55db88fa6937d8db11972ff154f17cdd4e0d1a9e"},{"author":{"_account_id":6816,"name":"Jesse Pretorius","email":"jesse@odyssey4.me","username":"jesse-pretorius"},"change_message_id":"d087d073fd0aaacbe1c754a917fdd842f5e229c0","unresolved":false,"context_lines":[{"line_number":25,"context_line":"- name: Register a fact for nova enabled_vgpu_types"},{"line_number":26,"context_line":"  set_fact:"},{"line_number":27,"context_line":"    enabled_vgpu_types: \"{{ mdev.stdout_lines | unique }}\""},{"line_number":28,"context_line":"  when: mdev.stdout_lines is defined and mdev.stdout_lines|length\u003e0"}],"source_content_type":"text/x-yaml","patch_set":4,"id":"3f79a3b5_e19aed6c","line":28,"range":{"start_line":28,"start_character":0,"end_line":28,"end_character":67},"updated":"2018-09-08 13:08:02.000000000","message":"It\u0027s a lot safer to ensure that groups in a logical AND are surrounded by brakcets to ensure precedence. Unfortunately ansible has changed precedence orders and processing over time. When two conditions are ANDed, though, you can use list format. Combine that with better spacing, it becomes a lot easier to read:\n\n  when:\n    - mdev.stdout_lines is defined\n    - mdev.stdout_lines | length \u003e 0","commit_id":"7e7677eb078faf4687fe3d1af0ea5880296c35ce"},{"author":{"_account_id":28716,"name":"Valentin Boucher","email":"Valentin.Boucher@kontron.com","username":"boucherv"},"change_message_id":"012c2701d083ea4d348fa1e5aa332072509eccd8","unresolved":false,"context_lines":[{"line_number":25,"context_line":"- name: Register a fact for nova enabled_vgpu_types"},{"line_number":26,"context_line":"  set_fact:"},{"line_number":27,"context_line":"    enabled_vgpu_types: \"{{ mdev.stdout_lines | unique }}\""},{"line_number":28,"context_line":"  when: mdev.stdout_lines is defined and mdev.stdout_lines|length\u003e0"}],"source_content_type":"text/x-yaml","patch_set":4,"id":"3f79a3b5_e3909c52","line":28,"range":{"start_line":28,"start_character":0,"end_line":28,"end_character":67},"in_reply_to":"3f79a3b5_e19aed6c","updated":"2018-09-10 12:47:07.000000000","message":"Thank you for these tips! I will update those lines","commit_id":"7e7677eb078faf4687fe3d1af0ea5880296c35ce"}],"templates/nova.conf.j2":[{"author":{"_account_id":6816,"name":"Jesse Pretorius","email":"jesse@odyssey4.me","username":"jesse-pretorius"},"change_message_id":"d087d073fd0aaacbe1c754a917fdd842f5e229c0","unresolved":false,"context_lines":[{"line_number":348,"context_line":""},{"line_number":349,"context_line":"{% if enabled_vgpu_types is defined %}"},{"line_number":350,"context_line":"[devices]"},{"line_number":351,"context_line":"enabled_vgpu_types \u003d {% for vgpu_type in enabled_vgpu_types %}{{ vgpu_type }}{% if not loop.last %},{% endif %}{% endfor %}"},{"line_number":352,"context_line":"{% endif %}"}],"source_content_type":"text/x-jinja2","patch_set":4,"id":"3f79a3b5_c18d7131","line":351,"range":{"start_line":351,"start_character":21,"end_line":351,"end_character":123},"updated":"2018-09-08 13:08:02.000000000","message":"This can be expressed more simply as: enabled_vgpu_types | join(\u0027,\u0027)","commit_id":"7e7677eb078faf4687fe3d1af0ea5880296c35ce"}]}
