少しややこしい ansible まわりのバージョン表記
ansible 2.10 から、ansible-base(2.10)や、ansible-core(2.11から)というコア部分のパッケージと、各種コレクションも含むパッケージ(Ansible community packageと呼ばれたりします)が登場しました。
pip install ansible-core でコア部分、pip isntall ansible でパッケージ含むものがインストールされます。少しややこしいのが、それぞれのパッケージごとにバージョン体系が異なる点です。たとえば、以下のようなバージョンの対応です。
ansible-core |
ansible |
|---|---|
2.11 |
4 |
2.12 |
5 |
2.13 |
6 |
そして、ansible --version の出力は ansible-core としてのバージョンです。つまり、たとえば pip install ansible==6.0.0 でインストールすると、ansible --version の結果は 2.13 系になります。
ansible としてのバージョンは、pip list で確認できます。
$ pip list Package Version ------------ ------- ansible 6.0.0 ansible-core 2.13.1
ansible-community --version で ansible としてのバージョンが表示される
ansible 6 で、ansible-community コマンドが追加されました。現状、実質 --version オプションしかありません。
$ ansible-community -h usage: ansible-community [-h] [--version] optional arguments: -h, --help show this help message and exit --version show the version of the Ansible community package
ansible-community --version で Ansible community package のバージョンを表示するとこんな感じになります。
$ ansible-community --version Ansible community version 6.0.0
ちなみに、ansible-community コマンド中身を調べるとこうなってました。
$ which ansible-community
/home/ansible/envs/a6/bin/ansible-community
$ cat /home/ansible/envs/a6/bin/ansible-community
#!/home/ansible/envs/a6/bin/python3.9
# -*- coding: utf-8 -*-
import re
import sys
from ansible_collections.ansible_community import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(main())