Skip to content

cli_config

jasper-zanjani edited this page Aug 23, 2020 · 2 revisions

Platform-agnostic way of pushing text-based configurations to network devices over the network_cli_connection plugin opensource.com

# Set hostname for a switch and exit with a commit message
- name: commit with comment
  cli_config:
    config: set system host-name foo
    commit_comment: this is a test
# Back up a config to a different destination file
- name: configurable backup path
  cli_config:
    config: "{{ lookup('template', 'basic/config.j2') }}"
    backup: yes
    backup_options:
      filename: backup.cfg
      dir_path: /home/user
Clone this wiki locally