Failure talking to yum: Can not create index on requires table: disk I/O error

Hello there amazing ansible community,

We’re using the latest Amazon Linux AMIs with ansible 2.0.0.2 and are getting following errors intermittently:

TASK [APPNAME_HERE : Install Development tools for gem extensions] **** amazon-ebs: \u001b[0;31mfailed: [127.0.0.1] => (item=[u'gcc', u'zlib-devel', u'libxml2-devel', u'libxslt-devel', u'postgresql94-devel']) => {\"failed\": true, \"item\": [\"gcc\", \"zlib-devel\", \"libxml2-devel\", \"libxslt-devel\", \"postgresql94-devel\"], \"msg\": \"Failure talking to yum: Can not create index on requires table: disk I/O error\"}\u001b[0m amazon-ebs: amazon-ebs: PLAY RECAP *********************************************************************

Has anyone come across these before?

I’m unsure why yum module is so flaky. We’ve been getting following issues too:

`
“msg”: “Failure talking to yum: amzn-updates: Check uncompressed DB failed”

`

and then

`

msg: Failure talking to yum: [Errno 2] No such file or directory: '/var/cache/yum/x86_64/latest/amzn-updates/gen/primary_db.sqlite'

`