You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
WDT allows you to create or extend the pre-installed type definitions, model filters, variable injectors, and target environments. Starting with WDT 1.10.0, these additional configuration files can be stored outside the `$WLSDEPLOY_HOME/lib` directory. This allows the files to remain in place if the WDT installation is moved or upgraded to a new version.
4
+
5
+
To use a separate configuration directory, set the `WDT_CUSTOM_CONFIG` environment variable to the directory to be used for configuration. For example:
6
+
```
7
+
export WDT_CUSTOM_CONFIG=/etc/wdtconfig
8
+
```
9
+
10
+
The customized configuration files should be named and organized the same way they would be under the `$WLSDEPLOY_HOME/lib` directory. For example:
11
+
```
12
+
/etc/wdtconfig
13
+
injectors
14
+
*.json (injector files)
15
+
typedefs
16
+
*.json (typedef files)
17
+
targets
18
+
my-target
19
+
target.json
20
+
*.py (filter files)
21
+
model_filters.json
22
+
model_variable_injector.json
23
+
variable_keywords.json
24
+
```
25
+
This is a full set of files that can be configured. You will need only to add the files you have created or extended. Details for each configuration type are found at the following links:
26
+
-[Model Filters](../tool_filters.md)
27
+
-[Type Definitions](../type_def.md) (see [example](#example-extending-a-type-definition) below)
28
+
-[Variable Injection](../variable_injection.md)
29
+
-[The Prepare Model Tool](../prepare.md) (target environments)
30
+
31
+
The WDT tools will look for each configuration file under `$WDT_CUSTOM_CONFIG` if specified, then under `$WLSDEPLOY_HOME/lib`.
32
+
33
+
### Example: Extending a Type Definition
34
+
35
+
To extend the `WLS` type definition, follow these steps:
36
+
- Create a directory to use for custom configurations, such as `/etc/wdtconfig`.
37
+
- Define the `WDT_CUSTOM_CONFIG` environment variable to point to that directory.
38
+
- Copy the file `$WLSDEPLOY_HOME/lib/typedefs/WLS.json` to the `$WDT_CUSTOM_CONFIG/typedefs` directory and rename it, for example `MY_WLS.json`.
39
+
- Edit `MY_WLS.json` with any required changes.
40
+
- Run the tool referencing the name of the new type definition, for example:
Copy file name to clipboardExpand all lines: site/prepare.md
+12-13Lines changed: 12 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -9,21 +9,17 @@ from the model that are not compatible with the WebLogic Kubernetes Operator, re
9
9
10
10
To use the Prepare Model Tool, simply run the `prepareModel` shell script with the correct arguments. To see the list of valid arguments, simply run the shell script with the `-help` option (or with no arguments) for usage information.
11
11
12
-
```
13
12
To prepare model files, run the tool as follows:
14
-
15
-
$WLSDEPLOY_HOME/bin/prepareModel.sh -oracle_home /u01/wls12213 -model_file [command separed list of models] -target k8s -output_dir $HOME/k8soutput
16
-
13
+
```
14
+
$WLSDEPLOY_HOME/bin/prepareModel.sh -oracle_home /u01/wls12213 -model_file [command separed list of models] -target k8s -output_dir $HOME/k8soutput
17
15
```
18
16
19
-
In the output directory, you will find
20
-
17
+
In the output directory, you will find:
21
18
```
22
19
model1.yaml
23
20
model2.yaml
24
21
create_k8s_secrets.sh
25
22
k8s_variable.properties
26
-
27
23
```
28
24
29
25
You can then customize the `k8s_variable.properties` and `create_k8s_secrets.sh` to provide environment specific values.
@@ -32,8 +28,9 @@ You can then customize the `k8s_variable.properties` and `create_k8s_secrets.sh`
32
28
33
29
The '-target' parameter is referring to a file on the file system '$WLSDEPLOY_HOME/lib/target/<targetvalue>/target.json'
34
30
35
-
It has the format
31
+
You also can configure a target in a [Custom Configuration](config/custom_configuration.md) directory, in `$WDT_CUSTOM_CONFIG/target/<target name>/target.json`.
36
32
33
+
It has the format:
37
34
```
38
35
{
39
36
"model_filters" : {
@@ -47,19 +44,21 @@ It has the format
47
44
}
48
45
```
49
46
50
-
The json file has several attributes that can be customized
47
+
The JSON file has several attributes that can be customized
51
48
52
49
| Name | Description |
53
50
| --- | --- |
54
-
| model_filters | Specify the filters json configuration for the target configuration. This follows the same schema of [Model Filters](tool_filters.md). Note only discover is valid |
55
-
| variable_injectors | Specify the variable injector json configuration for the target configuration. This follows the same schema of [Model Filters](tool_filters.md)|
51
+
| model_filters | Specify the filters JSON configuration for the target configuration. This follows the same schema of [Model Filters](tool_filters.md). Note only discover is valid |
52
+
| variable_injectors | Specify the variable injector JSON configuration for the target configuration. This follows the same schema of [Model Filters](tool_filters.md)|
56
53
| validation method | lax only |
57
54
| credentials_method | "secrets" or "config_override_secrets" |
58
55
59
56
`"@@TARGET_CONFIG_DIR@@` resolves to the '$WDT_INSTALL/lib/target/<targetvalue>' directory.
60
57
61
-
If there is a need to customize your own filers or injectors, you can
58
+
If there is a need to customize your own filters or injectors, you can
62
59
63
60
1.```mkdir $WDT_INSTALL/lib/target/mytarget```
64
-
2. Create a file named target.json follow the schema above in $WLSDEPLOY_HOME/lib/target/mytarget
61
+
2. Create a file named `target.json` following the schema above in $WLSDEPLOY_HOME/lib/target/mytarget
65
62
3. Run the prepareModel command using the parameter -target mytarget
63
+
64
+
Another option is to configure a new target in a [Custom Configuration](config/custom_configuration.md) directory. Create the `target/<target name>/target.json` file in the `$WDT_CUSTOM_CONFIG` directory.
Copy file name to clipboardExpand all lines: site/tool_filters.md
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,8 @@ def filter_model(model):
19
19
20
20
Model filters are configured by creating a `model_filters.json` file in the `WLSDEPLOY_HOME/lib` directory. This file has separate sections for filters to be applied for specific tools.
21
21
22
+
Another option is to configure model filters in a [Custom Configuration](config/custom_configuration.md) directory. Create the `model_filters.json` file in the `$WDT_CUSTOM_CONFIG` directory.
23
+
22
24
This example configures two filters for the Create Domain Tool: `fix-password.py` and `no-mail.py`, and one filter for the Discover Domain tool.
Copy file name to clipboardExpand all lines: site/type_def.md
+7-1Lines changed: 7 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -76,7 +76,13 @@ WebLogic Server Deploy Tooling has an extensible domain type system. The three
76
76
}
77
77
```
78
78
79
-
This file tells the Create Domain Tool which templates to use to create the domain, which server groups to target, and even which RCU schemas to create, all based on the installed version of WebLogic Server. New domain types can be defined by creating a new JSON file with the same structure in the `WLSDEPLOY_HOME/lib/typedefs` directory. For example, to define a `SOA` domain type for 12.2.1.3, add the `WLSDEPLOY_HOME/lib/typedefs/SOA.json` file with with similar content, as shown below.
79
+
This file tells the Create Domain Tool which templates to use to create the domain, which server groups to target, and even which RCU schemas to create, all based on the installed version of WebLogic Server.
80
+
81
+
New domain types can be defined by creating a new JSON file with the same structure in the `WLSDEPLOY_HOME/lib/typedefs` directory.
82
+
83
+
Another option is to create this file in the [Custom Configuration](config/custom_configuration.md) directory `$WDT_CUSTOM_CONFIG/typedefs`.
84
+
85
+
For example, to define a `SOA` domain type for 12.2.1.3, add the `typedefs/SOA.json` file with similar content, as shown below.
Copy file name to clipboardExpand all lines: site/variable_injection.md
+7-3Lines changed: 7 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,11 @@
2
2
3
3
The Variable Injector Tool is used to tokenize a model with variables. The values for these variables are assigned using an external property file. This facilitates using the same domain model to create new domains in different environments. The Variable Injector Tool can be run as an option in the Discover Domain Tool, or from the standalone command-line interface.
4
4
5
-
To enable the Variable Injector Tool during the Discover Domain Tool run, create a variable injector configuration by placing a JSON file named `model_variable_injector.json` into the `\<WLSDEPLOY\>/lib` directory using one or more of the pre-defined keywords and/or a CUSTOM list of files. A keyword points to an injector directive file. The tool applies the directives to the attributes in a model, and if the directive matches an attribute, then a property token with a unique variable name is injected into the model and replaces the attribute value. The variable name and model attribute value are placed into the external variable properties file.
5
+
To enable the Variable Injector Tool during the Discover Domain Tool run, create a variable injector configuration by placing a JSON file named `model_variable_injector.json` into the `<WLSDEPLOY>/lib` directory using one or more of the pre-defined keywords and/or a CUSTOM list of files.
6
+
7
+
Another option is to configure variable injection in a [Custom Configuration](config/custom_configuration.md) directory. Create the `model_variable_injector.json` file in the `$WDT_CUSTOM_CONFIG` directory.
8
+
9
+
A keyword points to an injector directive file. The tool applies the directives to the attributes in a model, and if the directive matches an attribute, then a property token with a unique variable name is injected into the model and replaces the attribute value. The variable name and model attribute value are placed into the external variable properties file.
6
10
7
11
**NOTE**: Variable injection on an attribute is only performed once. The property token is not replaced by any subsequent matches.
8
12
@@ -23,7 +27,7 @@ The supported keywords are as follows:
23
27
24
28
-`URL` - All MBean URL attribute values in the model are injected with a variable.
25
29
26
-
**NOTE**: The directives used by each pre-defined keyword are defined in an injector JSON file that is located in the `\<WLSDEPLOY\>/lib/injectors` folder. These files should not be changed, but could be used as is.
30
+
**NOTE**: The directives used by each pre-defined keyword are defined in an injector JSON file that is located in the `<WLSDEPLOY>/lib/injectors` folder. These files should not be changed, but could be used as is.
27
31
28
32
Here is an example of a `model_variable_injector.json` file using the PORT keyword.
To specify the name and location of the variable properties file for the Discover Domain Tool, use the argument `-variable_properties_file` on the command line. Usage of the `variable_properties_file` argument without the presence of the model variable injector file in the `\<WLSDEPLOY\>/lib` directory will cause an error condition and the tool will exit. If the model variable injector file exists in the directory, but the command-line argument is not used, the variable properties file is created with the following defaults:
87
+
To specify the name and location of the variable properties file for the Discover Domain Tool, use the argument `-variable_properties_file` on the command line. Usage of the `variable_properties_file` argument without the presence of the model variable injector file in the `<WLSDEPLOY>/lib` directory will cause an error condition and the tool will exit. If the model variable injector file exists in the directory, but the command-line argument is not used, the variable properties file is created with the following defaults:
84
88
* If the `model_file` command-line argument is used on the Discover Domain Tool run, the properties file name and location will be the same as the model file, with the file extension `.properties`.
85
89
* If only the archive file argument is present, the archive file name and location will be used.
0 commit comments