# ansible-playbook ./web_config.yml -e ansible_hosts=nameofhost
- name: Set Network Web 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=True
    when: use_https is undefined
  - set_fact: validate_certs=True
    when: validate_certs is undefined

  - cpm_web_config:
      cpm_url: "{{ansible_host}}"
      cpm_username: "{{ansible_user}}"
      cpm_password: "{{ansible_pw}}"
      interface: "eth1"
      harden: 0
      hsts: 0
      httpenable: 1
      httpport: 80
      httpsenable: 1
      httpsport: 443
      tlsmode: 2
      ocsp: 0
      trace: 0
      timeout: 0
      webterm: 0
      use_https: "{{use_https}}"
      validate_certs: "{{validate_certs}}"

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