Browse Source

Fix backward compatibility, storage_type/invetory reclass defaults

Change-Id: I8dee93ffd4441391a5b26ba2c5b46e43357a0ca7
pull/63/head
Petr Michalec 7 years ago
parent
commit
df4e781356
3 changed files with 35 additions and 2 deletions
  1. +5
    -0
      .kitchen.yml
  2. +2
    -2
      salt/files/master.conf
  3. +28
    -0
      tests/pillar/master_single_extolddays.sls

+ 5
- 0
.kitchen.yml View File

pillars-from-files: pillars-from-files:
salt.sls: tests/pillar/master_single_extreclass.sls salt.sls: tests/pillar/master_single_extreclass.sls


- name: master-backward-compat
provisioner:
pillars-from-files:
salt.sls: tests/pillar/master_single_extolddays.sls

- name: control-default - name: control-default
provisioner: provisioner:
grains: grains:

+ 2
- 2
salt/files/master.conf View File

{%- if master.pillar.engine == 'reclass' or (master.pillar.engine == 'composite' and master.pillar.reclass is defined) %} {%- if master.pillar.engine == 'reclass' or (master.pillar.engine == 'composite' and master.pillar.reclass is defined) %}


reclass: &reclass reclass: &reclass
storage_type: {{ master.pillar.get('reclass', {'storage_type': 'yaml_fs'}).storage_type }}
inventory_base_uri: {{ master.pillar.get('reclass', {'inventory_base_uri': '/srv/salt/reclass'}).inventory_base_uri }}
storage_type: {{ master.pillar.get('reclass', {}).get('storage_type', 'yaml_fs') }}
inventory_base_uri: {{ master.pillar.get('reclass', {}).get('inventory_base_uri', '/srv/salt/reclass') }}
{# Additional options, for backward compatibility salt:master:pillar might not be defined #} {# Additional options, for backward compatibility salt:master:pillar might not be defined #}
{%- if master.pillar.reclass is defined %} {%- if master.pillar.reclass is defined %}
{%- if master.pillar.reclass.reclass_source_path is defined %} {%- if master.pillar.reclass.reclass_source_path is defined %}

+ 28
- 0
tests/pillar/master_single_extolddays.sls View File

git:
client:
enabled: true
linux:
system:
enabled: true
reclass:
storage:
enabled: true
data_source:
engine: git
branch: master
address: 'https://github.com/salt-formulas/openstack-salt.git'
salt:
master:
enabled: true
command_timeout: 5
worker_threads: 2
base_environment: prd
#environment:
# prd:
# formula:
# python:
# source: git
# address: 'https://github.com/salt-formulas/salt-formula-python.git'
# revision: master
pillar:
engine: reclass

Loading…
Cancel
Save