ansible安装rabbitmq-server
时间: 2023-07-03 10:30:55 浏览: 284
ansible-role-rabbitmq:Ansible角色-安装和配置RabbitMQ
您可以使用以下Ansible Playbook来安装RabbitMQ Server:
```
---
- name: Install RabbitMQ Server
hosts: rabbitmq-servers
become: true
tasks:
- name: Install required packages
apt:
name:
- rabbitmq-server
- python-pip
state: latest
- name: Enable RabbitMQ Management Plugin
command: rabbitmq-plugins enable rabbitmq_management
- name: Create RabbitMQ Admin User
command: rabbitmqctl add_user admin your_password_here
- name: Set Admin User Permissions
command: rabbitmqctl set_permissions -p / admin ".*" ".*" ".*"
```
请注意,此Playbook假定您已经设置了适当的主机清单,并将RabbitMQ服务器分组为“rabbitmq-servers”。此外,您需要将“your_password_here”替换为实际的管理员密码。
阅读全文