+ Step #1
- Install Ubuntu version to work with SSHv2 and ansible 2.9.
![](https://172.105.20.94/wp-content/uploads/2021/12/image-42-1024x215.png)
- Test SSH connection on both CME Routers
![](https://172.105.20.94/wp-content/uploads/2021/12/image-43.png)
- Check the configuration on R2/R3.
![](https://172.105.20.94/wp-content/uploads/2021/12/image-44.png)
- R3 does not have any CIPC registered directory number.
![](https://172.105.20.94/wp-content/uploads/2021/12/image-45.png)
+ Step #2:
- Create ansible.cfg, hosts file and ansible yaml file to insert configuration on R3
tung@tung-VirtualBox:~/Documents/Ansible$ cat tung.yml
---
- name: Manage Cisco Router CME devices
hosts: r1
gather_facts: false
connection: local
vars:
cli:
username: admin
password: cisco
tasks:
- name: Configure Ephone-dn on R2
ios_config:
provider: "{{ cli }}"
authorize: yes
parents: ephone-dn 1
lines:
- number 1111
- name tungle1-1111
- hold-alert 30 originator
- name: Configure Ephone-dn on R2
ios_config:
provider: "{{ cli }}"
authorize: yes
parents: ephone-dn 2
lines:
- number 1112
- name tungle1-1112
- hold-alert 30 originator
- name: Configure Ephone number on R2
ios_config:
provider: "{{ cli }}"
authorize: yes
parents: ephone 1
lines:
- mac-address 0800.AAAA.28C0
- username "tungle1-1111" password Pa$$w0rd
- type CIPC
- button 1:1
- name: Configure Ephone number on R2
ios_config:
provider: "{{ cli }}"
authorize: yes
parents: ephone 2
lines:
- mac-address 0800.BBBB.1234
- username "tungle1-1112" password Pa$$w0rd
- type CIPC
- button 1:2
register: print_output - debug: var=print_output
![](https://172.105.20.94/wp-content/uploads/2021/12/image-46-1024x966.png)
tung@tung-VirtualBox:~/Documents/Ansible$ cat ansible.cfg
[defaults]
inventory = ./hosts
host_key_checking = false
deprecation_warnings=False
timeout = 5
![](https://172.105.20.94/wp-content/uploads/2021/12/image-47.png)
![](https://172.105.20.94/wp-content/uploads/2021/12/image-48.png)
- Run ansible-playbook
tung@tung-VirtualBox:~/Documents/Ansible$ ansible-playbook tung.yml
![](https://172.105.20.94/wp-content/uploads/2021/12/image-49.png)
- Check on CME Router
![](https://172.105.20.94/wp-content/uploads/2021/12/image-50.png)
- CIPCs have been registered successfully via Ansible
![](https://172.105.20.94/wp-content/uploads/2021/12/image-51.png)