-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from IBM/1.0.1
v1.0.1
- Loading branch information
Showing
31 changed files
with
336 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
kubernetes==28.1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,52 @@ | ||
kubernetes==11.0.0 | ||
# | ||
# This file is autogenerated by pip-compile with Python 3.9 | ||
# by the following command: | ||
# | ||
# pip-compile --output-file=collections/requirements.txt collections-requirements.txt | ||
# | ||
cachetools==5.3.1 | ||
# via google-auth | ||
certifi==2023.7.22 | ||
# via | ||
# kubernetes | ||
# requests | ||
charset-normalizer==3.3.0 | ||
# via requests | ||
google-auth==2.23.3 | ||
# via kubernetes | ||
idna==3.4 | ||
# via requests | ||
kubernetes==28.1.0 | ||
# via -r collections-requirements.txt | ||
oauthlib==3.2.2 | ||
# via | ||
# kubernetes | ||
# requests-oauthlib | ||
pyasn1==0.5.0 | ||
# via | ||
# pyasn1-modules | ||
# rsa | ||
pyasn1-modules==0.3.0 | ||
# via google-auth | ||
python-dateutil==2.8.2 | ||
# via kubernetes | ||
pyyaml==6.0.1 | ||
# via kubernetes | ||
requests==2.31.0 | ||
# via | ||
# kubernetes | ||
# requests-oauthlib | ||
requests-oauthlib==1.3.1 | ||
# via kubernetes | ||
rsa==4.9 | ||
# via google-auth | ||
six==1.16.0 | ||
# via | ||
# kubernetes | ||
# python-dateutil | ||
urllib3==1.26.18 | ||
# via | ||
# kubernetes | ||
# requests | ||
websocket-client==1.6.4 | ||
# via kubernetes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
-r collections/requirements.txt | ||
ansible-core | ||
ansible-lint | ||
ansible-core==2.15.5 | ||
ansible-lint==6.21.1 | ||
pytest==7.4.0 | ||
pytest-xdist==1.34.0 | ||
pytest-xdist==1.34.0 | ||
pylint==3.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# (c) Copyright IBM Corp. 2023 | ||
# Apache License, Version 2.0 (see https://opensource.org/licenses/Apache-2.0) | ||
--- | ||
requires_ansible: ">=2.9.10" | ||
requires_ansible: ">=2.13.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
# (c) Copyright IBM Corp. 2023 | ||
# Apache License, Version 2.0 (see https://opensource.org/licenses/Apache-2.0) | ||
from ansible.plugins.action import ActionBase | ||
|
||
# All instances of this role must be identical. Cloud broker does not execute playbooks | ||
# in this collection using FQCN, so as far as Ansible in CB is concerned, we're | ||
# executing an ad-hoc playbook. That means that Ansible will search for referenced | ||
# assets differently. | ||
# | ||
# In this case in CB, Ansible will look for action plugins relative to the | ||
# playbook in an action_plugins directory, rather than the collection-specific | ||
# location plugins/actions, relative to the collection root. In order to make this | ||
# collection executable as a collection and by cloud broker, this file is instead | ||
# embedded in all roles that require it independently, to work around this limitation. | ||
# | ||
# These files must be identical and tests/unit/test_detect_environment_duplicated.py | ||
# verifies this constraint. | ||
|
||
WAZI_SANDBOX_PRE_26_PYTHON_HOME = "/usr/lpp/IBM/cyp/v3r9/pyz" | ||
WAZI_SANDBOX_26_PYTHON_HOME = "/usr/lpp/IBM/cyp/pyz" | ||
|
||
|
||
class ActionModule(ActionBase): | ||
|
||
def run(self, tmp=None, task_vars=None): | ||
super(ActionModule, self).run(tmp, task_vars) | ||
|
||
# Execute an SSH command that doesn't require a python interepreter | ||
shell_result = self._low_level_execute_command(f"file {WAZI_SANDBOX_PRE_26_PYTHON_HOME}/bin/python3") | ||
|
||
discovered = {} | ||
if "FSUM6484" not in shell_result['stdout']: | ||
# wazi sandbox pre 2.6 | ||
pyz = WAZI_SANDBOX_PRE_26_PYTHON_HOME | ||
dfh_zos_stcjobs = "USER.Z25C.PROCLIB" | ||
else: | ||
# wazi sandbox 2.6 | ||
pyz = WAZI_SANDBOX_26_PYTHON_HOME | ||
dfh_zos_stcjobs = "USER.Z25D.PROCLIB" | ||
|
||
zoau_home = "/usr/lpp/IBM/zoautil" | ||
dfh_zfs_mountpoint = "/u/ibmuser/regions" | ||
|
||
discovered.update({ | ||
"pyz": pyz, | ||
"z_environment_vars": { | ||
"_BPXK_AUTOCVT": "ON", | ||
"ZOAU_HOME": zoau_home, | ||
"LIBPATH": f"{ zoau_home }/lib:{ pyz }/lib:/lib:/usr/lib:.", | ||
"PATH": f"{ zoau_home }/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", | ||
"PYTHONSTDINENCODING": "cp1047" | ||
}, | ||
|
||
"DFH_APPLID_PREFIX": "ZCICS", | ||
"JOB_CARD": "JOB REGION=0M,MSGLEVEL=(1,1),MSGCLASS=R", | ||
"DFH_CICS_HLQ": "DFH610.CICS", | ||
"DFH_CICS_LICENSE_DATASET": "DFH610.SDFHLIC", | ||
"DFH_LE_HLQ": "CEE", | ||
"DFH_ZOS_STCJOBS": dfh_zos_stcjobs, | ||
"DFH_CICS_USSHOME": "/usr/lpp/cicsts/cicsts61", | ||
"DFH_REGION_CICSSVC": 216, | ||
"DFH_REGION_SIT": "6$", | ||
"DFH_REGION_DFLTUSER": "CICSUSER", | ||
"DFH_REGION_HLQ": "IBMUSER.REGIONS", | ||
"DFH_ZFS_MOUNTPOINT": dfh_zfs_mountpoint, | ||
"DFH_ZFS_METADATA": f"{ dfh_zfs_mountpoint }/metadata", | ||
"DFH_STC_JOB_CARD": "JOB REGION=0M,MSGLEVEL=(1,1),MSGCLASS=R,NOTIFY=IBMUSER", | ||
"DFH_ZOS_VSAM_UNIT": "SYSDA" | ||
}) | ||
|
||
return dict( | ||
ansible_facts=discovered | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/usr/bin/python | ||
# -*- coding: utf-8 -*- | ||
|
||
# (c) Copyright IBM Corp. 2023 | ||
# Apache License, Version 2.0 (see https://opensource.org/licenses/Apache-2.0) | ||
|
||
DOCUMENTATION = r""" | ||
--- | ||
module: detect_environment | ||
short_description: Detect environment and facts for Wazi Sandbox | ||
description: | ||
- Detect environment and facts for Wazi Sandbox | ||
version_added: 1.0.0 | ||
author: | ||
- IBM (@IBM) | ||
""" | ||
|
||
EXAMPLES = r""" | ||
- name: Detect environment | ||
detect_environment: | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.