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

inventory file なしで (sudo ansible-playbook ./playbook.yml) で実行するには ansible 2.0.0.2 を入れないといけない

vagrant provision でのansibleが多くて忘れてた。 忘れた頃に下の手順でansibleインストール。

sudo apt-add-repository ppa:ansible/ansible -y
sudo apt-get install -y git ansible 

いつもの方法の、 inventory file なしだと怒られる。

ubuntu@ip-172-31-19-127:/mnt$ sudo ansible-playbook playbook.yml 
ERROR: provided hosts list is empty
ubuntu@ip-172-31-19-127:/mnt$ sudo ansible-playbook playbook.yml -i localhost
ERROR: Unable to find an inventory file, specify one with -i ?

ubuntu@ip-172-31-19-127:/mnt$ sudo ansible-playbook playbook.yml -c local -i localhost
ERROR: Unable to find an inventory file, specify one with -i ?

色々やってみてもダメ。 バージョンが1系になってる。

ubuntu@ip-172-31-19-127:/mnt$ ansible --version
ansible 1.5.4

うまく行ってる方は2.0.0.2。

unknownuser@anyware:~$ sudo ansible --version
ansible 2.0.0.2
  config file = /etc/ansible/ansible.cfg
  configured module search path = Default w/o overrides
unknownuser@anyware:~$ 

pipで入れないと2.0.0.2が入ってくれないみたい。

ubuntu@ip-172-31-19-127:/mnt$ sudo apt-get install -y python-pip python-dev 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  binutils build-essential cpp cpp-4.8 dpkg-dev fakeroot g++ g++-4.8 gcc
  gcc-4.8 libalgorithm-diff-perl libalgorithm-diff-xs-perl
  libalgorithm-merge-perl libasan0 libatomic1 libc-dev-bin libc6-dev
  libcloog-isl4 libdpkg-perl libexpat1-dev libfakeroot libfile-fcntllock-perl
  libgcc-4.8-dev libgomp1 libisl10 libitm1 libmpc3 libmpfr4 libpython-dev
  libpython2.7-dev libquadmath0 libstdc++-4.8-dev libtsan0 linux-libc-dev make
  manpages-dev python-chardet-whl python-colorama python-colorama-whl
  python-distlib python-distlib-whl python-html5lib python-html5lib-whl
  python-pip-whl python-requests-whl python-setuptools python-setuptools-whl
  python-six-whl python-urllib3-whl python-wheel python2.7-dev
  python3-pkg-resources
Suggested packages:
  binutils-doc cpp-doc gcc-4.8-locales debian-keyring g++-multilib
  g++-4.8-multilib gcc-4.8-doc libstdc++6-4.8-dbg gcc-multilib autoconf
  automake1.9 libtool flex bison gdb gcc-doc gcc-4.8-multilib libgcc1-dbg
  libgomp1-dbg libitm1-dbg libatomic1-dbg libasan0-dbg libtsan0-dbg
  libquadmath0-dbg glibc-doc libstdc++-4.8-doc make-doc python-genshi
  python-lxml python3-setuptools
Recommended packages:
  python-dev-all
The following NEW packages will be installed:
  binutils build-essential cpp cpp-4.8 dpkg-dev fakeroot g++ g++-4.8 gcc
  gcc-4.8 libalgorithm-diff-perl libalgorithm-diff-xs-perl
  libalgorithm-merge-perl libasan0 libatomic1 libc-dev-bin libc6-dev
  libcloog-isl4 libdpkg-perl libexpat1-dev libfakeroot libfile-fcntllock-perl
  libgcc-4.8-dev libgomp1 libisl10 libitm1 libmpc3 libmpfr4 libpython-dev
  libpython2.7-dev libquadmath0 libstdc++-4.8-dev libtsan0 linux-libc-dev make
  manpages-dev python-chardet-whl python-colorama python-colorama-whl
  python-dev python-distlib python-distlib-whl python-html5lib
  python-html5lib-whl python-pip python-pip-whl python-requests-whl
  python-setuptools python-setuptools-whl python-six-whl python-urllib3-whl
  python-wheel python2.7-dev python3-pkg-resources
