---
- name: Ensure we have loopback 888 for testing
  cisco.iosxr.iosxr_config:
    src: config.j2
  vars:
    ansible_connection: ansible.netcommon.network_cli

- name: Enable NETCONF service
  cisco.iosxr.iosxr_netconf:
    netconf_port: 830
    netconf_vrf: default
    state: present
  vars:
    ansible_connection: ansible.netcommon.network_cli
  tags:
    - netconf

- name: Enable gRPC
  cisco.iosxr.iosxr_config:
    src: config_grpc.j2
  vars:
    ansible_connection: ansible.netcommon.network_cli
  tags:
    - grpc

- name: Save truncated hostname
  ansible.builtin.set_fact:
    shorter_hostname: '{{ inventory_hostname_short | truncate(10, True, "") }}'
