I recently started using Ansible, and I have a playbook file, the contents are as follows:
...
...
- hosts: webserver
become: yes
remote_user: ubuntu
tasks:
- name: Install Nginx
apt: pkg=nginx state=installed update_cache=true
notify:
- start nginx
And I get the following error when starting using
ansible-playbook -i hosts ec2_launch.yml
ERROR! no activity was found in the task. it is often indicated by the name of the module with an error or the wrong path to the module.
The offending line appears to be:
- hosts: webserver
^ here
Something is missing for me, I canβt understand what needs to be updated. Maybe I can not start the instance and install Nginx in the same game?
Thanks in advance.
source
share