Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Orchestration of highstate using salt.state vs salt.function should behave similarly #26448

Closed
PredatorVI opened this issue Aug 18, 2015 · 8 comments
Labels
Bug broken, incorrect, or confusing behavior Core relates to code central or existential to Salt P3 Priority 3 Runners severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around stale
Milestone

Comments

@PredatorVI
Copy link

Given the following two orchestration states to initiate 'highstate':

##using salt.function
install_primary_minions:
  salt.function:
    - name: state.highstate
    - tgt: 'dbarmor-acc01*'
##using salt.state
install_primary_minions:
  salt.state:
    - highstate: True
    - tgt: 'dbarmor-acc01*'

The first example above works just like the command-line. The second throws the following error:

[ERROR   ] Run failed on minions: dbarmor-acc01
Failures:
    dbarmor-acc01:
        Data failed to compile:
    ----------
        No matching sls found for 'dbarmor' in env 'acc'

It doesn't appear that 'salt.state: - highstate: True' is evaluating top.sls and/or environments properly. The states in /srv/salt/base/* are 'templates' that reference pillar data. top.sls has a single 'base' environment section where minions are assigned roles using minion name. States are assigned to minions based on the roles. Each environment has minions that use the same roles.

/srv/salt/base/top.sls:

base:
#ROLE Assignments:
  'E@go-agent\..+':
    - go.role_go_agent
  'E@dbarmor-(dev|acc).+':
    - dbarmor.role_processor
  'E@dbarmor-(dev|acc)0[1-2]\..+':
    - dbarmor.role_web
  'E@dbarmor-(dev|acc)01\..+':
    - dbarmor.role_primary_rabbit
  'E@dbarmor-(dev|acc)(?!01).+':
    - dbarmor.role_secondary_rabbit
#STATE Assignments based on ROLE:
  'G@role:dbarmor_processor':
    - dbarmor.dbarmor-processor
  'G@role:dbarmor_web':
    - dbarmor.dbarmor-web
  'G@role:dbarmor_primary_rabbit':
    - dbarmor.dbarmor-rabbitmq
  'G@role:dbarmor_secondary_rabbit':
    - dbarmor.dbarmor-rabbitmq

Pillar top.sls is where minions are assigned environment environment-specific values that are used in the template state files.

/srv/pillar/base/top.sls:

dev:
  'rjv-test02*':
    - dbarmor
acc:
  'dbarmor-acc*':
    - dbarmor

FILE LAYOUT

/srv
├── pillar
│   ├── acc
│   │   ├── dbarmor
│   │   │   ├── globals.yml
│   │   │   ├── init.sls
│   │   │   ├── processor_jar.sls
│   │   │   ├── rabbitmq_pillar.sls
│   │   │   └── war_file.sls
│   │   └── updater
│   ├── base
│   │   ├── dbrisklevelutils
│   │   │   └── init.sls
│   │   ├── ratingtool
│   │   │   ├── props.sls
│   │   │   └── war_file.sls
│   │   ├── salt-formula
│   │   └── top.sls
│   └── dev
│       ├── dbarmor
│       │   ├── init.sls
│       │   ├── processor_jar.sls
│       │   ├── rabbitmq_pillar.sls
│       │   └── war_file.sls
│       └── dbrisklevelutils
│           └── init.sls
└── salt
    └── base
        ├── dbarmor
        │   ├── catalina.properties
        │   ├── dbarmor-processor.conf
        │   ├── dbarmor-processor.properties
        │   ├── dbarmorProcessor.sh
        │   ├── dbarmor-processor.sls
        │   ├── dbarmor-rabbitmq.sls
        │   ├── dbarmor-web.properties
        │   ├── dbarmor-web.sls
        │   ├── erlang.cookie
        │   ├── role_primary_rabbit.sls
        │   ├── role_processor.sls
        │   ├── role_secondary_rabbit.sls
        │   └── role_web.sls
        ├── openssh
        │   ├── init.sls
        │   ├── openssh-server.sls
        │   ├── ssh_config
        │   └── sshd_config
        ├── oracle-java
        │   ├── oracle-java7.sls
        │   └── oracle-java8.sls
        ├── orchestration
        │   └── dbarmor
        │       ├── dbarmor.sls
        │       └── out.txt
        ├── ratingtool
        │   ├── deploy_webapp.sls
        │   └── ratingtool.properties
        ├── salt
        │   └── minion
        ├── _states
        ├── test
        │   ├── shared_state_test.sls
        │   └── test.txt
        ├── tomcat
        │   ├── tomcat7.sls
        │   └── tomcat-users-template.xml
        ├── **top.sls**
        └── ubuntu
            ├── default-users.sls
            ├── init.sls
            ├── open-vm-tools.sls
            └── salt-minion.sls
@jfindlay jfindlay added Bug broken, incorrect, or confusing behavior severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around Core relates to code central or existential to Salt P3 Priority 3 labels Aug 19, 2015
@jfindlay jfindlay added this to the Approved milestone Aug 19, 2015
@jfindlay
Copy link
Contributor

@PredatorVI, thanks for finding and reporting this. Your salt.function and salt.state example titles are backwards.

@basepi
Copy link
Contributor

basepi commented Aug 19, 2015

I fixed the minor formatting issue for you that @jfindlay pointed out. No biggie, thanks for the report.

@PredatorVI
Copy link
Author

Sorry...I had changed the content but not the titles. I fixed the ordering as well.

@DanyC97
Copy link

DanyC97 commented Aug 20, 2015

@basepi @jfindlay wouldn't be nice to have a known issues list in the docs mentioning this type of reports? I know the list might be quite long but then not all people "scan" github every day like me to see if s'thing new was raised by @PredatorVI & others who are hanging around.

My £0.02

@basepi
Copy link
Contributor

basepi commented Aug 20, 2015

@DanyC97 We are working on doing more "known issues" in the release notes. The problem is we have a lot of open bugs, so an exhaustive list would be useless. We mostly try to point out major issues that we didn't have time to fix for a release.

@DanyC97
Copy link

DanyC97 commented Aug 21, 2015

@basepi i thought is hard too :)
Maybe you guys can quickly come with a voting system and then we from community can help to triage which "known" bugs should make it into the list?

@basepi
Copy link
Contributor

basepi commented Aug 21, 2015

That's not a bad idea. We'll have to take it into consideration.

Jlin317 added a commit to Jlin317/salt that referenced this issue Aug 18, 2016
Might be related to issues saltstack#30434 and saltstack#26448 but seems a bit tenuous
@stale
Copy link

stale bot commented Dec 20, 2017

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.

@stale stale bot added the stale label Dec 20, 2017
@stale stale bot closed this as completed Dec 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior Core relates to code central or existential to Salt P3 Priority 3 Runners severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around stale
Projects
None yet
Development

No branches or pull requests

4 participants