---
- name: initialize provisioning
hosts: docker
- name: start up target container
docker:
image: python:2.7
name: lab
pull: missing
detach: yes
tty: yes
command: sleep infinity
state: started
# dynamically update inventory to make it available down the playbook
- name: register new container hostname
add_host: name=lab
- name: provision container
connection: docker
hosts: lab
tasks:
# ...
- name: finalize build
hosts: docker
tasks:
- name: stop container
docker:
name: lab
image: python:2.7
state: stopped
But ansible-playbook throws an error
ERROR! Syntax Error while loading YAML.
The error appears to have been in '/Users/tanner/projects/ansible.git/playbooks.git/docker-testing.yml': line 5, column 3, but may be elsewhere in the file depending on the exact syntax problem. The offending line appears to be: - name: start up target container ^ here exception type: <class 'yaml.parser.ParserError'> exception: while parsing a block mapping in "<unicode string>", line 2, column 3: - name: initialize provisioning ^ expected <block end>, but found '-' in "<unicode string>", line 5, column 3: - name: start up target container ^
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscribe@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/8272e557-4555-450b-9ef0-f7d48f817441%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You seem to be missing `tasks:` in your first play. As such YAML wasn't expecting you to start a list there.
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscribe@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/d40736c8-b394-4ab4-8d10-b48e53e1ea6b%40googlegroups.com.
I didn't go look at the authors page. Based on what you provided, the first play is missing `tasks:`
On Thu, Sep 21, 2017 at 3:41 PM, Bob Tanner <basicth...@gmail.com> wrote:
On Thursday, September 21, 2017 at 3:11:41 PM UTC-5, Matt Martz wrote:You seem to be missing `tasks:` in your first play. As such YAML wasn't expecting you to start a list there.So the original authors Listing 11 is wrong?
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/d40736c8-b394-4ab4-8d10-b48e53e1ea6b%40googlegroups.com.