test

 avatar
unknown
yaml
4 years ago
984 B
4
Indexable
#playbook test code

- name: config
  hosts: all
  connection: local
  gather_facts: no
  tasks:
    - name: configure provider
      set_fact:
        provider:
            username: admin
            password: cisco
    - name: set_hostname
      ios_config:
        provider: "{{provider}}"
        lines: hostname {{inventory_hostname}}
    - name: interface_ip_address
      ios_config:
        provider: "{{provider}}"
        lines:
        - ip address 192.168.1.10 255.255.255.0
        - no shutdown
        - full-duplex
        parents: interface GigabitEthernet2
    - name: loopback interface
      ios_config:
        provider: "{{provider}}"
        lines:
        - ip address 1.1.1.1 255.255.255.255
        - no shutdown
        parents: interface Loopback0
    - name: configure ospf network
      ios_config:
        provider: "{{provider}}"
        lines:
        - router-id 1.1.1.1
        - network 192.168.1.10 0.0.0.255 area 0
        parents: router ospf 1
Editor is loading...