Luis Henrique
Luis Henrique

Reputation: 771

Unable to calculate the checksum of the remote file persist with validate_checksum equal false/no

How to handle the error below? I tried it with validate_checksum: no, any suggestions?

Playbook:

- name: "Collect file"
  hosts: WIN
  gather_facts: no
  tasks:
    - block:
        - name: 'Copy file'
          fetch:
            src: "D:\\Soft\\Program Files (x86)\\connect.cfg"
            dest: "/etc/files/connect.cfg"
            flat: yes
            validate_checksum: no
      rescue:
        - fail:
            msg: "Failure detected in playbook"

Error:

Unable to calculate the checksum of the remote file

Hosts:

[Windows]
WIN

[Windows:vars]
ansible_ssh=192.168.9.102
ansible_port=5985
ansible_user=domain\username
ansible_password="pass123"
ansible_connection=winrm
ansible_winrm_server_cert_validation=ignore

Upvotes: 0

Views: 1316

Answers (1)

Josh Zhang
Josh Zhang

Reputation: 127

You can start with checking the source file by adding the following code block before your 'Copy file'

    - name: Get file properties
      stat:
        path: "D:\\Soft\\Program Files (x86)\\connect.cfg"
        register: result
    - name: All properties
      debug:
        var: result.stat
    - name: Checksum
      debug:
        var: result.stat.checksum

A brute force way to move past the error is just to add ignore_errors: yes in place of validate_checksum: no

Upvotes: 1

Related Questions