Skip to content

[Enabler][Research][ibm_zos_*] Review all modules that can benefit from disposition share mode (DISP=SHR) #357

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ddimatos opened this issue Jul 22, 2022 · 4 comments
Assignees
Labels
Enabler Enabler task In Plan Issue has been accepted put into a planned release

Comments

@ddimatos
Copy link
Collaborator

ddimatos commented Jul 22, 2022

FEATURE

Many modules in the ibm_zos_core collection work with data sets that could benefit from DISP=SHR, for example the ibm_zos_data set calls ZOAU mrm and if the data set is being accessed by a long running task (started task or any other task) it will fail to delete the member.

This issue is to review all the ibm_zos_core modules and figure out which ones could benefit to support a mode of (force). This issue should return a researched list of modules, in doing so, it should also return a list of ZOAU functions needing to be enhanced to support DISP=SHR.

@ddimatos ddimatos added the Enhancement Enhancement to existing collection content label Jul 22, 2022
@ddimatos ddimatos added the In Plan Issue has been accepted put into a planned release label Jul 22, 2022
@ddimatos ddimatos added this to the 2022 - Q4 Enhancments milestone Sep 23, 2022
@ddimatos ddimatos moved this from ⚙ Backlog to 📗In plan in IBM Ansible z/OS Core Collection Sep 24, 2022
@ddimatos ddimatos changed the title [Feature][ibm_zos_*] Review all modules that can benefit from dispostion share mode (DISP=SHR) [Enabler][Research][ibm_zos_*] Review all modules that can benefit from dispostion share mode (DISP=SHR) Sep 25, 2022
@ddimatos ddimatos added Enabler Enabler task and removed Enhancement Enhancement to existing collection content labels Sep 25, 2022
@ddimatos
Copy link
Collaborator Author

Related to issue #356 and #358

@ketankelkar
Copy link
Collaborator

remember to take a look at zos_blockinfile

@ketankelkar
Copy link
Collaborator

This task may not be as straightforward as simply adding a "disp=shr" option and calling mrm -f in the background because mrm -f will force-remove an in-use member which does not fit the disp=shr use case -- immediate options i see are:

  • add a force option, let mrm -f do its work
  • add some check on the ansible end to see if target member is in use before allowing mrm -f to proceed
  • do more research to find a more elegant solution

@ketankelkar
Copy link
Collaborator

had a chance to look into this slightly, set up a playbook to test out some approaches -- this will definitely require additional research into the capabilities of disp=shr and where it's appropriate and where it's not

---
- name: hi
  hosts: zos_host
  collections:
    - ibm.ibm_zos_core
  gather_facts: no
  
  vars:

    ZOAU: /zoau/v1.2.2
    PYZ: /python2/usr/lpp/IBM/cyp/v3r9/pyz/

    DEFAULT_DATA_SET_NAME: "OMVSADM.DISPSHR.TESTDS"
    DEFAULT_DATA_SET_NAME_2: "OMVSADM.DISPSHR.TESTDS2"

  environment:
    _BPXK_AUTOCVT: "ON"
    ZOAU_HOME: "{{ ZOAU }}"
    PYTHONPATH: "{{ ZOAU }}/lib"
    LIBPATH: "{{ ZOAU }}/lib:{{ PYZ }}/lib:/lib:/usr/lib:."
    PATH: "{{ ZOAU }}/bin:{{ PYZ }}/bin:/bin:/var/bin"
    _CEE_RUNOPTS: "FILETAG(AUTOCVT,AUTOTAG) POSIX(ON)"
    _TAG_REDIR_ERR: "txt"
    _TAG_REDIR_IN: "txt"
    _TAG_REDIR_OUT: "txt"
    LANG: "C"


  tasks:

  - name: create pdse
    tags: setup, boilerplate
    zos_data_set:
      name: "{{ item }}"
      state: "present"
      type: "pdse"
      replace: True
    loop:
      - "{{ DEFAULT_DATA_SET_NAME }}"
      - "{{ DEFAULT_DATA_SET_NAME_2 }}"

  - name: add members
    tags: setup, boilerplate
    zos_data_set:
      name: "{{ DEFAULT_DATA_SET_NAME }}({{item}})"
      type: "member"
      state: "present"
      replace: True
    loop:
      - "MEM1"
      - "MEM2"
      - "COPYDEST"
      - "COPYSRC"
      - "CPYDEST2"
      - "ENCODE"
      - "SUBMIT"

  - name: "Add lines path to COPYSRC"
    zos_blockinfile:
      src: "{{ DEFAULT_DATA_SET_NAME }}(COPYSRC)"
      block: |
        this is line one
        another line
        third line in mem1

  - name: \"acquire lock\" ie open data set in ispf
    pause:

  # seems to work fine with force
  - name: zos_copy dest is "locked" member - no force
    zos_copy:
      src: "{{ playbook_dir }}/inventory"
      dest: "{{ DEFAULT_DATA_SET_NAME }}(COPYDEST)"
    ignore_errors: yes

  - name: zos_copy dest is "locked" member - force
    zos_copy:
      src: "{{ playbook_dir }}/inventory"
      dest: "{{ DEFAULT_DATA_SET_NAME }}(COPYDEST)"
      force: True
    ignore_errors: yes

  - name: zos_copy src is "locked" member - no force
    zos_copy:
      src: "{{ DEFAULT_DATA_SET_NAME }}(COPYDEST)"
      dest: "{{ DEFAULT_DATA_SET_NAME_2 }}(MEM1)"
      remote_src: yes
      force: no
    ignore_errors: yes

  - name: zos_copy src is "locked" member - force
    zos_copy:
      src: "{{ DEFAULT_DATA_SET_NAME }}(COPYDEST)"
      dest: "{{ DEFAULT_DATA_SET_NAME_2 }}(MEM1)"
      remote_src: yes
      force: yes
    ignore_errors: yes

  - name: zos_encode dest is "locked" member
    zos_encode:
      src: "/samples/Makefile"
      dest: "{{DEFAULT_DATA_SET_NAME}}(ENCODE)"
      encoding:
        from: ISO8859-1
        to: IBM-1047
    ignore_errors: yes

  # - name: zos_job_submit dest is "locked" member
  #   zos_job_submit:
  #     src: "{{DEFAULT_DATA_SET_NAME}}(SUBMIT)"
  #     location: PDS


  - pause:

  # clean up
  - name: clean up
    tags: clean, cleanup, boilerplate
    zos_data_set:
      name: "{{ DEFAULT_DATA_SET_NAME }}"
      state: absent

@ddimatos ddimatos changed the title [Enabler][Research][ibm_zos_*] Review all modules that can benefit from dispostion share mode (DISP=SHR) [Enabler][Research][ibm_zos_*] Review all modules that can benefit from disposition share mode (DISP=SHR) Sep 19, 2023
@ddimatos ddimatos assigned IBMAnsibleHelper and unassigned richp405 Jan 3, 2024
@ddimatos ddimatos moved this from 📗In plan to ⚙ Backlog in IBM Ansible z/OS Core Collection Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enabler Enabler task In Plan Issue has been accepted put into a planned release
Projects
Status: Backlog
Development

No branches or pull requests

4 participants