27.2. Extended Example: Common Provisioning Use Cases (and How They Handle Files)
- Deploying a full application server
- Deploying a web application to an application server
- Deploying configuration files
27.2.1. Deploying A Full Application Server
This is the core use for the provisioning system, deploying an entire application server. This bundle contains the complete configuration stack for a server like JBoss EAP (or Tomcat or Apache). The bundle contains all of the files used by the application — the JAR and configuration files and scripts for the EAP server, and all EAR or WAR web applications that are to be deployed on that EPA instance. All of the application server and web app files and directories are zipped into an archive, with the
deploy.xml which defines the Ant recipe.
Because this is a complete application server, it will be deployed into its own, new (or empty) directory, such as
/opt/my-application. That directory will be dedicated to the application server, so it will be entirely managed by the bundle.
complianceis set to full. This means:
- Only files and subdirectories in the bundle distribution file will be in the root directory.
- Any existing files or subdirectories will be deleted.
- If files or subdirectories are added to the root directory, then they will be deleted when the bundle is updated or redeployed, unless those files are explicitly ignored (a setting in the recipe).
27.2.2. Deploying A Web Application
In this case, the bundle file contains only the WAR file itself and the
Unlike the application server, when deploying the web app, there are or could be other web apps also in the
deploy/ directory. The bundle system, then, should not manage the root directory, meaning existing or new files should be allowed within the root directory even if they are not included in the bundle.
compliance=fileAndDirectories, which tells the provisioning system to leave alone any existing files in the directory that are outside the bundle.
compliance=filesAndDirectoriesonly preserves files outside the bundle deployment. If the bundle directory is
deploy/myApp/, then any files in
deploy/myApp/or subdirectories like
deploy/myApp/WEB-INF/will be overwritten or removed when the bundle is deployed. The subdirectories defined in the bundle distribution are still entirely managed by the bundle system.
- Include all of the web applications in the same bundle distribution. For example, to deploy
deploy/directory, both WAR files can be included in the same bundle and deployed to
- It may not be possible to roll all of the web apps into the same bundle. Instead of using
deploy/as the root directory, there could be two different bundle distributions that use a subdirectory as the root directory. For example, the first web app could use
deploy/myApp1/so that the final deployment is
deploy/myApp1/myApp1.war/, while the second app uses
deploy/myApp2/, resulting in
deploy/myApp2/myApp2.war/.This allows the two web applications to be deployed, updated, and reverted independently of each other.
27.2.3. Deploying Configuration Files
- New login configuration, in
- New JMX console users, in
conf/directory for the application server.
The bundle must contain all of the files that are expected to be in the
conf/props/ subdirectories, not just the two new files that the administrator wants to use. Additionally, the
compliance parameter in the recipe must be set to filesAndDirectories so that all of the existing configuration files in the root directory,
conf/, are preserved.
As with deploying a web app, the intent is to add new content, not to replace existing content. Setting
compliance=filesAndDirectories only preserves files outside the bundle deployment. However, because there are two subdirectories defined in the bundle, JBoss ON will manage all of the content in those subdirectories. This means:
- The recipe has to have
compliance=filesAndDirectoriesset for the bundle to preserve the other files in the
- Any files in the subdirectories of the bundle —
conf/props/— will be overwritten when the bundle is deployed. The provisioning process can ignore files in the root directory, but it always manages (meaning, updates, adds, or deletes) files in any subdirectories identified in the bundle so that they match the content of the bundle.
- Existing files in the
conf/props/subdirectories must be included in the bundle distribution.
/opt/bundle/. Then, an Ant post-install task can be defined in the recipe that copies the configuration files from the root directory into the application server's