AmazonLinuxにAnsibleをインストール

表題の通り。前に書いたような気もするのだが、検索してみるとCentOSしか書いていなかったので書いてしまう。

■ 環境

  • Ansible 2.2.1.0
  • Amazon Linux

■ version

ローカルのMacにおけるansibleのversionは下記の通りである。Homebrewでインストールしている。

$ ansible --version
ansible 2.2.1.0
  config file =
  configured module search path = Default w/o overrides
$

できればこのversionにAmazonLinuxでも合わせたい。

■ Amazon Linux

とりあえず検索。

$ sudo yum search ansible
読み込んだプラグイン:priorities, update-motd, upgrade-helper
警告: 一致するものが見つかりません: ansible
No matches found
$

だそうである。ではEPELレポジトリで確認する。

$ sudo yum --enablerepo=epel search ansible
読み込んだプラグイン:priorities, update-motd, upgrade-helper
981 packages excluded due to repository priority protections
================== N/S matched: ansible ===========================
ansible-inventory-grapher.noarch : Creates graphs representing ansible inventory
ansible-lint.noarch : Best practices checker for Ansible
python2-ansible-tower-cli.noarch : A CLI tool for Ansible Tower
ansible.noarch : SSH-based configuration management, deployment, and task execution system
ansible1.9.noarch : SSH-based configuration management, deployment, and task execution system

  Name and summary matches only, use "search all" for everything.
$

EPELレポジトリには存在するようだ。versionを確認する。

$ sudo yum --enablerepo=epel info ansible
読み込んだプラグイン:priorities, update-motd, upgrade-helper
981 packages excluded due to repository priority protections
インストール済みパッケージ
名前           : ansible
アーキテクチャー   : noarch
バージョン       : 2.2.1.0
リリース         : 1.el6
容量           : 22 M
リポジトリー      : installed
提供元リポジトリー : epel
要約           : SSH-based configuration management, deployment, and task execution system
URL           : http://ansible.com
ライセンス      : GPLv3+
説明          :
             : Ansible is a radically simple model-driven configuration management,
             : multi-node deployment, and remote task execution system. Ansible works
             : over SSH and does not require any software or daemons to be installed
             : on remote nodes. Extension modules can be written in any language and
            : are transferred to managed machines automatically.

$

versionもMacに入れていたものと変わらない。これをインストールする。

$ sudo yum --enablerepo=epel install ansible

インストールできた。

$ ansible --version
ansible 2.2.1.0
  config file = 
  configured module search path = Default w/o overrides
$

以上。

■ 関連

CentOSにAnsibleをインストール

Ubuntu 16.04をAnsibleで構築

ansible実行時のエラー