docker_container and etc_hosts

304 views
Skip to first unread message

Matt Butch

unread,
Dec 22, 2017, 9:34:48 PM12/22/17
to Ansible Project
I have another playbook that sets up a docker container, and now I want to add to the hosts file. Why does this not work?

- name: Add host entry
  docker_container:
    name: "{{ item }}"
    etc_hosts: "{'server.place.com': '{{ server_ip }}'}"
  with_items:
    - "container1"
    - "container2"

TASK [awx : Add host entry] *************************************************************************************

failed: [123.123.123.123] (item= container1) => {"changed": false, "item": "container1", "msg": "Error creating container: 400 Client Error: Bad Request (\"No command specified\")"}

failed: [123.123.123.123] (item= container2) => {"changed": false, "item": "container2", "msg": "Error creating container: 400 Client Error: Bad Request (\"No command specified\")"}


If this is a bug, I'm happy to submit a report. I just wanted to make sure I wasn't doing something wrong. 
Reply all
Reply to author
Forward
0 new messages