ansible / instruqt

Self-paced instruqt Training material
72 stars 60 forks source link

Issue with Writing First Playbook slug ID: playbook-extend #520

Closed cecek34 closed 11 months ago

cecek34 commented 1 year ago

I followed the instructions to the T and got the error message: 'ERROR! 'ansible.builtin.service' is not a valid attribute for a Play

The error appears to be in '/home/rhel/ansible-files/apache.yml': line 1, column 5, but may be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be: - name: Apache enabled and running ^ here'

leogallego commented 11 months ago

Hello @cecek34 thank you for your report.

The issue might be related to indentation. Please review the following ansible.builtin.service documentation for examples and check against your playbook. The task should look like this:

- name: Start service httpd, if not started
  ansible.builtin.service:
    name: httpd
    state: started

Spaces are important. Let us know if this solves your issue or you are still running into problems. If you are still having issues, please copy paste the content of apache.yml here into the issue, using the "code block" in the formatting tool here in Github, so it looks like above.

leogallego commented 11 months ago

Hi @cecek34 , I hope the comment above helped solve your issue, we will be closing the ticket now. If you are still having problems, please share the information requested above and we will reopen it. Thank you!