0 upgraded, 54 newly installed, 0 to remove and 0 not upgraded.
Need to get 63.6 MB of archives.
After this operation, 154 MB of additional disk space will be used.
Get:1 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/main libasan0 amd64 4.8.4-2ubuntu1~14.04.1 [63.1 kB]
Get:2 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/main libatomic1 amd64 4.8.4-2ubuntu1~14.04.1 [8,640 B]
Get:3 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ trusty/main libisl10 amd64 0.12.2-1 [419 kB]
Get:4 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ trusty/main libcloog-isl4 amd64 0.18.2-1 [57.5 kB]
Get:5 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/main libgomp1 amd64 4.8.4-2ubuntu1~14.04.1 [23.1 kB]
Get:6 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/main libitm1 amd64 4.8.4-2ubuntu1~14.04.1 [28.5 kB]
Get:7 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ trusty/main libmpfr4 amd64 3.1.2-1 [203 kB]
Get:8 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/main libc-dev-bin amd64 2.19-0ubuntu6.7 [69.0 kB]
Get:9 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/main linux-libc-dev amd64 3.13.0-77.121 [776 kB]
Get:10 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/main libc6-dev amd64 2.19-0ubuntu6.7 [1,910 kB]
Get:11 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/main libexpat1-dev amd64 2.1.0-4ubuntu1.1 [115 kB]
Get:12 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/main libpython2.7-dev amd64 2.7.6-8ubuntu0.2 [22.0 MB]
Get:13 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/main libquadmath0 amd64 4.8.4-2ubuntu1~14.04.1 [126 kB]
Get:14 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/main libtsan0 amd64 4.8.4-2ubuntu1~14.04.1 [94.9 kB]
Get:15 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ trusty/main libmpc3 amd64 1.0.1-1ubuntu1 [38.4 kB]
Get:16 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/main binutils amd64 2.24-5ubuntu14 [2,076 kB]
Get:17 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/main cpp-4.8 amd64 4.8.4-2ubuntu1~14.04.1 [4,595 kB]
Get:18 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ trusty/main cpp amd64 4:4.8.2-1ubuntu6 [27.5 kB]
Get:19 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/main libgcc-4.8-dev amd64 4.8.4-2ubuntu1~14.04.1 [1,688 kB]
Get:20 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/main gcc-4.8 amd64 4.8.4-2ubuntu1~14.04.1 [5,056 kB]
Get:21 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ trusty/main gcc amd64 4:4.8.2-1ubuntu6 [5,098 B]
Get:22 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/main libstdc++-4.8-dev amd64 4.8.4-2ubuntu1~14.04.1 [1,051 kB]
Get:23 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/main g++-4.8 amd64 4.8.4-2ubuntu1~14.04.1 [18.1 MB]
Get:24 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ trusty/main g++ amd64 4:4.8.2-1ubuntu6 [1,490 B]
Get:25 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ trusty/main make amd64 3.81-8.2ubuntu3 [119 kB]
Get:26 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/main libdpkg-perl all 1.17.5ubuntu5.5 [179 kB]
Get:27 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/main dpkg-dev all 1.17.5ubuntu5.5 [726 kB]
Get:28 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ trusty/main build-essential amd64 11.6ubuntu6 [4,838 B]
Get:29 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ trusty/main libfakeroot amd64 1.20-3ubuntu2 [25.4 kB]
Get:30 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ trusty/main fakeroot amd64 1.20-3ubuntu2 [55.0 kB]
Get:31 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ trusty/main libalgorithm-diff-perl all 1.19.02-3 [50.0 kB]
Get:32 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ trusty/main libalgorithm-diff-xs-perl amd64 0.04-2build4 [12.6 kB]
Get:33 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ trusty/main libalgorithm-merge-perl all 0.08-2 [12.7 kB]
Get:34 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ trusty/main libfile-fcntllock-perl amd64 0.14-2build1 [15.9 kB]
Get:35 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ trusty/main libpython-dev amd64 2.7.5-5ubuntu3 [7,078 B]
Get:36 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ trusty/main manpages-dev all 3.54-1ubuntu1 [1,820 kB]
Get:37 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/main python3-pkg-resources all 3.3-1ubuntu2 [31.7 kB]
Get:38 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/universe python-chardet-whl all 2.2.1-2~ubuntu1 [170 kB]
Get:39 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/universe python-colorama all 0.2.5-0.1ubuntu2 [18.4 kB]
Get:40 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/universe python-colorama-whl all 0.2.5-0.1ubuntu2 [18.2 kB]
Get:41 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/main python2.7-dev amd64 2.7.6-8ubuntu0.2 [269 kB]
Get:42 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ trusty/main python-dev amd64 2.7.5-5ubuntu3 [1,166 B]
Get:43 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/universe python-distlib all 0.1.8-1ubuntu1 [113 kB]
Get:44 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/universe python-distlib-whl all 0.1.8-1ubuntu1 [140 kB]
Get:45 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/main python-html5lib all 0.999-3~ubuntu1 [83.5 kB]
Get:46 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/main python-html5lib-whl all 0.999-3~ubuntu1 [109 kB]
Get:47 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/main python-six-whl all 1.5.2-1ubuntu1 [10.5 kB]
Get:48 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/main python-urllib3-whl all 1.7.1-1ubuntu4 [64.0 kB]
Get:49 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/main python-requests-whl all 2.2.1-1ubuntu0.3 [227 kB]
Get:50 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/main python-setuptools-whl all 3.3-1ubuntu2 [244 kB]
Get:51 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/universe python-pip-whl all 1.5.4-1ubuntu3 [111 kB]
Get:52 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/main python-setuptools all 3.3-1ubuntu2 [230 kB]
Get:53 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/universe python-pip all 1.5.4-1ubuntu3 [97.2 kB]
Get:54 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/main python-wheel all 0.24.0-1~ubuntu1 [44.7 kB]
Fetched 63.6 MB in 3s (19.9 MB/s)    
Extracting templates from packages: 100%
Selecting previously unselected package libasan0:amd64.
(Reading database ... 78217 files and directories currently installed.)
Preparing to unpack .../libasan0_4.8.4-2ubuntu1~14.04.1_amd64.deb ...
Unpacking libasan0:amd64 (4.8.4-2ubuntu1~14.04.1) ...
Selecting previously unselected package libatomic1:amd64.
Preparing to unpack .../libatomic1_4.8.4-2ubuntu1~14.04.1_amd64.deb ...
Unpacking libatomic1:amd64 (4.8.4-2ubuntu1~14.04.1) ...
Selecting previously unselected package libisl10:amd64.
Preparing to unpack .../libisl10_0.12.2-1_amd64.deb ...
Unpacking libisl10:amd64 (0.12.2-1) ...
Selecting previously unselected package libcloog-isl4:amd64.
Preparing to unpack .../libcloog-isl4_0.18.2-1_amd64.deb ...
Unpacking libcloog-isl4:amd64 (0.18.2-1) ...
Selecting previously unselected package libgomp1:amd64.
Preparing to unpack .../libgomp1_4.8.4-2ubuntu1~14.04.1_amd64.deb ...
Unpacking libgomp1:amd64 (4.8.4-2ubuntu1~14.04.1) ...
Selecting previously unselected package libitm1:amd64.
Preparing to unpack .../libitm1_4.8.4-2ubuntu1~14.04.1_amd64.deb ...
Unpacking libitm1:amd64 (4.8.4-2ubuntu1~14.04.1) ...
Selecting previously unselected package libmpfr4:amd64.
Preparing to unpack .../libmpfr4_3.1.2-1_amd64.deb ...
Unpacking libmpfr4:amd64 (3.1.2-1) ...
Selecting previously unselected package libc-dev-bin.
Preparing to unpack .../libc-dev-bin_2.19-0ubuntu6.7_amd64.deb ...
Unpacking libc-dev-bin (2.19-0ubuntu6.7) ...
Selecting previously unselected package linux-libc-dev:amd64.
Preparing to unpack .../linux-libc-dev_3.13.0-77.121_amd64.deb ...
Unpacking linux-libc-dev:amd64 (3.13.0-77.121) ...
Selecting previously unselected package libc6-dev:amd64.
Preparing to unpack .../libc6-dev_2.19-0ubuntu6.7_amd64.deb ...
Unpacking libc6-dev:amd64 (2.19-0ubuntu6.7) ...
Selecting previously unselected package libexpat1-dev:amd64.
Preparing to unpack .../libexpat1-dev_2.1.0-4ubuntu1.1_amd64.deb ...
Unpacking libexpat1-dev:amd64 (2.1.0-4ubuntu1.1) ...
Selecting previously unselected package libpython2.7-dev:amd64.
Preparing to unpack .../libpython2.7-dev_2.7.6-8ubuntu0.2_amd64.deb ...
Unpacking libpython2.7-dev:amd64 (2.7.6-8ubuntu0.2) ...
Selecting previously unselected package libquadmath0:amd64.
Preparing to unpack .../libquadmath0_4.8.4-2ubuntu1~14.04.1_amd64.deb ...
Unpacking libquadmath0:amd64 (4.8.4-2ubuntu1~14.04.1) ...
Selecting previously unselected package libtsan0:amd64.
Preparing to unpack .../libtsan0_4.8.4-2ubuntu1~14.04.1_amd64.deb ...
Unpacking libtsan0:amd64 (4.8.4-2ubuntu1~14.04.1) ...
Selecting previously unselected package libmpc3:amd64.
Preparing to unpack .../libmpc3_1.0.1-1ubuntu1_amd64.deb ...
Unpacking libmpc3:amd64 (1.0.1-1ubuntu1) ...
Selecting previously unselected package binutils.
Preparing to unpack .../binutils_2.24-5ubuntu14_amd64.deb ...
Unpacking binutils (2.24-5ubuntu14) ...
Selecting previously unselected package cpp-4.8.
Preparing to unpack .../cpp-4.8_4.8.4-2ubuntu1~14.04.1_amd64.deb ...
Unpacking cpp-4.8 (4.8.4-2ubuntu1~14.04.1) ...
Selecting previously unselected package cpp.
Preparing to unpack .../cpp_4%3a4.8.2-1ubuntu6_amd64.deb ...
Unpacking cpp (4:4.8.2-1ubuntu6) ...
Selecting previously unselected package libgcc-4.8-dev:amd64.
Preparing to unpack .../libgcc-4.8-dev_4.8.4-2ubuntu1~14.04.1_amd64.deb ...
Unpacking libgcc-4.8-dev:amd64 (4.8.4-2ubuntu1~14.04.1) ...
Selecting previously unselected package gcc-4.8.
Preparing to unpack .../gcc-4.8_4.8.4-2ubuntu1~14.04.1_amd64.deb ...
Unpacking gcc-4.8 (4.8.4-2ubuntu1~14.04.1) ...
Selecting previously unselected package gcc.
Preparing to unpack .../gcc_4%3a4.8.2-1ubuntu6_amd64.deb ...
Unpacking gcc (4:4.8.2-1ubuntu6) ...
Selecting previously unselected package libstdc++-4.8-dev:amd64.
Preparing to unpack .../libstdc++-4.8-dev_4.8.4-2ubuntu1~14.04.1_amd64.deb ...
Unpacking libstdc++-4.8-dev:amd64 (4.8.4-2ubuntu1~14.04.1) ...
Selecting previously unselected package g++-4.8.
Preparing to unpack .../g++-4.8_4.8.4-2ubuntu1~14.04.1_amd64.deb ...
Unpacking g++-4.8 (4.8.4-2ubuntu1~14.04.1) ...
Selecting previously unselected package g++.
Preparing to unpack .../g++_4%3a4.8.2-1ubuntu6_amd64.deb ...
Unpacking g++ (4:4.8.2-1ubuntu6) ...
Selecting previously unselected package make.
Preparing to unpack .../make_3.81-8.2ubuntu3_amd64.deb ...
Unpacking make (3.81-8.2ubuntu3) ...
Selecting previously unselected package libdpkg-perl.
Preparing to unpack .../libdpkg-perl_1.17.5ubuntu5.5_all.deb ...
Unpacking libdpkg-perl (1.17.5ubuntu5.5) ...
Selecting previously unselected package dpkg-dev.
Preparing to unpack .../dpkg-dev_1.17.5ubuntu5.5_all.deb ...
Unpacking dpkg-dev (1.17.5ubuntu5.5) ...
Selecting previously unselected package build-essential.
Preparing to unpack .../build-essential_11.6ubuntu6_amd64.deb ...
Unpacking build-essential (11.6ubuntu6) ...
Selecting previously unselected package libfakeroot:amd64.
Preparing to unpack .../libfakeroot_1.20-3ubuntu2_amd64.deb ...
Unpacking libfakeroot:amd64 (1.20-3ubuntu2) ...
Selecting previously unselected package fakeroot.
Preparing to unpack .../fakeroot_1.20-3ubuntu2_amd64.deb ...
Unpacking fakeroot (1.20-3ubuntu2) ...
Selecting previously unselected package libalgorithm-diff-perl.
Preparing to unpack .../libalgorithm-diff-perl_1.19.02-3_all.deb ...
Unpacking libalgorithm-diff-perl (1.19.02-3) ...
Selecting previously unselected package libalgorithm-diff-xs-perl.
Preparing to unpack .../libalgorithm-diff-xs-perl_0.04-2build4_amd64.deb ...
Unpacking libalgorithm-diff-xs-perl (0.04-2build4) ...
Selecting previously unselected package libalgorithm-merge-perl.
Preparing to unpack .../libalgorithm-merge-perl_0.08-2_all.deb ...
Unpacking libalgorithm-merge-perl (0.08-2) ...
Selecting previously unselected package libfile-fcntllock-perl.
Preparing to unpack .../libfile-fcntllock-perl_0.14-2build1_amd64.deb ...
Unpacking libfile-fcntllock-perl (0.14-2build1) ...
Selecting previously unselected package libpython-dev:amd64.
Preparing to unpack .../libpython-dev_2.7.5-5ubuntu3_amd64.deb ...
Unpacking libpython-dev:amd64 (2.7.5-5ubuntu3) ...
Selecting previously unselected package manpages-dev.
Preparing to unpack .../manpages-dev_3.54-1ubuntu1_all.deb ...
Unpacking manpages-dev (3.54-1ubuntu1) ...
Selecting previously unselected package python3-pkg-resources.
Preparing to unpack .../python3-pkg-resources_3.3-1ubuntu2_all.deb ...
Unpacking python3-pkg-resources (3.3-1ubuntu2) ...
Selecting previously unselected package python-chardet-whl.
Preparing to unpack .../python-chardet-whl_2.2.1-2~ubuntu1_all.deb ...
Unpacking python-chardet-whl (2.2.1-2~ubuntu1) ...
Selecting previously unselected package python-colorama.
Preparing to unpack .../python-colorama_0.2.5-0.1ubuntu2_all.deb ...
Unpacking python-colorama (0.2.5-0.1ubuntu2) ...
Selecting previously unselected package python-colorama-whl.
Preparing to unpack .../python-colorama-whl_0.2.5-0.1ubuntu2_all.deb ...
Unpacking python-colorama-whl (0.2.5-0.1ubuntu2) ...
Selecting previously unselected package python2.7-dev.
Preparing to unpack .../python2.7-dev_2.7.6-8ubuntu0.2_amd64.deb ...
Unpacking python2.7-dev (2.7.6-8ubuntu0.2) ...
Selecting previously unselected package python-dev.
Preparing to unpack .../python-dev_2.7.5-5ubuntu3_amd64.deb ...
Unpacking python-dev (2.7.5-5ubuntu3) ...
Selecting previously unselected package python-distlib.
Preparing to unpack .../python-distlib_0.1.8-1ubuntu1_all.deb ...
Unpacking python-distlib (0.1.8-1ubuntu1) ...
Selecting previously unselected package python-distlib-whl.
Preparing to unpack .../python-distlib-whl_0.1.8-1ubuntu1_all.deb ...
Unpacking python-distlib-whl (0.1.8-1ubuntu1) ...
Selecting previously unselected package python-html5lib.
Preparing to unpack .../python-html5lib_0.999-3~ubuntu1_all.deb ...
Unpacking python-html5lib (0.999-3~ubuntu1) ...
Selecting previously unselected package python-html5lib-whl.
Preparing to unpack .../python-html5lib-whl_0.999-3~ubuntu1_all.deb ...
Unpacking python-html5lib-whl (0.999-3~ubuntu1) ...
Selecting previously unselected package python-six-whl.
Preparing to unpack .../python-six-whl_1.5.2-1ubuntu1_all.deb ...
Unpacking python-six-whl (1.5.2-1ubuntu1) ...
Selecting previously unselected package python-urllib3-whl.
Preparing to unpack .../python-urllib3-whl_1.7.1-1ubuntu4_all.deb ...
Unpacking python-urllib3-whl (1.7.1-1ubuntu4) ...
Selecting previously unselected package python-requests-whl.
Preparing to unpack .../python-requests-whl_2.2.1-1ubuntu0.3_all.deb ...
Unpacking python-requests-whl (2.2.1-1ubuntu0.3) ...
Selecting previously unselected package python-setuptools-whl.
Preparing to unpack .../python-setuptools-whl_3.3-1ubuntu2_all.deb ...
Unpacking python-setuptools-whl (3.3-1ubuntu2) ...
Selecting previously unselected package python-pip-whl.
Preparing to unpack .../python-pip-whl_1.5.4-1ubuntu3_all.deb ...
Unpacking python-pip-whl (1.5.4-1ubuntu3) ...
Selecting previously unselected package python-setuptools.
Preparing to unpack .../python-setuptools_3.3-1ubuntu2_all.deb ...
Unpacking python-setuptools (3.3-1ubuntu2) ...
Selecting previously unselected package python-pip.
Preparing to unpack .../python-pip_1.5.4-1ubuntu3_all.deb ...
Unpacking python-pip (1.5.4-1ubuntu3) ...
Selecting previously unselected package python-wheel.
Preparing to unpack .../python-wheel_0.24.0-1~ubuntu1_all.deb ...
Unpacking python-wheel (0.24.0-1~ubuntu1) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
sudo Setting up libasan0:amd64 (4.8.4-2ubuntu1~14.04.1) ...
Setting up libatomic1:amd64 (4.8.4-2ubuntu1~14.04.1) ...
Setting up libisl10:amd64 (0.12.2-1) ...
Setting up libcloog-isl4:amd64 (0.18.2-1) ...
Setting up libgomp1:amd64 (4.8.4-2ubuntu1~14.04.1) ...
Setting up libitm1:amd64 (4.8.4-2ubuntu1~14.04.1) ...
Setting up libmpfr4:amd64 (3.1.2-1) ...
Setting up libc-dev-bin (2.19-0ubuntu6.7) ...
Setting up linux-libc-dev:amd64 (3.13.0-77.121) ...
Setting up libc6-dev:amd64 (2.19-0ubuntu6.7) ...
Setting up libexpat1-dev:amd64 (2.1.0-4ubuntu1.1) ...
Setting up libpython2.7-dev:amd64 (2.7.6-8ubuntu0.2) ...
Setting up libquadmath0:amd64 (4.8.4-2ubuntu1~14.04.1) ...
Setting up libtsan0:amd64 (4.8.4-2ubuntu1~14.04.1) ...
Setting up libmpc3:amd64 (1.0.1-1ubuntu1) ...
Setting up binutils (2.24-5ubuntu14) ...
Setting up cpp-4.8 (4.8.4-2ubuntu1~14.04.1) ...
Setting up cpp (4:4.8.2-1ubuntu6) ...
Setting up libgcc-4.8-dev:amd64 (4.8.4-2ubuntu1~14.04.1) ...
Setting up gcc-4.8 (4.8.4-2ubuntu1~14.04.1) ...
Setting up gcc (4:4.8.2-1ubuntu6) ...
pSetting up libstdc++-4.8-dev:amd64 (4.8.4-2ubuntu1~14.04.1) ...
Setting up g++-4.8 (4.8.4-2ubuntu1~14.04.1) ...
Setting up g++ (4:4.8.2-1ubuntu6) ...
update-alternatives: using /usr/bin/g++ to provide /usr/bin/c++ (c++) in auto mode
Setting up make (3.81-8.2ubuntu3) ...
Setting up libdpkg-perl (1.17.5ubuntu5.5) ...
Setting up dpkg-dev (1.17.5ubuntu5.5) ...
Setting up build-essential (11.6ubuntu6) ...
Setting up libfakeroot:amd64 (1.20-3ubuntu2) ...
Setting up fakeroot (1.20-3ubuntu2) ...
update-alternatives: using /usr/bin/fakeroot-sysv to provide /usr/bin/fakeroot (fakeroot) in auto mode
Setting up libalgorithm-diff-perl (1.19.02-3) ...
Setting up libalgorithm-diff-xs-perl (0.04-2build4) ...
Setting up libalgorithm-merge-perl (0.08-2) ...
Setting up libfile-fcntllock-perl (0.14-2build1) ...
Setting up libpython-dev:amd64 (2.7.5-5ubuntu3) ...
Setting up manpages-dev (3.54-1ubuntu1) ...
iSetting up python3-pkg-resources (3.3-1ubuntu2) ...
pSetting up python-chardet-whl (2.2.1-2~ubuntu1) ...
Setting up python-colorama (0.2.5-0.1ubuntu2) ...
Setting up python-colorama-whl (0.2.5-0.1ubuntu2) ...
Setting up python2.7-dev (2.7.6-8ubuntu0.2) ...
Setting up python-dev (2.7.5-5ubuntu3) ...
 Setting up python-distlib (0.1.8-1ubuntu1) ...
