为什么分子无法启动Docker容器

问题描述 投票:0回答:1

我正在使用分子来测试我的角色。在重新启动服务器之前,我的服务器工作正常。但是,之后,当我运行molecule create

正在跳过创建过程:正在跳过,已创建的实例。但是,什么都没有运行:

(myenv)[root]# docker container ls
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES

运行molecule converge时。我收到此错误:

TASK [Gathering Facts] *********************************************************

fatal: [test_instance]: UNREACHABLE! => {"changed": false, "msg": "Authentication or permission failure.
In some cases, you may have been able to authenticate and did not have permissions on the target directory. 

Consider changing the remote tmp path in ansible.cfg to a path rooted in \"/tmp\". Failed command was: 
( umask 77 && mkdir -p \"` echo ~/.ansible/tmp/ansible-tmp-1575033184.79-237504774558686 `\" && echo
ansible-tmp-1575033184.79-237504774558686=\"` echo ~/.ansible/tmp/ansible-tmp-1575033184.79-237504774558686 `\" ), 
exited with result 1", "unreachable": true} 

关于解决此问题的任何想法?

docker unit-testing testing ansible molecule
1个回答
1
投票

您的分子实例是在docker中创建的,但是它们在您重新启动时已停止,并且不会自动重新启动。分子将其视为已创建,但由于它们未运行而无法访问它们。

您有2个解决方案来解决此问题。

重新启动已停止的实例

  1. docker ps -a找到容器的相关名称
  2. 使用docker start <name>重新启动实例

从头重新启动

您可以简单地运行molecule destroy [-s scenarion_name]。这将清除剩余的实例,之后您可以从头开始测试。

© www.soinside.com 2019 - 2024. All rights reserved.