003 File Manager
Current Path:
/usr/local/lib/python3.8/site-packages/salt/roster
usr
/
local
/
lib
/
python3.8
/
site-packages
/
salt
/
roster
/
📁
..
📄
__init__.py
(3.53 KB)
📁
__pycache__
📄
ansible.py
(3.87 KB)
📄
cache.py
(7.27 KB)
📄
cloud.py
(3.61 KB)
📄
clustershell.py
(1.52 KB)
📄
dir.py
(3.32 KB)
📄
flat.py
(933 B)
📄
range.py
(2.25 KB)
📄
scan.py
(2.04 KB)
📄
sshconfig.py
(4.35 KB)
📄
terraform.py
(5.02 KB)
Editing: flat.py
""" Read in the roster from a flat file using the renderer system """ import logging import salt.config import salt.loader from salt.roster import get_roster_file from salt.template import compile_template log = logging.getLogger(__name__) def targets(tgt, tgt_type="glob", **kwargs): """ Return the targets from the flat yaml file, checks opts for location but defaults to /etc/salt/roster """ template = get_roster_file(__opts__) rend = salt.loader.render(__opts__, {}) raw = compile_template( template, rend, __opts__["renderer"], __opts__["renderer_blacklist"], __opts__["renderer_whitelist"], mask_value="passw*", **kwargs ) conditioned_raw = {} for minion in raw: conditioned_raw[str(minion)] = salt.config.apply_sdb(raw[minion]) return __utils__["roster_matcher.targets"](conditioned_raw, tgt, tgt_type, "ipv4")
Upload File
Create Folder