Пытаюсь поставить RabbitMQ из Ansible.
Фишка в чем: я работаю на винде. Для данной задачи у меня 2 Docker-контейнера. В одном - Ansible, который подключается к другому по SSH.
Все хорошо, пока я не пытаюсь создать юзера средствами Ansible. Когда вхожу в контейнер и руками создаю (теми-же командами), то все гуд.
Сам конфиг:
- name: Install RabbitMQ server
hosts: dev
become: yes
tasks:
- name: Install RabbitMQ
yum:
name: rabbitmq-server
state: present
update_cache: yes
- name: Enable RabbitMQ Management panel
rabbitmq_plugin:
names: rabbitmq_management
state: enabled
notify: Restart RabbitMQ
#add admin
- name: add rabbitmq users admin
rabbitmq_user:
user: admin
password: admin
vhost: /
tags: administrator
configure_priv: .*
read_priv: .*
write_priv: .*
state: present
#end add admin
- name: Enable RabbitMQ on boot
service: name=rabbitmq-server enabled=yes
handlers:
- name: Restart RabbitMQ
service:
name: rabbitmq-server
state: restarted
Лог с ошибкой, которую я получаю:
Цитата |
[root@93061cf5b3e4 ansible]# ansible-playbook playbook1.yml
PLAY [Install RabbitMQ server] **************************************************************************************
TASK [Gathering Facts] **********************************************************************************************ok: [dev_server1]
TASK [Install RabbitMQ] ********************************************************************************************* [WARNING]: Could not find aptitude. Using apt-get instead
ok: [dev_server1]
TASK [Enable RabbitMQ Management panel] *****************************************************************************ok: [dev_server1]
TASK [add rabbitmq users admin] *************************************************************************************fatal: [dev_server1]: FAILED! => {"changed": false, "cmd": "/usr/sbin/rabbitmqctl -q -n rabbit list_users", "msg": "Error:********@4060baa2bac9'\n- home dir: /var/lib/rabbitmq\n- cookie hash: R6FzOVO2KkoSBC9E9FHRVw==", "rc": 69, "stderr": "Error: unable to connect to node rabbit@4060baa2bac9: nodedown\n\nDIAGNOSTICS\n===========\n\nattempted to contact: [rabbit@4060baa2bac9]\n\nrabbit@4060baa2bac9:\n * connected to epmd (port 4369) on 4060baa2bac9\n * epmd reports: node 'rabbit' not running at all\n no other nodes on 4060baa2bac9\n * suggestion: start the node\n\ncurrent node details:\n- node name: 'rabbitmq-cli-81@4060baa2bac9'\n- home dir: /var/lib/rabbitmq\n- cookie hash: R6FzOVO2KkoSBC9E9FHRVw==\n\n", "stderr_lines": ["Error: unable to connect to node rabbit@4060baa2bac9: nodedown", "", "DIAGNOSTICS", "===========", "", "attempted to contact: [rabbit@4060baa2bac9]", "", "rabbit@4060baa2bac9:", " * connected to epmd (port 4369) on 4060baa2bac9", " * epmd reports: node 'rabbit' not running at all", " no other nodes on 4060baa2bac9", " * suggestion: start the node", "", "current node details:", "- node name: 'rabbitmq-cli-81@4060baa2bac9'", "- home dir: /var/lib/rabbitmq", "- cookie hash: R6FzOVO2KkoSBC9E9FHRVw==", ""], "stdout": "", "stdout_lines": []}
PLAY RECAP **********************************************************************************************************dev_server1 : ok=3 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
|