ansible-playbook -i host.inventory -l dev automation.yml
**I keep on getting this:**
PLAY [dev] ***********************************************************************************************************************************************************************************
TASK [Gathering Facts] ***********************************************************************************************************************************************************************
ok: [server1.westeurope.cloudapp.azure.com]
**ERROR! the field 'hosts' is required but was not set**
**# Here is my automation.yml:**
---
#- name: Prepares and installs a Jenkins automation server on azure
- hosts: dev
remote_user: dude
become: true
- roles:
- cloud-init
- set_kernel_conf
- add-authorized-keys
- create-root-ssh-folder
- create-ca
- create-local-tls-certificates
- install_JDK
- digicert
- jenkins
FYI, because the hyphen of roles was at the same level as name it was treated as a second play in the playbook. Your first play did nothing as dude against the dev hosts. Your second play applied roles to an unspecified list of hosts. Thus the error of hosts being required.