cli based configuration via ansible

23 views
Skip to first unread message

raj kr

unread,
Aug 29, 2017, 9:23:36 AM8/29/17
to Ansible Project

I am trying to do some cli based config on a router via ansible,
I can execute command on shell via ansible but is it possible to add any new config via cli command ?


Executed below command via yml but did not work,

I am trying to execute one cli command(example - oam-enable) by going to cli->config->oam-enable->commit


Please let me know if it is possible.

- name: run shell for cli based command
  shell: |
    set timeout 100
    spawn ssh security@{{ cimc_host }}

    expect "secu...@10.1.18.47's password:"
    send "{{ "xyz" }}"

    config
    oam-enable
    commit
    set timeout 50
    #send "{{ cimc_command }}"

    exit 0
Reply all
Reply to author
Forward
0 new messages