Skip to content

Commit

Permalink
Fixes from review
Browse files Browse the repository at this point in the history
Signed-off-by: 1000TurquoisePogs <[email protected]>
  • Loading branch information
1000TurquoisePogs committed Jun 27, 2024
1 parent 4cf6e9d commit f77b238
Show file tree
Hide file tree
Showing 9 changed files with 108 additions and 8 deletions.
33 changes: 33 additions & 0 deletions bin/commands/init/.help
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,39 @@ If you pass `--dry-run` with this command, each subcommand will print out the
JCL that it would submit, without doing the submission. This can be used to
review what Zowe would do before doing it.

The following are the JCL submitted by each command as needed

- `zwe init mvs`
- ZWEIMVS
- (If `--allow-overwrite` specified and old datasets exist) ZWERMVS
- (If `zowe.setup.dataset.authLoadLib` is not named prefix + ZWELOAD) ZWEIMVS2
- (If above is true, and the dataset exists, and `--allow-overwrite` is set) ZWERMVS2
- `zwe init vsam`
- ZWECSVSM
- (If `--allow-overwrite` specified and old datasets exist) ZWECSRVS
- `zwe init apfauth`
- ZWEIAPF2
- `zwe init security`
- (If RACF) ZWEIRAC
- (If RACF and z/OS 2.4) ZWIRACZ
- (If TSS) ZWEITSS
- (If TSS and z/OS 2.4) ZWITSSZ
- (If ACF2) ZWEIACF
- (If ACF2 and z/OS 2.4) ZWIACFZ
- `zwe init certificate`
- (If creating keyring and certificate for RACF) ZWEIKRR1
- (If creating keyring and connecting certificate for RACF) ZWEIKRR2
- (If creating keyring and importing certificate for RACF) ZWEIKRR3
- (If creating keyring and certificate for TSS) ZWEIKRR1
- (If creating keyring and connecting certificate for TSS) ZWEIKRT2
- (If creating keyring and importing certificate for TSS) ZWEIKRT3
- (If creating keyring and certificate for ACF2) ZWEIKRA1
- (If creating keyring and connecting certificate for ACF2) ZWEIKRA2
- (If creating keyring and importing certificate for ACF2) ZWEIKRA3
- `zwe init stc`
- ZWEISTC
- (If `--allow-overwrite` specified and old members exist) ZWERSTC

If you pass `--skip-security-setup` with this command, `zwe init apfauth` and
`zwe init security` steps will be skipped.

Expand Down
6 changes: 6 additions & 0 deletions bin/commands/init/certificate/index.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ else
CONFIG_TO_WRITE=${ZWE_CLI_PARAMETER_CONFIG}
fi

# Keytool is needed
require_java

# Node is needed for read_yaml
require_node

export ZWE_PRIVATE_TMP_MERGED_YAML_DIR=$(create_tmp_file)
mkdir -p ${ZWE_PRIVATE_TMP_MERGED_YAML_DIR}
_CEE_RUNOPTS="XPLINK(ON),HEAPPOOLS(OFF),HEAPPOOLS64(OFF)" ${ZWE_zowe_runtimeDirectory}/bin/utils/configmgr -script "${ZWE_zowe_runtimeDirectory}/bin/commands/internal/config/output/cli.js"
Expand Down
65 changes: 65 additions & 0 deletions bin/commands/init/generate/.help
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
Generate ready to execute JCL samples from zowe.yaml configuration values.

This command executes the job ZWEGENER which copies the JCL templates from Zowe's SZWESAMP dataset, minus those not valid for your system ESM, and creates resolved, ready to execute JCL content within the dataset defined by the zowe.yaml property `zowe.setup.dataset.jcllib` (such as `zowe.setup.dataset.prefix` + "CUST.JCLLIB")

These JCL files can be run by any means desired afterward.
The actions of `zwe init` will run them automatically if desired.
Each `zwe init` action has a `--dry-run` command which will print the value of the particular JCL file used, but not submit it.

`--security-dry-run` or `--dry-run` do not have an affect on the generate command, as this command is used to create the JCL for all the other init commands and their `--dry-run` options.

The following JCL will be created into the jcllib, using the content of the same name from within the SZWESAMP dataset:

Instance dataset creation:
- ZWEIMVS: Creates Zowe instance datasets
- ZWERMVS: Removes these datasets
- ZWEIMVS2: Creates the `zowe.setup.dataset.authLoadLib` dataset if you have customized its name. This is not recommended, it is best to leave it as default.
- ZWERMVS2: Removes the above customized dataset.

VSAM for caching service creation:
- ZWECSVSM: Creates a VSAM for the caching service
- ZWECSRVS: Removes the VSAM

ZIS APF Authorization:
- ZWEIAPF: An example of how one would APF authorize the ZIS content of Zowe.
- ZWEIAPF2: An example of how one would APF authorize the ZIS content of Zowe.
You may wish to do this step another way.
You can read https://docs.zowe.org/stable/user-guide/apf-authorize-load-library to learn more.

