- hosts: nas
  name: Reconfigure espresense
  ignore_unreachable: false
  tasks:
  - name: Check that you can connect (GET) to a page and it returns a status 200
    ansible.builtin.uri:
      url: http://192.168.77.150
    
      method: POST
      body_format: form-urlencoded
      body:
        language: "en"
        room: "worker"
        wifi_timeout: ""
        portal_timeout: ""
        mqtt_host: "{{ MQTT_BROKER }}"
        mqtt_port: "1883"
        mqtt_user: "{{ MQTT_USER }}"
        mqtt_pass: "{{ MQTT_PASS }}"
        discovery: "1"
        discovery_prefix: ""
        pub_tele: "1"
        pub_rooms: "1"
        pub_devices: "1"
        update: ""
    ignore_errors: true
  - name: Check that you can connect (GET) to a page and it returns a status 200
    ansible.builtin.uri:
      url: http://192.168.77.150/restart
    
      method: POST

    ignore_errors: true