690
690
- The DD name.
691
691
required: true
692
692
type: str
693
+ dd_volume:
694
+ description:
695
+ - Use I(dd_volume) to specify the volume to use in the DD statement.
696
+ required: false
697
+ type: dict
698
+ suboptions:
699
+ dd_name:
700
+ description: The DD name.
701
+ required: true
702
+ type: str
703
+ volume_name:
704
+ description:
705
+ - The volume serial number.
706
+ type: str
707
+ required: true
708
+ unit:
709
+ description:
710
+ - Device type for the volume.
711
+ - This option is case sensitive.
712
+ type: str
713
+ required: true
714
+ disposition:
715
+ description:
716
+ - I(disposition) indicates the status of a data set.
717
+ type: str
718
+ required: true
719
+ choices:
720
+ - new
721
+ - shr
722
+ - mod
723
+ - old
693
724
dd_concat:
694
725
description:
695
726
- I(dd_concat) is used to specify a data set concatenation.
1351
1382
dd_name: sysin
1352
1383
content: " LISTCAT ENTRIES('SOME.DATASET.*')"
1353
1384
1385
+ - name: Full volume dump using ADDRDSU.
1386
+ zos_mvs_raw:
1387
+ program_name: adrdssu
1388
+ auth: true
1389
+ dds:
1390
+ - dd_data_set:
1391
+ dd_name: dumpdd
1392
+ data_set_name: mypgm.output.ds
1393
+ disposition: new
1394
+ disposition_normal: catalog
1395
+ disposition_abnormal: delete
1396
+ space_type: cyl
1397
+ space_primary: 10
1398
+ space_secondary: 10
1399
+ record_format: u
1400
+ record_length: 0
1401
+ block_size: 32760
1402
+ type: seq
1403
+ - dd_volume:
1404
+ dd_name: voldd
1405
+ volume_name: "000000"
1406
+ unit: "3390"
1407
+ disposition: old
1408
+ - dd_input:
1409
+ dd_name: sysin
1410
+ content: " VOLDUMP VOL(voldd) DSNAME(dumpdd) FULL"
1411
+ - dd_output:
1412
+ dd_name: sysprint
1413
+ return_content:
1414
+ type: text
1415
+
1354
1416
- name: List data sets matching patterns in catalog,
1355
1417
save output to a new sequential data set and return output as text.
1356
1418
zos_mvs_raw:
1698
1760
DDStatement ,
1699
1761
DummyDefinition ,
1700
1762
VIODefinition ,
1763
+ VolumeDefinition ,
1701
1764
)
1702
1765
1703
1766
from ansible_collections .ibm .ibm_zos_core .plugins .module_utils .zos_mvs_raw import (
@@ -1907,14 +1970,19 @@ def run_module():
1907
1970
),
1908
1971
)
1909
1972
)
1910
-
1973
+ dd_volume_base = dict (
1974
+ volume_name = dict (type = "str" , required = True ),
1975
+ unit = dict (type = "str" , required = True ),
1976
+ disposition = dict (type = "str" , choices = ["new" , "shr" , "mod" , "old" ], required = True ),
1977
+ )
1911
1978
dd_data_set = dict (type = "dict" , options = combine_dicts (dd_name_base , dd_data_set_base ))
1912
1979
dd_unix = dict (type = "dict" , options = combine_dicts (dd_name_base , dd_unix_base ))
1913
1980
dd_input = dict (type = "dict" , options = combine_dicts (dd_name_base , dd_input_base ))
1914
1981
dd_output = dict (type = "dict" , options = combine_dicts (dd_name_base , dd_output_base ))
1915
1982
dd_dummy = dict (type = "dict" , options = combine_dicts (dd_name_base , dd_dummy_base ))
1916
1983
dd_vio = dict (type = "dict" , options = combine_dicts (dd_name_base , dd_vio_base ))
1917
1984
dd_concat = dict (type = "dict" , options = combine_dicts (dd_name_base , dd_concat_base ))
1985
+ dd_volume = dict (type = "dict" , options = combine_dicts (dd_name_base , dd_volume_base ))
1918
1986
1919
1987
module_args = dict (
1920
1988
program_name = dict (type = "str" , aliases = ["program" , "pgm" ], required = True ),
@@ -1934,6 +2002,7 @@ def run_module():
1934
2002
dd_vio = dd_vio ,
1935
2003
dd_concat = dd_concat ,
1936
2004
dd_dummy = dd_dummy ,
2005
+ dd_volume = dd_volume ,
1937
2006
),
1938
2007
),
1939
2008
)
@@ -2148,14 +2217,19 @@ def parse_and_validate_args(params):
2148
2217
),
2149
2218
)
2150
2219
)
2151
-
2220
+ dd_volume_base = dict (
2221
+ volume_name = dict (type = "str" , required = True ),
2222
+ unit = dict (type = "str" , required = True ),
2223
+ disposition = dict (type = "str" , choices = ["new" , "shr" , "mod" , "old" ], required = True ),
2224
+ )
2152
2225
dd_data_set = dict (type = "dict" , options = combine_dicts (dd_name_base , dd_data_set_base ))
2153
2226
dd_unix = dict (type = "dict" , options = combine_dicts (dd_name_base , dd_unix_base ))
2154
2227
dd_input = dict (type = "dict" , options = combine_dicts (dd_name_base , dd_input_base ))
2155
2228
dd_output = dict (type = "dict" , options = combine_dicts (dd_name_base , dd_output_base ))
2156
2229
dd_dummy = dict (type = "dict" , options = combine_dicts (dd_name_base , dd_dummy_base ))
2157
2230
dd_vio = dict (type = "dict" , options = combine_dicts (dd_name_base , dd_vio_base ))
2158
2231
dd_concat = dict (type = "dict" , options = combine_dicts (dd_name_base , dd_concat_base ))
2232
+ dd_volume = dict (type = "dict" , options = combine_dicts (dd_name_base , dd_volume_base ))
2159
2233
2160
2234
module_args = dict (
2161
2235
program_name = dict (type = "str" , aliases = ["program" , "pgm" ], required = True ),
@@ -2176,6 +2250,7 @@ def parse_and_validate_args(params):
2176
2250
dd_vio = dd_vio ,
2177
2251
dd_concat = dd_concat ,
2178
2252
dd_dummy = dd_dummy ,
2253
+ dd_volume = dd_volume ,
2179
2254
),
2180
2255
),
2181
2256
# verbose=dict(type="bool", required=False),
@@ -2690,6 +2765,9 @@ def get_dd_name_and_key(dd):
2690
2765
elif dd .get ("dd_concat" ):
2691
2766
dd_name = dd .get ("dd_concat" ).get ("dd_name" )
2692
2767
key = "dd_concat"
2768
+ elif dd .get ("dd_volume" ):
2769
+ dd_name = dd .get ("dd_volume" ).get ("dd_name" )
2770
+ key = "dd_volume"
2693
2771
return dd_name , key
2694
2772
2695
2773
@@ -2797,6 +2875,14 @@ def build_data_definition(dd):
2797
2875
dd .get ("dd_vio" ).get ("tmphlq" ))
2798
2876
elif dd .get ("dd_dummy" ):
2799
2877
data_definition = DummyDefinition ()
2878
+ elif dd .get ("dd_volume" ):
2879
+ volume_args = dd ["dd_volume" ]
2880
+ data_definition = VolumeDefinition (
2881
+ volume_name = volume_args .get ("volume_name" ),
2882
+ unit = volume_args .get ("unit" ),
2883
+ disposition = volume_args .get ("disposition" ),
2884
+ )
2885
+
2800
2886
elif dd .get ("dd_concat" ):
2801
2887
data_definition = []
2802
2888
for single_dd in dd .get ("dd_concat" ).get ("dds" , []):
0 commit comments