---
# Example Playbook: cisco.intersight.intersight_ntp_policy
# Runs on localhost since policies are only configured once
- hosts: localhost
  connection: local
  collections:
    - cisco.intersight
  gather_facts: false
  vars:
    # Create an anchor for api_info that can be used throughout the file
    api_info: &api_info
      api_private_key: "{{ api_private_key }}"
      api_key_id: "{{ api_key_id }}"
      api_uri: "{{ api_uri | default(omit) }}"
  tasks:
    - name: Configure NTP Policy
      intersight_ntp_policy:
        <<: *api_info
        organization: "{{ organization | default(omit) }}"
        name: lab-ntp
        description: NTP policy for lab use
        tags:
          - Key: Site
            Value: RCDN
        ntp_servers:
          - ntp.esl.cisco.com
        timezone: America/Chicago
