1. ansible実行用のhostをvagrantのansible_localで設定 ← ここ
  2. hostからansibleでcentOS 7.2の基本設定

前提

  • OS X El Capitan(10.11.6)

  • Vagrant インストール済み

1
2
3
$ vagrant version
Installed Version: 1.8.7
Latest Version: 1.8.7
1
2
$ VBoxManage -version
5.0.30r112061

1.ansible実行用のhostをvagrantのansible_localで設定

vagrantの初期化

Vagrantfile作成

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
$ vagrant init
A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com` for more information on using Vagrant.
$ tree
.
└── Vagrantfile

0 directories, 1 file

設定

公式ページを参考に編集ansible_local

ファイル構成

1
2
3
4
5
6
7
8
9
$ tree
.
├── Vagrantfile
├── ansible.cfg
└── provision
    ├── inventory
    └── playbook.yml

1 directory, 4 files

各ファイル

Vagrantfile

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# -*- mode: ruby -*-
# vi: set ft=ruby :

# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
  config.vm.define "host" do |node|
    node.vm.box = "bento/centos-7.2"
    node.vm.hostname = "host"
    node.vm.network :private_network, ip: "192.168.52.51"

    # Run Ansible from the Vagrant VM
    node.vm.provision :ansible_local do |ansible|
      ansible.playbook       = "provision/playbook.yml"
      ansible.verbose        = true
      ansible.install        = true
      ansible.install_mode   = :default
      ansible.limit          = "all" # or only "nodes" group, etc.
      ansible.inventory_path = "provision/inventory"
    end
  end
end

ansible.cfg

1
2
3
4
5
[defaults]
host_key_checking = no

[ssh_connection]
ssh_args = -o ControlMaster=auto -o ControlPersist=60s -o UserKnownHostsFile=/dev/null -o IdentitiesOnly=yes

provision/inventory

1
host ansible_connection=local

provision/playbook.yml

1
2
3
4
5
6
7
---
# file: ./provision/playbook.yml

- hosts: host
  tasks:
    - name: provision test
      debug: msg="provision test"

vagrantの実行

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
$ vagrant up --provision
Bringing machine 'host' up with 'virtualbox' provider...
==> host: Importing base box 'bento/centos-7.2'...
==> host: Matching MAC address for NAT networking...
==> host: Checking if box 'bento/centos-7.2' is up to date...
==> host: There was a problem while downloading the metadata for your box
==> host: to check for updates. This is not an error, since it is usually due
==> host: to temporary network problems. This is just a warning. The problem
==> host: encountered was:
==> host:
==> host:
==> host:
==> host: If you want to check for box updates, verify your network connection
==> host: is valid and try again.
==> host: Setting the name of the VM: vagrant_host_1480286713505_67653
==> host: Clearing any previously set network interfaces...
==> host: Preparing network interfaces based on configuration...
    host: Adapter 1: nat
    host: Adapter 2: hostonly
==> host: Forwarding ports...
    host: 22 (guest) => 2222 (host) (adapter 1)
==> host: Booting VM...
==> host: Waiting for machine to boot. This may take a few minutes...
    host: SSH address: 127.0.0.1:2222
    host: SSH username: vagrant
    host: SSH auth method: private key
    host: Warning: Remote connection disconnect. Retrying...
    host: Warning: Remote connection disconnect. Retrying...
    host: Warning: Remote connection disconnect. Retrying...
    host:
    host: Vagrant insecure key detected. Vagrant will automatically replace
    host: this with a newly generated keypair for better security.
    host:
    host: Inserting generated public key within guest...
    host: Removing insecure key from the guest if it's present...
    host: Key inserted! Disconnecting and reconnecting using new SSH key...
==> host: Machine booted and ready!
[host] GuestAdditions versions on your host (5.0.30) and guest (5.0.26) do not match.
Loaded plugins: fastestmirror
^@Determining fastest mirrors
 * base: ftp.tsukuba.wide.ad.jp
 * extras: ftp.tsukuba.wide.ad.jp
 * updates: ftp.tsukuba.wide.ad.jp
Package binutils-2.23.52.0.1-55.el7.x86_64 already installed and latest version
Package 1:make-3.82-21.el7.x86_64 already installed and latest version
Package bzip2-1.0.6-13.el7.x86_64 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package gcc.x86_64 0:4.8.5-4.el7 will be installed
--> Processing Dependency: cpp = 4.8.5-4.el7 for package: gcc-4.8.5-4.el7.x86_64
--> Processing Dependency: glibc-devel >= 2.2.90-12 for package: gcc-4.8.5-4.el7.x86_64
---> Package kernel-devel.x86_64 0:3.10.0-327.el7 will be installed
---> Package perl.x86_64 4:5.16.3-286.el7 will be installed
--> Processing Dependency: perl-libs = 4:5.16.3-286.el7 for package: 4:perl-5.16.3-286.el7.x86_64
--> Processing Dependency: perl(Socket) >= 1.3 for package: 4:perl-5.16.3-286.el7.x86_64
--> Processing Dependency: perl(Scalar::Util) >= 1.10 for package: 4:perl-5.16.3-286.el7.x86_64
--> Processing Dependency: perl-macros for package: 4:perl-5.16.3-286.el7.x86_64
--> Processing Dependency: perl-libs for package: 4:perl-5.16.3-286.el7.x86_64
--> Processing Dependency: perl(threads::shared) for package: 4:perl-5.16.3-286.el7.x86_64
--> Processing Dependency: perl(threads) for package: 4:perl-5.16.3-286.el7.x86_64
--> Processing Dependency: perl(constant) for package: 4:perl-5.16.3-286.el7.x86_64
--> Processing Dependency: perl(Time::Local) for package: 4:perl-5.16.3-286.el7.x86_64
--> Processing Dependency: perl(Time::HiRes) for package: 4:perl-5.16.3-286.el7.x86_64
--> Processing Dependency: perl(Storable) for package: 4:perl-5.16.3-286.el7.x86_64
--> Processing Dependency: perl(Socket) for package: 4:perl-5.16.3-286.el7.x86_64
--> Processing Dependency: perl(Scalar::Util) for package: 4:perl-5.16.3-286.el7.x86_64
--> Processing Dependency: perl(Pod::Simple::XHTML) for package: 4:perl-5.16.3-286.el7.x86_64
--> Processing Dependency: perl(Pod::Simple::Search) for package: 4:perl-5.16.3-286.el7.x86_64
--> Processing Dependency: perl(Getopt::Long) for package: 4:perl-5.16.3-286.el7.x86_64
--> Processing Dependency: perl(Filter::Util::Call) for package: 4:perl-5.16.3-286.el7.x86_64
--> Processing Dependency: perl(File::Temp) for package: 4:perl-5.16.3-286.el7.x86_64
--> Processing Dependency: perl(File::Spec::Unix) for package: 4:perl-5.16.3-286.el7.x86_64
--> Processing Dependency: perl(File::Spec::Functions) for package: 4:perl-5.16.3-286.el7.x86_64
--> Processing Dependency: perl(File::Spec) for package: 4:perl-5.16.3-286.el7.x86_64
--> Processing Dependency: perl(File::Path) for package: 4:perl-5.16.3-286.el7.x86_64
--> Processing Dependency: perl(Exporter) for package: 4:perl-5.16.3-286.el7.x86_64
--> Processing Dependency: perl(Cwd) for package: 4:perl-5.16.3-286.el7.x86_64
--> Processing Dependency: perl(Carp) for package: 4:perl-5.16.3-286.el7.x86_64
--> Processing Dependency: libperl.so()(64bit) for package: 4:perl-5.16.3-286.el7.x86_64
--> Running transaction check
---> Package cpp.x86_64 0:4.8.5-4.el7 will be installed
---> Package glibc-devel.x86_64 0:2.17-106.el7_2.8 will be installed
--> Processing Dependency: glibc-headers = 2.17-106.el7_2.8 for package: glibc-devel-2.17-106.el7_2.8.x86_64
--> Processing Dependency: glibc = 2.17-106.el7_2.8 for package: glibc-devel-2.17-106.el7_2.8.x86_64
--> Processing Dependency: glibc-headers for package: glibc-devel-2.17-106.el7_2.8.x86_64
---> Package perl-Carp.noarch 0:1.26-244.el7 will be installed
---> Package perl-Exporter.noarch 0:5.68-3.el7 will be installed
---> Package perl-File-Path.noarch 0:2.09-2.el7 will be installed
---> Package perl-File-Temp.noarch 0:0.23.01-3.el7 will be installed
---> Package perl-Filter.x86_64 0:1.49-3.el7 will be installed
---> Package perl-Getopt-Long.noarch 0:2.40-2.el7 will be installed
--> Processing Dependency: perl(Pod::Usage) >= 1.14 for package: perl-Getopt-Long-2.40-2.el7.noarch
--> Processing Dependency: perl(Text::ParseWords) for package: perl-Getopt-Long-2.40-2.el7.noarch
---> Package perl-PathTools.x86_64 0:3.40-5.el7 will be installed
---> Package perl-Pod-Simple.noarch 1:3.28-4.el7 will be installed
--> Processing Dependency: perl(Pod::Escapes) >= 1.04 for package: 1:perl-Pod-Simple-3.28-4.el7.noarch
--> Processing Dependency: perl(Encode) for package: 1:perl-Pod-Simple-3.28-4.el7.noarch
---> Package perl-Scalar-List-Utils.x86_64 0:1.27-248.el7 will be installed
---> Package perl-Socket.x86_64 0:2.010-3.el7 will be installed
---> Package perl-Storable.x86_64 0:2.45-3.el7 will be installed
---> Package perl-Time-HiRes.x86_64 4:1.9725-3.el7 will be installed
---> Package perl-Time-Local.noarch 0:1.2300-2.el7 will be installed
---> Package perl-constant.noarch 0:1.27-2.el7 will be installed
---> Package perl-libs.x86_64 4:5.16.3-286.el7 will be installed
---> Package perl-macros.x86_64 4:5.16.3-286.el7 will be installed
---> Package perl-threads.x86_64 0:1.87-4.el7 will be installed
---> Package perl-threads-shared.x86_64 0:1.43-6.el7 will be installed
--> Running transaction check
---> Package glibc.x86_64 0:2.17-105.el7 will be updated
--> Processing Dependency: glibc = 2.17-105.el7 for package: glibc-common-2.17-105.el7.x86_64
---> Package glibc.x86_64 0:2.17-106.el7_2.8 will be an update
---> Package glibc-headers.x86_64 0:2.17-106.el7_2.8 will be installed
--> Processing Dependency: kernel-headers >= 2.2.1 for package: glibc-headers-2.17-106.el7_2.8.x86_64
--> Processing Dependency: kernel-headers for package: glibc-headers-2.17-106.el7_2.8.x86_64
---> Package perl-Encode.x86_64 0:2.51-7.el7 will be installed
---> Package perl-Pod-Escapes.noarch 1:1.04-286.el7 will be installed
---> Package perl-Pod-Usage.noarch 0:1.63-3.el7 will be installed
--> Processing Dependency: perl(Pod::Text) >= 3.15 for package: perl-Pod-Usage-1.63-3.el7.noarch
--> Processing Dependency: perl-Pod-Perldoc for package: perl-Pod-Usage-1.63-3.el7.noarch
---> Package perl-Text-ParseWords.noarch 0:3.29-4.el7 will be installed
--> Running transaction check
---> Package glibc-common.x86_64 0:2.17-105.el7 will be updated
---> Package glibc-common.x86_64 0:2.17-106.el7_2.8 will be an update
---> Package kernel-headers.x86_64 0:3.10.0-327.36.3.el7 will be installed
---> Package perl-Pod-Perldoc.noarch 0:3.20-4.el7 will be installed
--> Processing Dependency: perl(parent) for package: perl-Pod-Perldoc-3.20-4.el7.noarch
--> Processing Dependency: perl(HTTP::Tiny) for package: perl-Pod-Perldoc-3.20-4.el7.noarch
---> Package perl-podlators.noarch 0:2.5.1-3.el7 will be installed
--> Running transaction check
---> Package perl-HTTP-Tiny.noarch 0:0.033-3.el7 will be installed
---> Package perl-parent.noarch 1:0.225-244.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package                   Arch      Version                   Repository  Size
================================================================================
Installing:
 gcc                       x86_64    4.8.5-4.el7               base        16 M
 kernel-devel              x86_64    3.10.0-327.el7            base        11 M
 perl                      x86_64    4:5.16.3-286.el7          base       8.0 M
Installing for dependencies:
 cpp                       x86_64    4.8.5-4.el7               base       5.9 M
 glibc-devel               x86_64    2.17-106.el7_2.8          updates    1.0 M
 glibc-headers             x86_64    2.17-106.el7_2.8          updates    663 k
 kernel-headers            x86_64    3.10.0-327.36.3.el7       updates    3.2 M
 perl-Carp                 noarch    1.26-244.el7              base        19 k
 perl-Encode               x86_64    2.51-7.el7                base       1.5 M
 perl-Exporter             noarch    5.68-3.el7                base        28 k
 perl-File-Path            noarch    2.09-2.el7                base        26 k
 perl-File-Temp            noarch    0.23.01-3.el7             base        56 k
 perl-Filter               x86_64    1.49-3.el7                base        76 k
 perl-Getopt-Long          noarch    2.40-2.el7                base        56 k
 perl-HTTP-Tiny            noarch    0.033-3.el7               base        38 k
 perl-PathTools            x86_64    3.40-5.el7                base        82 k
 perl-Pod-Escapes          noarch    1:1.04-286.el7            base        50 k
 perl-Pod-Perldoc          noarch    3.20-4.el7                base        87 k
 perl-Pod-Simple           noarch    1:3.28-4.el7              base       216 k
 perl-Pod-Usage            noarch    1.63-3.el7                base        27 k
 perl-Scalar-List-Utils    x86_64    1.27-248.el7              base        36 k
 perl-Socket               x86_64    2.010-3.el7               base        49 k
 perl-Storable             x86_64    2.45-3.el7                base        77 k
 perl-Text-ParseWords      noarch    3.29-4.el7                base        14 k
 perl-Time-HiRes           x86_64    4:1.9725-3.el7            base        45 k
 perl-Time-Local           noarch    1.2300-2.el7              base        24 k
 perl-constant             noarch    1.27-2.el7                base        19 k
 perl-libs                 x86_64    4:5.16.3-286.el7          base       687 k
 perl-macros               x86_64    4:5.16.3-286.el7          base        43 k
 perl-parent               noarch    1:0.225-244.el7           base        12 k
 perl-podlators            noarch    2.5.1-3.el7               base       112 k
 perl-threads              x86_64    1.87-4.el7                base        49 k
 perl-threads-shared       x86_64    1.43-6.el7                base        39 k
Updating for dependencies:
 glibc                     x86_64    2.17-106.el7_2.8          updates    3.6 M
 glibc-common              x86_64    2.17-106.el7_2.8          updates     11 M

Transaction Summary
================================================================================
Install  3 Packages (+30 Dependent packages)
Upgrade             (  2 Dependent packages)

Total download size: 64 M
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
Public key for cpp-4.8.5-4.el7.x86_64.rpm is not installed
warning: /var/cache/yum/x86_64/7/base/packages/cpp-4.8.5-4.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Public key for glibc-2.17-106.el7_2.8.x86_64.rpm is not installed
--------------------------------------------------------------------------------
Total                                               16 MB/s |  64 MB  00:04
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Importing GPG key 0xF4A80EB5:
 Userid     : "CentOS-7 Key (CentOS 7 Official Signing Key) <security@centos.org>"
 Fingerprint: 6341 ab27 53d7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5
 Package    : centos-release-7-2.1511.el7.centos.2.10.x86_64 (@anaconda)
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Updating   : glibc-2.17-106.el7_2.8.x86_64                               1/37
  Updating   : glibc-common-2.17-106.el7_2.8.x86_64                        2/37
  Installing : 1:perl-parent-0.225-244.el7.noarch                          3/37
  Installing : perl-HTTP-Tiny-0.033-3.el7.noarch                           4/37
  Installing : perl-podlators-2.5.1-3.el7.noarch                           5/37
  Installing : perl-Pod-Perldoc-3.20-4.el7.noarch                          6/37
  Installing : 1:perl-Pod-Escapes-1.04-286.el7.noarch                      7/37
  Installing : perl-Text-ParseWords-3.29-4.el7.noarch                      8/37
  Installing : perl-Encode-2.51-7.el7.x86_64                               9/37
  Installing : perl-Pod-Usage-1.63-3.el7.noarch                           10/37
  Installing : 4:perl-libs-5.16.3-286.el7.x86_64                          11/37
  Installing : 4:perl-macros-5.16.3-286.el7.x86_64                        12/37
  Installing : perl-Storable-2.45-3.el7.x86_64                            13/37
  Installing : perl-Exporter-5.68-3.el7.noarch                            14/37
  Installing : perl-constant-1.27-2.el7.noarch                            15/37
  Installing : perl-Time-Local-1.2300-2.el7.noarch                        16/37
  Installing : perl-Socket-2.010-3.el7.x86_64                             17/37
  Installing : perl-Carp-1.26-244.el7.noarch                              18/37
  Installing : 4:perl-Time-HiRes-1.9725-3.el7.x86_64                      19/37
  Installing : perl-PathTools-3.40-5.el7.x86_64                           20/37
  Installing : perl-Scalar-List-Utils-1.27-248.el7.x86_64                 21/37
  Installing : perl-File-Temp-0.23.01-3.el7.noarch                        22/37
  Installing : perl-File-Path-2.09-2.el7.noarch                           23/37
  Installing : perl-threads-shared-1.43-6.el7.x86_64                      24/37
  Installing : perl-threads-1.87-4.el7.x86_64                             25/37
  Installing : perl-Filter-1.49-3.el7.x86_64                              26/37
  Installing : 1:perl-Pod-Simple-3.28-4.el7.noarch                        27/37
  Installing : perl-Getopt-Long-2.40-2.el7.noarch                         28/37
  Installing : 4:perl-5.16.3-286.el7.x86_64                               29/37
  Installing : cpp-4.8.5-4.el7.x86_64                                     30/37
  Installing : kernel-headers-3.10.0-327.36.3.el7.x86_64                  31/37
  Installing : glibc-headers-2.17-106.el7_2.8.x86_64                      32/37
  Installing : glibc-devel-2.17-106.el7_2.8.x86_64                        33/37
  Installing : gcc-4.8.5-4.el7.x86_64                                     34/37^@
  Installing : kernel-devel-3.10.0-327.el7.x86_64                         35/37
  Cleanup    : glibc-2.17-105.el7.x86_64                                  36/37
  Cleanup    : glibc-common-2.17-105.el7.x86_64                           37/37
  Verifying  : perl-HTTP-Tiny-0.033-3.el7.noarch                           1/37
  Verifying  : gcc-4.8.5-4.el7.x86_64                                      2/37
  Verifying  : perl-threads-shared-1.43-6.el7.x86_64                       3/37
  Verifying  : perl-Storable-2.45-3.el7.x86_64                             4/37
  Verifying  : kernel-headers-3.10.0-327.36.3.el7.x86_64                   5/37
  Verifying  : perl-Exporter-5.68-3.el7.noarch                             6/37
  Verifying  : perl-constant-1.27-2.el7.noarch                             7/37
  Verifying  : perl-PathTools-3.40-5.el7.x86_64                            8/37
  Verifying  : 4:perl-libs-5.16.3-286.el7.x86_64                           9/37
  Verifying  : 4:perl-macros-5.16.3-286.el7.x86_64                        10/37
  Verifying  : 1:perl-Pod-Escapes-1.04-286.el7.noarch                     11/37
  Verifying  : 1:perl-parent-0.225-244.el7.noarch                         12/37
  Verifying  : 4:perl-5.16.3-286.el7.x86_64                               13/37
  Verifying  : glibc-devel-2.17-106.el7_2.8.x86_64                        14/37
  Verifying  : perl-File-Temp-0.23.01-3.el7.noarch                        15/37
  Verifying  : 1:perl-Pod-Simple-3.28-4.el7.noarch                        16/37
  Verifying  : glibc-headers-2.17-106.el7_2.8.x86_64                      17/37
  Verifying  : perl-Time-Local-1.2300-2.el7.noarch                        18/37
  Verifying  : glibc-common-2.17-106.el7_2.8.x86_64                       19/37
  Verifying  : perl-Pod-Perldoc-3.20-4.el7.noarch                         20/37
  Verifying  : perl-Socket-2.010-3.el7.x86_64                             21/37
  Verifying  : perl-Carp-1.26-244.el7.noarch                              22/37
  Verifying  : perl-podlators-2.5.1-3.el7.noarch                          23/37
  Verifying  : 4:perl-Time-HiRes-1.9725-3.el7.x86_64                      24/37
  Verifying  : perl-Scalar-List-Utils-1.27-248.el7.x86_64                 25/37
  Verifying  : glibc-2.17-106.el7_2.8.x86_64                              26/37
  Verifying  : perl-Pod-Usage-1.63-3.el7.noarch                           27/37
  Verifying  : perl-Encode-2.51-7.el7.x86_64                              28/37
  Verifying  : perl-Getopt-Long-2.40-2.el7.noarch                         29/37
  Verifying  : kernel-devel-3.10.0-327.el7.x86_64                         30/37
  Verifying  : cpp-4.8.5-4.el7.x86_64                                     31/37
  Verifying  : perl-File-Path-2.09-2.el7.noarch                           32/37
  Verifying  : perl-threads-1.87-4.el7.x86_64                             33/37
  Verifying  : perl-Filter-1.49-3.el7.x86_64                              34/37
  Verifying  : perl-Text-ParseWords-3.29-4.el7.noarch                     35/37
  Verifying  : glibc-common-2.17-105.el7.x86_64                           36/37
  Verifying  : glibc-2.17-105.el7.x86_64                                  37/37

Installed:
  gcc.x86_64 0:4.8.5-4.el7           kernel-devel.x86_64 0:3.10.0-327.el7
  perl.x86_64 4:5.16.3-286.el7

Dependency Installed:
  cpp.x86_64 0:4.8.5-4.el7
  glibc-devel.x86_64 0:2.17-106.el7_2.8
  glibc-headers.x86_64 0:2.17-106.el7_2.8
  kernel-headers.x86_64 0:3.10.0-327.36.3.el7
  perl-Carp.noarch 0:1.26-244.el7
  perl-Encode.x86_64 0:2.51-7.el7
  perl-Exporter.noarch 0:5.68-3.el7
  perl-File-Path.noarch 0:2.09-2.el7
  perl-File-Temp.noarch 0:0.23.01-3.el7
  perl-Filter.x86_64 0:1.49-3.el7
  perl-Getopt-Long.noarch 0:2.40-2.el7
  perl-HTTP-Tiny.noarch 0:0.033-3.el7
  perl-PathTools.x86_64 0:3.40-5.el7
  perl-Pod-Escapes.noarch 1:1.04-286.el7
  perl-Pod-Perldoc.noarch 0:3.20-4.el7
  perl-Pod-Simple.noarch 1:3.28-4.el7
  perl-Pod-Usage.noarch 0:1.63-3.el7
  perl-Scalar-List-Utils.x86_64 0:1.27-248.el7
  perl-Socket.x86_64 0:2.010-3.el7
  perl-Storable.x86_64 0:2.45-3.el7
  perl-Text-ParseWords.noarch 0:3.29-4.el7
  perl-Time-HiRes.x86_64 4:1.9725-3.el7
  perl-Time-Local.noarch 0:1.2300-2.el7
  perl-constant.noarch 0:1.27-2.el7
  perl-libs.x86_64 4:5.16.3-286.el7
  perl-macros.x86_64 4:5.16.3-286.el7
  perl-parent.noarch 1:0.225-244.el7
  perl-podlators.noarch 0:2.5.1-3.el7
  perl-threads.x86_64 0:1.87-4.el7
  perl-threads-shared.x86_64 0:1.43-6.el7

Dependency Updated:
  glibc.x86_64 0:2.17-106.el7_2.8     glibc-common.x86_64 0:2.17-106.el7_2.8

Complete!
Copy iso file /Applications/VirtualBox.app/Contents/MacOS/VBoxGuestAdditions.iso into the box /tmp/VBoxGuestAdditions.iso
mount: /dev/loop0 is write-protected, mounting read-only
Installing Virtualbox Guest Additions 5.0.30 - guest version is 5.0.26
Verifying archive integrity... All good.
Uncompressing VirtualBox 5.0.30 Guest Additions for Linux............
VirtualBox Guest Additions installer
Removing installed version 5.0.26 of VirtualBox Guest Additions...
Removing existing VirtualBox non-DKMS kernel modules[  OK  ]
Copying additional installer modules ...
Installing additional modules ...
Removing existing VirtualBox non-DKMS kernel modules[  OK  ]
Building the VirtualBox Guest Additions kernel modules
Building the main Guest Additions module^@[  OK  ]
Building the shared folder support module[  OK  ]
Building the graphics driver module[  OK  ]
Doing non-kernel setup of the Guest Additions[  OK  ]
You should restart your guest to make sure the new modules are actually used


==> host: Checking for guest additions in VM...
==> host: Setting hostname...
==> host: Configuring and enabling network interfaces...
^@==> host: Mounting shared folders...
    host: /vagrant => /Users/XXXXX/development/vagrant
==> host: Running provisioner: ansible_local...
    host: Installing Ansible...
    host: Running ansible-playbook...
cd /vagrant && PYTHONUNBUFFERED=1 ANSIBLE_FORCE_COLOR=true ansible-playbook --limit="all" --inventory-file=provision/inventory -v provision/playbook.yml
Using /vagrant/ansible.cfg as config file

PLAY [host] ********************************************************************

TASK [setup] *******************************************************************
ok: [host]

TASK [provision test] **********************************************************
ok: [host] => {
    "msg": "provision test"
}

PLAY RECAP *********************************************************************
host                       : ok=2    changed=0    unreachable=0    failed=0

vagrant 起動確認

1
2
3
4
5
6
$ vagrant ssh host
[vagrant@host ~]$ ansible --version
ansible 2.2.0.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = Default w/o overrides
[vagrant@host ~]$
ssh 出来て、ansibleのインストールが確認できたらここまでは完了。