BlueSaturn
BlueSaturn

Reputation: 7

Unable to run get_url module with ansible playbook

I have started to learn Ansible watching online vids . But got stuck at the first step when creating and running a simple playbook.

When I run below playbook as below -> $ ansible-playbook download.yml

Then output displayed is ->

ERROR! Syntax Error while loading YAML. mapping values are not allowed in this context The error appears to have been in '/etc/ansible/download.yml': line 3, column 11, but may be elsewhere in the file depending on the exact syntax problem. The offending line appears to be:

-name: Test get_url: ^ here

Below are the contents of my playbook download.yml ->

tasks: 
 -name: Test
  get_url:
   url: https://raw.githubusercontent.com/ansible/ansible/devel/contrib/inventory/ec2.ini
   dest: /home/sunny/ec2.ini
   mode: 700

What am I doing wrong here ?

Upvotes: 0

Views: 1066

Answers (1)

Vladimir Botka
Vladimir Botka

Reputation: 68104

Space behind the dash in name is missing. Instead of

-name: Test

the correct syntax is

- name: Test

Upvotes: 3

Related Questions