0

I have a Jenkins job with string parameter as target "server1,server2". Jenkins pipeline script is expected to execute the job on server1 and server2 respectively. There is a common salt sls file that updates directory permissions and groups on both servers. The expectation is when the job is executed on server1, a group by name xx-server1-yy must be created and updated in server1, similarly a group xx-server2-yy be created in server2 only. One sls file for Jenkins job on multiple servers with groups created specific to each server. What is the best approach?

0

You didn't say how the sls file is executed.

salt '*' state.apply ftpsync pillar='{"ftpusername": "test", "ftppassword": "0ydyfww3giq8"}'
  • Or you can set the group name as a grain on the minion in advance.

  • Yet another way would be to set the group name as a jinja variable in the sls formula, depending on the hostname grain. Assuming your host names are set and standardized.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.