Skip to content

Azure application gateway pfx certificate installation with Ansible #1436

@Rinshad

Description

@Rinshad

Hello,

I am trying to provision an Azure application gateway using Ansible. But am getting the below error when I try to include a PFX certificate.

fatal: [localhost]: FAILED! => {"msg": "An unhandled exception occurred while running the lookup plugin 'file'. Error was a <type 'exceptions.UnicodeDecodeError'>, original message: 'utf8' codec can't decode byte 0x82 in position 1: invalid start byte"}

This is my ansible script

ssl_certificates:
     - data: "{{ lookup('file', './certificate.pfx') }}"
       name: certificate
       password: "xxxxxxxx"

I have tried the following format but no luck

- data: "{{ b64encode (lookup('file', './certificate.pfx'  )) }}"  
- data: "{{ lookup('file', './certificate.pfx') | b64encode }}" 
- data: "{{ lookup('file', './certificate.pfx')  b64encode }}"  
- data: "{{ b64encode | (lookup('file', './certificate.pfx'  )) }}" 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions