Network Automation Cookbook
上QQ阅读APP看书,第一时间看更新

How to do it...

  1. Inside the new folder, ch3_junos, we create a hosts file with the following content:
$ cat hosts

[pe]
mxpe01 Ansible_host=172.20.1.3
mxpe02 Ansible_host=172.20.1.4

[p]
mxp01 Ansible_host=172.20.1.2
mxp02 Ansible_host=172.20.1.6

[junos]
mxpe[01:02]
mxp[01:02]

[core:children]
pe
p
  1. Create an Ansible.cfg file, as shown in the following code:
$ cat Ansible.cfg

[defaults]
inventory=hosts
retry_files_enabled=False
gathering=explicit
host_key_checking=False