2017-12-23 3 views
0

후 나는 다음과 같은 ansible 코드가 있습니다Ansible - 도커/컨테이너가 시작되지 않고 자동으로 재부팅

- name: Run mycontainer 
    docker_container: 
    name: "{{ my_container }}" 
    image: "my_container:{{ my_container_version }}" 
    pull: true 
    state: started 
    restart_policy: always 

나는 컴퓨터를 재부팅하고 기계가 정상으로 돌아, 컨테이너 상태 : Exited (1) 6 minutes ago합니다. docker restart mycontainer에 의해 수동으로 다시 시작했을 때 다시 작동합니다.

제가 알고 있듯이 restart_policy: always에서이 경우를 처리해야합니다. 내가 도대체 ​​뭘 잘못하고있는 겁니까?

답변

0

Ansible은 restart_policy 매개 변수를 항상 docker inspect -f "{{ .HostConfig.RestartPolicy }}" mycontainer으로 변경하지 않았습니다.

컨테이너를 제거하고 다시 배치 한 직후 수정되었습니다.

관련 문제