Дерево страниц

Сравнение версий

Ключ

  • Эта строка добавлена.
  • Эта строка удалена.
  • Изменено форматирование.

...

Блок кода
languageyml
- name: get full backup from ESR device
  # to avoid unplanned changes, it is recommended to set apply_when: true
  esr_config:
    backup: true
    apply_when: never

- name: upload config from src to ESR device whith sftp and confirm
  esr_config:
    src: esr-1000.cfg
    use_sftp: true
    sftp_user: sftpuser
    sftp_password: sftppassword
    save_when: applied

- name: render a Jinja2 template onto a ESR device
  esr_config:
    src: esr-config.j2
    save_when: applied

- name: add sftp user
  esr_config:
    save_when: applied
    parents:
      - username sftpuser
    lines:
      - password sftppassword
      - ip sftp enable

- name: configure ip helpers on multiple interfaces
  esr_config:
    save_when: applied
    lines:
      - ip helper-address 192.168.0.10
    parents: "{{ item }}"
  with_items:
    - bridge 1
    - bridge 2
    - bridge 3

 - name: configure nat section
   esr_config:
     save_when: applied
     parents:
       - nat source
       - ruleset NAT_ALL
       - rule 100
     lines:
       - match protocol tcp
       - match source-address any
       - action source-nat pool nat_ip
       - enable

- name: load new rule to existing access-list
  esr_config:
    save_when: applied
    match: exact
    before:
      - ip access-list extended ip-acl
      - no rule 1
    parents:
      - ip access-list extended ip-acl
      - rule 1
    lines:
      - action permit
      - match protocol tcp
      - match destination-port 443
      - enable

- name: for idempotency, use full-form commands
  esr_config:
    parents:
      # - br 6
      - bridge 6
    lines:
      # - ip help 192.168.0.10
      - ip helper-address 192.168.0.10

...