I am configuring a mesos-marathon cluster. I have the next role to install java and mesos.
---
- name: importar key Mesosphere
shell: gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys E56151BF
- name: ppa java8
apt_repository: repo='ppa:webupd8team/java' state=present
- name: seleccionar licencia Oracle
shell: echo debconf shared/accepted-oracle-license-v1-1 select true | sudo debconf-set-selections
- name: actualizar
apt: update_cache=yes
- name: instalar java8
apt: name=oracle-java8-installer state=latest update-cache=yes force=yes
- name: actualizar sources list
shell: DISTRO=$(lsb_release -is | tr '[:upper:]' '[:lower:]') && CODENAME=$(lsb_release -cs) && echo "deb http://repos.mesosphere.io/${DISTRO} ${CODENAME} main" | sudo tee /etc/apt/sources.list.d/mesosphere.list
- name: actualizar paquetes
apt: update_cache=yes cache_valid_time=3600
- name: instalar mesos
apt: name=mesos state=present install_recommends=yes force=yes
- name: instalar mesosphere
apt: name=mesosphere state=present install_recommends=yes force=yes
My problem is that when I execute the playbook, it gives me the next error:
TASK [common : actualizar sources list] ****************************************
changed: [172.16.8.191]
TASK [common : actualizar paquetes] ********************************************
ok: [172.16.8.191]
TASK [common : instalar mesos] *************************************************
fatal: [172.16.8.191]: FAILED! => {"changed": false, "failed": true, "msg": "No package matching 'mesos' is available"}
PLAY RECAP *********************************************************************
172.16.8.191 : ok=8 changed=5 unreachable=0 failed=1
But if I execute ansible for a second time it works perfectly you can see executing a second time:
TASK [common : actualizar paquetes] ********************************************
ok: [172.16.8.191]
TASK [common : instalar mesos] *************************************************
changed: [172.16.8.191]
TASK [common : instalar mesosphere] ********************************************
changed: [172.16.8.191]
What could be the problem?
Thanks.
SOLUTION BY @ydaetskcoR
Change the task 'instalar mesos':
- name: instalar mesos
apt: name=mesos state=present install_recommends=yes update_cache=yes force=yes
update_cache=yes
to the task that installs mesos? – ydaetskcoR