アンサーブル - Junos

アンサーブル - Junos

次のドキュメントに従って、Junosデバイスでansibleを使用しようとしています。

http://docs.ansible.com/ansible/junos_command_module.html

私はこのプレイブックを作りました:

- name: run a set of commands
  junos_command:
    commands: ['show version', 'show ip route']

別のものがあります:

- name: run show version on remote devices
  junos_command:
    commands: show version

ただし、次のエラーが発生します。

ERROR! 'junos_command' is not a valid attribute for a Play

The error appears to have been in '/home/joseluis/junos_command.yml': line 1, column 3, but may be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:


- name: run a set of commands   ^ here

私は次のバージョンを持っています:

  • アンサーブル2.3.0.0-1ppa~信頼できる
  • junos-eznc(2.1.3)
  • jxmlease(1.0.1)

どうですか?

ベストアンサー1

投稿した行は仕事

プレイブックでは、少なくとも目標を指定する必要があります。所有者そして仕事

- hosts: my_hosts
  tasks:
    - name: run show version on remote devices
      junos_command:
        commands: show version

バラよりhttp://docs.ansible.com/ansible/playbooks_intro.html#basics

おすすめ記事