我有一个Ubuntu 16(或18)EC2,并且我使用Ansible手册来安装软件包,例如Rabbitmq。等等。第一次安装时,我没有任何错误。但是如果我第二次运行剧本,由于apt-get update和apt-get upgrade出错,我总是会停下来。并且错误始终(大部分时间)与rabbitmq-server有关。
下面是我的Ansible代码的一部分。有人知道原因吗?
- name: Update and upgrade apt.
become_user: root
apt: update_cache=yes upgrade=dist cache_valid_time=1
...
- name: install rabbitmq-server
become_user: root
apt: name=rabbitmq-server state=installed
...
=========错误消息超长,大多数只是一些文件代码。在这里我粘贴了一些我认为相关的东西:
fatal: [10.X.X.X.X]: FAILED! => {"changed": false, "msg": "'/usr/bin/apt-get dist-upgrade' failed: E: Sub-process /usr/bin/dpkg returned an error code (1)\n", "rc": 100, "stdout": "Reading package lists...
…
…
"Setting up erlang-common-test (1:22.0.7-1) ...", "Setting up erlang (1:22.0.7-1) ...", "Setting up rabbitmq-server (3.6.15-1) ...", "Installing new version of config file /etc/init.d/rabbitmq-server ...", "Job for rabbitmq-server.service failed because the control process exited with error code.", "See \"systemctl status rabbitmq-server.service\" and \"journalctl -xe\" for details.", "invoke-rc.d: initscript rabbitmq-server, action \"start\" failed.", "* rabbitmq-server.service - RabbitMQ broker", " Loaded: loaded (/lib/systemd/system/rabbitmq-server.service; enabled; vendor preset: enabled)", " Active: activating (auto-restart) (Result: exit-code) since Thu 2019-09-12 12:48:59 PDT; 5ms ago", " Process: 712 ExecStart=/usr/lib/rabbitmq/bin/rabbitmq-server \u001b[0;1;31m(code=exited, status=1/FAILURE)\u001b[0m", " Main PID: 712 (code=exited, status=1/FAILURE)", "dpkg: error processing package rabbitmq-server (--configure):", " installed rabbitmq-server package post-installation script subprocess returned error exit status 1", "Processing triggers for systemd (237-3ubuntu10.29) ...", "Processing triggers for man-db (2.8.3-2ubuntu0.1) ...", "Processing triggers for hicolor-icon-theme (0.17-2) ...", "Processing triggers for mime-support (3.60ubuntu1) ...", "Processing triggers for ureadahead (0.100.0-21) ...", "Processing triggers for libc-bin (2.27-3ubuntu1) ...", "Errors were encountered while processing:", " rabbitmq-server"]}