import test
Dieser Commit ist enthalten in:
Ursprung
ebca030585
Commit
e2fdd94da4
|
@ -7,10 +7,11 @@ try:
|
||||||
from ansible.module_utils.generic import Types
|
from ansible.module_utils.generic import Types
|
||||||
from ansible.module_utils.module import SystemdUnitModule
|
from ansible.module_utils.module import SystemdUnitModule
|
||||||
except ImportError:
|
except ImportError:
|
||||||
from generic import SYSTEMD_NETWORK_CONFIG as SYSTEMD_PATH
|
import sys
|
||||||
from generic import Types
|
print(sys.path)
|
||||||
from module import SystemdUnitModule
|
from module_utils.generic import SYSTEMD_NETWORK_CONFIG as SYSTEMD_PATH
|
||||||
|
from module_utils.generic import Types
|
||||||
|
from module_utils.module import SystemdUnitModule
|
||||||
|
|
||||||
class Module(SystemdUnitModule):
|
class Module(SystemdUnitModule):
|
||||||
"""generates an systemd-networkd link"""
|
"""generates an systemd-networkd link"""
|
||||||
|
|
|
@ -1,15 +1,13 @@
|
||||||
#!/usr/bin/python3
|
#!/usr/bin/python3
|
||||||
import pathlib
|
import pathlib
|
||||||
from typing import List, Optional
|
from typing import List, Optional
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from ansible.module_utils.generic import SYSTEMD_SERVICE_CONFIG as SYSTEMD_PATH
|
from ansible.module_utils.generic import SYSTEMD_SERVICE_CONFIG as SYSTEMD_PATH
|
||||||
from ansible.module_utils.generic import Types
|
from ansible.module_utils.generic import Types
|
||||||
from ansible.module_utils.module import SystemdUnitModule
|
from ansible.module_utils.module import SystemdUnitModule
|
||||||
except ImportError:
|
except ImportError:
|
||||||
from generic import SYSTEMD_SERVICE_CONFIG as SYSTEMD_PATH
|
import sys
|
||||||
from generic import Types
|
print(sys.path)
|
||||||
from module import SystemdUnitModule
|
|
||||||
|
|
||||||
SYSTEMD_PATH = pathlib.Path("/etc/systemd/system")
|
SYSTEMD_PATH = pathlib.Path("/etc/systemd/system")
|
||||||
|
|
||||||
|
|
|
@ -7,9 +7,8 @@ try:
|
||||||
from ansible.module_utils.generic import Types
|
from ansible.module_utils.generic import Types
|
||||||
from ansible.module_utils.module import SystemdUnitModule
|
from ansible.module_utils.module import SystemdUnitModule
|
||||||
except ImportError:
|
except ImportError:
|
||||||
from generic import SYSTEMD_NETWORK_CONFIG as SYSTEMD_PATH
|
import sys
|
||||||
from generic import Types
|
print(sys.path)
|
||||||
from module import SystemdUnitModule
|
|
||||||
|
|
||||||
def boolconvert(b: Union[bool, str]) -> str:
|
def boolconvert(b: Union[bool, str]) -> str:
|
||||||
if b is True:
|
if b is True:
|
||||||
|
|
|
@ -3,10 +3,11 @@ import re
|
||||||
import pathlib
|
import pathlib
|
||||||
import importlib
|
import importlib
|
||||||
import sys
|
import sys
|
||||||
|
import ansible.module_utils
|
||||||
|
|
||||||
sys.path.append("plugins/module_utils")
|
|
||||||
sys.path.append("plugins/modules")
|
|
||||||
mindocstring = "DOCUMENTATION = ''''''"
|
mindocstring = "DOCUMENTATION = ''''''"
|
||||||
|
sys.path.append("plugins/modules")
|
||||||
|
sys.path.append(".")
|
||||||
|
|
||||||
moduledir = pathlib.Path("plugins/modules")
|
moduledir = pathlib.Path("plugins/modules")
|
||||||
regex = re.compile("DOCUMENTATION *= *r?(?P<quote>\"{3}|'{3})(---)?.*?(?P=quote)", re.MULTILINE | re.DOTALL)
|
regex = re.compile("DOCUMENTATION *= *r?(?P<quote>\"{3}|'{3})(---)?.*?(?P=quote)", re.MULTILINE | re.DOTALL)
|
||||||
|
@ -15,7 +16,7 @@ if __name__ == "__main__":
|
||||||
for modfile in moduledir.iterdir():
|
for modfile in moduledir.iterdir():
|
||||||
if modfile.name in ( "__init__.py", "__pycache__"):
|
if modfile.name in ( "__init__.py", "__pycache__"):
|
||||||
continue
|
continue
|
||||||
mod = importlib.import_module(modfile.stem)
|
mod = importlib.import_module("plugins.modules."+modfile.stem)
|
||||||
if hasattr(mod, "Module"):
|
if hasattr(mod, "Module"):
|
||||||
module = mod.Module
|
module = mod.Module
|
||||||
elif hasattr(mod, "__module_name__"):
|
elif hasattr(mod, "__module_name__"):
|
||||||
|
|
Laden…
In neuem Issue referenzieren