はじめに
2020/06/21 に、YouTube Live で「つまずき Ansible 【Part7】Ansible 2.10.0b1 でずっこける」という配信をしました。 実際に作業しながらエラーと戦って進めるシリーズです。
今回は、前日リリースされた Ansible 2.10.0b1 をインストールして、既存の Playbook が動くかどうか試しました。
※ 現時点で私が分かっている範囲での情報です。特に Collection に関しては Ansible Collections Overviewをウォッチされることをお勧めします。
つまずいたエラーと原因、対処をふりかえります。
動画
■ その前に: Ansible 2.10 とは?
次の Ansible のリリースバージョン
- 現在は Ansible 2.10.0b1
- 2020年8月にリリース予定
多くのモジュールが Collection へ移行
- 今までモジュール込み込みだったが、多くのモジュールが Collection へ移行
- Ansible 本体と、モジュールのリリースサイクルの依存をなくすため(個人的解釈)
- 「本体は安定利用したい」と「新機能を早く使いたい」を両立(個人的解釈)
- 詳細: Collections signal major shift in Ansible ecosystem
- Ansible 本体は
ansible-base
として扱われる - 詳細: Ansible Collections Overview
- その他情報
ansible-base
の changelog- Collection へ移行したものは collection 側を確認
- Porting Guide
Collection とは
- モジュール、プラグイン、ロールなどを含む新しい配布形式
- コミュニティとしては Ansible Galaxy 経由で配布される
community.general
やcisco.ios
のように名前空間が設けられる- モジュール名は
cisco.ios.ios_config
のような指定 - 移行のしやすさを考慮し、以前のモジュール名の指定で移行先 Collection 名を暗黙的に解決する仕組みがある
- "Routing data built into Ansible 2.10 ensures that 2.9 content should work unmodified on 2.10. Formerly included modules and plugins that were moved to collections are still accessible by their original unqualified names, so long as their destination collections are installed."
- ただし、該当 Collection のインストールは必要
- モジュール名は
- その他情報
[2020/06/22 追記]
pip install ansible==2.10.0a1
でインストールしたら、ansible 2.10.0b1 とともに、今までのモジュールたちが collection 経由でインストールされました。対象のコレクションのバージョンはこちらで定義されているようです。
正式リリース時は、単に pip install ansible
で ansible 2.10.0 と今までのモジュールがインストールされるかもしれません。
今回配信の内容は、あくまでこの時点にこの手順でやったらこうなった、という程度に留めていただければと思います。
■ インストール
pip install ansible==2.10.0b0
でインストールできない
以下のエラー。
(a210) [vagrant@stumble ~]$ pip install ansible==2.10.0b1 Collecting ansible==2.10.0b1 Could not find a version that satisfies the requirement ansible==2.10.0b1 (from versions: 1.0, 1.1, 1.2, 1.2.1, 1.2.2, 1.2.3, 1.3.0, 1.3.1, 1.3.2, 1.3.3, 1.3.4, 1.4, 1.4.1, 1.4.2, 1.4.3, 1.4.4, 1.4.5, 1.5, 1.5.1, 1.5.2, 1.5.3, 1.5.4, 1.5.5, 1.6, 1.6.1, 1.6.2, 1.6.3, 1.6.4, 1.6.5, 1.6.6, 1.6.7, 1.6.8, 1.6.9, 1.6.10, 1.7, 1.7.1, 1.7.2, 1.8, 1.8.1, 1.8.2, 1.8.3, 1.8.4, 1.9.0.1, 1.9.1, 1.9.2, 1.9.3, 1.9.4, 1.9.5, 1.9.6, 2.0.0.0, 2.0.0.1, 2.0.0.2, 2.0.1.0, 2.0.2.0, 2.1.0.0, 2.1.1.0, 2.1.2.0, 2.1.3.0, 2.1.4.0, 2.1.5.0, 2.1.6.0, 2.2.0.0, 2.2.1.0, 2.2.2.0, 2.2.3.0, 2.3.0.0, 2.3.1.0, 2.3.2.0, 2.3.3.0, 2.4.0.0, 2.4.1.0, 2.4.2.0, 2.4.3.0, 2.4.4.0, 2.4.5.0, 2.4.6.0, 2.5.0a1, 2.5.0b1, 2.5.0b2, 2.5.0rc1, 2.5.0rc2, 2.5.0rc3, 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.5.5, 2.5.6, 2.5.7, 2.5.8, 2.5.9, 2.5.10, 2.5.11, 2.5.12, 2.5.13, 2.5.14, 2.5.15, 2.6.0a1, 2.6.0a2, 2.6.0rc1, 2.6.0rc2, 2.6.0rc3, 2.6.0rc4, 2.6.0rc5, 2.6.0, 2.6.1, 2.6.2, 2.6.3, 2.6.4, 2.6.5, 2.6.6, 2.6.7, 2.6.8, 2.6.9, 2.6.10, 2.6.11, 2.6.12, 2.6.13, 2.6.14, 2.6.15, 2.6.16, 2.6.17, 2.6.18, 2.6.19, 2.6.20, 2.7.0.dev0, 2.7.0a1, 2.7.0b1, 2.7.0rc1, 2.7.0rc2, 2.7.0rc3, 2.7.0rc4, 2.7.0, 2.7.1, 2.7.2, 2.7.3, 2.7.4, 2.7.5, 2.7.6, 2.7.7, 2.7.8, 2.7.9, 2.7.10, 2.7.11, 2.7.12, 2.7.13, 2.7.14, 2.7.15, 2.7.16, 2.7.17, 2.7.18, 2.8.0a1, 2.8.0b1, 2.8.0rc1, 2.8.0rc2, 2.8.0rc3, 2.8.0, 2.8.1, 2.8.2, 2.8.3, 2.8.4, 2.8.5, 2.8.6, 2.8.7, 2.8.8, 2.8.9, 2.8.10, 2.8.11, 2.8.12, 2.9.0b1, 2.9.0rc1, 2.9.0rc2, 2.9.0rc3, 2.9.0rc4, 2.9.0rc5, 2.9.0, 2.9.1, 2.9.2, 2.9.3, 2.9.4, 2.9.5, 2.9.6, 2.9.7, 2.9.8, 2.9.9, 2.9.10, 2.10.0a1) No matching distribution found for ansible==2.10.0b1 You are using pip version 9.0.3, however version 20.1.1 is available. You should consider upgrading via the 'pip install --upgrade pip' command.
原因
(少なくとも現状は)ansible
ではなく ansible-base
をパッケージ名で指定する必要がある。
対処
以下のコマンドで ansible-base
をインストール。
(a210) [vagrant@stumble ~]$ pip install ansible-base==2.10.0b1 Collecting ansible-base==2.10.0b1 Downloading https://files.pythonhosted.org/packages/14/40/8c71ee17f6568b831463fd0de02c8ff87227776bda688def4de4da30747e/ansible-base-2.10.0b1.tar.gz (5.7MB) 100% |████████████████████████████████| 5.7MB 76kB/s ...(略)... (a210) [vagrant@stumble ~]$ ansible --version ansible 2.10.0b1 config file = None configured module search path = ['/home/vagrant/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /home/vagrant/envs/a210/lib64/python3.6/site-packages/ansible executable location = /home/vagrant/envs/a210/bin/ansible python version = 3.6.8 (default, Apr 2 2020, 13:34:55) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]
■ ios_command
モジュールの使用
ios_command
が見つからないエラーが発生
以下のエラー。
(a210) [vagrant@stumble stumble]$ ansible-playbook -i inventory.ini ios_show.yml ERROR! couldn't resolve module/action 'ios_command'. This often indicates a misspelling, missing collection, or incorrect module path. The error appears to be in '/vagrant/stumble/ios_show.yml': line 7, column 7, but may be elsewhere in the file depending on the exact syntax problem. The offending line appears to be: tasks: - name: show version ^ here : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
原因
ios_command
モジュールは、標準では入らなくなり、cisco.ios
collection に移行したため。
対処
cisco.ios
collection をインストールする。
(a210) [vagrant@stumble stumble]$ ansible-galaxy collection install cisco.ios Starting galaxy collection install process Process install dependency map Starting collection install process Installing 'cisco.ios:0.0.3' to '/home/vagrant/.ansible/collections/ansible_collections/cisco/ios' Installing 'ansible.netcommon:0.0.3' to '/home/vagrant/.ansible/collections/ansible_collections/ansible/netcommon'
yaml
コールバックプラグインがないエラーが発生
ansible-doc yaml -t plugin
でヘルプが表示されない。
原因
yaml コールバックプラグインは、標準では入らなくなり community.genal collection
へ移行したため。
対処
community.genal collection
をインストールする。
(a210) [vagrant@stumble stumble]$ ansible-galaxy collection install community.general Starting galaxy collection install process Process install dependency map Starting collection install process Installing 'community.general:0.2.0' to '/home/vagrant/.ansible/collections/ansible_collections/community/general' Installing 'google.cloud:0.0.9' to '/home/vagrant/.ansible/collections/ansible_collections/google/cloud' Installing 'ansible.posix:0.1.3' to '/home/vagrant/.ansible/collections/ansible_collections/ansible/posix' Skipping 'ansible.netcommon' as it is already installed Installing 'community.kubernetes:0.11.0' to '/home/vagrant/.ansible/collections/ansible_collections/community/kubernetes'
インストールした collection 一覧の確認
(a210) [vagrant@stumble stumble]$ ansible-galaxy collection list # /home/vagrant/.ansible/collections/ansible_collections Collection Version -------------------- ------- ansible.netcommon 0.0.3 ansible.posix 0.1.3 cisco.ios 0.0.3 community.general 0.2.0 community.kubernetes 0.11.0 google.cloud 0.0.9
■ yum
モジュールの使用
You need to be root to perform this command.
というエラーが発生。(Ansiible 2.10 とは無関係)
以下のエラー。
TASK [yum] ****************************************************************************************************************** fatal: [localhost]: FAILED! => changed=false ansible_facts: discovered_interpreter_python: /usr/bin/python changes: installed: - httpd msg: |- You need to be root to perform this command. rc: 1 results: - |- Loaded plugins: fastestmirror
原因
特権が必要なタスクに対して、become: true
の指定がない。
対処
become: true
を追加
おまけ
閲覧したサイト
全実行ログ
クリックして開く
bash: ansible: command not found (a210) [vagrant@stumble ~]$ (a210) [vagrant@stumble ~]$ pip instal ansible==2.10.0b1 ERROR: unknown command "instal" - maybe you meant "install" (a210) [vagrant@stumble ~]$ pip install ansible==2.10.0b1 Collecting ansible==2.10.0b1 Could not find a version that satisfies the requirement ansible==2.10.0b1 (from versions: 1.0, 1.1, 1.2, 1.2.1, 1.2.2, 1.2.3, 1.3.0, 1.3.1, 1.3.2, 1.3.3, 1.3.4, 1.4, 1.4.1, 1.4.2, 1.4.3, 1.4.4, 1.4.5, 1.5, 1.5.1, 1.5.2, 1.5.3, 1.5.4, 1.5.5, 1.6, 1.6.1, 1.6.2, 1.6.3, 1.6.4, 1.6.5, 1.6.6, 1.6.7, 1.6.8, 1.6.9, 1.6.10, 1.7, 1.7.1, 1.7.2, 1.8, 1.8.1, 1.8.2, 1.8.3, 1.8.4, 1.9.0.1, 1.9.1, 1.9.2, 1.9.3, 1.9.4, 1.9.5, 1.9.6, 2.0.0.0, 2.0.0.1, 2.0.0.2, 2.0.1.0, 2.0.2.0, 2.1.0.0, 2.1.1.0, 2.1.2.0, 2.1.3.0, 2.1.4.0, 2.1.5.0, 2.1.6.0, 2.2.0.0, 2.2.1.0, 2.2.2.0, 2.2.3.0, 2.3.0.0, 2.3.1.0, 2.3.2.0, 2.3.3.0, 2.4.0.0, 2.4.1.0, 2.4.2.0, 2.4.3.0, 2.4.4.0, 2.4.5.0, 2.4.6.0, 2.5.0a1, 2.5.0b1, 2.5.0b2, 2.5.0rc1, 2.5.0rc2, 2.5.0rc3, 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.5.5, 2.5.6, 2.5.7, 2.5.8, 2.5.9, 2.5.10, 2.5.11, 2.5.12, 2.5.13, 2.5.14, 2.5.15, 2.6.0a1, 2.6.0a2, 2.6.0rc1, 2.6.0rc2, 2.6.0rc3, 2.6.0rc4, 2.6.0rc5, 2.6.0, 2.6.1, 2.6.2, 2.6.3, 2.6.4, 2.6.5, 2.6.6, 2.6.7, 2.6.8, 2.6.9, 2.6.10, 2.6.11, 2.6.12, 2.6.13, 2.6.14, 2.6.15, 2.6.16, 2.6.17, 2.6.18, 2.6.19, 2.6.20, 2.7.0.dev0, 2.7.0a1, 2.7.0b1, 2.7.0rc1, 2.7.0rc2, 2.7.0rc3, 2.7.0rc4, 2.7.0, 2.7.1, 2.7.2, 2.7.3, 2.7.4, 2.7.5, 2.7.6, 2.7.7, 2.7.8, 2.7.9, 2.7.10, 2.7.11, 2.7.12, 2.7.13, 2.7.14, 2.7.15, 2.7.16, 2.7.17, 2.7.18, 2.8.0a1, 2.8.0b1, 2.8.0rc1, 2.8.0rc2, 2.8.0rc3, 2.8.0, 2.8.1, 2.8.2, 2.8.3, 2.8.4, 2.8.5, 2.8.6, 2.8.7, 2.8.8, 2.8.9, 2.8.10, 2.8.11, 2.8.12, 2.9.0b1, 2.9.0rc1, 2.9.0rc2, 2.9.0rc3, 2.9.0rc4, 2.9.0rc5, 2.9.0, 2.9.1, 2.9.2, 2.9.3, 2.9.4, 2.9.5, 2.9.6, 2.9.7, 2.9.8, 2.9.9, 2.9.10, 2.10.0a1) No matching distribution found for ansible==2.10.0b1 You are using pip version 9.0.3, however version 20.1.1 is available. You should consider upgrading via the 'pip install --upgrade pip' command. (a210) [vagrant@stumble ~]$ pip install ansible-base==2.10.0b1 Collecting ansible-base==2.10.0b1 Downloading https://files.pythonhosted.org/packages/14/40/8c71ee17f6568b831463fd0de02c8ff87227776bda688def4de4da30747e/ansible-base-2.10.0b1.tar.gz (5.7MB) 100% |████████████████████████████████| 5.7MB 76kB/s Collecting jinja2 (from ansible-base==2.10.0b1) Using cached https://files.pythonhosted.org/packages/30/9e/f663a2aa66a09d838042ae1a2c5659828bb9b41ea3a6efa20a20fd92b121/Jinja2-2.11.2-py2.py3-none-any.whl Collecting PyYAML (from ansible-base==2.10.0b1) Using cached https://files.pythonhosted.org/packages/64/c2/b80047c7ac2478f9501676c988a5411ed5572f35d1beff9cae07d321512c/PyYAML-5.3.1.tar.gz Collecting cryptography (from ansible-base==2.10.0b1) Using cached https://files.pythonhosted.org/packages/58/95/f1282ca55649b60afcf617e1e2ca384a2a3e7a5cf91f724cf83c8fbe76a1/cryptography-2.9.2-cp35-abi3-manylinux1_x86_64.whl Collecting packaging (from ansible-base==2.10.0b1) Downloading https://files.pythonhosted.org/packages/46/19/c5ab91b1b05cfe63cccd5cfc971db9214c6dd6ced54e33c30d5af1d2bc43/packaging-20.4-py2.py3-none-any.whl Collecting MarkupSafe>=0.23 (from jinja2->ansible-base==2.10.0b1) Using cached https://files.pythonhosted.org/packages/b2/5f/23e0023be6bb885d00ffbefad2942bc51a620328ee910f64abe5a8d18dd1/MarkupSafe-1.1.1-cp36-cp36m-manylinux1_x86_64.whl Collecting six>=1.4.1 (from cryptography->ansible-base==2.10.0b1) Using cached https://files.pythonhosted.org/packages/ee/ff/48bde5c0f013094d729fe4b0316ba2a24774b3ff1c52d924a8a4cb04078a/six-1.15.0-py2.py3-none-any.whl Collecting cffi!=1.11.3,>=1.8 (from cryptography->ansible-base==2.10.0b1) (a210) [vagrant@stumble ~]$ ansible --version ansible 2.10.0b1 config file = None configured module search path = ['/home/vagrant/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /home/vagrant/envs/a210/lib64/python3.6/site-packages/ansible executable location = /home/vagrant/envs/a210/bin/ansible python version = 3.6.8 (default, Apr 2 2020, 13:34:55) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] (a210) [vagrant@stumble ~]$ ansible-doc junos_config [WARNING]: module junos_config not found in: /home/vagrant/.ansible/plugins/modules:/usr/share/ansible/plugins/modules:/home/vagrant/envs/a210/lib64/python3.6/site-packages/ansible/modules (a210) [vagrant@stumble ~]$ (a210) [vagrant@stumble ~]$ (a210) [vagrant@stumble ~]$ pwd /home/vagrant (a210) [vagrant@stumble stumble]$ ansible-playbook -i inventory.ini ios_show.yml ^C (a210) [vagrant@stumble stumble]$ (a210) [vagrant@stumble stumble]$ (a210) [vagrant@stumble stumble]$ rm -fr ~/.ansible/ pc/ tmp/ (a210) [vagrant@stumble stumble]$ ansible-playbook -i inventory.ini ios_show.yml ERROR! couldn't resolve module/action 'ios_command'. This often indicates a misspelling, missing collection, or incorrect module path. The error appears to be in '/vagrant/stumble/ios_show.yml': line 7, column 7, but may be elsewhere in the file depending on the exact syntax problem. The offending line appears to be: tasks: - name: show version ^ here (a210) [vagrant@stumble stumble]$ ansible-galaxy collection install cisco.ios Starting galaxy collection install process Process install dependency map Starting collection install process Installing 'cisco.ios:0.0.3' to '/home/vagrant/.ansible/collections/ansible_collections/cisco/ios' Installing 'ansible.netcommon:0.0.3' to '/home/vagrant/.ansible/collections/ansible_collections/ansible/netcommon' (a210) [vagrant@stumble stumble]$ (a210) [vagrant@stumble stumble]$ (a210) [vagrant@stumble stumble]$ (a210) [vagrant@stumble stumble]$ ansible-doc ios_command > IOS_COMMAND (/home/vagrant/.ansible/collections/ansible_collections/cisco/ios/plugins/modules/ios_command.py) Sends arbitrary commands to an ios node and returns the results read from the device. This module includes an argument that will cause the module to wait for a specific condition before returning or timing out if the condition is not met. This module does not support running commands in configuration mode. Please use [ios_config] to configure IOS devices. OPTIONS (= is mandatory): = commands List of commands to send to the remote ios device over the configured provider. The resulting output from the command is returned. If the `wait_for' argument is provided, the module is not returned until the condition is satisfied or the number of retries has expired. If a command sent to the device requires answering a prompt, it is possible to pass a dict containing `command', `answer' and `prompt'. Common answers are 'y' or "\r" (carriage return, must be double quotes). See examples. - interval Configures the interval in seconds to wait between retries of the command. If the command does not pass the specified conditions, the interval indicates how long to wait before trying the command again. [Default: 1] - match The `match' argument is used in conjunction with the `wait_for' argument to specify the match policy. Valid values are `all' or `any'. If the value is set to `all' then all conditionals in the wait_for must be satisfied. If the value is set to `any' then only one of the values must be satisfied. (Choices: any, all)[Default: all] - provider *Deprecated* Starting with Ansible 2.5 we recommend using `connection: network_cli'. For more information please see the L(IOS Platform Options guide, ../network/user_guide/platform_ios.html). HORIZONTALLINE A dict object containing connection details. [Default: (null)] type: dict SUBOPTIONS: - auth_pass Specifies the password to use if required to enter privileged mode on the remote device. If `authorize' is false, then this argument does nothing. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_AUTH_PASS' will be used instead. [Default: (null)] type: str - authorize Instructs the module to enter privileged mode on the remote device before sending any commands. If not specified, the device will attempt to execute all commands in non-privileged mode. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_AUTHORIZE' will be used instead. [Default: False] type: bool = host Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. type: str - password (a210) [vagrant@stumble stumble]$ ansible-doc debug > DEBUG (/home/vagrant/envs/a210/lib64/python3.6/site-packages/ansible/modules/debug.py) This module prints statements during execution and can be useful for debugging variables or expressions without necessarily halting the playbook. Useful for debugging together with the 'when:' directive. This module is also supported for Windows targets. * note: This module has a corresponding action plugin. OPTIONS (= is mandatory): - msg The customized message that is printed. If omitted, prints a generic message. [Default: Hello world!] type: str (a210) [vagrant@stumble stumble]$ ansible-doc cisco.ios.ios_command (a210) [vagrant@stumble stumble]$ ansible-playbook -i inventory.ini ios_show.yml PLAY [rt01] *************************************************************************************************************************************** TASK [show version] ******************************************************************************************************************************* fatal: [rt01]: FAILED! => {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python"}, "changed": false, "msg": "paramiko is not installed: No module named 'paramiko'"} PLAY RECAP **************************************************************************************************************************************** rt01 : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0 (a210) [vagrant@stumble stumble]$ pip install paramiko Collecting paramiko Using cached https://files.pythonhosted.org/packages/06/1e/1e08baaaf6c3d3df1459fd85f0e7d2d6aa916f33958f151ee1ecc9800971/paramiko-2.7.1-py2.py3-none-any.whl Collecting pynacl>=1.0.1 (from paramiko) Using cached https://files.pythonhosted.org/packages/9d/57/2f5e6226a674b2bcb6db531e8b383079b678df5b10cdaa610d6cf20d77ba/PyNaCl-1.4.0-cp35-abi3-manylinux1_x86_64.whl Collecting bcrypt>=3.1.3 (from paramiko) Using cached https://files.pythonhosted.org/packages/8b/1d/82826443777dd4a624e38a08957b975e75df859b381ae302cfd7a30783ed/bcrypt-3.1.7-cp34-abi3-manylinux1_x86_64.whl Requirement already satisfied: cryptography>=2.5 in /home/vagrant/envs/a210/lib/python3.6/site-packages (from paramiko) Requirement already satisfied: six in /home/vagrant/envs/a210/lib/python3.6/site-packages (from pynacl>=1.0.1->paramiko) Requirement already satisfied: cffi>=1.4.1 in /home/vagrant/envs/a210/lib/python3.6/site-packages (from pynacl>=1.0.1->paramiko) Requirement already satisfied: pycparser in /home/vagrant/envs/a210/lib/python3.6/site-packages (from cffi>=1.4.1->pynacl>=1.0.1->paramiko) Installing collected packages: pynacl, bcrypt, paramiko Successfully installed bcrypt-3.1.7 paramiko-2.7.1 pynacl-1.4.0 You are using pip version 9.0.3, however version 20.1.1 is available. You should consider upgrading via the 'pip install --upgrade pip' command. (a210) [vagrant@stumble stumble]$ ansible-playbook -i inventory.ini ios_show.yml PLAY [rt01] *************************************************************************************************************************************** TASK [show version] ******************************************************************************************************************************* ok: [rt01] TASK [debug] ************************************************************************************************************************************** ok: [rt01] => { "msg": [ [ "Cisco IOS Software, IOSv Software (VIOS-ADVENTERPRISEK9-M), Version 15.8(3)M2, RELEASE SOFTWARE (fc2)", "Technical Support: http://www.cisco.com/techsupport", "Copyright (c) 1986-2019 by Cisco Systems, Inc.", "Compiled Thu 28-Mar-19 14:06 by prod_rel_team", "", "", "ROM: Bootstrap program is IOSv", "", "rt01 uptime is 44 minutes", "System returned to ROM by reload", "System image file is \"flash0:/vios-adventerprisek9-m\"", "Last reload reason: Unknown reason", "", "", "", "This product contains cryptographic features and is subject to United", "States and local country laws governing import, export, transfer and", "use. Delivery of Cisco cryptographic products does not imply", "third-party authority to import, export, distribute or use encryption.", "Importers, exporters, distributors and users are responsible for", "compliance with U.S. and local country laws. By using this product you", "agree to comply with applicable laws and regulations. If you are unable", "to comply with U.S. and local laws, return this product immediately.", "", "A summary of U.S. laws governing Cisco cryptographic products may be found at:", "http://www.cisco.com/wwl/export/crypto/tool/stqrg.html", "", "If you require further assistance please contact us by sending email to", "export@cisco.com.", "", "Cisco IOSv (revision 1.0) with with 460137K/62464K bytes of memory.", "Processor board ID 9K3FGTY3R8XN9BUUOQPMP", "4 Gigabit Ethernet interfaces", "DRAM configuration is 72 bits wide with parity disabled.", "256K bytes of non-volatile configuration memory.", "2097152K bytes of ATA System CompactFlash 0 (Read/Write)", "0K bytes of ATA CompactFlash 1 (Read/Write)", "11217K bytes of ATA CompactFlash 2 (Read/Write)", "0K bytes of ATA CompactFlash 3 (Read/Write)", "", "", "", "Configuration register is 0x0" ] ] } PLAY RECAP **************************************************************************************************************************************** rt01 : ok=2 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 (a210) [vagrant@stumble stumble]$ ansible-doc yaml [WARNING]: module yaml not found in: /home/vagrant/.ansible/plugins/modules:/usr/share/ansible/plugins/modules:/home/vagrant/envs/a210/lib64/python3.6/site-packages/ansible/modules (a210) [vagrant@stumble stumble]$ ansible-doc yaml -t plugin usage: ansible-doc [-h] [--version] [-v] [-M MODULE_PATH] [--playbook-dir BASEDIR] [-t {become,cache,callback,cliconf,connection,httpapi,inventory,lookup,netconf,shell,vars,module,strategy}] [-j] [-F | -l | -s | --metadata-dump] [plugin [plugin ...]] ansible-doc: error: argument -t/--type: invalid choice: 'plugin' (choose from 'become', 'cache', 'callback', 'cliconf', 'connection', 'httpapi', 'inventory', 'lookup', 'netconf', 'shell', 'vars', 'module', 'strategy') usage: ansible-doc [-h] [--version] [-v] [-M MODULE_PATH] [--playbook-dir BASEDIR] [-t {become,cache,callback,cliconf,connection,httpapi,inventory,lookup,netconf,shell,vars,module,strategy}] [-j] [-F | -l | -s | --metadata-dump] [plugin [plugin ...]] plugin documentation tool positional arguments: plugin Plugin optional arguments: --metadata-dump **For internal testing only** Dump json metadata for all plugins. --playbook-dir BASEDIR Since this tool does not use playbooks, use this as a substitute playbook directory.This sets the relative path for many features including roles/ group_vars/ etc. --version show program's version number, config file location, configured module search path, module location, executable location and exit -F, --list_files Show plugin names and their source files without summaries (implies --list). A supplied argument will be used for filtering, can be a namespace or full collection name. -M MODULE_PATH, --module-path MODULE_PATH prepend colon-separated path(s) to module library (def ault=~/.ansible/plugins/modules:/usr/share/ansible/plu gins/modules) -h, --help show this help message and exit -j, --json Change output into json format. -l, --list List available plugins. A supplied argument will be used for filtering, can be a namespace or full collection name. -s, --snippet Show playbook snippet for specified plugin(s) -t {become,cache,callback,cliconf,connection,httpapi,inventory,lookup,netconf,shell,vars,module (a210) [vagrant@stumble stumble]$ ansible-galaxy collection install community.general Starting galaxy collection install process Process install dependency map Starting collection install process Installing 'community.general:0.2.0' to '/home/vagrant/.ansible/collections/ansible_collections/community/general' Installing 'google.cloud:0.0.9' to '/home/vagrant/.ansible/collections/ansible_collections/google/cloud' Installing 'ansible.posix:0.1.3' to '/home/vagrant/.ansible/collections/ansible_collections/ansible/posix' Skipping 'ansible.netcommon' as it is already installed Installing 'community.kubernetes:0.11.0' to '/home/vagrant/.ansible/collections/ansible_collections/community/kubernetes' (a210) [vagrant@stumble stumble]$ pip install paramiko^C (reverse-i-search)`c': ansible-galaxy collection install ^Cmmunity.general (reverse-i-search)`c': ansible-galaxy collection install ^Cmmunity.general (a210) [vagrant@stumble stumble]$ ansible-doc yaml -t callback > YAML (/home/vagrant/.ansible/collections/ansible_collections/community/general/plugins/callback/yaml.py) (a210) [vagrant@stumble stumble]$ ansible-playbook -i inventory.ini ios_show.yml [DEPRECATION WARNING]: 'ansible_collections.community.general.plugins.callback.yaml' is subclassing DefaultCallback without the corresponding doc_fragment. This feature will be removed from ansible-base in version 2.14. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg. PLAY [rt01] ***************************************************************************************************************** TASK [show version] ********************************************************************************************************* ok: [rt01] TASK [debug] **************************************************************************************************************** ok: [rt01] => msg: - - Cisco IOS Software, IOSv Software (VIOS-ADVENTERPRISEK9-M), Version 15.8(3)M2, RELEASE SOFTWARE (fc2) - 'Technical Support: http://www.cisco.com/techsupport' - Copyright (c) 1986-2019 by Cisco Systems, Inc. - Compiled Thu 28-Mar-19 14:06 by prod_rel_team - '' - '' - 'ROM: Bootstrap program is IOSv' - '' - rt01 uptime is 55 minutes - System returned to ROM by reload - System image file is "flash0:/vios-adventerprisek9-m" - 'Last reload reason: Unknown reason' - '' - '' - '' - This product contains cryptographic features and is subject to United - States and local country laws governing import, export, transfer and - use. Delivery of Cisco cryptographic products does not imply - third-party authority to import, export, distribute or use encryption. - Importers, exporters, distributors and users are responsible for - compliance with U.S. and local country laws. By using this product you - agree to comply with applicable laws and regulations. If you are unable - to comply with U.S. and local laws, return this product immediately. - '' - 'A summary of U.S. laws governing Cisco cryptographic products may be found at:' - http://www.cisco.com/wwl/export/crypto/tool/stqrg.html - '' - If you require further assistance please contact us by sending email to (a210) [vagrant@stumble stumble]$ cat /etc/redhat-release CentOS Linux release 7.8.2003 (Core) (a210) [vagrant@stumble stumble]$ ansible-playbook -i localhost, server.yml [DEPRECATION WARNING]: 'ansible_collections.community.general.plugins.callback.yaml' is subclassing DefaultCallback without the corresponding doc_fragment. This feature will be removed from ansible-base in version 2.14. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg. PLAY [localhost] ************************************************************************************************************ TASK [yum] ****************************************************************************************************************** fatal: [localhost]: FAILED! => changed=false ansible_facts: discovered_interpreter_python: /usr/bin/python changes: installed: - httpd msg: |- You need to be root to perform this command. rc: 1 results: - |- Loaded plugins: fastestmirror PLAY RECAP ****************************************************************************************************************** localhost : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0 (a210) [vagrant@stumble stumble]$ ansible-playbook -i localhost, server.yml [DEPRECATION WARNING]: 'ansible_collections.community.general.plugins.callback.yaml' is subclassing DefaultCallback without the corresponding doc_fragment. This feature will be removed from ansible-base in version 2.14. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg. PLAY [localhost] ************************************************************************************************************ TASK [yum] ****************************************************************************************************************** changed: [localhost] PLAY RECAP ****************************************************************************************************************** localhost : ok=1 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 (a210) [vagrant@stumble stumble]$ (a210) [vagrant@stumble stumble]$ (a210) [vagrant@stumble stumble]$ ansible-playbook -i localhost, server.yml -t service [DEPRECATION WARNING]: 'ansible_collections.community.general.plugins.callback.yaml' is subclassing DefaultCallback without the corresponding doc_fragment. This feature will be removed from ansible-base in version 2.14. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg. PLAY [localhost] ************************************************************************************************************ TASK [service] ************************************************************************************************************** changed: [localhost] PLAY RECAP ****************************************************************************************************************** localhost : ok=1 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 (a210) [vagrant@stumble stumble]$ ansible-playbook -i inventory.ini ios_show.yml [DEPRECATION WARNING]: 'ansible_collections.community.general.plugins.callback.yaml' is subclassing DefaultCallback without the corresponding doc_fragment. This feature will be removed from ansible- base in version 2.14. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg. PLAY [rt01] ****************************************************************************************** TASK [show version] ********************************************************************************** ok: [rt01] TASK [debug] ***************************************************************************************** ok: [rt01] => msg: - - Cisco IOS Software, IOSv Software (VIOS-ADVENTERPRISEK9-M), Version 15.8(3)M2, RELEASE SOFTWARE (fc2) - 'Technical Support: http://www.cisco.com/techsupport' - Copyright (c) 1986-2019 by Cisco Systems, Inc. - Compiled Thu 28-Mar-19 14:06 by prod_rel_team - '' - '' - 'ROM: Bootstrap program is IOSv' - '' - rt01 uptime is 1 hour, 1 minute - System returned to ROM by reload - System image file is "flash0:/vios-adventerprisek9-m" - 'Last reload reason: Unknown reason' - '' - '' - '' - This product contains cryptographic features and is subject to United - States and local country laws governing import, export, transfer and - use. Delivery of Cisco cryptographic products does not imply - third-party authority to import, export, distribute or use encryption. - Importers, exporters, distributors and users are responsible for - compliance with U.S. and local country laws. By using this product you - agree to comply with applicable laws and regulations. If you are unable - to comply with U.S. and local laws, return this product immediately. - '' - 'A summary of U.S. laws governing Cisco cryptographic products may be found at:' - http://www.cisco.com/wwl/export/crypto/tool/stqrg.html - '' - If you require further assistance please contact us by sending email to (a210) [vagrant@stumble stumble]$ (a210) [vagrant@stumble stumble]$ ansible-galaxy collection list # /home/vagrant/.ansible/collections/ansible_collections Collection Version -------------------- ------- ansible.netcommon 0.0.3 ansible.posix 0.1.3 cisco.ios 0.0.3 community.general 0.2.0 community.kubernetes 0.11.0 google.cloud 0.0.9 (a210) [vagrant@stumble stumble]$
耳寄り情報: オフライン環境へ適用するには
2.10.0ではansible-galaxy collection download <COLLECTION_NAME>でcollectionsのアーカイブをダウンロードできるんですよ。同時に作られるrequirements.ymlとセットでオフラインホストに持っていってansible-galaxy collection install -r requirements.ymlしてやれば展開され手使えます
— SAITO Hideki (@saito_hideki) 2020年6月21日
Part8 にむけて
企画中です。もう少しネットワークモジュール?