basant307/AI_Governance_Project
048
1/*2Language: Puppet3Author: Jose Molina Colmenero <gaudy41@gmail.com>4Website: https://puppet.com/docs5Category: config6*/7 8function puppet(hljs) {9 const PUPPET_KEYWORDS = {10 keyword:11 /* language keywords */12 'and case default else elsif false if in import enherits node or true undef unless main settings $string ',13 literal:14 /* metaparameters */15 'alias audit before loglevel noop require subscribe tag '16 /* normal attributes */17 + 'owner ensure group mode name|0 changes context force incl lens load_path onlyif provider returns root show_diff type_check '18 + 'en_address ip_address realname command environment hour monute month monthday special target weekday '19 + 'creates cwd ogoutput refresh refreshonly tries try_sleep umask backup checksum content ctime force ignore '20 + 'links mtime purge recurse recurselimit replace selinux_ignore_defaults selrange selrole seltype seluser source '21 + 'souirce_permissions sourceselect validate_cmd validate_replacement allowdupe attribute_membership auth_membership forcelocal gid '22 + 'ia_load_module members system host_aliases ip allowed_trunk_vlans description device_url duplex encapsulation etherchannel '23 + 'native_vlan speed principals allow_root auth_class auth_type authenticate_user k_of_n mechanisms rule session_owner shared options '24 + 'device fstype enable hasrestart directory present absent link atboot blockdevice device dump pass remounts poller_tag use '25 + 'message withpath adminfile allow_virtual allowcdrom category configfiles flavor install_options instance package_settings platform '26 + 'responsefile status uninstall_options vendor unless_system_user unless_uid binary control flags hasstatus manifest pattern restart running '27 + 'start stop allowdupe auths expiry gid groups home iterations key_membership keys managehome membership password password_max_age '28 + 'password_min_age profile_membership profiles project purge_ssh_keys role_membership roles salt shell uid baseurl cost descr enabled '29 + 'enablegroups exclude failovermethod gpgcheck gpgkey http_caching include includepkgs keepalive metadata_expire metalink mirrorlist '30 + 'priority protect proxy proxy_password proxy_username repo_gpgcheck s3_enabled skip_if_unavailable sslcacert sslclientcert sslclientkey '31 + 'sslverify mounted',32 built_in:33 /* core facts */34 'architecture augeasversion blockdevices boardmanufacturer boardproductname boardserialnumber cfkey dhcp_servers '35 + 'domain ec2_ ec2_userdata facterversion filesystems ldom fqdn gid hardwareisa hardwaremodel hostname id|0 interfaces '36 + 'ipaddress ipaddress_ ipaddress6 ipaddress6_ iphostnumber is_virtual kernel kernelmajversion kernelrelease kernelversion '37 + 'kernelrelease kernelversion lsbdistcodename lsbdistdescription lsbdistid lsbdistrelease lsbmajdistrelease lsbminordistrelease '38 + 'lsbrelease macaddress macaddress_ macosx_buildversion macosx_productname macosx_productversion macosx_productverson_major '39 + 'macosx_productversion_minor manufacturer memoryfree memorysize netmask metmask_ network_ operatingsystem operatingsystemmajrelease '40 + 'operatingsystemrelease osfamily partitions path physicalprocessorcount processor processorcount productname ps puppetversion '41 + 'rubysitedir rubyversion selinux selinux_config_mode selinux_config_policy selinux_current_mode selinux_current_mode selinux_enforced '42 + 'selinux_policyversion serialnumber sp_ sshdsakey sshecdsakey sshrsakey swapencrypted swapfree swapsize timezone type uniqueid uptime '43 + 'uptime_days uptime_hours uptime_seconds uuid virtual vlans xendomains zfs_version zonenae zones zpool_version'44 };45 46 const COMMENT = hljs.COMMENT('#', '$');47 48 const IDENT_RE = '([A-Za-z_]|::)(\\w|::)*';49 50 const TITLE = hljs.inherit(hljs.TITLE_MODE, { begin: IDENT_RE });51 52 const VARIABLE = {53 className: 'variable',54 begin: '\\$' + IDENT_RE55 };56 57 const STRING = {58 className: 'string',59 contains: [60 hljs.BACKSLASH_ESCAPE,61 VARIABLE62 ],63 variants: [64 {65 begin: /'/,66 end: /'/67 },68 {69 begin: /"/,70 end: /"/71 }72 ]73 };74 75 return {76 name: 'Puppet',77 aliases: [ 'pp' ],78 contains: [79 COMMENT,80 VARIABLE,81 STRING,82 {83 beginKeywords: 'class',84 end: '\\{|;',85 illegal: /=/,86 contains: [87 TITLE,88 COMMENT89 ]90 },91 {92 beginKeywords: 'define',93 end: /\{/,94 contains: [95 {96 className: 'section',97 begin: hljs.IDENT_RE,98 endsParent: true99 }100 ]101 },102 {103 begin: hljs.IDENT_RE + '\\s+\\{',104 returnBegin: true,105 end: /\S/,106 contains: [107 {108 className: 'keyword',109 begin: hljs.IDENT_RE,110 relevance: 0.2111 },112 {113 begin: /\{/,114 end: /\}/,115 keywords: PUPPET_KEYWORDS,116 relevance: 0,117 contains: [118 STRING,119 COMMENT,120 {121 begin: '[a-zA-Z_]+\\s*=>',122 returnBegin: true,123 end: '=>',124 contains: [125 {126 className: 'attr',127 begin: hljs.IDENT_RE128 }129 ]130 },131 {132 className: 'number',133 begin: '(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b',134 relevance: 0135 },136 VARIABLE137 ]138 }139 ],140 relevance: 0141 }142 ]143 };144}145 146export { puppet as default };147 