No package matching 'mesos' is available on Ansible -
i configuring mesos-marathon cluster. have next role install java , 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 when execute playbook, gives me 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' available"} play recap ********************************************************************* 172.16.8.191 : ok=8 changed=5 unreachable=0 failed=1
but if execute ansible second time works can see executing 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 problem?
thanks.
solution @ydaetskcor
change task 'instalar mesos':
- name: instalar mesos apt: name=mesos state=present install_recommends=yes update_cache=yes force=yes
the issue have actualizar paquetes
task doing apt-get update
refresh repo lists if last update more hour ago.
considering you've added mesos repo in previous task won't able find package. re-running playbook triggers actualizar
task before doesn't have cache_valid_time
setting , force apt-get update
allow use mesos repo added in last playbook run.
to fix remove cache_valid_time
actualizar paquetes
task.
as mentioned in comments, can move update_cache
apt
tasks main apt
task installs packages , ansible run apt-get update
before apt-get install
.
Comments
Post a Comment