How to change the value in puppet master scripts

How to change puppet master value type scripts at the press of a button ( mode - active on mode - disable (screenshot))?. And how to do this using a script bolt?
Thanks in advance?

Same question