質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
CentOS

CentOSは、主にRed Hat Enterprise Linux(RHEL)をベースにした、フリーのソフトウェアオペレーティングシステムです。

MacOS(OSX)

MacOSとは、Appleの開発していたGUI(グラフィカルユーザーインターフェース)を採用したオペレーションシステム(OS)です。Macintoshと共に、市場に出てGUIの普及に大きく貢献しました。

VirtualBox

VirtualBoxは、現在米オラクル社が開発している、 x86仮想化ソフトウェア・パッケージの一つです。

Vagrant

Vagrantは、VirtualBox上の仮想マシンを コマンドラインから作成してくれるソフトウェアです。 ビルド環境など容易に構築が可能です。

Ansible

Ansibleは、Python で書かれたサーバーの設定を管理するための 構成管理ツールです。

Q&A

1回答

4302閲覧

Ansibleでteratermマクロの使い方

roronoazoro

総合スコア113

CentOS

CentOSは、主にRed Hat Enterprise Linux(RHEL)をベースにした、フリーのソフトウェアオペレーティングシステムです。

MacOS(OSX)

MacOSとは、Appleの開発していたGUI(グラフィカルユーザーインターフェース)を採用したオペレーションシステム(OS)です。Macintoshと共に、市場に出てGUIの普及に大きく貢献しました。

VirtualBox

VirtualBoxは、現在米オラクル社が開発している、 x86仮想化ソフトウェア・パッケージの一つです。

Vagrant

Vagrantは、VirtualBox上の仮想マシンを コマンドラインから作成してくれるソフトウェアです。 ビルド環境など容易に構築が可能です。

Ansible

Ansibleは、Python で書かれたサーバーの設定を管理するための 構成管理ツールです。

0グッド

0クリップ

投稿2017/08/10 08:31

編集2017/08/11 09:54

Ansibleのインストールについて質問です。
現在下記サイトを参考に学習を進めております。

Ansibleをはじめる人に。

自分のVagrantfileの設定は下記です。
ボックスイメージの違いのみでそれ以外は参考サイトの通りに進めたつもりです。

現在わからない点がteratermマクロを作ったのを使ってくださいとあり、その使い方がわかりません。
ファイルを作るのか、Vagrantfileに書き込むのか迷っています。
ここでいうマクロの使い方を教えていただきたく思います。
一応自分のVagrantfileも載せておきます。
読解力の部分となりそうで、恐縮ですがよろしくお願いします。

vagrantfile

bash

1# -*- mode: ruby -*- 2# vi: set ft=ruby : 3 4# All Vagrant configuration is done below. The "2" in Vagrant.configure 5# configures the configuration version (we support older styles for 6# backwards compatibility). Please don't change it unless you know what 7# you're doing. 8Vagrant.configure("2") do |config| 9 config.vm.define "controller" do |node| 10 node.vm.box = "centos/7" 11 node.vm.hostname = "controller" 12 node.vm.network :private_network, ip: "192.168.100.10" 13 node.vm.network :forwarded_port, id: "ssh", guest: 22, host: 2210 14 end 15 config.vm.define "target" do |node| 16 node.vm.box = "centos/7" 17 node.vm.hostname = "target" 18 node.vm.network :private_network, ip: "192.168.100.20" 19 node.vm.network :forwarded_port, id: "ssh", guest: 22, host: 2220 20 end 21 22 # The most common configuration options are documented and commented below. 23 # For a complete reference, please see the online documentation at 24 # https://docs.vagrantup.com. 25 26 # Every Vagrant development environment requires a box. You can search for 27 # boxes at https://vagrantcloud.com/search. 28 config.vm.box = "centos/7" 29 30 # Disable automatic box update checking. If you disable this, then 31 # boxes will only be checked for updates when the user runs 32 # `vagrant box outdated`. This is not recommended. 33 # config.vm.box_check_update = false 34 35 # Create a forwarded port mapping which allows access to a specific port 36 # within the machine from a port on the host machine. In the example below, 37 # accessing "localhost:8080" will access port 80 on the guest machine. 38 # NOTE: This will enable public access to the opened port 39 # config.vm.network "forwarded_port", guest: 80, host: 8080 40 41 # Create a forwarded port mapping which allows access to a specific port 42 # within the machine from a port on the host machine and only allow access 43 # via 127.0.0.1 to disable public access 44 # config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "127.0.0.1" 45 46 # Create a private network, which allows host-only access to the machine 47 # using a specific IP. 48 config.vm.network "private_network", ip: "192.168.33.10" 49 50 # Create a public network, which generally matched to bridged network. 51 # Bridged networks make the machine appear as another physical device on 52 # your network. 53 # config.vm.network "public_network" 54 55 # Share an additional folder to the guest VM. The first argument is 56 # the path on the host to the actual folder. The second argument is 57 # the path on the guest to mount the folder. And the optional third 58 # argument is a set of non-required options. 59 # config.vm.synced_folder "../data", "/vagrant_data" 60 61 # Provider-specific configuration so you can fine-tune various 62 # backing providers for Vagrant. These expose provider-specific options. 63 # Example for VirtualBox: 64 # 65 # config.vm.provider "virtualbox" do |vb| 66 # # Display the VirtualBox GUI when booting the machine 67 # vb.gui = true 68 # 69 # # Customize the amount of memory on the VM: 70 # vb.memory = "1024" 71 # end 72 # 73 # View the documentation for the provider you are using for more 74 # information on available options. 75 76 # Enable provisioning with a shell script. Additional provisioners such as 77 # Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the 78 # documentation for more information about their specific syntax and use. 79 # config.vm.provision "shell", inline: <<-SHELL 80 # apt-get update 81 # apt-get install -y apache2 82 # SHELL 83end 84

8/11追記

bash

1$sudo yum install ansible 2 3Loaded plugins: fastestmirror 4Loading mirror speeds from cached hostfile 5 * base: ftp.tsukuba.wide.ad.jp 6 * extras: ftp.tsukuba.wide.ad.jp 7 * updates: ftp.tsukuba.wide.ad.jp 8No package ansible available. 9Error: Nothing to do

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

Macをお使いですか?MacにはTera Termはありませんのでttlマクロは動きません。

Windowsならば、teratermフォルダのttpmacro.exeに関連付けしてください。

投稿2017/08/10 08:41

naga3

総合スコア1293

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

roronoazoro

2017/08/10 08:50

早速のご回答ありがとうございます。 はい、macを使用しております。そうだったのですね。 こちらの対策としてVagrantfileに記載しても問題ないのでしょうか?
chelsy7110

2017/08/10 09:01

macでしたらVagrantfileに何も記載せずにターミナルで $ vagrant ssh を実行すると繋がりませんか?
roronoazoro

2017/08/11 09:56

sshで繋がるとこまでは確認できているのですが、マクロの部分を飛ばしたからなのか、ansibleをインストールしようとするとエラーになります。現在エラー究明中です。 エラー文については本文に追記しました。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだベストアンサーが選ばれていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問