{% if params | default(none) is not none %}
{%   if params.authenticate | default(none) is sameas true %}
ntp authenticate
{%   endif %}
{%   if params.keys | default(none) is not none %}
{%     with params = params.keys %}
{%       include 'ios_ntp_keys.j2' %}
{%     endwith %}
{%   endif %}
{%   if params.src_interface | default(none) is not none %}
ntp source {{ params.src_interface }}
{%   endif %}
{%   include 'ios_ntp_access_groups.j2' %}
{%   if params.servers | default(none) is not none %}
{%     for server in params.servers %}
{%       with session_type = 'server', params=server %}
{%         include 'ios_ntp_session.j2' %}
{%       endwith %}
{%     endfor %}
{%   endif %}
{%   if params.peers | default(none) is not none %}
{%     for peer in params.peers %}
{%       with session_type = 'peer', params=peer %}
{%         include 'ios_ntp_session.j2' %}
{%       endwith %}
{%     endfor %}
{%   endif %}
{%   include 'ios_ntp_peers.j2' %}
{% endif %}