Score:0

I am getting an error in the ansible playbook

it flag

I am trying to learn ansible and I have coded my first playbook but it gives me the error saying

ERROR! A playbook must be a list of plays, got a <class 'ansible.parsing.yaml.objects.AnsibleMapping'> instead

The error appears to be in '/etc/ansible/playbook/ngix.yml': line 1, column 1, but may be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

  name: Ping all servers
  ^ here

I am trying to ping all servers below is the file

name: Ping all servers
hosts: prod
become: yes

task:
ping

Can someone please help me on this.

Score:0
in flag

Your playbook should look like this:

---

- name: Ping all servers
  hosts: prod
  become: yes
  tasks:
  - ping:
baba yaga avatar
it flag
Still don't work gives the below error ------------------(myansible) [root@Master playbook]# ./doc.yml ./doc.yml: line 1: ---: command not found ./doc.yml: line 3: -: command not found ./doc.yml: line 4: hosts:: command not found ./doc.yml: line 5: become:: command not found ./doc.yml: line 6: tasks:: command not found ./doc.yml: line 7: -: command not found (myansible) [root@Master playbook]# -------------
in flag
Are you trying to execute a .yml file as a script file?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.