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?

guettli
  • 3,113
  • 14
  • 59
  • 110

2 Answers2

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!

ProT-0-TypE
  • 491
  • 4
  • 8
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

Tux_DEV_NULL
  • 1,083
  • 7
  • 11