{"id":90996,"date":"2025-01-08T17:14:54","date_gmt":"2025-01-08T11:44:54","guid":{"rendered":"https:\/\/cloudfoundation.com\/blog\/?p=90996"},"modified":"2025-01-09T09:21:47","modified_gmt":"2025-01-09T03:51:47","slug":"saltstack-tutorial","status":"publish","type":"post","link":"https:\/\/cloudfoundation.com\/blog\/saltstack-tutorial\/","title":{"rendered":"Salt or SaltStack Tutorial"},"content":{"rendered":"<p>[et_pb_section fb_built=&#8221;1&#8243; _builder_version=&#8221;4.9.7&#8243;][et_pb_row _builder_version=&#8221;4.9.7&#8243; background_size=&#8221;initial&#8221; background_position=&#8221;top_left&#8221; background_repeat=&#8221;repeat&#8221;][et_pb_column type=&#8221;4_4&#8243; _builder_version=&#8221;3.25&#8243; custom_padding=&#8221;|||&#8221; custom_padding__hover=&#8221;|||&#8221;][et_pb_post_title meta=&#8221;off&#8221; featured_image=&#8221;off&#8221; _builder_version=&#8221;4.9.7&#8243; title_font=&#8221;Times New Roman||||||||&#8221; title_text_align=&#8221;left&#8221; title_text_color=&#8221;#000000&#8243; title_font_size=&#8221;47&#8243; background_color=&#8221;RGBA(0,0,0,0)&#8221; background_enable_image=&#8221;off&#8221; custom_margin=&#8221;|||10%&#8221; title_font_size_tablet=&#8221;40&#8243; title_font_size_phone=&#8221;35&#8243; title_font_size_last_edited=&#8221;on|desktop&#8221;][\/et_pb_post_title][\/et_pb_column][\/et_pb_row][et_pb_row _builder_version=&#8221;4.9.7&#8243; background_size=&#8221;initial&#8221; background_position=&#8221;top_left&#8221; background_repeat=&#8221;repeat&#8221;][et_pb_column type=&#8221;4_4&#8243; _builder_version=&#8221;3.25&#8243; custom_padding=&#8221;|||&#8221; custom_padding__hover=&#8221;|||&#8221;][et_pb_text _builder_version=&#8221;4.9.7&#8243; text_font=&#8221;Georgia||||||||&#8221; text_text_color=&#8221;#000000&#8243; text_font_size=&#8221;22px&#8221; text_line_height=&#8221;1.9em&#8221; max_width=&#8221;800px&#8221; max_width_last_edited=&#8221;off|phone&#8221; custom_margin=&#8221;|||10%&#8221; custom_margin_last_edited=&#8221;off|desktop&#8221; hover_enabled=&#8221;0&#8243; text_font_size_tablet=&#8221;&#8221; text_font_size_phone=&#8221;&#8221; text_font_size_last_edited=&#8221;on|phone&#8221; text_line_height_last_edited=&#8221;off|phone&#8221; sticky_enabled=&#8221;0&#8243;]<\/p><div id=\"ez-toc-container\" class=\"ez-toc-v2_0_80 ez-toc-wrap-center counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<span class=\"ez-toc-title-toggle\"><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/cloudfoundation.com\/blog\/saltstack-tutorial\/#What_is_Salt_or_SaltStack\" >What is Salt or SaltStack?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/cloudfoundation.com\/blog\/saltstack-tutorial\/#Why_to_use_SaltStack\" >Why to use SaltStack?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/cloudfoundation.com\/blog\/saltstack-tutorial\/#SaltStack_Features\" >SaltStack Features<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/cloudfoundation.com\/blog\/saltstack-tutorial\/#SaltStack_Architecture\" >SaltStack Architecture<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/cloudfoundation.com\/blog\/saltstack-tutorial\/#Few_Concepts_in_SaltStack\" >Few Concepts in SaltStack<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/cloudfoundation.com\/blog\/saltstack-tutorial\/#SaltStack_configuration\" >SaltStack configuration<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/cloudfoundation.com\/blog\/saltstack-tutorial\/#_How_to_set_up_a_minion_service\" >\u00a0How to set up a minion service?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/cloudfoundation.com\/blog\/saltstack-tutorial\/#Importance_of_having_a_top_dot_SLS_file\" >Importance of having a top dot SLS file<\/a><\/li><\/ul><\/nav><\/div>\n\n<h2><span class=\"ez-toc-section\" id=\"What_is_Salt_or_SaltStack\"><\/span><strong>What is Salt or SaltStack?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>SaltStack is a powerful and versatile configuration management tool that has gained popularity among organizations.<\/p>\n<p>It offers a combination of push and pull features, making it a valuable addition to any organization&#8217;s configuration management needs.<\/p>\n<p>SaltStack is an open-source configuration management tool with a remote execution engine.<\/p>\n<p>It has a server and an agent, with a master as the server and minions as the nodes. SaltStack is a push-based configuration management tool, similar to Ansible, where the server pushes configuration onto the nodes.<\/p>\n<p>However, in SaltStack, the agent runs on the nodes, allowing for a combination of push and pull communication.<\/p>\n<p><img decoding=\"async\" class=\"size-medium aligncenter\" src=\"http:\/\/cloudfoundation.com\/blog\/wp-content\/uploads\/2025\/01\/What-is-saltstack.jpg\" alt=\"\" width=\"800\" height=\"600\" \/><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Why_to_use_SaltStack\"><\/span><strong>Why to use SaltStack?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>SaltStack, a configuration management tool that can be configured as either a node agent or an agent cluster configuration management tool.<\/p>\n<p>The agent is responsible for running the configuration from the server, while the agent node is a small software installed on the server.<\/p>\n<p>The difference between a puppet node and an agent node is that the agent runs the configuration taken from the server.<\/p>\n<p>In SaltStack, the server and node can communicate through SSH protocol or API, with TCP IP communication being the preferred method. If SSH is not desired, there must be an API or protocol for communication between the server and node.<\/p>\n<p>SaltStack can be configured to be an agentless configuration management tool, but by default, it has an agent running on all minions. This is how the SaltStack works.<\/p>\n<p>The server puts information into the message queue, and the agent pulls the information from the message queue. If the agent is agentless, the information will be SSH into, copied into, or executed in the minion. For agentless configuration, SaltStack requires some configuration or tweaking.<\/p>\n<p>SaltStack also offers Salt SSH, which provides an agentless system for management.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"SaltStack_Features\"><\/span><strong>SaltStack Features<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>SaltStack offers several advantages over other tools, such as being easier to have a cluster of masters, good fault tolerance, fall stall tolerance, and the ability to connect salt minions to multiple masters at once.<\/p>\n<p><img decoding=\"async\" class=\"size-medium aligncenter\" src=\"http:\/\/cloudfoundation.com\/blog\/wp-content\/uploads\/2025\/01\/SaltStack-Features.jpg\" alt=\"\" width=\"800\" height=\"600\" \/><\/p>\n<p>SaltStack also allows for different types of configurations, such as agent servers, server-only configurations, and parallel execution.<\/p>\n<p>SaltStack is based on the Python API, making it easier to set up compared to Chef and Puppet.<\/p>\n<p>In addition to its flexibility, SaltStack provides a simple deployment model-driven configuration management and command execution framework.<\/p>\n<p>It does not require learning any new programming language, and tasks are executed sequentially, similar to Ansible.<\/p>\n<p>[\/et_pb_text][\/et_pb_column][\/et_pb_row][et_pb_row column_structure=&#8221;1_3,1_3,1_3&#8243; _builder_version=&#8221;4.9.7&#8243; _module_preset=&#8221;default&#8221; background_color=&#8221;#064399&#8243; use_background_color_gradient=&#8221;on&#8221; background_color_gradient_start=&#8221;#0095f2&#8243; background_color_gradient_end=&#8221;#7dbed8&#8243; background_color_gradient_direction=&#8221;92deg&#8221; background_color_gradient_start_position=&#8221;35%&#8221; background_color_gradient_end_position=&#8221;80%&#8221; transform_scale=&#8221;73%|62%&#8221; transform_scale_linked=&#8221;off&#8221; transform_translate=&#8221;-53px|-50px&#8221; transform_translate_linked=&#8221;off&#8221; link_option_url=&#8221;https:\/\/cloudfoundation.com\/blog\/interview-questions\/&#8221; link_option_url_new_window=&#8221;on&#8221;][et_pb_column type=&#8221;1_3&#8243; _builder_version=&#8221;4.9.7&#8243; _module_preset=&#8221;default&#8221;][et_pb_image src=&#8221;https:\/\/cloudfoundation.com\/blog\/wp-content\/uploads\/2023\/06\/SS_436-_Converted_-1.png&#8221; _builder_version=&#8221;4.9.7&#8243; _module_preset=&#8221;default&#8221; transform_scale=&#8221;114%|112%&#8221; transform_scale_linked=&#8221;off&#8221; transform_translate=&#8221;25px|-4px&#8221; transform_translate_linked=&#8221;off&#8221; width=&#8221;98.1%&#8221; custom_margin=&#8221;|7px|||false|false&#8221;][\/et_pb_image][\/et_pb_column][et_pb_column type=&#8221;1_3&#8243; _builder_version=&#8221;4.9.7&#8243; _module_preset=&#8221;default&#8221;][et_pb_text _builder_version=&#8221;4.9.7&#8243; _module_preset=&#8221;default&#8221; text_font=&#8221;Georgia|700|||||||&#8221; text_font_size=&#8221;23px&#8221; text_line_height=&#8221;1.3em&#8221; header_font=&#8221;Georgia|700|||||||&#8221; header_font_size=&#8221;21px&#8221; header_letter_spacing=&#8221;-1px&#8221; header_line_height=&#8221;2em&#8221; transform_scale=&#8221;171%|159%&#8221; transform_scale_linked=&#8221;off&#8221; transform_translate=&#8221;40px|44px&#8221; transform_translate_linked=&#8221;off&#8221; transform_origin=&#8221;70%|50%&#8221; z_index=&#8221;-161&#8243; width=&#8221;100%&#8221; custom_margin=&#8221;|-215px||||&#8221; custom_padding=&#8221;|0px||||&#8221; link_option_url=&#8221;https:\/\/cloudfoundation.com\/blog\/interview-questions\/&#8221; link_option_url_new_window=&#8221;on&#8221; hover_enabled=&#8221;0&#8243; sticky_enabled=&#8221;0&#8243;]<\/p>\n<h1 style=\"text-align: center;\"><span style=\"color: #ffffff;\"><strong>SaltStack <\/strong>Training<\/span><\/h1>\n<p>[\/et_pb_text][et_pb_button button_url=&#8221;https:\/\/cloudfoundation.com\/blog\/interview-questions\/&#8221; url_new_window=&#8221;on&#8221; button_text=&#8221;Explore Course Content&#8221; _builder_version=&#8221;4.9.7&#8243; _module_preset=&#8221;default&#8221; custom_button=&#8221;on&#8221; button_text_color=&#8221;#0C71C3&#8243; button_bg_color=&#8221;#FFFFFF&#8221; button_font=&#8221;|700|||||||&#8221; transform_translate=&#8221;64px|65px&#8221; transform_translate_linked=&#8221;off&#8221;][\/et_pb_button][\/et_pb_column][et_pb_column type=&#8221;1_3&#8243; _builder_version=&#8221;4.9.7&#8243; _module_preset=&#8221;default&#8221;][et_pb_image src=&#8221;https:\/\/cloudfoundation.com\/blog\/wp-content\/uploads\/2019\/06\/logo_resize_color.png&#8221; _builder_version=&#8221;4.9.7&#8243; _module_preset=&#8221;default&#8221; transform_translate=&#8221;-36px|0px&#8221; transform_translate_linked=&#8221;off&#8221; custom_margin=&#8221;|||178px||&#8221;][\/et_pb_image][\/et_pb_column][\/et_pb_row][et_pb_row _builder_version=&#8221;4.9.7&#8243; background_size=&#8221;initial&#8221; background_position=&#8221;top_left&#8221; background_repeat=&#8221;repeat&#8221;][et_pb_column type=&#8221;4_4&#8243; _builder_version=&#8221;3.25&#8243; custom_padding=&#8221;|||&#8221; custom_padding__hover=&#8221;|||&#8221;][et_pb_text _builder_version=&#8221;4.9.7&#8243; text_font=&#8221;Georgia||||||||&#8221; text_text_color=&#8221;#000000&#8243; text_font_size=&#8221;22px&#8221; text_line_height=&#8221;1.9em&#8221; max_width=&#8221;800px&#8221; max_width_last_edited=&#8221;off|phone&#8221; custom_margin=&#8221;|||10%&#8221; custom_margin_last_edited=&#8221;off|desktop&#8221; hover_enabled=&#8221;0&#8243; text_font_size_tablet=&#8221;&#8221; text_font_size_phone=&#8221;&#8221; text_font_size_last_edited=&#8221;on|phone&#8221; text_line_height_last_edited=&#8221;off|phone&#8221; sticky_enabled=&#8221;0&#8243;]<\/p>\n<h2><span class=\"ez-toc-section\" id=\"SaltStack_Architecture\"><\/span><strong>SaltStack Architecture<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Salt architecture contains several components which includes the salt master, salt slaves, and salt minions.<\/p>\n<p>It has two types of modules: execution modules and state modules.<\/p>\n<p>Execution modules are used to execute modules in dark mode, while state modules are used to put modules inside a configuration file and execute them.<\/p>\n<p>In Ansible, these modules are called package dot installed and package node installed, respectively. The name of the module changes depending on whether it is used for execution or state modules.<\/p>\n<p><img decoding=\"async\" class=\"size-medium aligncenter\" src=\"http:\/\/cloudfoundation.com\/blog\/wp-content\/uploads\/2025\/01\/SaltStack-Architecture.jpg\" alt=\"\" width=\"800\" height=\"600\" \/><\/p>\n<p>The salt master is a demon running on the server, which controls everything. Each minion has a unique ID generated at the time when connecting the minion to the Salt Master.<\/p>\n<p>The minion receives the configuration from the server executed on the node and sends the report back to the Salt Master. The minions and the master open a TCP connection and must maintain this connection.<\/p>\n<p>The next dumpster is an interface that provides information specific to a minion, such as Ohio facts. Greens is equal to the facts or output of a high command.<\/p>\n<p>Pillar is a separate folder where variables are stored based on nodes, and when the node executes any formula or state file, it loads the data from the pillar folder.<\/p>\n<p>The top five files in SaltStack are the top file, which defines what configuration should be executed on the nodes.<\/p>\n<p>These files are similar to site.pp files and TOC files, and they define the data that is sent out to the node. State files are the heart of SaltStack, used to manage all resources and modules defined within the state file.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Few_Concepts_in_SaltStack\"><\/span><strong>Few Concepts in SaltStack<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The purpose of facts in Puppet and Chef is to provide information about nodes, CPU, operating system, memory, IP, and network details.<\/p>\n<p>These facts are obtained from grains, which are modules located inside the Salt Master that perform tasks such as getting job status, connecting, status reading data from external APIs, and using salt minions.<\/p>\n<p><img decoding=\"async\" class=\"size-medium aligncenter\" src=\"http:\/\/cloudfoundation.com\/blog\/wp-content\/uploads\/2025\/01\/SaltStack.jpeg\" alt=\"\" width=\"800\" height=\"600\" \/><\/p>\n<p>Runners are modules that manage configuration on various nodes and check the status of nodes. They push data configuration to the node and check API connections.<\/p>\n<p>Returners are small software programs or modules that send data back to the server after executing the configuration data.<\/p>\n<p>Reactors are responsible for triggering events, such as successful installation or errors.<\/p>\n<p>Salt Cloud is a module that allows the Salt Master to talk to an interface or talk to a node on the cloud. Salt SSH is another module used to set up an agentless architecture or configuration management tool.<\/p>\n<p>[\/et_pb_text][\/et_pb_column][\/et_pb_row][et_pb_row column_structure=&#8221;1_3,1_3,1_3&#8243; _builder_version=&#8221;4.9.7&#8243; _module_preset=&#8221;default&#8221; background_color=&#8221;#064399&#8243; use_background_color_gradient=&#8221;on&#8221; background_color_gradient_start=&#8221;#ff8c7c&#8221; background_color_gradient_end=&#8221;#e5ba4e&#8221; background_color_gradient_type=&#8221;radial&#8221; background_color_gradient_direction_radial=&#8221;top left&#8221; background_color_gradient_start_position=&#8221;35%&#8221; background_color_gradient_end_position=&#8221;80%&#8221; transform_scale=&#8221;74%|69%&#8221; transform_scale_linked=&#8221;off&#8221; transform_translate=&#8221;-53px|-50px&#8221; transform_translate_linked=&#8221;off&#8221; custom_margin=&#8221;||-5px||false|false&#8221; custom_padding=&#8221;|||2px|false|false&#8221; link_option_url=&#8221;https:\/\/cloudfoundation.com\/blog\/interview-questions\/&#8221; link_option_url_new_window=&#8221;on&#8221;][et_pb_column type=&#8221;1_3&#8243; _builder_version=&#8221;4.9.7&#8243; _module_preset=&#8221;default&#8221;][et_pb_image src=&#8221;https:\/\/cloudfoundation.com\/blog\/wp-content\/uploads\/2023\/06\/8423118_3895895.png&#8221; _builder_version=&#8221;4.9.7&#8243; _module_preset=&#8221;default&#8221; width=&#8221;85.4%&#8221; custom_margin=&#8221;-31px||-24px||false|false&#8221; custom_padding=&#8221;|22px|0px||false|false&#8221;][\/et_pb_image][\/et_pb_column][et_pb_column type=&#8221;1_3&#8243; _builder_version=&#8221;4.9.7&#8243; _module_preset=&#8221;default&#8221;][et_pb_text _builder_version=&#8221;4.9.7&#8243; _module_preset=&#8221;default&#8221; text_font=&#8221;Georgia|700|||||||&#8221; text_font_size=&#8221;23px&#8221; text_line_height=&#8221;1.3em&#8221; header_font=&#8221;Georgia|700|||||||&#8221; header_font_size=&#8221;19px&#8221; header_letter_spacing=&#8221;-1px&#8221; header_line_height=&#8221;1.2em&#8221; transform_scale=&#8221;171%|159%&#8221; transform_scale_linked=&#8221;off&#8221; transform_translate=&#8221;40px|44px&#8221; transform_translate_linked=&#8221;off&#8221; transform_origin=&#8221;70%|50%&#8221; z_index=&#8221;-161&#8243; width=&#8221;100%&#8221; custom_margin=&#8221;|-215px||||&#8221; custom_padding=&#8221;|0px||||&#8221; link_option_url=&#8221;https:\/\/cloudfoundation.com\/blog\/interview-questions\/&#8221; link_option_url_new_window=&#8221;on&#8221; hover_enabled=&#8221;0&#8243; sticky_enabled=&#8221;0&#8243;]<\/p>\n<h1 style=\"text-align: center;\"><strong>SaltStack <\/strong>Training<\/h1>\n<p>[\/et_pb_text][et_pb_button button_url=&#8221;https:\/\/cloudfoundation.com\/blog\/interview-questions\/&#8221; url_new_window=&#8221;on&#8221; button_text=&#8221;Up Coming Batches&#8221; _builder_version=&#8221;4.9.7&#8243; _module_preset=&#8221;default&#8221; custom_button=&#8221;on&#8221; button_text_color=&#8221;#E09900&#8243; button_bg_color=&#8221;#FFFFFF&#8221; button_font=&#8221;|700|||||||&#8221; transform_translate=&#8221;64px|65px&#8221; transform_translate_linked=&#8221;off&#8221; background_layout=&#8221;dark&#8221;][\/et_pb_button][\/et_pb_column][et_pb_column type=&#8221;1_3&#8243; _builder_version=&#8221;4.9.7&#8243; _module_preset=&#8221;default&#8221;][et_pb_image src=&#8221;https:\/\/cloudfoundation.com\/blog\/wp-content\/uploads\/2019\/06\/logo_resize_color.png&#8221; _builder_version=&#8221;4.9.7&#8243; _module_preset=&#8221;default&#8221; transform_translate=&#8221;-36px|0px&#8221; transform_translate_linked=&#8221;off&#8221; custom_margin=&#8221;|||178px||&#8221;][\/et_pb_image][\/et_pb_column][\/et_pb_row][et_pb_row _builder_version=&#8221;4.9.7&#8243; background_size=&#8221;initial&#8221; background_position=&#8221;top_left&#8221; background_repeat=&#8221;repeat&#8221;][et_pb_column type=&#8221;4_4&#8243; _builder_version=&#8221;3.25&#8243; custom_padding=&#8221;|||&#8221; custom_padding__hover=&#8221;|||&#8221;][et_pb_text _builder_version=&#8221;4.9.7&#8243; text_font=&#8221;Georgia||||||||&#8221; text_text_color=&#8221;#000000&#8243; text_font_size=&#8221;22px&#8221; text_line_height=&#8221;1.9em&#8221; max_width=&#8221;800px&#8221; max_width_last_edited=&#8221;off|phone&#8221; custom_margin=&#8221;|||10%&#8221; custom_margin_last_edited=&#8221;off|desktop&#8221; hover_enabled=&#8221;0&#8243; text_font_size_tablet=&#8221;&#8221; text_font_size_phone=&#8221;&#8221; text_font_size_last_edited=&#8221;on|phone&#8221; text_line_height_last_edited=&#8221;off|phone&#8221; sticky_enabled=&#8221;0&#8243;]<\/p>\n<h2><span class=\"ez-toc-section\" id=\"SaltStack_configuration\"><\/span><strong>SaltStack configuration<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>To create a simple SaltStack configuration, one can create a sample dot SLS file, which will end with the dot SLS. For example, the name of the package Wim is Wim, and the state of BIM is PKG dot installed. This is called the state state module or the state execution of a module, specifically Pavan.<\/p>\n<p>To apply the SaltDot Apply command on the current machine, one must do sol star and then do state DOT apply. The SLS file name is Wim, and the path is Wim. Salt Dot Apply applies the application to the node, but it requires connecting nodes to the server.<\/p>\n<p>To connect nodes to the server, one must use the SaltDot Apply command, which is different from the Puppet Apply command. Puppet Apply applies the application to the current machine, while Salt Dot Apply applies it to the node.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"_How_to_set_up_a_minion_service\"><\/span><strong>\u00a0<\/strong><strong>How to set up a minion service?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Setting up a minion service is a simple process that requires a few steps. The Puppet Agent uses a salt key to generate and send keys to the server, and the minion agent uses a salt key to send the request to the specified host.<\/p>\n<p><img decoding=\"async\" class=\"size-medium aligncenter\" src=\"http:\/\/cloudfoundation.com\/blog\/wp-content\/uploads\/2025\/01\/saltstack-minion-service.jpeg\" alt=\"\" width=\"800\" height=\"600\" \/><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Importance_of_having_a_top_dot_SLS_file\"><\/span><strong>Importance of having a top dot SLS file <\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The top dot SLS file is structured as follows:<\/p>\n<p>1. Environment name: The default environment for nginx configurations is the base environment.<\/p>\n<p>2. Target: The name or regex to match minions.<\/p>\n<p>3. Target: The environment, the target, and the list of state files.<\/p>\n<p>4. SLS file: The SLS file name or folder name.importance of having a top dot SLS file within the salt folder to define formulas for different nodes.<\/p>\n<p>[\/et_pb_text][\/et_pb_column][\/et_pb_row][et_pb_row column_structure=&#8221;1_3,1_3,1_3&#8243; _builder_version=&#8221;4.9.7&#8243; _module_preset=&#8221;default&#8221; background_color=&#8221;#064399&#8243; use_background_color_gradient=&#8221;on&#8221; background_color_gradient_start=&#8221;#494fff&#8221; background_color_gradient_end=&#8221;#9ea6ff&#8221; background_color_gradient_type=&#8221;radial&#8221; background_color_gradient_direction_radial=&#8221;top left&#8221; background_color_gradient_start_position=&#8221;35%&#8221; background_color_gradient_end_position=&#8221;80%&#8221; transform_scale=&#8221;74%|71%&#8221; transform_scale_linked=&#8221;off&#8221; transform_translate=&#8221;-53px|-50px&#8221; transform_translate_linked=&#8221;off&#8221; link_option_url=&#8221;https:\/\/cloudfoundation.com\/blog\/interview-questions\/&#8221; link_option_url_new_window=&#8221;on&#8221;][et_pb_column type=&#8221;1_3&#8243; _builder_version=&#8221;4.9.7&#8243; _module_preset=&#8221;default&#8221;][et_pb_image src=&#8221;https:\/\/cloudfoundation.com\/blog\/wp-content\/uploads\/2023\/06\/Untitled-11.png&#8221; _builder_version=&#8221;4.9.7&#8243; _module_preset=&#8221;default&#8221; transform_scale=&#8221;103%|103%&#8221; transform_scale_linked=&#8221;off&#8221; transform_translate=&#8221;11px|0px&#8221; transform_translate_linked=&#8221;off&#8221; custom_padding=&#8221;|88px||||&#8221;][\/et_pb_image][\/et_pb_column][et_pb_column type=&#8221;1_3&#8243; _builder_version=&#8221;4.9.7&#8243; _module_preset=&#8221;default&#8221;][et_pb_text _builder_version=&#8221;4.9.7&#8243; _module_preset=&#8221;default&#8221; text_font=&#8221;Georgia|700|||||||&#8221; text_text_color=&#8221;#FFFFFF&#8221; text_font_size=&#8221;23px&#8221; text_line_height=&#8221;1.3em&#8221; header_font=&#8221;Georgia|700|||||||&#8221; header_font_size=&#8221;19px&#8221; header_letter_spacing=&#8221;-1px&#8221; header_line_height=&#8221;1.2em&#8221; transform_scale=&#8221;171%|159%&#8221; transform_scale_linked=&#8221;off&#8221; transform_translate=&#8221;40px|44px&#8221; transform_translate_linked=&#8221;off&#8221; transform_origin=&#8221;70%|50%&#8221; z_index=&#8221;-161&#8243; width=&#8221;100%&#8221; custom_margin=&#8221;|-215px||||&#8221; custom_padding=&#8221;|0px||||&#8221; link_option_url=&#8221;https:\/\/cloudfoundation.com\/datorama-training\/&#8221; link_option_url_new_window=&#8221;on&#8221; hover_enabled=&#8221;0&#8243; sticky_enabled=&#8221;0&#8243;]<\/p>\n<h1 style=\"text-align: center;\"><span style=\"color: #ffffff;\"><strong>SaltStack Course Price<\/strong><\/span><\/h1>\n<p>[\/et_pb_text][et_pb_button button_url=&#8221;https:\/\/cloudfoundation.com\/blog\/interview-questions\/&#8221; url_new_window=&#8221;on&#8221; button_text=&#8221;Offer Price&#8221; _builder_version=&#8221;4.9.7&#8243; _module_preset=&#8221;default&#8221; custom_button=&#8221;on&#8221; button_text_color=&#8221;#0C71C3&#8243; button_bg_color=&#8221;#FFFFFF&#8221; button_font=&#8221;|700|||||||&#8221; transform_translate=&#8221;64px|65px&#8221; transform_translate_linked=&#8221;off&#8221;][\/et_pb_button][\/et_pb_column][et_pb_column type=&#8221;1_3&#8243; _builder_version=&#8221;4.9.7&#8243; _module_preset=&#8221;default&#8221;][et_pb_image src=&#8221;https:\/\/cloudfoundation.com\/blog\/wp-content\/uploads\/2019\/06\/logo_resize_color.png&#8221; _builder_version=&#8221;4.9.7&#8243; _module_preset=&#8221;default&#8221; transform_translate=&#8221;-36px|0px&#8221; transform_translate_linked=&#8221;off&#8221; custom_margin=&#8221;|||178px||&#8221;][\/et_pb_image][\/et_pb_column][\/et_pb_row][et_pb_row _builder_version=&#8221;4.9.7&#8243; background_size=&#8221;initial&#8221; background_position=&#8221;top_left&#8221; background_repeat=&#8221;repeat&#8221;][et_pb_column type=&#8221;4_4&#8243; _builder_version=&#8221;3.25&#8243; custom_padding=&#8221;|||&#8221; custom_padding__hover=&#8221;|||&#8221;][et_pb_team_member name=&#8221;Saniya&#8221; position=&#8221;Author&#8221; image_url=&#8221;https:\/\/cloudfoundation.com\/blog\/wp-content\/uploads\/2023\/06\/Saniya2.png&#8221; _builder_version=&#8221;4.9.7&#8243; header_level=&#8221;h5&#8243; header_font=&#8221;Titillium Web|700|||||||&#8221; body_font=&#8221;Titillium Web||||||||&#8221; body_font_size=&#8221;16&#8243;]<\/p>\n<h5>\u201cLife Is An Experiment In Which You May Fail Or Succeed. Explore More, Expect Least.\u201d<\/h5>\n<p>[\/et_pb_team_member][\/et_pb_column][\/et_pb_row][\/et_pb_section]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>[et_pb_section fb_built=&#8221;1&#8243; _builder_version=&#8221;4.9.7&#8243;][et_pb_row _builder_version=&#8221;4.9.7&#8243; background_size=&#8221;initial&#8221; background_position=&#8221;top_left&#8221; background_repeat=&#8221;repeat&#8221;][et_pb_column type=&#8221;4_4&#8243; _builder_version=&#8221;3.25&#8243; custom_padding=&#8221;|||&#8221; custom_padding__hover=&#8221;|||&#8221;][et_pb_post_title meta=&#8221;off&#8221; featured_image=&#8221;off&#8221; _builder_version=&#8221;4.9.7&#8243; title_font=&#8221;Times New Roman||||||||&#8221; title_text_align=&#8221;left&#8221; title_text_color=&#8221;#000000&#8243; title_font_size=&#8221;47&#8243; background_color=&#8221;RGBA(0,0,0,0)&#8221; background_enable_image=&#8221;off&#8221; custom_margin=&#8221;|||10%&#8221; title_font_size_tablet=&#8221;40&#8243; title_font_size_phone=&#8221;35&#8243; title_font_size_last_edited=&#8221;on|desktop&#8221;][\/et_pb_post_title][\/et_pb_column][\/et_pb_row][et_pb_row _builder_version=&#8221;4.9.7&#8243; background_size=&#8221;initial&#8221; background_position=&#8221;top_left&#8221; background_repeat=&#8221;repeat&#8221;][et_pb_column type=&#8221;4_4&#8243; _builder_version=&#8221;3.25&#8243; custom_padding=&#8221;|||&#8221; custom_padding__hover=&#8221;|||&#8221;][et_pb_text _builder_version=&#8221;4.9.7&#8243; text_font=&#8221;Georgia||||||||&#8221; text_text_color=&#8221;#000000&#8243; text_font_size=&#8221;22px&#8221; text_line_height=&#8221;1.9em&#8221; max_width=&#8221;800px&#8221; max_width_last_edited=&#8221;off|phone&#8221; custom_margin=&#8221;|||10%&#8221; custom_margin_last_edited=&#8221;off|desktop&#8221; hover_enabled=&#8221;0&#8243; text_font_size_tablet=&#8221;&#8221; text_font_size_phone=&#8221;&#8221; text_font_size_last_edited=&#8221;on|phone&#8221; text_line_height_last_edited=&#8221;off|phone&#8221; sticky_enabled=&#8221;0&#8243;] What is Salt or SaltStack? SaltStack [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":91006,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"on","_et_pb_old_content":"","_et_gb_content_width":"2880","footnotes":""},"categories":[1],"tags":[],"class_list":{"0":"post-90996","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-uncategorized"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Salt or SaltStack Tutorial<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/cloudfoundation.com\/blog\/saltstack-tutorial\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Salt or SaltStack Tutorial\" \/>\n<meta property=\"og:description\" content=\"[et_pb_section fb_built=&#8221;1&#8243; _builder_version=&#8221;4.9.7&#8243;][et_pb_row _builder_version=&#8221;4.9.7&#8243; background_size=&#8221;initial&#8221; background_position=&#8221;top_left&#8221; background_repeat=&#8221;repeat&#8221;][et_pb_column type=&#8221;4_4&#8243; _builder_version=&#8221;3.25&#8243; custom_padding=&#8221;|||&#8221; custom_padding__hover=&#8221;|||&#8221;][et_pb_post_title meta=&#8221;off&#8221; featured_image=&#8221;off&#8221; _builder_version=&#8221;4.9.7&#8243; title_font=&#8221;Times New Roman||||||||&#8221; title_text_align=&#8221;left&#8221; title_text_color=&#8221;#000000&#8243; title_font_size=&#8221;47&#8243; background_color=&#8221;RGBA(0,0,0,0)&#8221; background_enable_image=&#8221;off&#8221; custom_margin=&#8221;|||10%&#8221; title_font_size_tablet=&#8221;40&#8243; title_font_size_phone=&#8221;35&#8243; title_font_size_last_edited=&#8221;on|desktop&#8221;][\/et_pb_post_title][\/et_pb_column][\/et_pb_row][et_pb_row _builder_version=&#8221;4.9.7&#8243; background_size=&#8221;initial&#8221; background_position=&#8221;top_left&#8221; background_repeat=&#8221;repeat&#8221;][et_pb_column type=&#8221;4_4&#8243; _builder_version=&#8221;3.25&#8243; custom_padding=&#8221;|||&#8221; custom_padding__hover=&#8221;|||&#8221;][et_pb_text _builder_version=&#8221;4.9.7&#8243; text_font=&#8221;Georgia||||||||&#8221; text_text_color=&#8221;#000000&#8243; text_font_size=&#8221;22px&#8221; text_line_height=&#8221;1.9em&#8221; max_width=&#8221;800px&#8221; max_width_last_edited=&#8221;off|phone&#8221; custom_margin=&#8221;|||10%&#8221; custom_margin_last_edited=&#8221;off|desktop&#8221; hover_enabled=&#8221;0&#8243; text_font_size_tablet=&#8221;&#8221; text_font_size_phone=&#8221;&#8221; text_font_size_last_edited=&#8221;on|phone&#8221; text_line_height_last_edited=&#8221;off|phone&#8221; sticky_enabled=&#8221;0&#8243;] What is Salt or SaltStack? SaltStack [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/cloudfoundation.com\/blog\/saltstack-tutorial\/\" \/>\n<meta property=\"og:site_name\" content=\"CloudFoundation | Blog\" \/>\n<meta property=\"article:published_time\" content=\"2025-01-08T11:44:54+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-01-09T03:51:47+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/cloudfoundation.com\/blog\/wp-content\/uploads\/2025\/01\/Featured-image-of-saltstack.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"500\" \/>\n\t<meta property=\"og:image:height\" content=\"642\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"NAGENDRAG\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"NAGENDRAG\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Salt or SaltStack Tutorial","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/cloudfoundation.com\/blog\/saltstack-tutorial\/","og_locale":"en_US","og_type":"article","og_title":"Salt or SaltStack Tutorial","og_description":"[et_pb_section fb_built=&#8221;1&#8243; _builder_version=&#8221;4.9.7&#8243;][et_pb_row _builder_version=&#8221;4.9.7&#8243; background_size=&#8221;initial&#8221; background_position=&#8221;top_left&#8221; background_repeat=&#8221;repeat&#8221;][et_pb_column type=&#8221;4_4&#8243; _builder_version=&#8221;3.25&#8243; custom_padding=&#8221;|||&#8221; custom_padding__hover=&#8221;|||&#8221;][et_pb_post_title meta=&#8221;off&#8221; featured_image=&#8221;off&#8221; _builder_version=&#8221;4.9.7&#8243; title_font=&#8221;Times New Roman||||||||&#8221; title_text_align=&#8221;left&#8221; title_text_color=&#8221;#000000&#8243; title_font_size=&#8221;47&#8243; background_color=&#8221;RGBA(0,0,0,0)&#8221; background_enable_image=&#8221;off&#8221; custom_margin=&#8221;|||10%&#8221; title_font_size_tablet=&#8221;40&#8243; title_font_size_phone=&#8221;35&#8243; title_font_size_last_edited=&#8221;on|desktop&#8221;][\/et_pb_post_title][\/et_pb_column][\/et_pb_row][et_pb_row _builder_version=&#8221;4.9.7&#8243; background_size=&#8221;initial&#8221; background_position=&#8221;top_left&#8221; background_repeat=&#8221;repeat&#8221;][et_pb_column type=&#8221;4_4&#8243; _builder_version=&#8221;3.25&#8243; custom_padding=&#8221;|||&#8221; custom_padding__hover=&#8221;|||&#8221;][et_pb_text _builder_version=&#8221;4.9.7&#8243; text_font=&#8221;Georgia||||||||&#8221; text_text_color=&#8221;#000000&#8243; text_font_size=&#8221;22px&#8221; text_line_height=&#8221;1.9em&#8221; max_width=&#8221;800px&#8221; max_width_last_edited=&#8221;off|phone&#8221; custom_margin=&#8221;|||10%&#8221; custom_margin_last_edited=&#8221;off|desktop&#8221; hover_enabled=&#8221;0&#8243; text_font_size_tablet=&#8221;&#8221; text_font_size_phone=&#8221;&#8221; text_font_size_last_edited=&#8221;on|phone&#8221; text_line_height_last_edited=&#8221;off|phone&#8221; sticky_enabled=&#8221;0&#8243;] What is Salt or SaltStack? SaltStack [&hellip;]","og_url":"https:\/\/cloudfoundation.com\/blog\/saltstack-tutorial\/","og_site_name":"CloudFoundation | Blog","article_published_time":"2025-01-08T11:44:54+00:00","article_modified_time":"2025-01-09T03:51:47+00:00","og_image":[{"width":500,"height":642,"url":"http:\/\/cloudfoundation.com\/blog\/wp-content\/uploads\/2025\/01\/Featured-image-of-saltstack.jpg","type":"image\/jpeg"}],"author":"NAGENDRAG","twitter_card":"summary_large_image","twitter_misc":{"Written by":"NAGENDRAG","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/cloudfoundation.com\/blog\/saltstack-tutorial\/","url":"https:\/\/cloudfoundation.com\/blog\/saltstack-tutorial\/","name":"Salt or SaltStack Tutorial","isPartOf":{"@id":"https:\/\/cloudfoundation.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/cloudfoundation.com\/blog\/saltstack-tutorial\/#primaryimage"},"image":{"@id":"https:\/\/cloudfoundation.com\/blog\/saltstack-tutorial\/#primaryimage"},"thumbnailUrl":"https:\/\/cloudfoundation.com\/blog\/wp-content\/uploads\/2025\/01\/Featured-image-of-saltstack.jpg","datePublished":"2025-01-08T11:44:54+00:00","dateModified":"2025-01-09T03:51:47+00:00","author":{"@id":"https:\/\/cloudfoundation.com\/blog\/#\/schema\/person\/df6c7eba98f1bb15f2a100a9958266e4"},"breadcrumb":{"@id":"https:\/\/cloudfoundation.com\/blog\/saltstack-tutorial\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/cloudfoundation.com\/blog\/saltstack-tutorial\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cloudfoundation.com\/blog\/saltstack-tutorial\/#primaryimage","url":"https:\/\/cloudfoundation.com\/blog\/wp-content\/uploads\/2025\/01\/Featured-image-of-saltstack.jpg","contentUrl":"https:\/\/cloudfoundation.com\/blog\/wp-content\/uploads\/2025\/01\/Featured-image-of-saltstack.jpg","width":500,"height":642},{"@type":"BreadcrumbList","@id":"https:\/\/cloudfoundation.com\/blog\/saltstack-tutorial\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/cloudfoundation.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Salt or SaltStack Tutorial"}]},{"@type":"WebSite","@id":"https:\/\/cloudfoundation.com\/blog\/#website","url":"https:\/\/cloudfoundation.com\/blog\/","name":"CloudFoundation | Blog","description":"A New way of Learning","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/cloudfoundation.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/cloudfoundation.com\/blog\/#\/schema\/person\/df6c7eba98f1bb15f2a100a9958266e4","name":"NAGENDRAG","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cloudfoundation.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/09e08ba1102807a876f2c00245d6b955f0a9f027b40c181e9cee0cd2d927f84a?s=96&d=wavatar&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/09e08ba1102807a876f2c00245d6b955f0a9f027b40c181e9cee0cd2d927f84a?s=96&d=wavatar&r=g","caption":"NAGENDRAG"},"url":"https:\/\/cloudfoundation.com\/blog\/author\/nagendrag\/"}]}},"_links":{"self":[{"href":"https:\/\/cloudfoundation.com\/blog\/wp-json\/wp\/v2\/posts\/90996","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cloudfoundation.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cloudfoundation.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cloudfoundation.com\/blog\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/cloudfoundation.com\/blog\/wp-json\/wp\/v2\/comments?post=90996"}],"version-history":[{"count":4,"href":"https:\/\/cloudfoundation.com\/blog\/wp-json\/wp\/v2\/posts\/90996\/revisions"}],"predecessor-version":[{"id":91007,"href":"https:\/\/cloudfoundation.com\/blog\/wp-json\/wp\/v2\/posts\/90996\/revisions\/91007"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cloudfoundation.com\/blog\/wp-json\/wp\/v2\/media\/91006"}],"wp:attachment":[{"href":"https:\/\/cloudfoundation.com\/blog\/wp-json\/wp\/v2\/media?parent=90996"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cloudfoundation.com\/blog\/wp-json\/wp\/v2\/categories?post=90996"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cloudfoundation.com\/blog\/wp-json\/wp\/v2\/tags?post=90996"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}