Setting up python-distlib-whl (0.1.8-1ubuntu1) ...
Setting up python-html5lib (0.999-3~ubuntu1) ...
Setting up python-html5lib-whl (0.999-3~ubuntu1) ...
Setting up python-six-whl (1.5.2-1ubuntu1) ...
Setting up python-urllib3-whl (1.7.1-1ubuntu4) ...
Setting up python-requests-whl (2.2.1-1ubuntu0.3) ...
Setting up python-setuptools-whl (3.3-1ubuntu2) ...
Setting up python-pip-whl (1.5.4-1ubuntu3) ...
Setting up python-setuptools (3.3-1ubuntu2) ...
aSetting up python-pip (1.5.4-1ubuntu3) ...
nSetting up python-wheel (0.24.0-1~ubuntu1) ...
siProcessing triggers for libc-bin (2.19-0ubuntu6.7) ...
ble ubuntu@ip-172-31-19-127:/mnt$ sudo pip install ansible
Requirement already satisfied (use --upgrade to upgrade): ansible in /usr/lib/python2.7/dist-packages
Cleaning up...
ubuntu@ip-172-31-19-127:/mnt$ sudo apt-get purge ansible -y
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  python-crypto python-httplib2 python-jinja2 python-markupsafe
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
  ansible*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 2,758 kB disk space will be freed.
