[centos@localhost tmp]$ grep "localpkg_gpgcheck" /etc/dnf/dnf.conf localpkg_gpgcheck=0 [centos@localhost tmp]$ ls -la /etc/yum.conf lrwxrwxrwx. 1 root root 12 Sep 17 15:05 /etc/yum.conf -> dnf/dnf.conf [centos@localhost tmp]$ cat playbook.yml --- - hosts: all connection: local become: true vars: ansible_user: centos tasks: - name: Install local package yum: name: /tmp/cloud-init-vmware-guestinfo-1.1.0-1.el7.noarch.rpm state: latest [centos@localhost tmp]$ ansible-playbook -i localhost, playbook.yml PLAY [all] ************************************************************************************************************************* TASK [Gathering Facts] ************************************************************************************************************* ok: [localhost] TASK [Install local package] ******************************************************************************************************* fatal: [localhost]: FAILED! => {"changed": false, "msg": "Failed to validate GPG signature for cloud-init-vmware-guestinfo-1.1.0-1.el7.noarch"} PLAY RECAP ************************************************************************************************************************* localhost : ok=1 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0