# Example inventory that makes an alias for localhost that uses Python3
localhost-py3 ansible_host=localhost ansible_connection=local ansible_python_interpreter=/usr/bin/python3
# Example of setting a group of hosts to use Python3
[py3-hosts]
ubuntu18
[py3-hosts:vars]
ansible_python_interpreter=/usr/bin/python3
- name: Run apt upgrade
apt:
upgrade: "yes"
update_cache: yes
cache_valid_time: 432000
async: 7200
poll: 20
notify: reboot
TASK [mariadb : Install MariaDB repository] ************************************
fatal: [164.90.176.188]: FAILED! => {"changed": false, "msg": "apt cache update failed"}
<164.90.176.188> (0, b'', b'')
The full traceback is:
File "/tmp/ansible_apt_repository_payload_60scw5rp/ansible_apt_repository_payload.zip/ansible/modules/packaging/os/apt_repository.py", line 548, in main
File "/usr/lib/python3/dist-packages/apt/cache.py", line 586, in update
raise FetchFailedException(e)
fatal: [164.90.176.188]: FAILED! => {
"changed": false,
"invocation": {
"module_args": {
"codename": null,
"filename": null,
"install_python_apt": true,
"mode": null,
"repo": "deb http://ftp.igh.cnrs.fr/pub/mariadb/repo/10.3/ubuntu trusty main",
"state": "present",
"update_cache": true,
"validate_certs": true
}
},
"msg": "apt cache update failed"
}
PLAY RECAP *********************************************************************
164.90.176.188 : ok=25 changed=1 unreachable=0 failed=1 skipped=2 rescued=0 ignored=0