5.2. Automation content navigator からのコレクションの参照
Automation content navigator テキストベースのユーザーインターフェイスを使用して、インタラクティブモードで Ansible コレクションを参照し、各コレクションを詳しく調べることができます。Automation content navigator は、現在のプロジェクトディレクトリー内のコレクションと、自動化実行環境で利用可能なコレクションを表示します。
前提条件
- ローカルでアクセス可能なコレクションまたはインストールされた自動化実行環境。
手順
Automation content navigator を起動します。
ansible-navigator
$ ansible-navigatorCopy to Clipboard Copied! Toggle word wrap Toggle overflow コレクションを参照します。または、
ansible-navigator collectionsと入力してコレクションを直接参照することもできます。:collections
$ :collectionsCopy to Clipboard Copied! Toggle word wrap Toggle overflow
確認するコレクションの数を入力します。
:4
:4Copy to Clipboard Copied! Toggle word wrap Toggle overflow
調べるモジュールに対応する番号を入力します。
ANSIBLE.UTILS.IP_ADDRESS: Test if something in an IP address 0│--- 1│additional_information: {} 2│collection_info: 3│ authors: 4│ - Ansible Community 5│ dependencies: {} 6│ description: Ansible Collection with utilities to ease the management, manipulation, 7│ and validation of data within a playbook 8│ documentation: null 9│ homepage: null 10│ issues: null 11│ license: [] 12│ license_file: LICENSE 13│ name: ansible.utils 14│ namespace: ansible 15│ path:/usr/share/ansible/collections/ansible_collections/ansible/utils/ 16│ readme: README.md <... output truncated...>ANSIBLE.UTILS.IP_ADDRESS: Test if something in an IP address 0│--- 1│additional_information: {} 2│collection_info: 3│ authors: 4│ - Ansible Community 5│ dependencies: {} 6│ description: Ansible Collection with utilities to ease the management, manipulation, 7│ and validation of data within a playbook 8│ documentation: null 9│ homepage: null 10│ issues: null 11│ license: [] 12│ license_file: LICENSE 13│ name: ansible.utils 14│ namespace: ansible 15│ path:/usr/share/ansible/collections/ansible_collections/ansible/utils/ 16│ readme: README.md <... output truncated...>Copy to Clipboard Copied! Toggle word wrap Toggle overflow オプション: このモジュールのドキュメントの例に移動します。
:{{ examples }} 0│ 1│ 2│#### Simple examples 3│ 4│- name: Check if 10.1.1.1 is a valid IP address 5│ ansible.builtin.set_fact: 6│ data: "{{ '10.1.1.1' is ansible.utils.ip_address }}" 7│ 8│# TASK [Check if 10.1.1.1 is a valid IP address] ********************* 9│# ok: [localhost] => { 10│# "ansible_facts": { 11│# "data": true 12│# }, 13│# "changed": false 14│# } 15│:{{ examples }} 0│ 1│ 2│#### Simple examples 3│ 4│- name: Check if 10.1.1.1 is a valid IP address 5│ ansible.builtin.set_fact: 6│ data: "{{ '10.1.1.1' is ansible.utils.ip_address }}" 7│ 8│# TASK [Check if 10.1.1.1 is a valid IP address] ********************* 9│# ok: [localhost] => { 10│# "ansible_facts": { 11│# "data": true 12│# }, 13│# "changed": false 14│# } 15│Copy to Clipboard Copied! Toggle word wrap Toggle overflow オプション: エディターでサンプルを開き、それを Playbook にコピーします。
:open
:openCopy to Clipboard Copied! Toggle word wrap Toggle overflow
検証
コレクションリストを参照します。