Linux webserver 6.8.0-49-generic #49~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Nov 6 17:42:15 UTC 2 x86_64
Apache/2.4.52 (Ubuntu)
Server IP : 192.168.1.1 & Your IP : 13.58.157.160
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
lib /
python3 /
dist-packages /
cloudinit /
config /
Delete
Unzip
Name
Size
Permission
Date
Action
__pycache__
[ DIR ]
drwxr-xr-x
2024-09-18 19:49
schemas
[ DIR ]
drwxr-xr-x
2024-09-18 19:49
__init__.py
40
B
-rw-r--r--
2024-07-03 01:59
cc_ansible.py
7.66
KB
-rw-r--r--
2024-07-03 01:59
cc_apk_configure.py
4.25
KB
-rw-r--r--
2024-07-03 01:59
cc_apt_configure.py
38.07
KB
-rw-r--r--
2024-07-03 01:59
cc_apt_pipelining.py
1.86
KB
-rw-r--r--
2024-07-03 01:59
cc_bootcmd.py
1.67
KB
-rw-r--r--
2024-07-03 01:59
cc_byobu.py
2.66
KB
-rw-r--r--
2024-07-03 01:59
cc_ca_certs.py
8.35
KB
-rw-r--r--
2024-07-03 01:59
cc_chef.py
12.2
KB
-rw-r--r--
2024-07-03 01:59
cc_disable_ec2_metadata.py
1.62
KB
-rw-r--r--
2024-07-03 01:59
cc_disk_setup.py
29.99
KB
-rw-r--r--
2024-07-03 01:59
cc_fan.py
1.97
KB
-rw-r--r--
2024-07-03 01:59
cc_final_message.py
2.49
KB
-rw-r--r--
2024-07-03 01:59
cc_growpart.py
18.39
KB
-rw-r--r--
2024-07-03 01:59
cc_grub_dpkg.py
5.44
KB
-rw-r--r--
2024-07-03 01:59
cc_install_hotplug.py
3.21
KB
-rw-r--r--
2024-07-03 01:59
cc_keyboard.py
1.51
KB
-rw-r--r--
2024-07-03 01:59
cc_keys_to_console.py
2.04
KB
-rw-r--r--
2024-07-03 01:59
cc_landscape.py
3.12
KB
-rw-r--r--
2024-07-03 01:59
cc_locale.py
1.21
KB
-rw-r--r--
2024-07-03 01:59
cc_lxd.py
13.49
KB
-rw-r--r--
2024-07-11 21:27
cc_mcollective.py
4.12
KB
-rw-r--r--
2024-07-03 01:59
cc_mounts.py
16.35
KB
-rw-r--r--
2024-07-03 01:59
cc_ntp.py
18.74
KB
-rw-r--r--
2024-07-03 01:59
cc_package_update_upgrade_install.py
3.8
KB
-rw-r--r--
2024-07-03 01:59
cc_phone_home.py
3.75
KB
-rw-r--r--
2024-07-03 01:59
cc_power_state_change.py
5.94
KB
-rw-r--r--
2024-07-03 01:59
cc_puppet.py
10.73
KB
-rw-r--r--
2024-07-03 01:59
cc_reset_rmc.py
4.47
KB
-rw-r--r--
2024-07-03 01:59
cc_resizefs.py
10.82
KB
-rw-r--r--
2024-07-03 01:59
cc_resolv_conf.py
3.15
KB
-rw-r--r--
2024-07-03 01:59
cc_rh_subscription.py
15.23
KB
-rw-r--r--
2024-07-03 01:59
cc_rsyslog.py
12.7
KB
-rw-r--r--
2024-07-03 01:59
cc_runcmd.py
1.62
KB
-rw-r--r--
2024-07-03 01:59
cc_salt_minion.py
3.97
KB
-rw-r--r--
2024-07-03 01:59
cc_scripts_per_boot.py
1.28
KB
-rw-r--r--
2024-07-03 01:59
cc_scripts_per_instance.py
1.28
KB
-rw-r--r--
2024-07-03 01:59
cc_scripts_per_once.py
1.26
KB
-rw-r--r--
2024-07-03 01:59
cc_scripts_user.py
1.27
KB
-rw-r--r--
2024-07-03 01:59
cc_scripts_vendor.py
1.28
KB
-rw-r--r--
2024-07-03 01:59
cc_seed_random.py
3.01
KB
-rw-r--r--
2024-07-03 01:59
cc_set_hostname.py
3.42
KB
-rw-r--r--
2024-07-03 01:59
cc_set_passwords.py
8.68
KB
-rw-r--r--
2024-07-03 01:59
cc_snap.py
3.34
KB
-rw-r--r--
2024-07-11 21:27
cc_spacewalk.py
2.65
KB
-rw-r--r--
2024-07-03 01:59
cc_ssh.py
11
KB
-rw-r--r--
2024-07-03 01:59
cc_ssh_authkey_fingerprints.py
3.73
KB
-rw-r--r--
2024-07-03 01:59
cc_ssh_import_id.py
5.45
KB
-rw-r--r--
2024-07-03 01:59
cc_timezone.py
1.21
KB
-rw-r--r--
2024-07-03 01:59
cc_ubuntu_autoinstall.py
4.5
KB
-rw-r--r--
2024-07-11 21:27
cc_ubuntu_drivers.py
4.09
KB
-rw-r--r--
2024-07-03 01:59
cc_ubuntu_pro.py
13.74
KB
-rw-r--r--
2024-07-03 01:59
cc_update_etc_hosts.py
2.46
KB
-rw-r--r--
2024-07-03 01:59
cc_update_hostname.py
2.19
KB
-rw-r--r--
2024-07-03 01:59
cc_users_groups.py
2.88
KB
-rw-r--r--
2024-07-03 01:59
cc_wireguard.py
6.68
KB
-rw-r--r--
2024-07-03 01:59
cc_write_files.py
3.99
KB
-rw-r--r--
2024-07-03 01:59
cc_write_files_deferred.py
1.23
KB
-rw-r--r--
2024-07-03 01:59
cc_yum_add_repo.py
4.91
KB
-rw-r--r--
2024-07-03 01:59
cc_zypper_add_repo.py
4.95
KB
-rw-r--r--
2024-07-03 01:59
modules.py
12.96
KB
-rw-r--r--
2024-07-03 01:59
schema.py
66.38
KB
-rw-r--r--
2024-07-03 01:59
Save
Rename
# Author: Jeff Bauer <jbauer@rubic.com> # # This file is part of cloud-init. See LICENSE file for license information. """Salt Minion: Setup and run salt minion""" import logging import os from cloudinit import safeyaml, subp, util from cloudinit.cloud import Cloud from cloudinit.config import Config from cloudinit.config.schema import MetaSchema from cloudinit.distros import ALL_DISTROS from cloudinit.settings import PER_INSTANCE meta: MetaSchema = { "id": "cc_salt_minion", "distros": [ALL_DISTROS], "frequency": PER_INSTANCE, "activate_by_schema_keys": ["salt_minion"], } # type: ignore LOG = logging.getLogger(__name__) # Note: see https://docs.saltstack.com/en/latest/topics/installation/ # Note: see https://docs.saltstack.com/en/latest/ref/configuration/ class SaltConstants: """ defines default distribution specific salt variables """ def __init__(self, cfg): # constants tailored for FreeBSD if util.is_FreeBSD(): self.pkg_name = "py-salt" self.srv_name = "salt_minion" self.conf_dir = "/usr/local/etc/salt" # constants for any other OS else: self.pkg_name = "salt-minion" self.srv_name = "salt-minion" self.conf_dir = "/etc/salt" # if there are constants given in cloud config use those self.pkg_name = util.get_cfg_option_str(cfg, "pkg_name", self.pkg_name) self.conf_dir = util.get_cfg_option_str( cfg, "config_dir", self.conf_dir ) self.srv_name = util.get_cfg_option_str( cfg, "service_name", self.srv_name ) def handle(name: str, cfg: Config, cloud: Cloud, args: list) -> None: # If there isn't a salt key in the configuration don't do anything if "salt_minion" not in cfg: LOG.debug( "Skipping module named %s, no 'salt_minion' key in configuration", name, ) return s_cfg = cfg["salt_minion"] const = SaltConstants(cfg=s_cfg) # Start by installing the salt package ... cloud.distro.install_packages([const.pkg_name]) # Ensure we can configure files at the right dir util.ensure_dir(const.conf_dir) minion_data = None # ... and then update the salt configuration if "conf" in s_cfg: # Add all sections from the conf object to minion config file minion_config = os.path.join(const.conf_dir, "minion") minion_data = s_cfg.get("conf") util.write_file(minion_config, safeyaml.dumps(minion_data)) if "grains" in s_cfg: # add grains to /etc/salt/grains grains_config = os.path.join(const.conf_dir, "grains") grains_data = safeyaml.dumps(s_cfg.get("grains")) util.write_file(grains_config, grains_data) # ... copy the key pair if specified if "public_key" in s_cfg and "private_key" in s_cfg: pki_dir_default = os.path.join(const.conf_dir, "pki/minion") if not os.path.isdir(pki_dir_default): pki_dir_default = os.path.join(const.conf_dir, "pki") pki_dir = s_cfg.get("pki_dir", pki_dir_default) with util.umask(0o77): util.ensure_dir(pki_dir) pub_name = os.path.join(pki_dir, "minion.pub") pem_name = os.path.join(pki_dir, "minion.pem") util.write_file(pub_name, s_cfg["public_key"]) util.write_file(pem_name, s_cfg["private_key"]) minion_daemon = not bool( minion_data and minion_data.get("file_client") == "local" ) cloud.distro.manage_service( "enable" if minion_daemon else "disable", const.srv_name ) cloud.distro.manage_service( "restart" if minion_daemon else "stop", const.srv_name ) if not minion_daemon: # if salt-minion was configured as masterless, we should not run # salt-minion as a daemon # Note: see https://docs.saltproject.io/en/latest/topics/tutorials/quickstart.html # noqa: E501 subp.subp(["salt-call", "--local", "state.apply"], capture=False)