Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

state is present but all of the following are missing: source

I have an Ansible script to build a docker image:

---
- hosts: localhost
  tasks:
  - name: build docker image
    docker_image:
      name: bionic
      path: /
      force: yes
    tags: deb

and Dockerfile:

FROM ubuntu:bionic
RUN export DEBIAN_FRONTEND=noninteractive; \
  apt-get -qq update && \
  apt-get -qq install \
  software-properties-common git curl wget openjdk-8-jre-headless debhelper devscripts
WORKDIR /workspace

when I run the next command:ansible-playbook build.yml -vvv I received the next exception.

<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /home/devpc/.ansible/tmp/ansible-tmp-1633701673.999151-517949-133730725910177/ > /dev/null 2>&1 && sleep 0'
fatal: [localhost]: FAILED! => {
"changed": false,
"invocation": {
    "module_args": {
        "api_version": "auto",
        "archive_path": null,
        "build": null,
        "ca_cert": null,
        "client_cert": null,
        "client_key": null,
        "debug": false,
        "docker_host": "unix://var/run/docker.sock",
        "force": true,
        "force_absent": false,
        "force_source": false,
        "force_tag": false,
        "load_path": null,
        "name": "xroad-deb-bionic",
        "path": "/",
        "pull": null,
        "push": false,
        "repository": null,
        "source": null,
        "ssl_version": null,
        "state": "present",
        "tag": "latest",
        "timeout": 60,
        "tls": false,
        "tls_hostname": null,
        "use_ssh_client": false,
        "validate_certs": false
    }
},
"msg": "state is present but all of the following are missing: source"
}

Could you please give me a hint on how to debug and understand what this error means? Thanks for your time and consideration.


_______________________________

Got into my mind while I’m going through a docker interview question blog.

Sign In or Register to comment.