There's a issue open for this exact 
case: https://github.com/ansible/ansible/issues/20711

On Thursday, February 16, 2017 at 4:39:37 PM UTC-5, [email protected] 
wrote:
>
> Here's the play I've tried:
>
> - hosts: eliza
>   tags:
>     - grafana
>   roles:
>     - role: service_restart
>
>   tasks:
>     - name: Add grafana repository
>       yum_repository:
>         name: grafana
>         description: grafana
>         baseurl: https://packagecloud.io/grafana/stable/el/6/$basearch
>         gpgcheck: True
>         repo_gpgcheck: True
>         gpgkey: https://packagecloud.io/gpg.key 
> https://grafanarel.s3.amazonaws.com/RPM-GPG-KEY-grafana
>         sslcacert: /etc/pki/tls/certs/ca-bundle.crt
>
>     - rpm_key:
>         state: present
>         key: "{{ item }}"
>       with_items:
>         - https://packagecloud.io/gpg.key
>         - https://grafanarel.s3.amazonaws.com/RPM-GPG-KEY-grafana
>
>     - name: Install grafana
>       package:
>         name: grafana
>
>
> This results is:
> [vagrant@jolly ansible-repo]$ ./run-ansible-vagrant 
> playbooks/prometheus/grafana.yml
>
> PLAY [eliza] 
> *******************************************************************
>
> TASK [setup] 
> *******************************************************************
> ok: [eliza]
>
> TASK [Add grafana repository] 
> **************************************************
> changed: [eliza]
>
> TASK [rpm_key] 
> *****************************************************************
> changed: [eliza] => (item=https://packagecloud.io/gpg.key)
> changed: [eliza] => (item=
> https://grafanarel.s3.amazonaws.com/RPM-GPG-KEY-grafana)
>
> TASK [Install grafana] 
> *********************************************************
> fatal: [eliza]: FAILED! => {"changed": false, "failed": true, "msg": 
> "Failure talking to yum: failure: repodata/repomd.xml from grafana: [Errno 
> 256] No more mirrors to try.\nhttps://
> packagecloud.io/grafana/stable/el/6/x86_64/repodata/repomd.xml: [Errno 
> -1] repomd.xml signature could not be verified for grafana"}
>
> NO MORE HOSTS LEFT 
> *************************************************************
>
> PLAY RECAP 
> *********************************************************************
> eliza                      : ok=3    changed=2    unreachable=0    failed=1
>
> [vagrant@jolly ansible-repo]$
>
> If I run 'yum -y install grafana' it works and accepts the gpg keys.  How 
> am I supposed to do this correctly in ansible?
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/e13e0bcf-f291-43a1-b14b-e589730cbb96%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to