Skip to content

saltenv not used from roster with salt-ssh state.apply #50011

@vbasem

Description

@vbasem

Description of Issue/Question

I am trying to define saltenv in my roster files and have the correct environment applied when salt-ssh is called. What I observe is state.apply always seems to default to "base" environment, which pillar.items uses the correct saltenv defined in the roster.

Setup

roster

  user: root
  host: localhost
  minion_opts:
    environment: cloud_local
    saltenv: cloud_local
    pillarenv_from_saltenv: True

/etc/salt/master

pillarenv_from_saltenv: True
pillar_source_merging_strategy: none

file_roots:
  cloud_local:
    - /srv/salt/cloud/
pillar_roots:
    - /srv/pillar/cloud/local

test.sls

doit:
  cmd.run:
    - name: echo {{ saltenv }}

top.sls

{{saltenv}}
  '*':
    - test

Steps to Reproduce Issue

  1. salt ssh will output base (expected is cloud_local)
salt-ssh localhost state.apply test
  1. salt ssh will output cloud_local
salt-ssh localhost state.apply test saltenv=cloud_local
  1. salt call will output cloud_local (put saltenv: cloud_local in minion file)
salt-call state.apply test

Versions Report

(master, minion and ssh are all the same version)

Salt Version:
           Salt: 2018.3.2

Dependency Versions:
           cffi: 1.11.5
       cherrypy: Not Installed
       dateutil: Not Installed
      docker-py: Not Installed
          gitdb: Not Installed
      gitpython: Not Installed
          ioflo: Not Installed
         Jinja2: 2.7.2
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: 0.28.2
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.5.6
   mysql-python: Not Installed
      pycparser: 2.19
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: Not Installed
         Python: 2.7.5 (default, Nov  6 2016, 00:28:07)
   python-gnupg: Not Installed
         PyYAML: 3.11
          PyZMQ: 15.3.0
           RAET: Not Installed
          smmap: Not Installed
        timelib: Not Installed
        Tornado: 4.2.1
            ZMQ: 4.1.4

System Versions:
           dist: centos 7.3.1611 Core
         locale: UTF-8
        machine: x86_64
        release: 3.10.0-514.26.2.el7.x86_64
         system: Linux
        version: CentOS Linux 7.3.1611 Core

Metadata

Metadata

Assignees

No one assigned

    Labels

    Corerelates to code central or existential to SaltSalt-SSHbugbroken, incorrect, or confusing behaviorseverity-medium3rd level, incorrect or bad functionality, confusing and lacks a work around

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions