Open ikepon opened 6 years ago
➜ ansible_vagrant brew install ansible
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 3 taps (caskroom/cask, heroku/brew, homebrew/core).
==> New Formulae
auditbeat bioawk darksky-weather glances hmmer kumo libtomcrypt mpir sickle visp
augustus blast elektra go-statik jdupes libjwt mmseqs2 opencascade skafos
bedops bwa field3d hlint kallisto librealsense@1 monero orocos-kdl vis
==> Updated Formulae
chromedriver ✔ coffeescript git-annex kitchen-sync mruby pybind11 suite-sparse
elasticsearch ✔ collectd git-cinnabar knot mu pyenv sundials
freetype ✔ collector-sidecar git-cola kobalt mycli pygobject svgcleaner
git ✔ compcert git-remote-hg kompose mypy pygobject3 svtplay-dl
heroku ✔ conan git-secret konoha mysql++ pypy swagger-codegen
heroku/brew/heroku ✔ conjure-up git-town kontena mysql-connector-c++ pypy3 swi-prolog
heroku/brew/heroku-node ✔ coreutils gitbucket kotlin mysql-sandbox pyqt swiftformat
imagemagick ✔ cp2k gjs kpcli mysql@5.5 python swiftlint
libtiff ✔ cppcheck glib kubeless mysql@5.6 python3 sword
mongodb ✔ cppcms gmsh kubernetes-cli mytop pytouhou sync_gateway
mysql ✔ cracklib gmt kubernetes-helm nagios-plugins qca syncthing
node ✔ crosstool-ng gmt@4 lammps nano qd sysbench
postgresql ✔ crowdin gnome-builder languagetool nesc qpdf sysdig
abcmidi cryfs gnome-doc-utils lapack net-snmp qrupdate taisei
abyss crystal-icr gnome-recipes lcm netcdf qscintilla2 taktuk
acpica csvkit gnu-smalltalk ldc nghttp2 qt talloc
agda csvtomd gnumeric ledger ngrep qt@5.7 tcl-tk
amazon-ecs-cli ctop gnupg@2.0 ledger@2.6 nifi quex tclap
angular-cli czmq gnutls lensfun nikto r telegraf
ansible datetime-fortran gobuster libcddb node-build rancher-cli teleport
ansible-lint datomic goffice libcdio node@6 ratfor terraform
antigen davmail gom libcds node@8 rbenv-aliases terraform_landscape
apache-arrow dcm2niix goofys libconfig noti rbenv-binstubs terragrunt
apache-spark dcos-cli googler libdvdcss notmuch rbenv-bundle-exec thefuck
apm-server ddgr gopass libdvdnav nrpe rbenv-bundler thrift
app-engine-go-64 debianutils gpg-agent libdvdread nspr rbenv-bundler-ruby-version thrift@0.9
arangodb dehydrated gradle-completion libgetdata numpy rbenv-chefdk tile38
argon2 dependency-check grc libgig nuxeo rbenv-communal-gems tin
armadillo devd grib-api libgit2-glib nvc rbenv-ctags tintin
armor diff-so-fancy gromacs libgosu octave rbenv-default-gems tnef
arpack diffoscope gron libjson-rpc-cpp offlineimap rbenv-gemset todoman
artifactory digdag groonga liblunar ola rbenv-use tokei
asciinema ditaa grpc libmagic onioncat rbenv-vars tomcat-native
astyle django-completion gsoap libmaxminddb ooniprobe rbenv-whatis tor
ats2-postiats dmd gst-plugins-bad libmonome open-babel re2 tracebox
autogen docfx gst-plugins-base libmpc open-mpi recutils traefik
aws-elasticbeanstalk docker gst-python libmspub open-mpi@1.6 redland trafficserver
aws-sdk-cpp docker-completion gtk+ libpagemaker openblas restic transmission
awscli docker-gen guile libphonenumber opencoarrays rex travis
azure-cli docker-machine-nfs gwyddion libpqxx opencolorio riemann ttf2eot
azure-cli@1 doxygen gxml libpqxx@3 opencv rocksdb ttfautohint
babl doxymacs gzip libpst openshift-cli rom-tools ttyd
backupninja dpkg hadolint libqalculate openssl@1.1 root twoping
bandcamp-dl dub haproxy libre oscats rpm twtxt
bartycrouch duck hashpump librealsense osm2pgrouting rtags txr
basex dungeon haste-client librsvg osm2pgsql rtv u-boot-tools
bash-preexec duplicity hdf5 libsass osquery ruby unbound
bash-snippets e2fsprogs hdf5@1.8 libsigsegv overmind ruby@1.9 unixodbc
bear ejabberd heartbeat libsoup packetbeat ruby@2.0 urh
beast elixir henplus libstfl packmol ruby@2.1 urweb
bento4 elvish hexgui libtasn1 paket ruby@2.2 v8
bettercap emscripten hg-flow libtorrent-rasterbar pandoc ruby@2.3 vapoursynth
betty enchant hh libu2f-server pandoc-citeproc rust vcdimager
binaryen entr hledger libuv pandoc-crossref rustup-init vdirsyncer
bind ephemeralpg homebank libvirt pari s6 veclibfort
binwalk eralchemy htop libvoikko pass sagittarius-scheme verilator
biogeme etcd http-server libxc passpie sassc vim
bit etsh httpd libxml2@2.7 pdf2htmlex sbcl vim@7.4
bitrise exim httpie libzdb pdns sbt vips
blackbox exomizer hugo link-grammar pegtl scalapack voltdb
blastem exploitdb hwloc linkerd percona-server sccache vte
boost-mpi faas-cli hydra liquigraph percona-toolkit scipy vtk
boost-python fabio hypre little-cms percona-xtrabackup scummvm vultr
boost-python@1.59 fades ib llnode pex scummvm-tools w-calc
boost@1.55 fail2ban ibex llvm pg_top selecta watson
boost@1.57 fb-client idnits llvm@3.9 pgloader serialosc weboob
boost@1.59 fd idris llvm@4 pgplot serveit websocketd
boost@1.60 fdclone igv logstash pgpool-ii sfcgal weechat
botan fdroidserver imagemagick@6 logtalk pgrouting shadowsocks-libev whatmp3
bowtie2 feh immortal lwtools pianod shairport-sync whohas
braid fftw influxdb@0.8 lynis picard-tools shfmt whois
bsponmpi fibjs innotop lz4 pick shmcat wiggle
bubbros filebeat inspircd macosvpn pigz shunit2 wine
buku firebase-cli io macvim pilosa shyaml wireshark
bzt flatcc ipython magic-wormhole pipenv silk wpscan
cake flow ipython@5 mame pius simgrid writerperfect
cargo-completion fluid-synth iron-functions mariadb plantuml sip wtf
cask fn irssi mat platformio sjk wwwoffle
cayley fobis iso-codes mdp plplot smlnj wxpython
ccache fonttools jags mercurial pngquant snakemake x3270
ccm format-udf jenkins meson poco snapcraft xapian
ceres-solver fox jenkins-job-builder mesos pod2man snapraid xcenv
certbot freetds jenkins-lts metricbeat ponyc sngrep xmrig
cfengine frugal jetty mikutter ponysay snort xonsh
cgal gammu jetty-runner miller postgis solr xvid
cgrep gauge jfrog-cli-go mingw-w64 postgres-xc sonarqube xxhash
chakra gawk jhipster minio-mc postgresql@9.4 sourcery yaf
chamber gcc jing-trang minizinc postgresql@9.5 spades yara
charm-tools gcc@5 joe mitmproxy postgresql@9.6 spdlog yaze-ag
check_postgres gcc@6 joplin mksh postgrest sphinx yeti
checkstyle gdal json-fortran mkvtoolnix povray sphinx-doc ykpers
chisel gdbm jsvc modules pre-commit spigot you-get
chronograf gdcm juju molecule presto spin youtube-dl
chuck gearman juju-wait monetdb prometheus sql-translator z3
cimg geeqie jump mongo-c-driver proof-general sqlmap zabbix
citus geoip just monitoring-plugins protobuf ssh-audit zero-install
clipper get-flash-videos kafka moreutils protobuf@2.5 sslscan zimg
clojure get_iplayer karn mpd pspg sslsplit znc
closure-compiler ghi kedge mpfi psqlodbc sslyze zookeeper
cmake gifsicle keepassc mpfr pure-ftpd statik zplug
cmark gifski khal mpich pushpin stress-ng zsh
cmark-gfm gimme khard mpv pwntools subversion
cockroach gist kibana mr py3cairo subversion@1.8
==> Deleted Formulae
cloudbees-sdk litmus otto pond
==> Installing dependencies for ansible: libyaml, sqlite, gdbm, python ==> Installing ansible dependency: libyaml ==> Downloading https://homebrew.bintray.com/bottles/libyaml-0.1.7.sierra.bottle.tar.gz ######################################################################## 100.0% ==> Pouring libyaml-0.1.7.sierra.bottle.tar.gz 🍺 /usr/local/Cellar/libyaml/0.1.7: 8 files, 312.6KB ==> Installing ansible dependency: sqlite ==> Downloading https://homebrew.bintray.com/bottles/sqlite-3.21.0.sierra.bottle.tar.gz ######################################################################## 100.0% ==> Pouring sqlite-3.21.0.sierra.bottle.tar.gz ==> Caveats Homebrew has detected an existing SQLite history file that was created with the editline library. The current version of this formula is built with Readline. To back up and convert your history file so that it can be used with Readline, run:
sed -i~ 's/\040/ /g' ~/.sqlite_history
before using the sqlite
command-line tool again. Otherwise, your
history will be lost.
This formula is keg-only, which means it was not symlinked into /usr/local, because macOS provides an older sqlite3.
If you need to have this software first in your PATH run: echo 'export PATH="/usr/local/opt/sqlite/bin:$PATH"' >> ~/.zshrc
For compilers to find this software you may need to set: LDFLAGS: -L/usr/local/opt/sqlite/lib CPPFLAGS: -I/usr/local/opt/sqlite/include For pkg-config to find this software you may need to set: PKG_CONFIG_PATH: /usr/local/opt/sqlite/lib/pkgconfig
==> Summary 🍺 /usr/local/Cellar/sqlite/3.21.0: 11 files, 3.0MB ==> Installing ansible dependency: gdbm ==> Downloading https://homebrew.bintray.com/bottles/gdbm-1.14.1_1.sierra.bottle.tar.gz ######################################################################## 100.0% ==> Pouring gdbm-1.14.1_1.sierra.bottle.tar.gz 🍺 /usr/local/Cellar/gdbm/1.14.1_1: 20 files, 555.8KB ==> Installing ansible dependency: python ==> Downloading https://homebrew.bintray.com/bottles/python-2.7.14_2.sierra.bottle.tar.gz ######################################################################## 100.0% ==> Pouring python-2.7.14_2.sierra.bottle.tar.gz ==> /usr/local/Cellar/python/2.7.14_2/bin/python2 -s setup.py --no-user-cfg install --force --verbose --single-version-externally-managed --record=installed.txt --install-scripts=/usr/local/Cellar/python/ ==> /usr/local/Cellar/python/2.7.14_2/bin/python2 -s setup.py --no-user-cfg install --force --verbose --single-version-externally-managed --record=installed.txt --install-scripts=/usr/local/Cellar/python/ ==> /usr/local/Cellar/python/2.7.14_2/bin/python2 -s setup.py --no-user-cfg install --force --verbose --single-version-externally-managed --record=installed.txt --install-scripts=/usr/local/Cellar/python/ ==> Caveats This formula installs a python2 executable to /usr/local/bin. If you wish to have this formula's python executable in your PATH then add the following to ~/.zshrc: export PATH="/usr/local/opt/python/libexec/bin:$PATH"
Pip and setuptools have been installed. To update them pip2 install --upgrade pip setuptools
You can install Python packages with
pip2 install
They will install into the site-package directory /usr/local/lib/python2.7/site-packages
See: https://docs.brew.sh/Homebrew-and-Python.html ==> Summary 🍺 /usr/local/Cellar/python/2.7.14_2: 3,517 files, 48.4MB ==> Installing ansible ==> Downloading https://homebrew.bintray.com/bottles/ansible-2.4.2.0_2.sierra.bottle.tar.gz ######################################################################## 100.0% ==> Pouring ansible-2.4.2.0_2.sierra.bottle.tar.gz 🍺 /usr/local/Cellar/ansible/2.4.2.0_2: 10,625 files, 134.3MB
➜ ansible_vagrant git:(master) ✗ ansible --version ansible 2.4.2.0 config file = None configured module search path = [u'/Users/ikepon/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules'] ansible python module location = /usr/local/Cellar/ansible/2.4.2.0_2/libexec/lib/python2.7/site-packages/ansible executable location = /usr/local/bin/ansible python version = 2.7.10 (default, Feb 7 2017, 00:08:15) [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)]
記事には vagrant up
で走るってあったけど、設定が悪いのか ansible が走らない...
➜ centos7 git:(master) ✗ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'centos/7' is up to date...
==> default: A newer version of the box 'centos/7' is available! You currently
==> default: have version '1710.01'. The latest is version '1801.01'. Run
==> default: `vagrant box update` to update.
==> 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: Adapter 2: hostonly
==> default: Forwarding ports...
default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> 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: Machine booted and ready!
==> default: Checking for guest additions in VM...
default: No guest additions were detected on the base box for this VM! Guest
default: additions are required for forwarded ports, shared folders, host only
default: networking, and more. If SSH fails on this machine, please install
default: the guest additions and repackage the box to continue.
default:
default: This is not an error message; everything may continue to work properly,
default: in which case you may ignore this message.
==> default: Configuring and enabling network interfaces...
default: SSH address: 127.0.0.1:2222
default: SSH username: vagrant
default: SSH auth method: private key
==> default: Rsyncing folder: /Users/ikepon/ikepon/00_DIG/centos7/ => /vagrant
==> default: Machine already provisioned. Run `vagrant provision` or use the `--provision`
==> default: flag to force provisioning. Provisioners marked to run always will still run.
vagrant provision
を実行したら走った!
➜ centos7 git:(master) ✗ vagrant provision
==> default: Running provisioner: ansible...
Vagrant has automatically selected the compatibility mode '2.0'
according to the Ansible version installed (2.4.2.0).
Alternatively, the compatibility mode can be specified in your Vagrantfile:
https://www.vagrantup.com/docs/provisioning/ansible_common.html#compatibility_mode
default: Running ansible-playbook...
[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
version 2.6. Deprecation warnings can be disabled by setting
deprecation_warnings=False in ansible.cfg.
PLAY [vagrants] ****************************************************************
TASK [Gathering Facts] *********************************************************
ok: [192.168.33.10]
TASK [install packages zsh] ****************************************************
changed: [192.168.33.10]
PLAY RECAP *********************************************************************
192.168.33.10 : ok=2 changed=1 unreachable=0 failed=0
zsh がインストールされてる
[vagrant@localhost ~]$ zsh --version
zsh 5.0.2 (x86_64-redhat-linux-gnu)
もう一回 vagrant provision
を実行すると最後の行の changed が 0 になる。
これですでに実行されているものは、2回目以降は実行されないってのが分かる。
➜ centos7 git:(master) ✗ vagrant provision
==> default: Running provisioner: ansible...
Vagrant has automatically selected the compatibility mode '2.0'
according to the Ansible version installed (2.4.2.0).
Alternatively, the compatibility mode can be specified in your Vagrantfile:
https://www.vagrantup.com/docs/provisioning/ansible_common.html#compatibility_mode
default: Running ansible-playbook...
[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
version 2.6. Deprecation warnings can be disabled by setting
deprecation_warnings=False in ansible.cfg.
PLAY [vagrants] ****************************************************************
TASK [Gathering Facts] *********************************************************
ok: [192.168.33.10]
TASK [install packages zsh] ****************************************************
ok: [192.168.33.10]
PLAY RECAP *********************************************************************
192.168.33.10 : ok=2 changed=0 unreachable=0 failed=0
git をインストール 元々入ってたので、 changed=0 になってる。
➜ centos7 git:(master) ✗ vagrant provision
==> default: Running provisioner: ansible...
Vagrant has automatically selected the compatibility mode '2.0'
according to the Ansible version installed (2.4.2.0).
Alternatively, the compatibility mode can be specified in your Vagrantfile:
https://www.vagrantup.com/docs/provisioning/ansible_common.html#compatibility_mode
default: Running ansible-playbook...
[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
version 2.6. Deprecation warnings can be disabled by setting
deprecation_warnings=False in ansible.cfg.
PLAY [vagrants] ****************************************************************
TASK [Gathering Facts] *********************************************************
ok: [192.168.33.10]
TASK [install packages zsh] ****************************************************
ok: [192.168.33.10]
TASK [install packages git] ****************************************************
ok: [192.168.33.10]
PLAY RECAP *********************************************************************
192.168.33.10 : ok=3 changed=0 unreachable=0 failed=0
https://qiita.com/iamdaisuke/items/46da26b4060ddec18895 この記事を参考に必要そうなものをインストール。 新しくインストールされたもの ⬇️ それ以外はすでに入ってた。
TASK [install packages libyaml-devel] ******************************************
changed: [192.168.33.10]
mkdir の permission がない。 sudo にしてやると、 rbenv がないって言われる。 ユーザーを定義してやれば大丈夫な気はするけど...
fatal: [192.168.33.10]: FAILED! => {"changed": true, "cmd": "bash -lc \"rbenv install 2.5.0\"", "delta": "0:00:31.991281", "end": "2018-01-20 15:38:47.247250", "msg": "non-zero return code", "rc": 1, "start": "2018-01-20 15:38:15.255969", "stderr": "/etc/profile: line 79: rbenv: command not found\nmkdir: cannot create directory ‘/usr/local/rbenv/shims’: Permission denied\nmkdir: cannot create directory ‘/usr/local/rbenv/versions’: Permission denied\nmkdir: cannot create directory ‘/usr/local/rbenv/shims’: Permission denied\nmkdir: cannot create directory ‘/usr/local/rbenv/versions’: Permission denied\nDownloading ruby-2.5.0.tar.bz2...\n-> https://cache.ruby-lang.org/pub/ruby/2.5/ruby-2.5.0.tar.bz2\nInstalling ruby-2.5.0...\nmkdir: cannot create directory ‘/usr/local/rbenv/versions’: Permission denied\n\nBUILD FAILED (CentOS Linux 7 using ruby-build 20171226-3-g01e7b7b)\n\nInspect or clean up the working tree at /tmp/ruby-build.20180120153815.19557\nResults logged to /tmp/ruby-build.20180120153815.19557.log\n\nLast 10 log lines:\n/tmp/ruby-build.20180120153815.19557 ~\n/tmp/ruby-build.20180120153815.19557/ruby-2.5.0 /tmp/ruby-build.20180120153815.19557 ~", "stderr_lines": ["/etc/profile: line 79: rbenv: command not found", "mkdir: cannot create directory ‘/usr/local/rbenv/shims’: Permission denied", "mkdir: cannot create directory ‘/usr/local/rbenv/versions’: Permission denied", "mkdir: cannot create directory ‘/usr/local/rbenv/shims’: Permission denied", "mkdir: cannot create directory ‘/usr/local/rbenv/versions’: Permission denied", "Downloading ruby-2.5.0.tar.bz2...", "-> https://cache.ruby-lang.org/pub/ruby/2.5/ruby-2.5.0.tar.bz2", "Installing ruby-2.5.0...", "mkdir: cannot create directory ‘/usr/local/rbenv/versions’: Permission denied", "", "BUILD FAILED (CentOS Linux 7 using ruby-build 20171226-3-g01e7b7b)", "", "Inspect or clean up the working tree at /tmp/ruby-build.20180120153815.19557", "Results logged to /tmp/ruby-build.20180120153815.19557.log", "", "Last 10 log lines:", "/tmp/ruby-build.20180120153815.19557 ~", "/tmp/ruby-build.20180120153815.19557/ruby-2.5.0 /tmp/ruby-build.20180120153815.19557 ~"], "stdout": "", "stdout_lines": []}
sudo 付ける
fatal: [192.168.33.10]: FAILED! => {"changed": true, "cmd": "bash -lc \"rbenv versions\"", "delta": "0:00:00.013011", "end": "2018-01-20 15:44:23.632614", "msg": "non-zero return code", "rc": 127, "start": "2018-01-20 15:44:23.619603", "stderr": "/etc/profile: line 79: rbenv: command not found\n/root/.bash_profile: line 14: rbenv: command not found\n/root/.bash_profile: line 16: rbenv: command not found\n/root/.bash_profile: line 18: rbenv: command not found\n/root/.bash_profile: line 20: rbenv: command not found\n/root/.bash_profile: line 22: rbenv: command not found\nbash: rbenv: command not found", "stderr_lines": ["/etc/profile: line 79: rbenv: command not found", "/root/.bash_profile: line 14: rbenv: command not found", "/root/.bash_profile: line 16: rbenv: command not found", "/root/.bash_profile: line 18: rbenv: command not found", "/root/.bash_profile: line 20: rbenv: command not found", "/root/.bash_profile: line 22: rbenv: command not found", "bash: rbenv: command not found"], "stdout": "", "stdout_lines": []}
参考にした記事