I am trying to execute the following yml script but some errors are occurring ,please some help me out this error .
---
- hosts: all
tasks:
- name: Import Remi GPG key
rpm_key: "key={{ item }} state=present"
with_items:
- name: Install Remi repo.
command: "rpm -Uvh --force {{ item.href }} creates={{ item.creates }}"
with_items:
creates: "/etc/yum.repos.d/remi.repo"
- name: Install EPEL repo.
yum: name=epel-release state=present
- name: Ensure firewalld is stopped
service: name=firewalld state=stopped
- name: Install Node.js and npm
yum: name=npm state=present enablerepo=epel
- name: Install Forever
npm: name=forever global=yes state=latest
ERROR! Syntax Error while loading YAML.
The error appears to have been in '/home/shahzad/playbook.yml': line 5, column 5, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
- name: Import Remi GPG key
rpm_key: "key={{ item }} state=present"
^ here
We could be wrong, but this one looks like it might be an issue with
missing quotes. Always quote template expression brackets when they
start a value. For instance:
with_items:
- {{ foo }}
Should be written as:
with_items:
- "{{ foo }}"
exception type: <class 'yaml.parser.ParserError'>
exception: while parsing a block collection
in "<unicode string>", line 4, column 4
did not find expected '-' indicator
in "<unicode string>", line 5, column 5