I'm running a CentOS 8 VM created with Vagrant and setup with masterless Salt-Stack. I'm trying to use the function create_self_signed_cert
in an SLS file, however, I cannot figure out the syntax for the life of me. The specific function can be found here: create_self_signed_cert
This is what I have so far:
self_signed_cert:
create_self_signed_cert:
- CN: "mywebsite.com"
- ca.cert_base_path: "/etc"
- ca_name: "ssl"
From within a VM I call it like so:
salt-call --local state.sls path.to.self-signed-cert
and I get this error:
local:
Data failed to compile:
----------
No function declared in state 'create_self_signed_cert' in SLS 'path.to.self-signed-cert'
So my question is, how do I convert what is shown in the documentation to an SLS file?
Also, bonus question, is there documentation that I've missed that explains how to use any function in an SLS file? It seems like all the docs give the command line version of commands.
Cheers
Shortly after posting this I stumbled upon a Github issue that had the correct layout. My issue is that create_self_signed_cert
is actually a module and as such it needs be called like one. So my final layout that works is as so:
self_signed_cert:
module.run:
- name: tls.create_self_signed_cert
- CN: "my.website.com"
- ca.cert_base_path: "/etc"
- ca_name: "ssl"