)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":9816,"name":"Takashi Kajinami","email":"kajinamit@oss.nttdata.com","username":"kajinamit"},"change_message_id":"cdb07a377f65f31fc37aaccdd839d0b1de580d84","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"44315667_c2df1491","updated":"2022-09-20 05:46:29.000000000","message":"Thanks Rabi for pointing that. Let me put WIP until I double-check the commands in my local.","commit_id":"0bb105ba667cc00d0bbfe655c9a9d6d4e002345c"},{"author":{"_account_id":9816,"name":"Takashi Kajinami","email":"kajinamit@oss.nttdata.com","username":"kajinamit"},"change_message_id":"097dedece325cb484f863e1c872874c814ee7d46","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"08a1509b_a124958c","updated":"2022-09-20 06:02:07.000000000","message":"Ugh. Sorry I somehow mis-recognized this as my own patch ... still booting up after a long weekend ...","commit_id":"0bb105ba667cc00d0bbfe655c9a9d6d4e002345c"},{"author":{"_account_id":28223,"name":"Cedric Jeanneret","display_name":"cjeanner (Tengu)","email":"cjeanner@redhat.com","username":"cjeanner"},"change_message_id":"804b9d627deaf34515a09fc5501f85fe15f347e8","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"d93fb211_ea29b81c","updated":"2022-09-13 13:57:12.000000000","message":"guess I\u0027ll have to chase down \"| grep -q\" patterns in t-h-t soon :).","commit_id":"0bb105ba667cc00d0bbfe655c9a9d6d4e002345c"}],"deployment/metrics/collectd-container-puppet.yaml":[{"author":{"_account_id":8833,"name":"Rabi Mishra","email":"ramishra@redhat.com","username":"rabi"},"change_message_id":"97d0fa809ef7c2df32f2bb19afa203585faf9387","unresolved":true,"context_lines":[{"line_number":618,"context_line":"            - step|int \u003d\u003d 1"},{"line_number":619,"context_line":"          block:"},{"line_number":620,"context_line":"            - name: Check if rsyslog exists"},{"line_number":621,"context_line":"              command: systemctl list-unit-files --type\u003dservice rsyslog"},{"line_number":622,"context_line":"              register: rsyslog_config"},{"line_number":623,"context_line":"              failed_when: rsyslog_config.rc not in [0, 1]"},{"line_number":624,"context_line":"            - name: Configure if we can"}],"source_content_type":"text/x-yaml","patch_set":1,"id":"06d0e292_fb8cd8ac","line":621,"range":{"start_line":621,"start_character":64,"end_line":621,"end_character":71},"updated":"2022-09-20 05:37:39.000000000","message":"Would not you need rsyslog.service here?","commit_id":"0bb105ba667cc00d0bbfe655c9a9d6d4e002345c"},{"author":{"_account_id":9816,"name":"Takashi Kajinami","email":"kajinamit@oss.nttdata.com","username":"kajinamit"},"change_message_id":"75169412b27dbfe0eae71ff4d732bbdff4c23961","unresolved":true,"context_lines":[{"line_number":618,"context_line":"            - step|int \u003d\u003d 1"},{"line_number":619,"context_line":"          block:"},{"line_number":620,"context_line":"            - name: Check if rsyslog exists"},{"line_number":621,"context_line":"              command: systemctl list-unit-files --type\u003dservice rsyslog"},{"line_number":622,"context_line":"              register: rsyslog_config"},{"line_number":623,"context_line":"              failed_when: rsyslog_config.rc not in [0, 1]"},{"line_number":624,"context_line":"            - name: Configure if we can"}],"source_content_type":"text/x-yaml","patch_set":1,"id":"6f0af5c8_30cfd6d9","line":621,"range":{"start_line":621,"start_character":64,"end_line":621,"end_character":71},"in_reply_to":"06d0e292_fb8cd8ac","updated":"2022-09-20 06:03:33.000000000","message":"Seems this is not working as intended.\n\n```\n[root@undercloud ~]# systemctl list-unit-files --type\u003dservice rsyslog\nUNIT FILE STATE VENDOR PRESET\n\n0 unit files listed.\n[root@undercloud ~]# echo $?\n1\n[root@undercloud ~]# systemctl list-unit-files --type\u003dservice rsyslog.service\nUNIT FILE       STATE   VENDOR PRESET\nrsyslog.service enabled enabled      \n\n1 unit files listed.\n[root@undercloud ~]# echo $?\n0\n[root@undercloud ~]# systemctl list-unit-files --type\u003dservice foo.service\nUNIT FILE STATE VENDOR PRESET\n\n0 unit files listed.\n[root@undercloud ~]# echo $?\n1\n```\n\nMaybe we should use status and check return code (if the unit does not exist, the command should return 4)","commit_id":"0bb105ba667cc00d0bbfe655c9a9d6d4e002345c"},{"author":{"_account_id":28223,"name":"Cedric Jeanneret","display_name":"cjeanner (Tengu)","email":"cjeanner@redhat.com","username":"cjeanner"},"change_message_id":"c7b96c282385e296b5968060b506320a59f90edd","unresolved":true,"context_lines":[{"line_number":618,"context_line":"            - step|int \u003d\u003d 1"},{"line_number":619,"context_line":"          block:"},{"line_number":620,"context_line":"            - name: Check if rsyslog exists"},{"line_number":621,"context_line":"              command: systemctl list-unit-files --type\u003dservice rsyslog"},{"line_number":622,"context_line":"              register: rsyslog_config"},{"line_number":623,"context_line":"              failed_when: rsyslog_config.rc not in [0, 1]"},{"line_number":624,"context_line":"            - name: Configure if we can"}],"source_content_type":"text/x-yaml","patch_set":1,"id":"94712d51_7bee4cf2","line":621,"range":{"start_line":621,"start_character":64,"end_line":621,"end_character":71},"in_reply_to":"6f0af5c8_30cfd6d9","updated":"2022-09-20 13:56:49.000000000","message":"fun, here it was working just fine without the .service... I\u0027ll do some more tests.\n\n@Takashi: if you don\u0027t have enough work, please, lemme know, I have a ton of ideas :D","commit_id":"0bb105ba667cc00d0bbfe655c9a9d6d4e002345c"},{"author":{"_account_id":28223,"name":"Cedric Jeanneret","display_name":"cjeanner (Tengu)","email":"cjeanner@redhat.com","username":"cjeanner"},"change_message_id":"4367b3fe9a5bdd79be74521d52786d209ff7d805","unresolved":true,"context_lines":[{"line_number":618,"context_line":"            - step|int \u003d\u003d 1"},{"line_number":619,"context_line":"          block:"},{"line_number":620,"context_line":"            - name: Check if rsyslog exists"},{"line_number":621,"context_line":"              command: systemctl list-unit-files --type\u003dservice rsyslog"},{"line_number":622,"context_line":"              register: rsyslog_config"},{"line_number":623,"context_line":"              failed_when: rsyslog_config.rc not in [0, 1]"},{"line_number":624,"context_line":"            - name: Configure if we can"}],"source_content_type":"text/x-yaml","patch_set":1,"id":"ffcfb07c_cdd7e87e","line":621,"range":{"start_line":621,"start_character":64,"end_line":621,"end_character":71},"in_reply_to":"94712d51_7bee4cf2","updated":"2022-09-20 14:06:50.000000000","message":"Ah, also, intended action:\n- rc \u003d\u003d 0, means the unit is present, in whatever state we get\n- rc \u003d\u003d 1, means the unit is not present\n\nWe don\u0027t want to fail on [0, 1]\n\nThen, if we match rc \u003d\u003d 0, then we want to ensure it\u0027s enabled/running/configured.\n\nThis is the intended use, and your listing seems to show it\u0027s working as expected. I\u0027m adding the \".service\", indeed it\u0027s needed. And will also make sure it\u0027s working fine if anyone copies this logic for a service with some alias.","commit_id":"0bb105ba667cc00d0bbfe655c9a9d6d4e002345c"},{"author":{"_account_id":9816,"name":"Takashi Kajinami","email":"kajinamit@oss.nttdata.com","username":"kajinamit"},"change_message_id":"ebf5684186e94221822b10004443a041f3b8dde7","unresolved":false,"context_lines":[{"line_number":618,"context_line":"            - step|int \u003d\u003d 1"},{"line_number":619,"context_line":"          block:"},{"line_number":620,"context_line":"            - name: Check if rsyslog exists"},{"line_number":621,"context_line":"              command: systemctl list-unit-files --type\u003dservice rsyslog"},{"line_number":622,"context_line":"              register: rsyslog_config"},{"line_number":623,"context_line":"              failed_when: rsyslog_config.rc not in [0, 1]"},{"line_number":624,"context_line":"            - name: Configure if we can"}],"source_content_type":"text/x-yaml","patch_set":1,"id":"009a82d0_51c01e57","line":621,"range":{"start_line":621,"start_character":64,"end_line":621,"end_character":71},"in_reply_to":"ffcfb07c_cdd7e87e","updated":"2022-09-21 05:25:17.000000000","message":"I somehow misread the return code but indeed the return code is different if the service does not exist. I was thinking of using systemctl status intead but it\u0027d be\noverkilling as it can show a few more different codes.","commit_id":"0bb105ba667cc00d0bbfe655c9a9d6d4e002345c"}]}
