On 7/26/19 8:13 AM, Shahzad Adil shaikh wrote:
> Hello All,
>
> I am trying to execute the following yml script but some errors are occurring
> ,please some help me out this error .
>
> Script:-
> ---
> - hosts: all
> tasks:
> - name: Import Remi GPG key
> rpm_key: "key={{ item }} state=present"
> with_items:
> - "http://rpms.famillecollet.com/RPM-GPG-KEY-remi"
> - name: Install Remi repo.
> command: "rpm -Uvh --force {{ item.href }} creates={{ item.creates }}"
> with_items:
> - href: "http://rpms.famillecollet.com/enterprise/remi-release-6.rpm"
> 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:-
> ERROR! Syntax Error while loading YAML.
The indentation is incorrect in the line with "rpm_key". It needs the same
position as "name".
Regards
Racke
>
>
> 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
>
>
>
> --
> 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
> [email protected]
> <mailto:[email protected]>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/b78e0ad5-b7a4-41ae-b915-deb786f13b53%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/b78e0ad5-b7a4-41ae-b915-deb786f13b53%40googlegroups.com?utm_medium=email&utm_source=footer>.
--
Ecommerce and Linux consulting + Perl and web application programming.
Debian and Sympa administration. Provisioning with Ansible.
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/d0c4073d-9394-99c5-824c-c5e2e941acab%40linuxia.de.
signature.asc
Description: OpenPGP digital signature
