added tests state

This commit is contained in:
Paul 2023-08-26 09:51:03 +02:00
parent 1f8fdeb8bb
commit b01f06564f
3 changed files with 42 additions and 0 deletions

6
states/tests/custom.sls Normal file
View File

@ -0,0 +1,6 @@
---
human_friendly_state_id:
custom.enforce_custom_thing:
- name: Nom
- foo: Valeur
- bar: false

17
states/tests/file.sls Normal file
View File

@ -0,0 +1,17 @@
---
#/tmp/postgresql.conf:
# file.keyvalue:
# - key_values:
# listen_addresses: "'localhost'"
# include: "'test'"
# - separator: ' = '
# - uncomment: '# '
# - key_ignore_case: True
# - append_if_not_found: True
/etc/default/grub:
file.line:
- content: GRUB_CMDLINE_LINUX="texr"
- match: "^GRUB_CMDLINE_LINUX="
- mode: ensure
- location: end

View File

@ -0,0 +1,19 @@
{% set minion_ips = salt['mine.get'](
tgt='G@lb:true',
fun='internal_ip_addrs',
tgt_type='compound') %}
#pkg-repo-test-absent:
# pkgrepo.absent:
# - name: deb http://repository.spotify.com stable non-free
{% set a = [] %}
{%- for k,v in minion_ips.items() %}
{%- if k != salt['grains.get']('fqdn') %}
{%- for i in v %}
{% set _ = a.append(i) %}
{%- endfor %}
{%- endif %}
{%- endfor %}
{{ a|sort|unique }}