community.windows icon indicating copy to clipboard operation
community.windows copied to clipboard

win_iis_webbinding fails to assign specified certificate_hash

Open espekkaya opened this issue 4 years ago • 0 comments

SUMMARY

When I set certificate_hash, I have had an error message "Failed to set new SSL certificate - You cannot call a method on a null-valued expression."

ISSUE TYPE
  • Bug Report
COMPONENT NAME

community.windows.win_iis_webbinding

ANSIBLE VERSION
ansible 2.10.3
CONFIGURATION
HOST_KEY_CHECKING(/etc/ansible/ansible.cfg) = False
OS / ENVIRONMENT

OS : Windows Server 2019

STEPS TO REPRODUCE

I want to set ssl certificate but somehow ıt throws an error.

First I imported my pfx file to personel certificate sections. Then I set ssl certificate to bind iis bindings.

- name: Pfx import
  ansible.windows.win_certificate_store:
    path: C:\Users\Ansible\AppData\Local\Temp\cert.pfx
    file_type: pkcs12
    password: *password*
    store_location: LocalMachine
    key_storage: machine
    state: present

- name: HTTPS binding
  community.windows.win_iis_webbinding:
    name: "{{ win_web }}"
    port: 443
    ip: "*"
    protocol: https
    certificate_hash: "thumbprint"
    host_header: "{{ win_web_dns }}"
    ssl_flags: 1
    state: present
EXPECTED RESULTS

set binding successfully to bind.

ACTUAL RESULTS

Throws an error.

Failed to set new SSL certificate - You cannot call a method on a null-valued expression.

espekkaya avatar Nov 24 '20 14:11 espekkaya