'SaltStack Plugin Usage in Jenkinsfile

Trying to incorporate SaltStack Plugin(https://plugins.jenkins.io/saltstack/) in a pipeline

Plugin is used to send a message to Salt API as a part of the Build step,

sample DSL Pipeline script is below

pipeline {
  agent {
    node {
      label 'agent1'
    }

  }
  stages {
    stage('saltcommand') {
      steps {
        salt(authtype: 'pam', clientInterface: local(arguments: '"sleep 3; ls -la"', blockbuild: true, function: 'cmd.run', jobPollTime: 6, target: '*', targettype: 'glob'), credentialsId: 'b5f40401-01b9-4b27-a4e8-8ae94bc90250', saveFile: true, servername: 'http://master.local:8000')
        script {
          env.WORKSPACE = pwd()
          def output = readFile "${env.WORKSPACE}/saltOutput.json"
          echo output
        }

      }
    }
  }
}

Could anyone from the community please answer how to generate credentialsId argument for the salt command under stages/stage/steps salt(), did not find anything regarding this from official Salt(https://docs.saltstack.com/en/latest/) or Jenkins(https://jenkins.io/doc/)?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source