IBM / ibm_zos_zosmf

Ansible collection to work with z/OS based on z/OS Management Facility (z/OSMF).
21 stars 14 forks source link

Can't set workflow_host in zmf_workflow_complete role #87

Closed tobias-huschle closed 3 years ago

tobias-huschle commented 3 years ago

Hi all,

In ibm_zos_zosmf/roles/zmf_workflow_complete/tasks/main.yml

Lines 16 and 63: workflow_host: "{{ inventory_hostname | default() }}"

This prevents me to override the workflow_host variable when using the role. Should this not be workflow_host | default() with defaulting to inventory_hostname?

Kind regards, Tobias

zosmf-Young commented 3 years ago

Hi Tobias,

This role is designed to use inventory_hostname as the workflow_host which is the target system nickname on which the z/OSMF workflow will be run. As you know, Ansible itself uses inventory to manage the nodes/systems, so we also want to follow the same philosophy. If you want to run the workflow on a different system, what you should do is add one more system to the inventory file and put it to the hosts of the playbook instead of changing this workflow_host variable.

For example, there are 2 z/OS systems in the same sysplex, one is SY1, the other is SYS2, and z/OSMF is only running on SY1. And the z/OSMF manages both SY1 and SY2. Then in the inventory, you can put SY1 and SY2 in the same group, then use group_vars/sysplex1.yml to configure the z/OSMF which manages the systems.

in hosts file:

[sysplex1]
SY1
SY2

in group_vars/sysplex1.yml:

zmf_host=SY1.com
zmf_port=443
zmf_user=user1
zmf_password=***

After doing the above configuration, when you want to change the system on which the workflow will be run, just change the hosts in the playbook. No need to change the workflow_host variable, this also complies with the Ansible philosophy.

tobias-huschle commented 3 years ago

Ahhh, gotcha. That makes sense.

Thanks for the clarification 👍