ansible-kafka
ansible-kafka copied to clipboard
running this role on vagrant vm fails during "apt-get"ting java
I think the Vagrant VM is irrelevant, or at least much less relevant than updating apt's cache before trying to install the java package.
$ vagrant provision
==> deployml: Running provisioner: ansible...
deployml: Running ansible-playbook...
statically included: /usr/local/etc/ansible/roles/ansible-kafka/tasks/check-env.yml
statically included: /usr/local/etc/ansible/roles/ansible-kafka/tasks/java.yml
[DEPRECATION WARNING]: Instead of sudo/sudo_user, use become/become_user and
make sure become_method is 'sudo' (default).
This feature will be removed in a
future release. Deprecation warnings can be disabled by setting
deprecation_warnings=False in ansible.cfg.
statically included: /usr/local/etc/ansible/roles/ansible-kafka/tasks/system.yml
statically included: /usr/local/etc/ansible/roles/ansible-kafka/tasks/limits.yml
statically included: /usr/local/etc/ansible/roles/ansible-kafka/tasks/kafka-install.yml
statically included: /usr/local/etc/ansible/roles/ansible-kafka/tasks/kafka-cfg.yml
PLAY [Apply configuration to virtual machine] **********************************
TASK [setup] *******************************************************************
ok: [deployml]
TASK [ansible-kafka : Check 'kafka_zookeeper_hosts' variable] ******************
skipping: [deployml]
TASK [ansible-kafka : Check 'kafka_hosts' variable] ****************************
skipping: [deployml]
TASK [ansible-kafka : Check 'kafka_generate_broker_id' variable] ***************
skipping: [deployml]
TASK [ansible-kafka : Check if Java is installed] ******************************
fatal: [deployml]: FAILED! => {"changed": false, "cmd": "command -v java", "delta": "0:00:00.001418", "end": "2016-11-03 20:17:58.563578", "failed": true, "rc": 127, "start": "2016-11-03 20:17:58.562160", "stderr": "", "stdout": "", "stdout_lines": [], "warnings": []}
...ignoring
TASK [ansible-kafka : Install OpenJDK] *****************************************
fatal: [deployml]: FAILED! => {"cache_update_time": 0, "cache_updated": false, "changed": false, "failed": true, "msg": "'/usr/bin/apt-get -y -o \"Dpkg::Options::=--force-confdef\" -o \"Dpkg::Options::=--force-confold\" install 'openjdk-7-jre-headless'' failed: E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/t/tzdata/tzdata-java_2016f-0ubuntu0.14.04_all.deb 404 Not Found [IP: 91.189.91.23 80]\n\nE: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?\n", "stderr": "E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/t/tzdata/tzdata-java_2016f-0ubuntu0.14.04_all.deb 404 Not Found [IP: 91.189.91.23 80]\n\nE: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?\n", "stdout": "Reading package lists...\nBuilding dependency tree...\nReading state information...\nThe following packages were automatically installed and are no longer required:\n acl at-spi2-core colord dconf-gsettings-backend dconf-service fontconfig\n hicolor-icon-theme libasound2 libasound2-data libatk-bridge2.0-0 libatk1.0-0\n libatk1.0-data libatspi2.0-0 libcairo-gobject2 libcairo2 libcanberra-gtk3-0\n libcanberra-gtk3-module libcanberra0 libcolord1 libcolorhug1 libdatrie1\n libdconf1 libdrm-intel1 libdrm-nouveau2 libdrm-radeon1 libexif12 libfontenc1\n libgd3 libgdk-pixbuf2.0-0 libgdk-pixbuf2.0-common libgl1-mesa-dri\n libgl1-mesa-glx libglapi-mesa libgphoto2-6 libgphoto2-l10n libgphoto2-port10\n libgraphite2-3 libgtk-3-0 libgtk-3-bin libgtk-3-common libgudev-1.0-0\n libgusb2 libharfbuzz0b libice6 libieee1284-3 libjasper1 libjbig0 liblcms2-2\n libllvm3.4 libltdl7 libnotify-bin libnotify4 libpango-1.0-0\n libpangocairo-1.0-0 libpangoft2-1.0-0 libpciaccess0 libpixman-1-0 libsane\n libsane-common libsm6 libtdb1 libthai-data libthai0 libtiff5\n libtxc-dxtn-s2tc0 libv4l-0 libv4lconvert0 libvorbisfile3 libvpx1\n libwayland-client0 libwayland-cursor0 libx11-xcb1 libxaw7 libxcb-dri2-0\n libxcb-dri3-0 libxcb-glx0 libxcb-present0 libxcb-render0 libxcb-shm0\n libxcb-sync1 libxcomposite1 libxcursor1 libxdamage1 libxfixes3 libxfont1\n libxi6 libxinerama1 libxkbcommon0 libxkbfile1 libxmu6 libxpm4 libxrandr2\n libxrender1 libxshmfence1 libxt6 libxtst6 libxxf86vm1 notification-daemon\n sound-theme-freedesktop x11-common x11-xkb-utils xfonts-base\n xfonts-encodings xfonts-utils xserver-common xserver-xorg-core\nUse 'apt-get autoremove' to remove them.\nThe following extra packages will be installed:\n ca-certificates-java java-common libasyncns0 libflac8 libnspr4 libnss3\n libnss3-nssdb libpcsclite1 libpulse0 libsctp1 libsndfile1 libvorbisenc2\n lksctp-tools tzdata-java\nSuggested packages:\n default-jre equivs pcscd pulseaudio icedtea-7-jre-jamvm libnss-mdns\n sun-java6-fonts fonts-dejavu-extra fonts-ipafont-gothic fonts-ipafont-mincho\n ttf-wqy-microhei ttf-wqy-zenhei ttf-indic-fonts-core ttf-telugu-fonts\n ttf-oriya-fonts ttf-kannada-fonts ttf-bengali-fonts\nThe following NEW packages will be installed:\n ca-certificates-java java-common libasyncns0 libflac8 libnspr4 libnss3\n libnss3-nssdb libpcsclite1 libpulse0 libsctp1 libsndfile1 libvorbisenc2\n lksctp-tools openjdk-7-jre-headless tzdata-java\n0 upgraded, 15 newly installed, 0 to remove and 0 not upgraded.\nNeed to get 69.6 kB/41.4 MB of archives.\nAfter this operation, 66.0 MB of additional disk space will be used.\nErr http://archive.ubuntu.com/ubuntu/ trusty-updates/main tzdata-java all 2016f-0ubuntu0.14.04\n 404 Not Found [IP: 91.189.88.162 80]\nErr http://security.ubuntu.com/ubuntu/ trusty-security/main tzdata-java all 2016f-0ubuntu0.14.04\n 404 Not Found [IP: 91.189.91.23 80]\n", "stdout_lines": ["Reading package lists...", "Building dependency tree...", "Reading state information...", "The following packages were automatically installed and are no longer required:", " acl at-spi2-core colord dconf-gsettings-backend dconf-service fontconfig", " hicolor-icon-theme libasound2 libasound2-data libatk-bridge2.0-0 libatk1.0-0", " libatk1.0-data libatspi2.0-0 libcairo-gobject2 libcairo2 libcanberra-gtk3-0", " libcanberra-gtk3-module libcanberra0 libcolord1 libcolorhug1 libdatrie1", " libdconf1 libdrm-intel1 libdrm-nouveau2 libdrm-radeon1 libexif12 libfontenc1", " libgd3 libgdk-pixbuf2.0-0 libgdk-pixbuf2.0-common libgl1-mesa-dri", " libgl1-mesa-glx libglapi-mesa libgphoto2-6 libgphoto2-l10n libgphoto2-port10", " libgraphite2-3 libgtk-3-0 libgtk-3-bin libgtk-3-common libgudev-1.0-0", " libgusb2 libharfbuzz0b libice6 libieee1284-3 libjasper1 libjbig0 liblcms2-2", " libllvm3.4 libltdl7 libnotify-bin libnotify4 libpango-1.0-0", " libpangocairo-1.0-0 libpangoft2-1.0-0 libpciaccess0 libpixman-1-0 libsane", " libsane-common libsm6 libtdb1 libthai-data libthai0 libtiff5", " libtxc-dxtn-s2tc0 libv4l-0 libv4lconvert0 libvorbisfile3 libvpx1", " libwayland-client0 libwayland-cursor0 libx11-xcb1 libxaw7 libxcb-dri2-0", " libxcb-dri3-0 libxcb-glx0 libxcb-present0 libxcb-render0 libxcb-shm0", " libxcb-sync1 libxcomposite1 libxcursor1 libxdamage1 libxfixes3 libxfont1", " libxi6 libxinerama1 libxkbcommon0 libxkbfile1 libxmu6 libxpm4 libxrandr2", " libxrender1 libxshmfence1 libxt6 libxtst6 libxxf86vm1 notification-daemon", " sound-theme-freedesktop x11-common x11-xkb-utils xfonts-base", " xfonts-encodings xfonts-utils xserver-common xserver-xorg-core", "Use 'apt-get autoremove' to remove them.", "The following extra packages will be installed:", " ca-certificates-java java-common libasyncns0 libflac8 libnspr4 libnss3", " libnss3-nssdb libpcsclite1 libpulse0 libsctp1 libsndfile1 libvorbisenc2", " lksctp-tools tzdata-java", "Suggested packages:", " default-jre equivs pcscd pulseaudio icedtea-7-jre-jamvm libnss-mdns", " sun-java6-fonts fonts-dejavu-extra fonts-ipafont-gothic fonts-ipafont-mincho", " ttf-wqy-microhei ttf-wqy-zenhei ttf-indic-fonts-core ttf-telugu-fonts", " ttf-oriya-fonts ttf-kannada-fonts ttf-bengali-fonts", "The following NEW packages will be installed:", " ca-certificates-java java-common libasyncns0 libflac8 libnspr4 libnss3", " libnss3-nssdb libpcsclite1 libpulse0 libsctp1 libsndfile1 libvorbisenc2", " lksctp-tools openjdk-7-jre-headless tzdata-java", "0 upgraded, 15 newly installed, 0 to remove and 0 not upgraded.", "Need to get 69.6 kB/41.4 MB of archives.", "After this operation, 66.0 MB of additional disk space will be used.", "Err http://archive.ubuntu.com/ubuntu/ trusty-updates/main tzdata-java all 2016f-0ubuntu0.14.04", " 404 Not Found [IP: 91.189.88.162 80]", "Err http://security.ubuntu.com/ubuntu/ trusty-security/main tzdata-java all 2016f-0ubuntu0.14.04", " 404 Not Found [IP: 91.189.91.23 80]"]}
NO MORE HOSTS LEFT *************************************************************
to retry, use: --limit @/vagrant_setup.retry
PLAY RECAP *********************************************************************
deployml : ok=6 changed=0 unreachable=0 failed=1
Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.
I believe this issue can easily be fixed by editing this step in tasks/java.yml
:
- name: "Install OpenJDK"
apt: name=openjdk-7-jre-headless state=present update_cache=yes cache_valid_time=3600
sudo: yes
when: check_java.rc != 0
tags:
- kafka-install
- java
Depending on what you think, would be happy to submit a PR!
@igozali Would love to merge a PR which fixes this :D
Is this repo still active? I noticed that openjdk-7 is no longer available on ubuntu channels. Its openjdk-8. This is one issue.
The other issue is with the zookeeper dependency that this playbook has on https://github.com/hpcloud-mon/ansible-zookeeper. This playbook installs openjdk-7 as well.
I think 2 PRs are in order?