Closed relvira closed 7 years ago
@ansible ping, this issue is waiting for your response. click here for bot help
@ansible, ping. This issue is still waiting on your response. click here for bot help
+1 Faced with the same issue on ansible 2.2.0.0. Same playbook was executed on two hosts: on the first - success executed, on the second failed with error above.
@ansible, ping. This issue is still waiting on your response. click here for bot help
@relviratellez, i've resolved my issue by updating docker-py on the server.
In the guide:
Using the docker modules requires having docker-py installed on the host running Ansible. You will need to have >= 1.7.0 installed.
pip install 'docker-py>=1.7.0'
@pezzak Thanks for the headsup, I'll try to upgrade docker-py as soon as I can.
Cheers!
Faced with the same issue on ansible 2.2.0.0-1. Docker-py 1.7.2 is installed on the target, I don't specify the ip4 address but still get this issue.
- name: Create the DIRK network
docker_network:
name: dirkNet
appends: yes
------
- name: Ensure Redis is installed
become: true
docker_container:
name: redis
image: '{{ image_redis_full }}'
docker_api_version: "{{ docker_api_version }}"
networks:
- name: dirkNet
exposed_ports:
- 6379
published_ports:
- 6379:6379
state: started
log_opt:
max-size: '{{ dirk_redis_log_file_size }}'
max-file: '{{ dirk_redis_log_file_roll }}'
tags:
- dirk_router
- dirk
I need a fix or workaround. :(
@Dirk-c-Walter maybe you have a typo?
docker_network: name: dirkNet
networks:
- name: dikNet
@pezzak Nah I changed the names when copy and pasting the code over. good catch though :)
FYI when introducing a typo deliberately the error becomes a
"...raise errors.NotFound(e, response, explanation=explanation)\r\ndocker.errors.NotFound: 404 Client Error: Not Found (\"network dNet not found\")\r\n", "msg": "MODULE FAILURE"}"
without typos the error is the same as you get:
"FAILED! => {"changed": false, "failed": true, "msg": "Error connecting container to network dirkNet - connect_container_to_network() got an unexpected keyword argument 'ipv4_address'"}"
What version of docker-py are you using to bypass this problem?
Ok workaround found it needs docker-py 1.9.0 to be installed as that adds the ipv4_address argument. If you install 1.10.x you will find that ansible thinks it is too old and so will refuse to run...
@ansible, ping. This issue is still waiting on your response. click here for bot help
Faced similar issue with 2.2 of ansible and docker-py 1.7. Tried the same as per documentation, gives and error of IPAddress - connect_container_to_network() got an unexpected keyword argument 'ipv4_address'"
Upgrade to docker-py1.10, similar issue as mentioned by @Dirk-c-Walter above. However, should be fixed structurally since advanced versions of docker-py have been released already and larger rollouts are constrained by this restrictions. It also introduces quite a lot of dependency management in the requirements file for playbooks and itsm processes.
This repository has been locked. All new issues and pull requests should be filed in https://github.com/ansible/ansible
Please read through the repomerge page in the dev guide. The guide contains links to tools which automatically move your issue or pull request to the ansible/ansible repo.
Confirmed docker-py 1.9.0
fixes the referenced issue. Dropped this into my playbook:
- name: Install docker-py python module
pip:
name: docker-py
version: "1.9.0"
This issue was migrated to https://github.com/ansible/ansible/issues/29608
ISSUE TYPE
COMPONENT NAME
docker_container
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
OSX 10.10.5 (Yosemite) and OSX Sierra
SUMMARY
When trying to create docker containers from an ansible playbook and adding them to a docker network previously created from another playbook to give this container a static IP address I'm getting an error saying: "Error connecting container to network privnet - connect_container_to_network() got an unexpected keyword argument 'ipv4_address'"
STEPS TO REPRODUCE
Create network playbook:
Create docker container playbook:
EXPECTED RESULTS
I expect a successful container creation instead of an error.
ACTUAL RESULTS
Cheers, R.