{"action":"created","issue":{"url":"https://api.github.com/repos/ONSdigital/eq-messaging/issues/4","repository_url":"https://api.github.com/repos/ONSdigital/eq-messaging","labels_url":"https://api.github.com/repos/ONSdigital/eq-messaging/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/ONSdigital/eq-messaging/issues/4/comments","events_url":"https://api.github.com/repos/ONSdigital/eq-messaging/issues/4/events","html_url":"https://github.com/ONSdigital/eq-messaging/pull/4","id":132753022,"number":4,"title":"Remove default users and create admin, write and read users","user":{"login":"weapdiv-david","id":7520937,"avatar_url":"https://avatars.githubusercontent.com/u/7520937?v=3","gravatar_id":"","url":"https://api.github.com/users/weapdiv-david","html_url":"https://github.com/weapdiv-david","followers_url":"https://api.github.com/users/weapdiv-david/followers","following_url":"https://api.github.com/users/weapdiv-david/following{/other_user}","gists_url":"https://api.github.com/users/weapdiv-david/gists{/gist_id}","starred_url":"https://api.github.com/users/weapdiv-david/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weapdiv-david/subscriptions","organizations_url":"https://api.github.com/users/weapdiv-david/orgs","repos_url":"https://api.github.com/users/weapdiv-david/repos","events_url":"https://api.github.com/users/weapdiv-david/events{/privacy}","received_events_url":"https://api.github.com/users/weapdiv-david/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"warrenbailey","id":14093825,"avatar_url":"https://avatars.githubusercontent.com/u/14093825?v=3","gravatar_id":"","url":"https://api.github.com/users/warrenbailey","html_url":"https://github.com/warrenbailey","followers_url":"https://api.github.com/users/warrenbailey/followers","following_url":"https://api.github.com/users/warrenbailey/following{/other_user}","gists_url":"https://api.github.com/users/warrenbailey/gists{/gist_id}","starred_url":"https://api.github.com/users/warrenbailey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/warrenbailey/subscriptions","organizations_url":"https://api.github.com/users/warrenbailey/orgs","repos_url":"https://api.github.com/users/warrenbailey/repos","events_url":"https://api.github.com/users/warrenbailey/events{/privacy}","received_events_url":"https://api.github.com/users/warrenbailey/received_events","type":"User","site_admin":false},"milestone":null,"comments":3,"created_at":"2016-02-10T16:41:23Z","updated_at":"2016-02-11T11:09:54Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ONSdigital/eq-messaging/pulls/4","html_url":"https://github.com/ONSdigital/eq-messaging/pull/4","diff_url":"https://github.com/ONSdigital/eq-messaging/pull/4.diff","patch_url":"https://github.com/ONSdigital/eq-messaging/pull/4.patch"},"body":"***What***\r\n\r\nThis branch updates the ansible config for rabbitmq to remove the default user accounts and create three new ones.  The three acounts are for the admin, \"read-only\", and \"write-only\" users, although currently there are no permissions to limit access on any account.  The admin account is the only one with administrator functionality however.\r\n\r\nIt requires 6 (yes SIX!) new variables in eq-terraform (also modified) to set up the three accounts.\r\n\r\nThese are:\r\n\r\n- `rabbitmq_admin_user` The new admin username\r\n- `rabbitmq_admin_password` The new admin user password\r\n- `rabbitmq_read_user` The new \"read-only\" account username\r\n- `rabbitmq_read_password` The new \"read-only\" account password\r\n- `rabbitmq_write_user` The new \"write-only\" account username\r\n- `rabbitmq_write_password` The new \"write-only\" account password\r\n\r\n***How to test***\r\n\r\n1) Check out the branch\r\n2) Set up some environment variables...\r\n\r\n```\r\nexport MQ_A_USER=admin\r\nexport MQ_A_PASS=admin\r\nexport MQ_R_USER=read\r\nexport MQ_R_PASS=read\r\nexport MQ_W_USER=write\r\nexport MQ_W_PASS=write\r\nexport ENV_NAME=<name of your environment>\r\n```\r\n3) Run the following command\r\n\r\n```\r\nansible-playbook -i \"$ENV_NAME-rabbitmq1.eq.ons.digital,$ENV_NAME-rabbitmq2.eq.ons.digital\"  --private-key ~/.ssh/pre-prod.pem ../eq-messaging/ansible/rabbitmq-cluster.yml --extra-vars \"{\\\"deploy_env\\\":\\\"$ENV_NAME\\\",\\\"rabbitmq_admin_user\\\":\\\"$MQ_A_USER\\\",\\\"rabbitmq_admin_password\\\":\\\"$MQ_A_PASS\\\",\\\"rabbitmq_write_user\\\":\\\"$MQ_W_USER\\\",\\\"rabbitmq_write_password\\\":\\\"$MQ_W_PASS\\\",\\\"rabbitmq_read_user\\\":\\\"$MQ_R_USER\\\",\\\"rabbitmq_read_password\\\":\\\"$MQ_R_PASS\\\"}\"\r\n```\r\n4) SSH into one of your RabbitMQ instances and run:\r\n\r\n```\r\nsudo rabbitmqctl list_users\r\n```\r\n\r\n5) Verify that your users have been created.\r\n\r\n***Who can test***\r\n\r\nAnybody except @weapdiv-david"},"comment":{"url":"https://api.github.com/repos/ONSdigital/eq-messaging/issues/comments/182811986","html_url":"https://github.com/ONSdigital/eq-messaging/pull/4#issuecomment-182811986","issue_url":"https://api.github.com/repos/ONSdigital/eq-messaging/issues/4","id":182811986,"user":{"login":"warrenbailey","id":14093825,"avatar_url":"https://avatars.githubusercontent.com/u/14093825?v=3","gravatar_id":"","url":"https://api.github.com/users/warrenbailey","html_url":"https://github.com/warrenbailey","followers_url":"https://api.github.com/users/warrenbailey/followers","following_url":"https://api.github.com/users/warrenbailey/following{/other_user}","gists_url":"https://api.github.com/users/warrenbailey/gists{/gist_id}","starred_url":"https://api.github.com/users/warrenbailey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/warrenbailey/subscriptions","organizations_url":"https://api.github.com/users/warrenbailey/orgs","repos_url":"https://api.github.com/users/warrenbailey/repos","events_url":"https://api.github.com/users/warrenbailey/events{/privacy}","received_events_url":"https://api.github.com/users/warrenbailey/received_events","type":"User","site_admin":false},"created_at":"2016-02-11T11:09:54Z","updated_at":"2016-02-11T11:09:54Z","body":"OK happy with the environment variables, as they are only used for this PR. I've tested it and it works. All looks good :+1: "}}