doubt

34 views
Skip to first unread message

Dark Night

unread,
Feb 15, 2018, 4:52:00 AM2/15/18
to Ansible Project
let me out from this below 

how can i integrate ansible with docker-container
 the function of docker commands run on ansible module


for example
    docker pull command run ansible 
  

     - name: pull an image
  docker_image:
    name: centos-7
its not working can anyone help me 

its contain this error
  ERROR! 'docker_image' is not a valid attribute for a Play

Manuel Schmidt

unread,
Feb 15, 2018, 6:48:31 AM2/15/18
to Ansible Project
Hey

you are nit indented your yaml file correctly. The docer_image command must be inside the task you have started with "- name". That means at least as much space until th n of name.

For your further reference: http://docs.ansible.com/ansible/latest/YAMLSyntax.html

Regards

Dark Night

unread,
Feb 16, 2018, 12:00:10 AM2/16/18
to Ansible Project
Thanks for your support 


im a beginner for ansible can u rebuild to this one


 
---
- hosts: local
  tasks:
          - name: pull an image
            docker_image:
                    - name: ubuntu:latest
im also getting this error
ERROR! unexpected parameter type in action: <class 'ansible.parsing.yaml.objects.AnsibleSequence'>
tasks:
          - name: pull an image
            ^ here

Reply all
Reply to author
Forward
0 new messages