not found what is the error actually means. Error: "(<unknown>): mapping values are not allowed in this context at line 3 column 16 "

- hosts: local_host
    remote_user: ansible
    become: yes
    become_method: sudo
    connection: ssh
    gather_fact: yes
    tasks:
      name: installing MariaDB
      yum:
        name: mariadb-server
        state: latest
      notify: startservice
    handlers:
      name: startservice
      service:
        name: mariadb
        state: restarted

Upvotes: 0

Views: 56

Answers (1)

flyx
flyx

Reputation: 39688

The error is in the first two lines:

- hosts: local_host
    remote_user: ansible

host cannot have both a scalar value (local_host) and a mapping value (starting at remote_user:). Chances are that you want remote_user to be on the level of hosts, making it a sibling key:

- host: local_host
  remote_user: ansible
  # and so on

Upvotes: 1

Related Questions