3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

AWSのEC2へのAnsibleの確認(ping)

Last updated at Posted at 2017-11-25

作業メモ

VPSからAWSへのEC2へのAnsibleの接続テストではまったのでメモ

ベース

コマンド

ansible all -i ansible_hosts --private-key=.ssh/XXXXXX.pem -m ping -u ec2-user

準備

ansible_hosts
# EC2のIPアドレス
xxx.xxx.xxx.xxx

実行結果

ansible all -i ansible_hosts --private-key=.ssh/XXXXXX.pem -m ping -u ec2-user
xxx.xxx.xxx.xxx | SUCCESS => {
    "changed": false, 
    "failed": false, 
    "ping": "pong"
}

オプション

オプション 内容
-i hostsファイルの指定 -i ansible_hosts
--private-key 秘密鍵の指定 --private-key=.ssh/XXXXXX.pem
-m ansibleのモジュール指定(今回は疎通確認のためping) -m ping
-u ユーザ指定 -u ec2-user

参考URL

Ansibleのドキュメントを読んでみたメモ

3
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?