Riddhesh Singasane
Riddhesh Singasane

Reputation: 11

Autosys Job: machine name parametrization

I am creating a Autosys Job as follows:

/* ----------------- GLB_1045_AMDGC_IntegrationAMDH_DEV ----------------- */


insert_job: GLB_1045_AMDGC_Integration_DEV   job_type: CMD

command: /app/localstorage/AMDGC/Scripts/Integration_trigger.sh

machine: 1045_VM_AMDGC_APP_DEV2

owner: dgovdev

permission: gx,mx

date_conditions: 1

days_of_week: mo

start_times: "10:00"

description: "This Job is to trigger Integration workflow instance"

n_retrys: 2

std_out_file: "$LOGS_DIR/$AUTO_JOB_NAME.$AUTORUN"

std_err_file: "$LOGS_DIR/$AUTO_JOB_NAME.$AUTORUN"

max_run_alarm: 5

alarm_if_fail: 1

profile: "/app/localstorage/AMDGC/Profile/env.profile"

timezone: US/Eastern

I want to parameterize the machine name so that JIL will read it from env.profile file something similar to :

machine: ${machine_name}

where machine_name property is present in env.profile file like this:

machine_name=1045_VM_AMDGC_APP_DEV2

I tried it but getting error while submitting JIl on server.

Upvotes: 1

Views: 3826

Answers (1)

ppp
ppp

Reputation: 1005

It may not be possible to get machine name from profile file because profile file gets sourced on the machine before executing command from autosys definition, i.e. machine is a pre-requisite to read profile file.

You could use machine chooser script in machine attribute. But this is NOT a recommended way because it poses security risks as it executes the script on AE server.

machine: `script_that_returns_machine_name`

Better way is to use virtual machines if you do not want to hardcode the machine names in autosys definitions.

Upvotes: 0

Related Questions