{"action":"created","comment":{"url":"https://api.github.com/repos/msgqe/ansible-amq-broker/pulls/comments/216389762","pull_request_review_id":153849627,"id":216389762,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxNjM4OTc2Mg==","diff_hunk":"@@ -20,18 +20,39 @@\n   when:\n     - amq_broker_service_start is defined and amq_broker_service_start == true\n     - amq_broker_path_st.stat.exists and amq_broker_path_st.stat.isdir is defined\n-  become: true\n-  become_user: \"{{ amq_broker_user | default(amq_broker_default_user) }}\"\n-  command: \"{{ amq_broker_install_dest }}/{{ amq_broker_instance_dir }}/bin/artemis-service stop\"\n-  register: stop_result\n+  block:\n+    - name: Stop broker instance via service\n+      become: true\n+      become_user: \"{{ amq_broker_user | default(amq_broker_default_user) }}\"\n+      command: \"{{ amq_broker_install_dest }}/{{ amq_broker_instance_dir }}/bin/artemis-service stop\"\n+  rescue:\n+    - name: Kill JBoss AMQ 7 Broker\n+      include: kill_amq_broker_instance.yml\n \n - name: Stop JBoss AMQ 7 Broker default instance\n-  when: amq_broker_service_start is defined and amq_broker_service_start == false\n-  become: true\n-  become_user: \"{{ amq_broker_user | default(amq_broker_default_user) }}\"\n-  command: \"{{ amq_broker_install_dest }}/{{ amq_broker_instance_dir }}/bin/artemis stop\"\n-  register: stop_result\n+  when:\n+    - amq_broker_service_start is defined and amq_broker_service_start == false\n+    - amq_broker_path_st.stat.exists and amq_broker_path_st.stat.isdir is defined\n+  block:\n+    - name: Stop broker instance\n+      become: true\n+      become_user: \"{{ amq_broker_user | default(amq_broker_default_user) }}\"\n+      command: \"{{ amq_broker_install_dest }}/{{ amq_broker_instance_dir }}/bin/artemis stop\"\n+  rescue:\n+    - name: Kill JBoss AMQ 7 Broker\n+      include: kill_amq_broker_instance.yml\n \n-- name: Kill JBoss AMQ 7 Broker\n-  when: stop_result | failed and amq_broker_force_kill is defined and amq_broker_force_kill == true\n-  include: kill_amq_broker_instance.yml\n+- name: Make sure no Artemis/AMQ 7 broker is running on machine\n+  when: amq_broker_force_kill is defined and amq_broker_force_kill == true\n+  block:\n+    - name: Check running artemis process\n+      command: 'pgrep -f \"java.*artemis\"'\n+      register: bad_artemis_pid\n+      msg: \"Bad artemis= {{ bad_artemis_pid }}\"\n+      failed_when: bad_artemis_pid.rc == 0\n+  rescue:\n+    - name: SIGKILL any artemis java process\n+      become: true\n+      become_user: root\n+      command: 'pkill -9 -f \"java.*artemis\"'","path":"tasks/service_stop_amq_broker_instance.yml","position":50,"original_position":50,"commit_id":"c7e6aed342fce506889d6a7f181fe934c1b21c88","original_commit_id":"c7e6aed342fce506889d6a7f181fe934c1b21c88","user":{"login":"orpiske","id":1851560,"node_id":"MDQ6VXNlcjE4NTE1NjA=","avatar_url":"https://avatars0.githubusercontent.com/u/1851560?v=4","gravatar_id":"","url":"https://api.github.com/users/orpiske","html_url":"https://github.com/orpiske","followers_url":"https://api.github.com/users/orpiske/followers","following_url":"https://api.github.com/users/orpiske/following{/other_user}","gists_url":"https://api.github.com/users/orpiske/gists{/gist_id}","starred_url":"https://api.github.com/users/orpiske/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/orpiske/subscriptions","organizations_url":"https://api.github.com/users/orpiske/orgs","repos_url":"https://api.github.com/users/orpiske/repos","events_url":"https://api.github.com/users/orpiske/events{/privacy}","received_events_url":"https://api.github.com/users/orpiske/received_events","type":"User","site_admin":false},"body":"I think this is very dangerous. It can kill broker instances not running on the same user (this is a problem for Maestro). \r\n\r\n1. I don't think it needs to become root here.\r\n2. I think a safer command line, using shell module instead of command, would be something like: \r\n\r\n> pgrep -U $(id -u {{ amq_broker_user }} ) -f '.\\*java.\\*artemis.\\*' \r\n\r\n","created_at":"2018-09-10T16:35:06Z","updated_at":"2018-09-10T16:37:34Z","html_url":"https://github.com/msgqe/ansible-amq-broker/pull/10#discussion_r216389762","pull_request_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/pulls/10","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/msgqe/ansible-amq-broker/pulls/comments/216389762"},"html":{"href":"https://github.com/msgqe/ansible-amq-broker/pull/10#discussion_r216389762"},"pull_request":{"href":"https://api.github.com/repos/msgqe/ansible-amq-broker/pulls/10"}},"in_reply_to_id":216383806},"pull_request":{"url":"https://api.github.com/repos/msgqe/ansible-amq-broker/pulls/10","id":207380041,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA3MzgwMDQx","html_url":"https://github.com/msgqe/ansible-amq-broker/pull/10","diff_url":"https://github.com/msgqe/ansible-amq-broker/pull/10.diff","patch_url":"https://github.com/msgqe/ansible-amq-broker/pull/10.patch","issue_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/issues/10","number":10,"state":"open","locked":false,"title":"UPD Ignore stop command if location does not exist","user":{"login":"michalxo","id":2168878,"node_id":"MDQ6VXNlcjIxNjg4Nzg=","avatar_url":"https://avatars1.githubusercontent.com/u/2168878?v=4","gravatar_id":"","url":"https://api.github.com/users/michalxo","html_url":"https://github.com/michalxo","followers_url":"https://api.github.com/users/michalxo/followers","following_url":"https://api.github.com/users/michalxo/following{/other_user}","gists_url":"https://api.github.com/users/michalxo/gists{/gist_id}","starred_url":"https://api.github.com/users/michalxo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michalxo/subscriptions","organizations_url":"https://api.github.com/users/michalxo/orgs","repos_url":"https://api.github.com/users/michalxo/repos","events_url":"https://api.github.com/users/michalxo/events{/privacy}","received_events_url":"https://api.github.com/users/michalxo/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-08-09T16:53:42Z","updated_at":"2018-09-10T16:37:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"291ef211a63e57801377d3abdfb15f06e55d72da","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/pulls/10/commits","review_comments_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/pulls/10/comments","review_comment_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/pulls/comments{/number}","comments_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/issues/10/comments","statuses_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/statuses/c7e6aed342fce506889d6a7f181fe934c1b21c88","head":{"label":"msgqe:mt_service_stop","ref":"mt_service_stop","sha":"c7e6aed342fce506889d6a7f181fe934c1b21c88","user":{"login":"msgqe","id":24704290,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI0NzA0Mjkw","avatar_url":"https://avatars3.githubusercontent.com/u/24704290?v=4","gravatar_id":"","url":"https://api.github.com/users/msgqe","html_url":"https://github.com/msgqe","followers_url":"https://api.github.com/users/msgqe/followers","following_url":"https://api.github.com/users/msgqe/following{/other_user}","gists_url":"https://api.github.com/users/msgqe/gists{/gist_id}","starred_url":"https://api.github.com/users/msgqe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/msgqe/subscriptions","organizations_url":"https://api.github.com/users/msgqe/orgs","repos_url":"https://api.github.com/users/msgqe/repos","events_url":"https://api.github.com/users/msgqe/events{/privacy}","received_events_url":"https://api.github.com/users/msgqe/received_events","type":"Organization","site_admin":false},"repo":{"id":92163109,"node_id":"MDEwOlJlcG9zaXRvcnk5MjE2MzEwOQ==","name":"ansible-amq-broker","full_name":"msgqe/ansible-amq-broker","owner":{"login":"msgqe","id":24704290,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI0NzA0Mjkw","avatar_url":"https://avatars3.githubusercontent.com/u/24704290?v=4","gravatar_id":"","url":"https://api.github.com/users/msgqe","html_url":"https://github.com/msgqe","followers_url":"https://api.github.com/users/msgqe/followers","following_url":"https://api.github.com/users/msgqe/following{/other_user}","gists_url":"https://api.github.com/users/msgqe/gists{/gist_id}","starred_url":"https://api.github.com/users/msgqe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/msgqe/subscriptions","organizations_url":"https://api.github.com/users/msgqe/orgs","repos_url":"https://api.github.com/users/msgqe/repos","events_url":"https://api.github.com/users/msgqe/events{/privacy}","received_events_url":"https://api.github.com/users/msgqe/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/msgqe/ansible-amq-broker","description":"AMQ Broker deployment scripts","fork":false,"url":"https://api.github.com/repos/msgqe/ansible-amq-broker","forks_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/forks","keys_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/teams","hooks_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/hooks","issue_events_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/issues/events{/number}","events_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/events","assignees_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/assignees{/user}","branches_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/branches{/branch}","tags_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/tags","blobs_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/git/refs{/sha}","trees_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/statuses/{sha}","languages_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/languages","stargazers_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/stargazers","contributors_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/contributors","subscribers_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/subscribers","subscription_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/subscription","commits_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/commits{/sha}","git_commits_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/git/commits{/sha}","comments_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/comments{/number}","issue_comment_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/issues/comments{/number}","contents_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/contents/{+path}","compare_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/merges","archive_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/downloads","issues_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/issues{/number}","pulls_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/pulls{/number}","milestones_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/milestones{/number}","notifications_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/labels{/name}","releases_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/releases{/id}","deployments_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/deployments","created_at":"2017-05-23T11:03:55Z","updated_at":"2018-08-09T12:27:42Z","pushed_at":"2018-09-10T13:15:01Z","git_url":"git://github.com/msgqe/ansible-amq-broker.git","ssh_url":"git@github.com:msgqe/ansible-amq-broker.git","clone_url":"https://github.com/msgqe/ansible-amq-broker.git","svn_url":"https://github.com/msgqe/ansible-amq-broker","homepage":null,"size":127,"stargazers_count":1,"watchers_count":1,"language":"Makefile","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":5,"open_issues":2,"watchers":1,"default_branch":"master"}},"base":{"label":"msgqe:master","ref":"master","sha":"56c8c1abc1fb27cdccbe2c0ac184bd334395c740","user":{"login":"msgqe","id":24704290,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI0NzA0Mjkw","avatar_url":"https://avatars3.githubusercontent.com/u/24704290?v=4","gravatar_id":"","url":"https://api.github.com/users/msgqe","html_url":"https://github.com/msgqe","followers_url":"https://api.github.com/users/msgqe/followers","following_url":"https://api.github.com/users/msgqe/following{/other_user}","gists_url":"https://api.github.com/users/msgqe/gists{/gist_id}","starred_url":"https://api.github.com/users/msgqe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/msgqe/subscriptions","organizations_url":"https://api.github.com/users/msgqe/orgs","repos_url":"https://api.github.com/users/msgqe/repos","events_url":"https://api.github.com/users/msgqe/events{/privacy}","received_events_url":"https://api.github.com/users/msgqe/received_events","type":"Organization","site_admin":false},"repo":{"id":92163109,"node_id":"MDEwOlJlcG9zaXRvcnk5MjE2MzEwOQ==","name":"ansible-amq-broker","full_name":"msgqe/ansible-amq-broker","owner":{"login":"msgqe","id":24704290,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI0NzA0Mjkw","avatar_url":"https://avatars3.githubusercontent.com/u/24704290?v=4","gravatar_id":"","url":"https://api.github.com/users/msgqe","html_url":"https://github.com/msgqe","followers_url":"https://api.github.com/users/msgqe/followers","following_url":"https://api.github.com/users/msgqe/following{/other_user}","gists_url":"https://api.github.com/users/msgqe/gists{/gist_id}","starred_url":"https://api.github.com/users/msgqe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/msgqe/subscriptions","organizations_url":"https://api.github.com/users/msgqe/orgs","repos_url":"https://api.github.com/users/msgqe/repos","events_url":"https://api.github.com/users/msgqe/events{/privacy}","received_events_url":"https://api.github.com/users/msgqe/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/msgqe/ansible-amq-broker","description":"AMQ Broker deployment scripts","fork":false,"url":"https://api.github.com/repos/msgqe/ansible-amq-broker","forks_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/forks","keys_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/teams","hooks_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/hooks","issue_events_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/issues/events{/number}","events_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/events","assignees_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/assignees{/user}","branches_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/branches{/branch}","tags_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/tags","blobs_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/git/refs{/sha}","trees_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/statuses/{sha}","languages_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/languages","stargazers_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/stargazers","contributors_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/contributors","subscribers_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/subscribers","subscription_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/subscription","commits_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/commits{/sha}","git_commits_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/git/commits{/sha}","comments_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/comments{/number}","issue_comment_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/issues/comments{/number}","contents_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/contents/{+path}","compare_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/merges","archive_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/downloads","issues_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/issues{/number}","pulls_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/pulls{/number}","milestones_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/milestones{/number}","notifications_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/labels{/name}","releases_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/releases{/id}","deployments_url":"https://api.github.com/repos/msgqe/ansible-amq-broker/deployments","created_at":"2017-05-23T11:03:55Z","updated_at":"2018-08-09T12:27:42Z","pushed_at":"2018-09-10T13:15:01Z","git_url":"git://github.com/msgqe/ansible-amq-broker.git","ssh_url":"git@github.com:msgqe/ansible-amq-broker.git","clone_url":"https://github.com/msgqe/ansible-amq-broker.git","svn_url":"https://github.com/msgqe/ansible-amq-broker","homepage":null,"size":127,"stargazers_count":1,"watchers_count":1,"language":"Makefile","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":5,"open_issues":2,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/msgqe/ansible-amq-broker/pulls/10"},"html":{"href":"https://github.com/msgqe/ansible-amq-broker/pull/10"},"issue":{"href":"https://api.github.com/repos/msgqe/ansible-amq-broker/issues/10"},"comments":{"href":"https://api.github.com/repos/msgqe/ansible-amq-broker/issues/10/comments"},"review_comments":{"href":"https://api.github.com/repos/msgqe/ansible-amq-broker/pulls/10/comments"},"review_comment":{"href":"https://api.github.com/repos/msgqe/ansible-amq-broker/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/msgqe/ansible-amq-broker/pulls/10/commits"},"statuses":{"href":"https://api.github.com/repos/msgqe/ansible-amq-broker/statuses/c7e6aed342fce506889d6a7f181fe934c1b21c88"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"orpiske"}}