title: How to deploy a module/provider/spi via scripting?
body: <p>Is there a way to deploy modules to Wildfly <strong>via scripting</strong> (as in, without manually modifying XML files)? I know about the <code>jboss-cli.sh</code> command to <code>add module</code> but is there a way to either directly modify my <code>standalone.xml</code>/<code>domain.xml</code> or do some equivalent thing that will tell Wildfly to load the module? </p>
  
  <hr>
  
  <p>Said another way... </p>
  
  <p>I've discovered two ways to deploy modules:</p>
  
  <p>1) Hot deploy a jar directly by copying it into <code>$KEYCLOAK_HOME/standalone/deployments</code>
     (Per the README in that directory, this method is <strong>not recommended</strong> for production deployments <em>but</em> it works without any manual work afterward.)</p>
  
  <p>2) run <code>jboss-cli.sh --command="module add --name=com.example.MySpi"</code> then <strong>manually</strong> edit <code>standalone.xml</code> (or <code>domain.xml</code>) to have your module in the "providers" list, like so: </p>
  
  <pre><code>&lt;subsystem xmlns="urn:jboss:domain:keycloak-server:1.1"&gt;
    &lt;web-context&gt;auth&lt;/web-context&gt;
    &lt;providers&gt;
      ...
      &lt;provider&gt;module:com.example.MySpi&lt;/provider&gt;
    &lt;/providers&gt;
    ...
  &lt;/subsystem&gt;
  </code></pre>
  
  <p>... and finally restart the server.</p>
  
  <p>I'd like to use the recommended way, but without manually editing an XML file. Is there a recommended path for this?</p>