geerlingguy / ansible-role-clamav

Ansible Role - ClamAV.
https://galaxy.ansible.com/geerlingguy/clamav/
MIT License
60 stars 51 forks source link

Fails on RHEL7 AWS, packer install #7

Closed ghost closed 5 years ago

ghost commented 5 years ago

amazon-ebs: failed: [default] (item=[u'clamav', u'clamav-update', u'clamav-scanner-systemd']) => { amazon-ebs: "changed": false, amazon-ebs: "invocation": { amazon-ebs: "module_args": { amazon-ebs: "allow_downgrade": false, amazon-ebs: "bugfix": false, amazon-ebs: "conf_file": null, amazon-ebs: "disable_gpg_check": false, amazon-ebs: "disable_plugin": [], amazon-ebs: "disablerepo": null, amazon-ebs: "enable_plugin": [], amazon-ebs: "enablerepo": null, amazon-ebs: "exclude": null, amazon-ebs: "install_repoquery": true, amazon-ebs: "installroot": "/", amazon-ebs: "list": null, amazon-ebs: "name": [ amazon-ebs: "clamav", amazon-ebs: "clamav-update", amazon-ebs: "clamav-scanner-systemd" amazon-ebs: ], amazon-ebs: "security": false, amazon-ebs: "skip_broken": false, amazon-ebs: "state": "latest", amazon-ebs: "update_cache": false, amazon-ebs: "update_only": false, amazon-ebs: "validate_certs": true amazon-ebs: } amazon-ebs: }, amazon-ebs: "item": [ amazon-ebs: "clamav", amazon-ebs: "clamav-update", amazon-ebs: "clamav-scanner-systemd" amazon-ebs: ], amazon-ebs: "msg": "No package matching 'clamav' found available, installed or updated", amazon-ebs: "rc": 126, amazon-ebs: "results": [ amazon-ebs: "No package matching 'clamav' found available, installed or updated" amazon-ebs: ] amazon-ebs: } amazon-ebs: to retry, use: --limit @/opt/mirs/mirs-ansible/base.retry amazon-ebs: amazon-ebs: PLAY RECAP ***** amazon-ebs: default : ok=21 changed=12 unreachable=0 failed=1

ghost commented 5 years ago

Turning off the GPG key validation helps it along a bit further, but installation still fails with the same error.

geerlingguy commented 5 years ago

@gloriajw-devmynd - Are you using the Amazon Linux? Or RHEL 7 on AWS? The test build on CentOS 7 is currently passing without issue, and it should be pretty much identical to RHEL 7: https://travis-ci.org/geerlingguy/ansible-role-clamav

However, if you're using Amazon Linux... things are often slightly (or much) different in the AZ Linux repos. You might need to override clamav_packages with the actual packages available from Amazon.

ghost commented 5 years ago

Thanks for the info. I am using AWS RHEL7. I finally made good progress by doing this in the EPEL ansible config:

lineinfile: path: /etc/yum.repos.d/epel.repo line: 'includepkgs=*' state: present insertafter: 'repo=epel-7' It was not easy to find out which packages were essential for clamav, so I installed them all. Now clamav is present. The first change I applied to get past the initial gpg check turns out to be unnecessary. Installing all EPEL packages solved the problem.

Thanks for your guidance.