The Anatomy of a Salt for VCF State File
The Anatomy of a Salt for VCF State File
Salt State File = A text file that tells the system which settings you want to check for.
File requirements:
- Either YAML or JSON structure within body of text
- Best practice is to append .sls to file name
- Must follow the conventions and structure outlined below
Example Body of Text:
{% set compliance_config = "compliance_config" %}
{% from 'vcf_compliance_control_salt/conf/vcenter_ntp_dns.jinja' import global with context %}
{% set control_config = global[compliance_config] %}
{% set target_control_config = {"compliance_config": control_config} %}
vcenter_controls:
vmware_compliance_control.check_control:
- control_config: {{ target_control_config }}
- product: "vcenter"
Breakdown of Sections
Here’s a breakdown of what’s happening, which sections you should modify and which portions you cannot:
| Field Name | File code example | Explanation |
|---|---|---|
|
Key-name-in-this-file key-name-inside-both-files |
{% set compliance_config = "compliance_config" %} |
|
| Path Location | {% from 'vcf_compliance_control_salt/conf/vcenter.jinja' import global with context %} |
|
| user-selected-label-for-holding-jinja-content | {% set control_config = global[compliance_config] %} |
|
| Salt Logic Line | {% set target_control_config = {"compliance_config": control_config} %} |
|
|
User-selected-label-for-settings product-name |
vcenter_controls: |
|