読者です 読者をやめる 読者になる 読者になる

今日学んだこと

読書感想文とか、勉強した内容とか

JenkinsからAnsibleを叩いて、Vagrantの設定をする

CentOS Jenkins Ansible Vagrant

前回の記事の続きです

システム開発環境構築の自動化についての構想 - 今日学んだこと

お名前.comのVPS(CentOS6.5)にVirtualBoxを入れる - 今日学んだこと

お名前.comのVPS(CentOS6.5)にVagrantを入れる - 今日学んだこと

お名前.comのVPS(CentOS6.5)にJenkinsを入れる - 今日学んだこと

お名前.comのVPS(CentOS6.5)にAnsibleを入れる - 今日学んだこと

JenkinsからVagrantを起動する - 今日学んだこと

Vagrantの起動スクリプト的な感じでAnsibleを呼ぶこともできますが、ここではsshでつないで設定する方法にしています。

Ansibleスクリプト(playbook)の用意

emacspython、そしてpythonのwebフレームワークであるdjangoを入れるplaybookを用意しました。githubで公開というか配置しています。


nakazye/DevMachine · GitHub

ポイントとしては、sshconfigとして

Host 127.0.0.1
  HostName 127.0.0.1
  User vagrant
  Port 2222
  UserKnownHostsFile /dev/null
  StrictHostKeyChecking no
  PasswordAuthentication no
  IdentityFile ~/.vagrant.d/insecure_private_key
  IdentitiesOnly yes

 といったファイルを用意していることです。

vagrantを起動する時にこのファイルを指定して

export ANSIBLE_SSH_ARGS=' -F sshconfig -o ControlMaster=no'; ansible-playbook ./Ansible/devPy3Django.yml -i hosts

ANSIBLE_SSH_ARGSとして設定してあげる事によって、~/.ssh/configに依存せずssh 接続できます。

jenkinsからの実行

設定は以下の感じです。シェルスクリプトとして登録しています。

f:id:nakazye:20140913223754p:plain

実行すると・・・

aptリポジトリがイカれてて失敗していますが、ちゃんと動いてることが確認できます。

http://security.ubuntu.com/ubuntu/pool/main/c/cups/libcups2_1.7.2-0ubuntu1.2_i386.deb

としないといけないところが

http://security.ubuntu.com/ubuntu/pool/main/c/cups/libcups2_1.7.2-0ubuntu1.1_i386.deb

 としてapt君がアクセスを試みているためエラーになっています。これ、どこに報告上げればいいんだ・・・?

※※ 僕がubuntuの知識なかっただけでした。詳しくは追記を

 わざわざJenkinsでboxファイル作るんじゃなくて、そのままスクリプトだけ管理しておけばいいじゃんと最初は考えてましたが、こういうことを考えてboxファイルを用意しておくのは安全だなぁと思った次第です。はい

Building in workspace /var/lib/jenkins/jobs/BuildDevVirtualMachine/workspace
 > git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > git config remote.origin.url https://github.com/nakazye/DevMachine # timeout=10
Fetching upstream changes from https://github.com/nakazye/DevMachine
 > git --version # timeout=10
 > git fetch --tags --progress https://github.com/nakazye/DevMachine +refs/heads/*:refs/remotes/origin/*
 > git rev-parse refs/remotes/origin/master^{commit} # timeout=10
 > git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
Checking out Revision 859277e08ef387ca8c4cea6cba3eec8a8bddc2a3 (refs/remotes/origin/master)
 > git config core.sparsecheckout # timeout=10
 > git checkout -f 859277e08ef387ca8c4cea6cba3eec8a8bddc2a3
 > git rev-list 859277e08ef387ca8c4cea6cba3eec8a8bddc2a3 # timeout=10
[workspace] $ /bin/sh -xe /tmp/hudson1055637060660000233.sh
+ vagrant destroy -f
==> default: Destroying VM and associated drives...
+ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'ubuntu14_4'...

