1

I have a server which was managed by hand before. We want to manage this server with saltstack in the future.

I run this to see what you current salt formular would do:

salt-ssh remote-host state.sls webserver test=True

There are several changes.

I would like to push (apply) some of the changes, but not all.

For example I see the output of this, and I would like to apply this, but no other change should get applied:


      ID: server.conf
Function: file.managed
    Name: /etc/apache2/vhosts.d/server.conf
  Result: None
 Comment: The file /etc/apache2/vhosts.d/server.conf is set to be changed
 Changes:   
          ----------
          diff:
              --- 
              +++ 
              @@ -13,43 +13,17 @@

              - old_stuff
              + new_stuff

Is there a way to do this?

1

salt.sls_id is in theory what you're looking for. It works for salt master/minion and masterless but I've just noticed it doesn't work with salt-ssh

EDIT: see Issue #44733

EDIT2: it's coming in 2017.7.3!

  • Sad, this one (sls_id) looked close to a great solution. Thank you - – guettli Nov 29 '17 at 15:30
  • rmarchei at github is you? Thank you very much! – guettli Nov 30 '17 at 15:05
  • 1
    yeah that was me! – ProT-0-TypE Dec 1 '17 at 15:08
0

You can create a individual sls (here my-change.sls) file for the change and just call it: salt remote-host state.apply my-change test=true

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.