SAF permission setup:
- ZWEIRAC: Sets up SAF permissions for RACF
- ZWEIRACZ: Sets up the Zowe class for RACF if on z/OS 2.4 or older
- ZWEITSS: Sets up SAF permissions for TSS
- ZWEITSSZ: Sets up the Zowe class for TSS if on z/OS 2.4 or older
- ZWEIACF: Sets up SAF permissions for ACF2
- ZWEIACFZ: Sets up the Zowe class for ACF2 if on z/OS 2.4 or older

SAF permission removal:
- ZWENOSEC: Removes SAF permissions. Has RACF, TSS, ACF2 sections.


Keyring creation:
- ZWEIKRR1: Creates a keyring and certificate for RACF
- ZWEIKRR2: Creates a keyring and connects a certificate for RACF
- ZWEIKRR3: Creates a keyring and imports a certificate for RACF
- ZWEIKRT1: Creates a keyring and certificate for TSS
- ZWEIKRT2: Creates a keyring and connects a certificate for TSS
- ZWEIKRT3: Creates a keyring and imports a certificate for TSS
- ZWEIKRA1: Creates a keyring and certificate for ACF2
- ZWEIKRA2: Creates a keyring and connects a certificate for ACF2
- ZWEIKRA3: Creates a keyring and imports a certificate for ACF2

Keyring removal:
- ZWENOKRR: Removes Zowe's keyring for RACF
- ZWENOKRT: Removes Zowe's keyring for TSS
- ZWENORRA: Removes Zowe's keyring for ACF2

STC job setup:
- ZWEISTC: Copies the STC JCL of Zowe into your proclib
- ZWERSTC: Removes the Zowe STC JCL from the proclib


If you want to use a premade keyring with Zowe,, do not run these. These are for Zowe assisting in keyring creation.

The above datasets can be run to set up a Zowe instance.
You can also use `zwe init` or `zwe init` subcommands to have them run automatically.
2 changes: 0 additions & 2 deletions bin/commands/init/index.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
# Copyright Contributors to the Zowe Project.
#######################################################################

init_missing_yaml_properties

if [ -z "${ZWE_PRIVATE_TMP_MERGED_YAML_DIR}" ]; then
# user-facing command, use tmpdir to not mess up workspace permissions
export ZWE_PRIVATE_TMP_MERGED_YAML_DIR=1
Expand Down
2 changes: 1 addition & 1 deletion bin/commands/init/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export function execute(allowOverwrite?: boolean, dryRun?: boolean, ignoreSecuri
common.printMessage(` home: "${newJavaHome}"`);
}

common.printLevel2Message(`Please manually update "${std.getenv('ZWE_CLI_PARAMETER_CONFIG')}" before you start Zowe.`);
common.printLevel2Message(`Please manually update "${std.getenv('ZWE_CLI_PARAMETER_CONFIG_ORIG')}" before you start Zowe.`);
}
} else {
common.printLevel2Message(`No need to update runtime directory, Java and node.js settings.`);
Expand Down
2 changes: 0 additions & 2 deletions bin/commands/init/mvs/index.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
# Copyright Contributors to the Zowe Project.
#######################################################################

init_missing_yaml_properties

if [ -z "${ZWE_PRIVATE_TMP_MERGED_YAML_DIR}" ]; then
# user-facing command, use tmpdir to not mess up workspace permissions
export ZWE_PRIVATE_TMP_MERGED_YAML_DIR=1
Expand Down
2 changes: 1 addition & 1 deletion bin/libs/java.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export function requireJava() {
}
}
if (!std.getenv('JAVA_HOME')) {
common.printErrorAndExit("Error ZWEL0122E: Cannot find java. Set the java.path value in the Zowe YAML, or include java in the PATH environment variable of any accounts that start or manage Zowe", undefined, 122);
common.printErrorAndExit("Error ZWEL0122E: Cannot find java. Set the java.home value in the Zowe YAML, or include java in the PATH environment variable of any accounts that start or manage Zowe", undefined, 122);
}

ensureJavaIsOnPath();
Expand Down
2 changes: 1 addition & 1 deletion bin/libs/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export function requireNode() {
}
}
if (!std.getenv('NODE_HOME')) {
common.printErrorAndExit("Error ZWEL0121E: Cannot find node. Set the node.path value in the Zowe YAML, or include node in the PATH environment variable of any accounts that start or manage Zowe", undefined, 121);
common.printErrorAndExit("Error ZWEL0121E: Cannot find node. Set the node.home value in the Zowe YAML, or include node in the PATH environment variable of any accounts that start or manage Zowe", undefined, 121);
}

ensureNodeIsOnPath();
Expand Down
2 changes: 1 addition & 1 deletion workflows/templates/ZWESECUR.vtl
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
// SET ZISUSER=#[[{zowe.setup.security.users.zis}]]#
// SET ZOWESTC=#[[{zowe.setup.security.stcs.zowe}]]#
// SET ZISSTC=#[[{zowe.setup.security.stcs.zis}]]#
// SET AUXSTC=#[[zowe.setup.security.stcs.aux}]]#
// SET AUXSTC=#[[{zowe.setup.security.stcs.aux}]]#
// SET HLQ=#[[{zowe.setup.dataset.prefix}]]#
// SET SYSPROG=#[[{zowe.setup.security.groups.sysProg}]]#
//*
Expand Down

0 comments on commit f77b238

Please sign in to comment.