[KProgress: 90%
[K==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM: workspace_default_1410615215827_58129
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 22 => 2222 (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
    default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Mounting shared folders...
    default: /vagrant => /var/lib/jenkins/jobs/BuildDevVirtualMachine/workspace
+ export 'ANSIBLE_SSH_ARGS= -F sshconfig -o ControlMaster=no'
+ ANSIBLE_SSH_ARGS=' -F sshconfig -o ControlMaster=no'
+ ansible-playbook ./Ansible/devPy3Django.yml -i hosts
 [WARNING]: The version of gmp you have installed has a known issue regarding
timing vulnerabilities when used with pycrypto. If possible, you should update
it (ie. yum update gmp).


PLAY [all] ******************************************************************** 

GATHERING FACTS *************************************************************** 
ok: [127.0.0.1]

TASK: [git | install git(apt)] ************************************************ 
changed: [127.0.0.1]

TASK: [emacs | install emacs(apt)] ******************************************** 
failed: [127.0.0.1] => {"failed": true}
stderr: E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/c/cups/libcups2_1.7.2-0ubuntu1.1_i386.deb  404  Not Found [IP: 91.189.88.149 80]

E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/c/cups/libcupsimage2_1.7.2-0ubuntu1.1_i386.deb  404  Not Found [IP: 91.189.88.149 80]

E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/s/systemd/libgudev-1.0-0_204-5ubuntu20.5_i386.deb  404  Not Found [IP: 91.189.92.201 80]

E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

stdout: Reading package lists...
Building dependency tree...
Reading state information...
The following extra packages will be installed:
  acl at-spi2-core colord dconf-gsettings-backend dconf-service
  emacs24-bin-common emacs24-common emacs24-common-non-dfsg emacsen-common
  fontconfig fontconfig-config fonts-dejavu-core gconf-service
  gconf-service-backend gconf2-common ghostscript gsfonts hicolor-icon-theme
  imagemagick-common libasound2 libasound2-data libatk-bridge2.0-0 libatk1.0-0
  libatk1.0-data libatspi2.0-0 libavahi-client3 libavahi-common-data
  libavahi-common3 libcairo-gobject2 libcairo2 libcolord1 libcolorhug1
  libcroco3 libcups2 libcupsfilters1 libcupsimage2 libdatrie1 libdconf1
  libexif12 libfftw3-double3 libfontconfig1 libgconf-2-4 libgd3
  libgdk-pixbuf2.0-0 libgdk-pixbuf2.0-common libgif4 libgphoto2-6
  libgphoto2-l10n libgphoto2-port10 libgraphite2-3 libgs9 libgs9-common
  libgtk-3-0 libgtk-3-bin libgtk-3-common libgudev-1.0-0 libgusb2
  libharfbuzz0b libieee1284-3 libijs-0.35 libjasper1 libjbig0 libjbig2dec0
  libjpeg-turbo8 libjpeg8 liblcms2-2 liblqr-1-0 libltdl7 libm17n-0
  libmagickcore5 libmagickwand5 libotf0 libpango-1.0-0 libpangocairo-1.0-0
  libpangoft2-1.0-0 libpaper-utils libpaper1 librsvg2-2 librsvg2-common
  libsane libsane-common libthai-data libthai0 libtiff5 libv4l-0
  libv4lconvert0 libvpx1 libwayland-client0 libwayland-cursor0 libxcb-render0
  libxcb-shm0 libxcursor1 libxft2 libxi6 libxinerama1 libxkbcommon0 libxtst6
  m17n-contrib m17n-db poppler-data
Suggested packages:
  emacs24-el ghostscript-x hpijs libasound2-plugins alsa-utils cups-common
  libfftw3-bin libfftw3-dev libgd-tools gphoto2 gtkam fonts-droid gvfs
  libjasper-runtime liblcms2-utils m17n-docs libmagickcore5-extra ttf-baekmuk
  ttf-arphic-gbsn00lp ttf-arphic-bsmi00lp ttf-arphic-gkai00mp
  ttf-arphic-bkai00mp librsvg2-bin avahi-daemon hplip hpoj libsane-extras
  sane-utils poppler-utils fonts-japanese-mincho fonts-ipafont-mincho
  fonts-japanese-gothic fonts-ipafont-gothic fonts-arphic-ukai
  fonts-arphic-uming fonts-unfonts-core
The following NEW packages will be installed:
  acl at-spi2-core colord dconf-gsettings-backend dconf-service emacs24
  emacs24-bin-common emacs24-common emacs24-common-non-dfsg emacsen-common
  fontconfig fontconfig-config fonts-dejavu-core gconf-service
  gconf-service-backend gconf2-common ghostscript gsfonts hicolor-icon-theme
  imagemagick-common libasound2 libasound2-data libatk-bridge2.0-0 libatk1.0-0
  libatk1.0-data libatspi2.0-0 libavahi-client3 libavahi-common-data
  libavahi-common3 libcairo-gobject2 libcairo2 libcolord1 libcolorhug1
  libcroco3 libcups2 libcupsfilters1 libcupsimage2 libdatrie1 libdconf1
  libexif12 libfftw3-double3 libfontconfig1 libgconf-2-4 libgd3
  libgdk-pixbuf2.0-0 libgdk-pixbuf2.0-common libgif4 libgphoto2-6
  libgphoto2-l10n libgphoto2-port10 libgraphite2-3 libgs9 libgs9-common
  libgtk-3-0 libgtk-3-bin libgtk-3-common libgudev-1.0-0 libgusb2
  libharfbuzz0b libieee1284-3 libijs-0.35 libjasper1 libjbig0 libjbig2dec0
  libjpeg-turbo8 libjpeg8 liblcms2-2 liblqr-1-0 libltdl7 libm17n-0
  libmagickcore5 libmagickwand5 libotf0 libpango-1.0-0 libpangocairo-1.0-0
  libpangoft2-1.0-0 libpaper-utils libpaper1 librsvg2-2 librsvg2-common
  libsane libsane-common libthai-data libthai0 libtiff5 libv4l-0
  libv4lconvert0 libvpx1 libwayland-client0 libwayland-cursor0 libxcb-render0
  libxcb-shm0 libxcursor1 libxft2 libxi6 libxinerama1 libxkbcommon0 libxtst6
  m17n-contrib m17n-db poppler-data
0 upgraded, 101 newly installed, 0 to remove and 0 not upgraded.
Need to get 46.1 MB of archives.
After this operation, 182 MB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu/ trusty/main imagemagick-common all 8:6.7.7.10-6ubuntu3 [37.2 kB]
Get:2 http://archive.ubuntu.com/ubuntu/ trusty/main libasound2-data all 1.0.27.2-3ubuntu7 [26.3 kB]
Get:3 http://archive.ubuntu.com/ubuntu/ trusty/main libasound2 i386 1.0.27.2-3ubuntu7 [324 kB]
Get:4 http://archive.ubuntu.com/ubuntu/ trusty/main libatk1.0-data all 2.10.0-2ubuntu2 [13.7 kB]
Get:5 http://archive.ubuntu.com/ubuntu/ trusty/main libatk1.0-0 i386 2.10.0-2ubuntu2 [49.5 kB]
Get:6 http://archive.ubuntu.com/ubuntu/ trusty/main libatspi2.0-0 i386 2.10.2.is.2.10.1-0ubuntu1 [51.6 kB]
Get:7 http://archive.ubuntu.com/ubuntu/ trusty/main libatk-bridge2.0-0 i386 2.10.2-2ubuntu1 [46.6 kB]
Get:8 http://archive.ubuntu.com/ubuntu/ trusty/main libavahi-common-data i386 0.6.31-4ubuntu1 [21.3 kB]
Get:9 http://archive.ubuntu.com/ubuntu/ trusty/main libavahi-common3 i386 0.6.31-4ubuntu1 [22.2 kB]
Get:10 http://archive.ubuntu.com/ubuntu/ trusty/main libavahi-client3 i386 0.6.31-4ubuntu1 [24.5 kB]
Get:11 http://archive.ubuntu.com/ubuntu/ trusty/main fonts-dejavu-core all 2.34-1ubuntu1 [1024 kB]
Get:12 http://archive.ubuntu.com/ubuntu/ trusty-updates/main fontconfig-config all 2.11.0-0ubuntu4.1 [47.4 kB]
Get:13 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libfontconfig1 i386 2.11.0-0ubuntu4.1 [124 kB]
Get:14 http://archive.ubuntu.com/ubuntu/ trusty/main libxcb-render0 i386 1.10-2ubuntu1 [11.9 kB]
Get:15 http://archive.ubuntu.com/ubuntu/ trusty/main libxcb-shm0 i386 1.10-2ubuntu1 [5622 B]
Get:16 http://archive.ubuntu.com/ubuntu/ trusty/main libcairo2 i386 1.13.0~20140204-0ubuntu1 [550 kB]
Get:17 http://archive.ubuntu.com/ubuntu/ trusty/main libcairo-gobject2 i386 1.13.0~20140204-0ubuntu1 [16.5 kB]
Get:18 http://archive.ubuntu.com/ubuntu/ trusty/main liblcms2-2 i386 2.5-0ubuntu4 [129 kB]
Get:19 http://archive.ubuntu.com/ubuntu/ trusty/main libcolord1 i386 1.0.6-1 [81.4 kB]
Get:20 http://archive.ubuntu.com/ubuntu/ trusty/main libcroco3 i386 0.6.8-2ubuntu1 [81.1 kB]
Err http://archive.ubuntu.com/ubuntu/ trusty-updates/main libcups2 i386 1.7.2-0ubuntu1.1
  404  Not Found [IP: 91.189.92.201 80]
Get:21 http://archive.ubuntu.com/ubuntu/ trusty/main libjpeg-turbo8 i386 1.3.0-0ubuntu2 [107 kB]
Get:22 http://archive.ubuntu.com/ubuntu/ trusty/main libjpeg8 i386 8c-2ubuntu8 [2188 B]
Get:23 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libjbig0 i386 2.0-2ubuntu4.1 [25.1 kB]
Get:24 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libtiff5 i386 4.0.3-7ubuntu0.1 [142 kB]
Get:25 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libcupsfilters1 i386 1.0.52-0ubuntu1.2 [73.9 kB]
Get:26 http://archive.ubuntu.com/ubuntu/ trusty/main libdatrie1 i386 0.2.8-1 [17.3 kB]
Get:27 http://archive.ubuntu.com/ubuntu/ trusty/main libdconf1 i386 0.20.0-1 [31.4 kB]
Get:28 http://archive.ubuntu.com/ubuntu/ trusty/main libexif12 i386 0.6.21-1ubuntu1 [71.3 kB]
Get:29 http://archive.ubuntu.com/ubuntu/ trusty/main libfftw3-double3 i386 3.3.3-7ubuntu3 [573 kB]
Err http://security.ubuntu.com/ubuntu/ trusty-security/main libcups2 i386 1.7.2-0ubuntu1.1
  404  Not Found [IP: 91.189.88.149 80]
Err http://security.ubuntu.com/ubuntu/ trusty-security/main libcupsimage2 i386 1.7.2-0ubuntu1.1
  404  Not Found [IP: 91.189.88.149 80]
Get:30 http://archive.ubuntu.com/ubuntu/ trusty/main gconf2-common all 3.2.6-0ubuntu2 [20.2 kB]
Get:31 http://archive.ubuntu.com/ubuntu/ trusty/main libgconf-2-4 i386 3.2.6-0ubuntu2 [77.3 kB]
Get:32 http://archive.ubuntu.com/ubuntu/ trusty/main libvpx1 i386 1.3.0-2 [518 kB]
Get:33 http://archive.ubuntu.com/ubuntu/ trusty/main libgd3 i386 2.1.0-3 [142 kB]
Get:34 http://archive.ubuntu.com/ubuntu/ trusty/main libjasper1 i386 1.900.1-14ubuntu3 [126 kB]
Get:35 http://archive.ubuntu.com/ubuntu/ trusty/main libgdk-pixbuf2.0-common all 2.30.7-0ubuntu1 [8610 B]
Get:36 http://archive.ubuntu.com/ubuntu/ trusty/main libgdk-pixbuf2.0-0 i386 2.30.7-0ubuntu1 [155 kB]
Get:37 http://archive.ubuntu.com/ubuntu/ trusty/main libgif4 i386 4.1.6-11 [28.4 kB]
Get:38 http://archive.ubuntu.com/ubuntu/ trusty/main libltdl7 i386 2.4.2-1.7ubuntu1 [35.2 kB]
Get:39 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libgphoto2-port10 i386 2.5.3.1-1ubuntu2.2 [39.9 kB]
Get:40 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libgphoto2-6 i386 2.5.3.1-1ubuntu2.2 [712 kB]
Get:41 http://archive.ubuntu.com/ubuntu/ trusty/main libgraphite2-3 i386 1.2.4-1ubuntu1 [54.4 kB]
Get:42 http://archive.ubuntu.com/ubuntu/ trusty/main dconf-service i386 0.20.0-1 [26.3 kB]
Get:43 http://archive.ubuntu.com/ubuntu/ trusty/main dconf-gsettings-backend i386 0.20.0-1 [19.2 kB]
Get:44 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libgtk-3-common all 3.10.8-0ubuntu1.2 [167 kB]
Get:45 http://archive.ubuntu.com/ubuntu/ trusty/main libthai-data all 0.1.20-3 [130 kB]
Get:46 http://archive.ubuntu.com/ubuntu/ trusty/main libthai0 i386 0.1.20-3 [17.1 kB]
Get:47 http://archive.ubuntu.com/ubuntu/ trusty-updates/main fontconfig i386 2.11.0-0ubuntu4.1 [175 kB]
Get:48 http://archive.ubuntu.com/ubuntu/ trusty/main libpango-1.0-0 i386 1.36.3-1ubuntu1 [148 kB]
Get:49 http://archive.ubuntu.com/ubuntu/ trusty/main libharfbuzz0b i386 0.9.27-1 [125 kB]
Get:50 http://archive.ubuntu.com/ubuntu/ trusty/main libpangoft2-1.0-0 i386 1.36.3-1ubuntu1 [32.6 kB]
Get:51 http://archive.ubuntu.com/ubuntu/ trusty/main libpangocairo-1.0-0 i386 1.36.3-1ubuntu1 [20.0 kB]
Get:52 http://archive.ubuntu.com/ubuntu/ trusty/main libwayland-client0 i386 1.4.0-1ubuntu1 [20.9 kB]
Get:53 http://archive.ubuntu.com/ubuntu/ trusty/main libwayland-cursor0 i386 1.4.0-1ubuntu1 [9812 B]
Get:54 http://archive.ubuntu.com/ubuntu/ trusty/main libxcursor1 i386 1:1.1.14-1 [22.8 kB]
Get:55 http://archive.ubuntu.com/ubuntu/ trusty/main libxi6 i386 2:1.7.1.901-1ubuntu1 [32.0 kB]
Get:56 http://archive.ubuntu.com/ubuntu/ trusty/main libxinerama1 i386 2:1.1.3-1 [7900 B]
Get:57 http://archive.ubuntu.com/ubuntu/ trusty/main libxkbcommon0 i386 0.4.1-0ubuntu1 [88.7 kB]
Get:58 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libgtk-3-0 i386 3.10.8-0ubuntu1.2 [1919 kB]
Err http://archive.ubuntu.com/ubuntu/ trusty-updates/main libgudev-1.0-0 i386 1:204-5ubuntu20.5
  404  Not Found [IP: 91.189.92.201 80]
Get:59 http://archive.ubuntu.com/ubuntu/ trusty/main libieee1284-3 i386 0.2.11-12 [23.7 kB]
Get:60 http://archive.ubuntu.com/ubuntu/ trusty/main liblqr-1-0 i386 0.4.1-2ubuntu1 [22.7 kB]
Get:61 http://archive.ubuntu.com/ubuntu/ trusty/main libmagickcore5 i386 8:6.7.7.10-6ubuntu3 [1387 kB]
Get:62 http://archive.ubuntu.com/ubuntu/ trusty/main libmagickwand5 i386 8:6.7.7.10-6ubuntu3 [236 kB]
Get:63 http://archive.ubuntu.com/ubuntu/ trusty/main libotf0 i386 0.9.13-1ubuntu1 [41.2 kB]
Get:64 http://archive.ubuntu.com/ubuntu/ trusty/main libpaper1 i386 1.1.24+nmu2ubuntu3 [13.4 kB]
Get:65 http://archive.ubuntu.com/ubuntu/ trusty/main librsvg2-2 i386 2.40.2-1 [90.0 kB]
Get:66 http://archive.ubuntu.com/ubuntu/ trusty/main acl i386 2.2.52-1 [43.0 kB]
Get:67 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libsane-common i386 1.0.23-3ubuntu3.1 [450 kB]
Get:68 http://archive.ubuntu.com/ubuntu/ trusty/main libv4lconvert0 i386 1.0.1-1 [73.0 kB]
Get:69 http://archive.ubuntu.com/ubuntu/ trusty/main libv4l-0 i386 1.0.1-1 [36.5 kB]
Get:70 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libsane i386 1.0.23-3ubuntu3.1 [1858 kB]
Get:71 http://archive.ubuntu.com/ubuntu/ trusty/main libxft2 i386 2.3.1-2 [35.6 kB]
Get:72 http://archive.ubuntu.com/ubuntu/ trusty/main libxtst6 i386 2:1.2.2-1 [13.8 kB]
Get:73 http://archive.ubuntu.com/ubuntu/ trusty/main poppler-data all 0.4.6-4 [1479 kB]
Get:74 http://archive.ubuntu.com/ubuntu/ trusty/main libgusb2 i386 0.1.6-5 [15.4 kB]
Get:75 http://archive.ubuntu.com/ubuntu/ trusty/main libcolorhug1 i386 1.0.6-1 [21.0 kB]
Get:76 http://archive.ubuntu.com/ubuntu/ trusty/main at-spi2-core i386 2.10.2.is.2.10.1-0ubuntu1 [42.8 kB]
Get:77 http://archive.ubuntu.com/ubuntu/ trusty/main colord i386 1.0.6-1 [211 kB]
Get:78 http://archive.ubuntu.com/ubuntu/ trusty/main emacsen-common all 2.0.7 [17.1 kB]
Get:79 http://archive.ubuntu.com/ubuntu/ trusty/main emacs24-common-non-dfsg all 24.3+1-1 [4421 kB]
Get:80 http://archive.ubuntu.com/ubuntu/ trusty/main emacs24-common all 24.3+1-2ubuntu1 [13.7 MB]
Get:81 http://archive.ubuntu.com/ubuntu/ trusty/main emacs24-bin-common i386 24.3+1-2ubuntu1 [96.5 kB]
Get:82 http://archive.ubuntu.com/ubuntu/ trusty/main gconf-service-backend i386 3.2.6-0ubuntu2 [54.6 kB]
Get:83 http://archive.ubuntu.com/ubuntu/ trusty/main gconf-service i386 3.2.6-0ubuntu2 [2040 B]
Get:84 http://archive.ubuntu.com/ubuntu/ trusty/main m17n-db all 1.6.4-1 [1807 kB]
Get:85 http://archive.ubuntu.com/ubuntu/ trusty/main m17n-contrib all 1.1.14-1 [517 kB]
Get:86 http://archive.ubuntu.com/ubuntu/ trusty/main libm17n-0 i386 1.6.4-2ubuntu1 [230 kB]
Get:87 http://archive.ubuntu.com/ubuntu/ trusty/main emacs24 i386 24.3+1-2ubuntu1 [2859 kB]
Get:88 http://archive.ubuntu.com/ubuntu/ trusty/main libijs-0.35 i386 0.35-8build1 [17.1 kB]
Get:89 http://archive.ubuntu.com/ubuntu/ trusty/main libjbig2dec0 i386 0.11+20120125-1ubuntu1 [48.1 kB]
Get:90 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libgs9-common all 9.10~dfsg-0ubuntu10.2 [2068 kB]
Get:91 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libgs9 i386 9.10~dfsg-0ubuntu10.2 [1892 kB]
Get:92 http://archive.ubuntu.com/ubuntu/ trusty/main gsfonts all 1:8.11+urwcyr1.0.7~pre44-4.2ubuntu1 [3374 kB]
Get:93 http://archive.ubuntu.com/ubuntu/ trusty-updates/main ghostscript i386 9.10~dfsg-0ubuntu10.2 [40.7 kB]
Get:94 http://archive.ubuntu.com/ubuntu/ trusty/main hicolor-icon-theme all 0.13-1 [7140 B]
Get:95 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libgphoto2-l10n all 2.5.3.1-1ubuntu2.2 [7602 B]
Get:96 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libgtk-3-bin i386 3.10.8-0ubuntu1.2 [18.0 kB]
Get:97 http://archive.ubuntu.com/ubuntu/ trusty/main libpaper-utils i386 1.1.24+nmu2ubuntu3 [8096 B]
Get:98 http://archive.ubuntu.com/ubuntu/ trusty/main librsvg2-common i386 2.40.2-1 [4962 B]
Fetched 45.9 MB in 2min 23s (320 kB/s)

msg: 'apt-get install 'emacs24' ' failed: E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/c/cups/libcups2_1.7.2-0ubuntu1.1_i386.deb  404  Not Found [IP: 91.189.88.149 80]

E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/c/cups/libcupsimage2_1.7.2-0ubuntu1.1_i386.deb  404  Not Found [IP: 91.189.88.149 80]

E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/s/systemd/libgudev-1.0-0_204-5ubuntu20.5_i386.deb  404  Not Found [IP: 91.189.92.201 80]

E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?


FATAL: all hosts have already failed -- aborting

PLAY RECAP ******************************************************************** 
           to retry, use: --limit @/var/lib/jenkins/devPy3Django.retry

127.0.0.1                  : ok=2    changed=1    unreachable=0    failed=1   

Build step 'Execute shell' marked build as failure
Finished: FAILURE

 

追記

emacsのインストール前にapt-get updateにあたる、ansibleで

- name: package list update
  sudo: yes
  apt: update_cache=yes
  when: ansible_os_family == "Debian"

を追加したところうまく動くようになりました!