I would like to make a simple script that can deploy and download docker image from docker hub using Ansible but when I am trying to execute mycode I experience some errors as follows:
PLAY [manage docker using ansible] *********************************************
TASK [Gathering Facts] *********************************************************
ok: [controller]
ok: [worker]
TASK [ping hosts] **************************************************************
ok: [controller]
ok: [worker]
TASK [pull docker image] *******************************************************
fatal: [controller]: FAILED! => {"changed": false, "msg": "Unsupported parameters for (docker_image) module: source Supported parameters include: api_version,archive_path,buildargs,cacert_path,cert_path,container_limits,debug,docker_host,dockerfile,filter_logger,force,http_timeout,key_path,load_path,name,nocache,path,pull,push,repository,rm,ssl_version,state,tag,timeout,tls,tls_hostname,tls_verify,use_tls"}
fatal: [worker]: FAILED! => {"changed": false, "msg": "Unsupported parameters for (docker_image) module: source Supported parameters include: api_version,archive_path,buildargs,cacert_path,cert_path,container_limits,debug,docker_host,dockerfile,filter_logger,force,http_timeout,key_path,load_path,name,nocache,path,pull,push,repository,rm,ssl_version,state,tag,timeout,tls,tls_hostname,tls_verify,use_tls"}
to retry, use: --limit @/home/testuser/docker_manage.retry
PLAY RECAP *********************************************************************
controller : ok=2 changed=0 unreachable=0 failed=1
worker : ok=2 changed=0 unreachable=0 failed=1
here is my code:
---
- name: manage docker using ansible
hosts: all
become: true
tasks:
- name: ping hosts
ping:
- name: pull docker image
docker_image:
name: busybox
source: pull
- name: deploy container
docker_container:
name: first_container
image: busybox
state: present
I have tried to follow guide on this [link] (https://docs.ansible.com/ansible/latest/scenario_guides/guide_docker.html) to config my ansible.cfg file.