From 5eef74f3bca008b62923563654668da3cd699e4e Mon Sep 17 00:00:00 2001 From: Stepan Andrushko Date: Thu, 18 Oct 2018 21:16:09 +0300 Subject: Trex KPI are not collected due to rabbitmq user Changed the way rabbitmq-server user is created. Fix is needed to collect KPIs from Trex. JIRA: YARDSTICK-1479 Change-Id: I6142109563fcdb27e0ec554dd08567a1a43237e7 (cherry picked from commit d06e6da19db545dfcc6fdfdc706b9cccdb75c498) formerly: I54369535fdb7af6af76de30f758227736f83db78 Signed-off-by: Stepan Andrushko --- ansible/roles/configure_rabbitmq/tasks/main.yml | 20 +++++++++++-------- .../templates/rabbitmq.config.j2 | 5 +++++ .../templates/user_definitions.json.j2 | 23 ++++++++++++++++++++++ 3 files changed, 40 insertions(+), 8 deletions(-) create mode 100644 ansible/roles/configure_rabbitmq/templates/rabbitmq.config.j2 create mode 100644 ansible/roles/configure_rabbitmq/templates/user_definitions.json.j2 diff --git a/ansible/roles/configure_rabbitmq/tasks/main.yml b/ansible/roles/configure_rabbitmq/tasks/main.yml index 3ad60c1ea..4ff4222dc 100644 --- a/ansible/roles/configure_rabbitmq/tasks/main.yml +++ b/ansible/roles/configure_rabbitmq/tasks/main.yml @@ -12,6 +12,16 @@ # See the License for the specific language governing permissions and # limitations under the License. --- +- name: Create rabbitmq configuration + template: + src: rabbitmq.config.j2 + dest: /etc/rabbitmq/rabbitmq.config + +- name: Define user definitions file + template: + src: user_definitions.json.j2 + dest: /etc/rabbitmq/definitions.json + - name: Restart rabbitmq service: name: rabbitmq-server @@ -20,11 +30,5 @@ - name: rabbitmqctl start_app shell: rabbitmqctl start_app -- name: Configure rabbitmq - rabbitmq_user: - user: yardstick - password: yardstick - configure_priv: .* - read_priv: .* - write_priv: .* - state: present +- name: Enable management plugin + shell: rabbitmq-plugins enable rabbitmq_management diff --git a/ansible/roles/configure_rabbitmq/templates/rabbitmq.config.j2 b/ansible/roles/configure_rabbitmq/templates/rabbitmq.config.j2 new file mode 100644 index 000000000..8f07edf5c --- /dev/null +++ b/ansible/roles/configure_rabbitmq/templates/rabbitmq.config.j2 @@ -0,0 +1,5 @@ + [ + {rabbitmq_management, [ + {load_definitions, "/etc/rabbitmq/definitions.json"} + ]} +]. \ No newline at end of file diff --git a/ansible/roles/configure_rabbitmq/templates/user_definitions.json.j2 b/ansible/roles/configure_rabbitmq/templates/user_definitions.json.j2 new file mode 100644 index 000000000..831675ff1 --- /dev/null +++ b/ansible/roles/configure_rabbitmq/templates/user_definitions.json.j2 @@ -0,0 +1,23 @@ + { + "users": [{ + "name": "yardstick", + "password_hash": "{{ }}", + "hashing_algorithm": "rabbit_password_hashing_sha256", + "tags": "" + }], + "vhosts": [{ + "name": "/" + }], + "permissions": [{ + "user": "yardstick", + "vhost": "/", + "configure": ".*", + "write": ".*", + "read": ".*" + }], + "parameters": [], + "policies": [], + "queues": [], + "exchanges": [], + "bindings": [] +} -- cgit 1.2.3-korg From edbe5db41636fbf5d7007da77e73c26d79edc36b Mon Sep 17 00:00:00 2001 From: Stepan Andrushko Date: Wed, 31 Oct 2018 19:07:08 +0200 Subject: Update: Trex KPI not collected no rabbitmq user Update of review #63707: missed yardstick password hash. This must be set on top of changes on review. JIRA: YARDSTICK-1479 Change-Id: Ia8783de81ad91ea7421c6bbff87a30c59db2d44c Signed-off-by: Stepan Andrushko --- ansible/roles/configure_rabbitmq/templates/user_definitions.json.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/roles/configure_rabbitmq/templates/user_definitions.json.j2 b/ansible/roles/configure_rabbitmq/templates/user_definitions.json.j2 index 831675ff1..7c811f16d 100644 --- a/ansible/roles/configure_rabbitmq/templates/user_definitions.json.j2 +++ b/ansible/roles/configure_rabbitmq/templates/user_definitions.json.j2 @@ -1,7 +1,7 @@ { "users": [{ "name": "yardstick", - "password_hash": "{{ }}", + "password_hash": "XHp9fBOE3vjTEf7ktiUBHqefW2g=", "hashing_algorithm": "rabbit_password_hashing_sha256", "tags": "" }], -- cgit 1.2.3-korg