(Reading database ... 83597 files and directories currently installed.)
Removing ansible (1.5.4+dfsg-1) ...
Purging configuration files for ansible (1.5.4+dfsg-1) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
ubuntu@ip-172-31-19-127:/mnt$ sudo pip install ansible
Downloading/unpacking ansible
  Downloading ansible-2.0.0.2.tar.gz (1.5MB): 1.5MB downloaded
  Running setup.py (path:/tmp/pip_build_root/ansible/setup.py) egg_info for package ansible
    
    no previously-included directories found matching 'v2'
    no previously-included directories found matching 'docsite'
    no previously-included directories found matching 'ticket_stubs'
    no previously-included directories found matching 'packaging'
    no previously-included directories found matching 'test'
    no previously-included directories found matching 'hacking'
    warning: no previously-included files found matching 'lib/ansible/modules/core/.git*'
    warning: no previously-included files found matching 'lib/ansible/modules/extras/.git*'
    no previously-included directories found matching 'lib/ansible/modules/core/.git'
    no previously-included directories found matching 'lib/ansible/modules/extras/.git'
Downloading/unpacking paramiko (from ansible)
  Downloading paramiko-1.16.0-py2.py3-none-any.whl (169kB): 169kB downloaded
Requirement already satisfied (use --upgrade to upgrade): jinja2 in /usr/lib/python2.7/dist-packages (from ansible)
Requirement already satisfied (use --upgrade to upgrade): PyYAML in /usr/lib/python2.7/dist-packages (from ansible)
Requirement already satisfied (use --upgrade to upgrade): setuptools in /usr/lib/python2.7/dist-packages (from ansible)
Requirement already satisfied (use --upgrade to upgrade): pycrypto>=2.6 in /usr/lib/python2.7/dist-packages (from ansible)
Downloading/unpacking ecdsa>=0.11 (from paramiko->ansible)
  Downloading ecdsa-0.13-py2.py3-none-any.whl (86kB): 86kB downloaded
