diff options
author | Volodymyr Mytnyk <volodymyrx.mytnyk@intel.com> | 2018-12-17 08:38:40 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2018-12-17 08:38:40 +0000 |
commit | 686525d589afae49751fe56a2a90d67db5a70f95 (patch) | |
tree | cb697405e52b03af11303b2aeadde57410533627 | |
parent | 97851fc3e05ef4513f65f9ca9ead95f07bcb0c99 (diff) | |
parent | 0d6c251582f2fd19980c5d73d6a412a3b8fede64 (diff) |
Merge "Update#2: Trex KPI not collected no rabbitmq user"
-rw-r--r-- | ansible/install.yaml | 2 | ||||
-rw-r--r-- | ansible/roles/configure_rabbitmq/tasks/main.yml | 20 | ||||
-rw-r--r-- | ansible/roles/configure_rabbitmq/templates/rabbitmq.config.j2 | 5 | ||||
-rw-r--r-- | ansible/roles/configure_rabbitmq/templates/user_definitions.json.j2 | 23 | ||||
-rwxr-xr-x | docker/supervisor.sh | 14 |
5 files changed, 22 insertions, 42 deletions
diff --git a/ansible/install.yaml b/ansible/install.yaml index 084cdcef3..0c7ad7e92 100644 --- a/ansible/install.yaml +++ b/ansible/install.yaml @@ -39,7 +39,7 @@ - { role: configure_gui, when: installation_mode != inst_mode_container_pull } - { role: download_trex, when: installation_mode != inst_mode_container_pull } - { role: install_trex, when: installation_mode != inst_mode_container_pull } - - { role: configure_rabbitmq, when: installation_mode != inst_mode_container_pull } + - { role: configure_rabbitmq, when: installation_mode == inst_mode_baremetal } post_tasks: diff --git a/ansible/roles/configure_rabbitmq/tasks/main.yml b/ansible/roles/configure_rabbitmq/tasks/main.yml index 4ff4222dc..3ad60c1ea 100644 --- a/ansible/roles/configure_rabbitmq/tasks/main.yml +++ b/ansible/roles/configure_rabbitmq/tasks/main.yml @@ -12,16 +12,6 @@ # 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 @@ -30,5 +20,11 @@ - name: rabbitmqctl start_app shell: rabbitmqctl start_app -- name: Enable management plugin - shell: rabbitmq-plugins enable rabbitmq_management +- name: Configure rabbitmq + rabbitmq_user: + user: yardstick + password: yardstick + configure_priv: .* + read_priv: .* + write_priv: .* + state: present diff --git a/ansible/roles/configure_rabbitmq/templates/rabbitmq.config.j2 b/ansible/roles/configure_rabbitmq/templates/rabbitmq.config.j2 deleted file mode 100644 index 8f07edf5c..000000000 --- a/ansible/roles/configure_rabbitmq/templates/rabbitmq.config.j2 +++ /dev/null @@ -1,5 +0,0 @@ - [
- {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 deleted file mode 100644 index 7c811f16d..000000000 --- a/ansible/roles/configure_rabbitmq/templates/user_definitions.json.j2 +++ /dev/null @@ -1,23 +0,0 @@ - {
- "users": [{
- "name": "yardstick",
- "password_hash": "XHp9fBOE3vjTEf7ktiUBHqefW2g=",
- "hashing_algorithm": "rabbit_password_hashing_sha256",
- "tags": ""
- }],
- "vhosts": [{
- "name": "/"
- }],
- "permissions": [{
- "user": "yardstick",
- "vhost": "/",
- "configure": ".*",
- "write": ".*",
- "read": ".*"
- }],
- "parameters": [],
- "policies": [],
- "queues": [],
- "exchanges": [],
- "bindings": []
-}
diff --git a/docker/supervisor.sh b/docker/supervisor.sh index 44e34fb38..bd17cfbc4 100755 --- a/docker/supervisor.sh +++ b/docker/supervisor.sh @@ -10,8 +10,10 @@ # nginx service start when boot supervisor_config='/etc/supervisor/conf.d/yardstick.conf' +rabbitmq_config='/etc/supervisor/conf.d/rabbitmq.conf' if [[ ! -e "${supervisor_config}" ]]; then + cat << EOF > "${supervisor_config}" [supervisord] nodaemon = true @@ -22,8 +24,18 @@ command = service nginx restart [program:yardstick_uwsgi] directory = /etc/yardstick command = uwsgi -i yardstick.ini +EOF + +fi + +if [[ ! -e "${rabbitmq_config}" ]]; then + cat << EOF > "${rabbitmq_config}" [program:rabbitmq] -command = service rabbitmq-server restart +command = /bin/bash -c "service rabbitmq-server restart + rabbitmqctl start_app + rabbitmqctl add_user yardstick yardstick + rabbitmqctl set_permissions -p / yardstick '.*' '.*'" EOF + fi |