はじめに
ansible を使ってみました。備忘としてインストールとアップデート手順を残しておきます。
環境
$ cat /etc/redhat-release CentOS Linux release 7.6.1810 (Core)
インストール手順
pip を使って、ansible をインストールします。
$ sudo pip2 install ansible
動作確認
ping で動作確認します。
$ ansible localhost -m ping
動作確認の結果を確認します。 SUCCESS が表示されれば成功です。
[WARNING]: Unable to parse /etc/ansible/hosts as an inventory source
[WARNING]: No inventory was parsed, only implicit localhost is available
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit
localhost does not match 'all'
localhost | SUCCESS => {
"changed": false,
"ping": "pong"
}
ansible のアップグレード
通常は、pip を使って以下のようにアップデートします。
$ sudo pip2 install -U ansible
バージョンを指定したい場合は、以下のようにアップデート可能です。
$ sudo pip2 install ansible==2.2.1.0
開発最新版を使いたい場合は、以下のようにアップデート可能です。
$ sudo pip2 install git+https://github.com/ansible/ansible.git@devel
参考資料

- 作者: 廣川英寿,平初,橋本直哉,森田邦裕,渡辺一宏
- 出版社/メーカー: 翔泳社
- 発売日: 2017/03/21
- メディア: Kindle版
- この商品を含むブログを見る