Requirement already satisfied (use --upgrade to upgrade): markupsafe in /usr/lib/python2.7/dist-packages (from jinja2->ansible)
Installing collected packages: ansible, paramiko, ecdsa
  Running setup.py install for ansible
    changing mode of build/scripts-2.7/ansible from 644 to 755
    changing mode of build/scripts-2.7/ansible-playbook from 644 to 755
    changing mode of build/scripts-2.7/ansible-pull from 644 to 755
    changing mode of build/scripts-2.7/ansible-doc from 644 to 755
    changing mode of build/scripts-2.7/ansible-galaxy from 644 to 755
    changing mode of build/scripts-2.7/ansible-vault from 644 to 755
    
    no previously-included directories found matching 'v2'
    no previously-included directories found matching 'docsite'
    no previously-included directories found matching 'ticket_stubs'
    no previously-included directories found matching 'test'
    no previously-included directories found matching 'hacking'
    warning: no previously-included files found matching 'lib/ansible/modules/core/.git*'
    warning: no previously-included files found matching 'lib/ansible/modules/extras/.git*'
    no previously-included directories found matching 'lib/ansible/modules/core/.git'
    no previously-included directories found matching 'lib/ansible/modules/extras/.git'
    changing mode of /usr/local/bin/ansible-vault to 755
    changing mode of /usr/local/bin/ansible-playbook to 755
    changing mode of /usr/local/bin/ansible to 755
    changing mode of /usr/local/bin/ansible-pull to 755
    changing mode of /usr/local/bin/ansible-doc to 755
    changing mode of /usr/local/bin/ansible-galaxy to 755
Successfully installed ansible paramiko ecdsa
Cleaning up...

バージョン確認

ubuntu@ip-172-31-19-127:/mnt$ ansible --version
ansible 2.0.0.2
  config file = 
  configured module search path = Default w/o overrides

ok。

もう一回。

ubuntu@ip-172-31-19-127:/mnt$ sudo ansible-playbook playbook.yml 
 [WARNING]: provided hosts list is empty, only localhost is available

[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.

PLAY ***************************************************************************

TASK [setup] *******************************************************************
ok: [127.0.0.1]

TASK [apt] *********************************************************************
ok: [127.0.0.1]

.
.
.
.

ok.

ちなみに、playbookにローカルの指定が必要です。

---
- hosts: 127.0.0.1
  connection: local
  sudo: true
  tasks:
    - apt: name=vim update_cache=yes
    - apt: name=curl

.
.
.
.