The problem in this case is just the yaml syntax. "-" denotes the start of 
a new item, typically in a list, so when you write:

- hosts
- name

You are actually writing two separate objects, when what you want is:

- name: "download artifactory"
  hosts: all


On Thursday, August 15, 2019 at 6:23:05 PM UTC-7, GM wrote:
>
> Hi there - first I will post my response from when I run my playbook:
>
> ansible-playbook -vv glen.yml
>
> ansible-playbook 2.5.2
>   config file = /etc/ansible/ansible.cfg
>   configured module search path = 
> [u'/home/gmillard/.ansible/plugins/modules', 
> u'/usr/share/ansible/plugins/modules']
>   ansible python module location = /usr/lib/python2.7/site-packages/ansible
>   executable location = /usr/bin/ansible-playbook
>   python version = 2.7.15 (default, May  9 2018, 11:32:33) [GCC 7.3.1 
> 20180130 (Red Hat 7.3.1-2)]
> Using /etc/ansible/ansible.cfg as config file
>
> PLAYBOOK: glen.yml 
> *******************************************************************************************************************************************************************************************
> 2 plays in glen.yml
>
> PLAY [all] 
> ***************************************************************************************************************************************************************************************************
>
> TASK [Gathering Facts] 
> ***************************************************************************************************************************************************************************************
> task path: /home/gmillard/myplatform/OtherStuff/glen.yml:2
> ok: [fedoracontrol]
> META: ran handlers
> META: ran handlers
> META: ran handlers
> ERROR! the field 'hosts' is required but was not set
>
> Now, I'll post the playbook itself:
> ---
> - hosts: all
> - name: "download artifactory"
>   tasks:
>   - get_url:
>       url: 
> http://10.10.10.170:8081/artifactory/generic-local-repo/FilesArchive.tar.gz
>       headers:  
> "X-JFrog-Art-Api:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
>       dest: $PWD
>       mode: 0644
>
> Two things:
> 1. Why am I getting the *ERROR! the field 'hosts' is required but was not 
> set - * I'm thinking that my formatting/indentations are incorrect.
> 2. I'm attempting to grab an artifact from JFrog Artifactory - using the 
> get_url module - am I using it correctly?  
>
> Any and all help is appreciated. Thanks in advance.
>
> G
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/a520f148-78a3-49c6-a125-67571a904bfe%40googlegroups.com.

Reply via email to