# ansible-playbook ./time_config.yml -e ansible_hosts=nameofhost
- name: Set Time Date parameters
  hosts: "{{ansible_hosts}}"  # pass as -e ansible_hosts=wti_demo on the commandline
  collections:
     - wti.remote
  connection: local
  gather_facts: False

  tasks:
  - set_fact: use_https=False
    when: use_https is undefined
  - set_fact: validate_certs=False
    when: validate_certs is undefined

  - cpm_time_config:
      cpm_url: "{{ansible_host}}"
      cpm_username: "{{ansible_user}}"
      cpm_password: "{{ansible_pw}}"
      timezone: 5
      ntpenable: 1
      ipv4address: "time1.google.com,time2.google.com"
      timeout: 4
      use_https: "{{use_https}}"
      validate_certs: "{{validate_certs}}"

    register: testout
  - name: dump test output
    debug:
      msg: "{{ testout['data'] }}"
