Skip to main content

Salt (software) Interview Questions & Answers

  1. Is Salt Open-core?

    Answer :
    No. Salt is 100% committed to being open-source, including all of our APIs. It is developed under the Apache 2.0 license, allowing it to be used in both open and proprietary projects.
    To expand on this a little:
    There is much argument over the actual definition of "open core". From our standpoint, Salt is open source because
    1. It is a standalone product that anyone is free to use.
    2. It is developed in the open with contributions accepted from the community for the good of the project.
    3. There are no features of Salt itself that are restricted to separate proprietary products distributed by SaltStack, Inc.
    4. Because of our Apache 2.0 license, Salt can be used as the foundation for a project or even a proprietary tool.
    5. Our APIs are open and documented (any lack of documentation is an oversight as opposed to an intentional decision by SaltStack the company) and available for use by anyone.
    SaltStack the company does make proprietary products which use Salt and its libraries, like the company is free to do, but we do so via the APIs, NOT by forking Salt and creating a different, closed-source version of it for paying customers.
  2. I Think I Found A Bug! What Should I Do?

    Answer :
    The salt-users mailing list, as well as the salt IRC channel, can both be helpful resources to confirm if others are seeing the issue and to assist with immediate debugging.
    To report a bug to the Salt project, please follow the instructions in reporting a bug.
  3. What Ports Should I Open On My Firewall?

    Answer :
    Minions need to be able to connect to the Master on TCP ports 4505 and 4506. Minions do not need any inbound ports open.
  4. My Script Runs Every Time I Run A State.apply. Why?

    Answer :
    You are probably using cmd.run rather than cmd.wait. A cmd.wait state will only run when there has been a change in a state that it is watching.
    A cmd.run state will run the corresponding command every time (unless it is prevented from running by the unless or onlyif arguments).
  5. How Does Salt Determine The Minion's Id?

    Answer :
    If the Minion id is not configured explicitly (using the id parameter), Salt will determine the id based on the hostname.
  6. I'm Trying To Manage Packages/services But I Get An Error Saying That The State Is Not Available. Why?

    Answer :
    Salt detects the Minion's operating system and assigns the correct package or service management module based on what is detected. However, for certain custom spins and OS derivatives this detection fails. In cases like this, an issue should be opened on our tracker, with the following information:
    1. The output of the following command:
    2. salt <minion_id> grains.items | grep os
    3. The contents of /etc/lsb-release, if present on the Minion.
  7. Why Aren't My Custom Modules/states/etc. Available On My Minions?

    Answer :
    Custom modules are synced to Minions when saltutil.sync_modules, or saltutil.sync_all is run. Custom modules are also synced by state.apply when run without any arguments.
    Similarly, custom states are synced to Minions when state.apply, saltutil.sync_states, or saltutil.sync_all is run.
    Custom states are also synced by state.apply when run without any arguments.
    Other custom types (renderers, outputters, etc.) have similar behavior, see the documentation for the saltutilmodule for more information.
    This reactor example can be used to automatically sync custom types when the minion connects to the master, to help with this chicken-and-egg issue.
  8. Module X Isn't Available, Even Though The Shell Command It Uses Is Installed. Why?

    Answer :
    This is most likely a PATH issue. Did you custom-compile the software which the module requires? RHEL/CentOS/etc. in particular override the root user's path in /etc/init.d/functions, setting it to /sbin:/usr/sbin:/bin:/usr/bin, making software installed into /usr/local/bin unavailable to Salt when the Minion is started using the initscript. In version 2014.1.0, Salt will have a better solution for these sort of PATH-related issues, but recompiling the software to install it into a location within the PATH should resolve the issue in the meantime. Alternatively, you can create a symbolic link within the PATH using a file.symlink state.
    /usr/bin/foo:
      file.symlink:
        - target: /usr/local/bin/foo
  9. Can I Run Different Versions Of Salt On My Master And Minion?

    Answer :
    This depends on the versions. In general, it is recommended that Master and Minion versions match.
    When upgrading Salt, the master(s) should always be upgraded first. Backwards compatibility for minions running newer versions of salt than their masters is not guaranteed.
    Whenever possible, backwards compatibility between new masters and old minions will be preserved. Generally, the only exception to this policy is in case of a security vulnerability.
    Recent examples of backwards compatibility breakage include the 0.17.1 release (where all backwards compatibility was broken due to a security fix), and the 2014.1.0 release (which retained compatibility between 2014.1.0 masters and 0.17 minions, but broke compatibility for 2014.1.0 minions and older masters).
  10. Does Salt Support Back Up Managed Files?

    Answer :
    Yes. Salt provides an easy to use addition to your file.managed states that allow you to back up files via backup_mode, backup_mode can be configured on a per state basis, or in the minion config (note that if set in the minion config this would simply be the default method to use, you still need to specify that the file should be backed up!).

  11. Is It Possible To Deploy A File To A Specific Minion, Without Other Minions Having Access To It?

    Answer :
    The Salt fileserver does not yet support access control, but it is still possible to do this. As of Salt 2015.5.0, thefile_tree external pillar is available, and allows the contents of a file to be loaded as Pillar data. This external pillar is capable of assigning Pillar values both to individual minions, and to nodegroups. See the documentation for details on how to set this up.
    Once the external pillar has been set up, the data can be pushed to a minion via a file.managed state, using thecontents_pillar argument:
    /etc/my_super_secret_file:
      file.managed:
        - user: secret
        - group: secret
        - mode: 600
        - contents_pillar: secret_files:my_super_secret_file
    In this example, the source file would be located in a directory called secret_files underneath the file_tree path for the minion. The syntax for specifying the pillar variable is the same one used for pillar.get, with a colon representing a nested dictionary.
  12. What Is The Best Way To Restart A Salt Minion Daemon Using Salt After Upgrade?

    Answer :
    Updating the salt-minion package requires a restart of the salt-minion service. But restarting the service while in the middle of a state run interrupts the process of the Minion running states and sending results back to the Master. A common way to workaround that is to schedule restarting of the Minion service using masterless mode after all other states have been applied. This allows the minion to keep Minion to Master connection alive for the Minion to report the final results to the Master, while the service is restarting in the background.
  13. Upgrade Without Automatic Restart?

    Answer :
    Doing the Minion upgrade seems to be a simplest state in your SLS file at first. But the operating systems such as Debian GNU/Linux, Ubuntu and their derivatives start the service after the package installation by default. To prevent this, we need to create policy layer which will prevent the Minion service to restart right after the upgrade:
    {%- if grains['os_family'] == 'Debian' %}
    Disable starting services:
      file.managed:
        - name: /usr/sbin/policy-rc.d
        - user: root
        - group: root
        - mode: 0755
        - contents:
          - '#!/bin/sh'
          - exit 101
        # do not touch if already exists
        - replace: False
        - prereq:
          - pkg: Upgrade Salt Minion
    {%- endif %}
    Upgrade Salt Minion:
      pkg.installed:
        - name: salt-minion
        - version: 2016.11.3{% if grains['os_family'] == 'Debian' %}+ds-1{% endif %}
        - order: last
    Enable Salt Minion:
      service.enabled:
        - name: salt-minion
        - require:
          - pkg: Upgrade Salt Minion
    {%- if grains['os_family'] == 'Debian' %}
    Enable starting services:
      file.absent:
        - name: /usr/sbin/policy-rc.d
        - onchanges:
          - pkg: Upgrade Salt Minion
    {%- endif %}
  14. Restart Using States?

    Answer :
    Now we can apply the workaround to restart the Minion in reliable way. The following example works on both UNIX-like and Windows operating systems:
    Restart Salt Minion:
      cmd.run:
    {%- if grains['kernel'] == 'Windows' %}
        - name: 'C:saltsalt-call.bat --local service.restart salt-minion'
    {%- else %}
        - name: 'salt-call --local service.restart salt-minion'
    {%- endif %}
        - bg: True
        - onchanges:
          - pkg: Upgrade Salt Minion
    However, it requires more advanced tricks to upgrade from legacy version of Salt (before 2016.3.0), where executing commands in the background is not supported:
    Restart Salt Minion:
      cmd.run:
    {%- if grains['kernel'] == 'Windows' %}
        - name: 'start powershell "Restart-Service -Name salt-minion"'
    {%- else %}
        # fork and disown the process
        - name: |-
            exec 0>&- # close stdin
            exec 1>&- # close stdout
            exec 2>&- # close stderr
           nohup salt-call --local service.restart salt-minion &
    {%- endif %}
  15. Restart Using Remote Executions?

    Answer :
    Restart the Minion from the command line:
    salt -G kernel:Windows cmd.run_bg 'C:saltsalt-call.bat --local service.restart salt-minion'
    salt -C 'not G@kernel:Windows' cmd.run_bg 'salt-call --local service.restart salt-minion'
  16. Salting The Salt Master?

    Answer :
    In order to configure a master server via states, the Salt master can also be "salted" in order to enforce state on the Salt master as well as the Salt minions. Salting the Salt master requires a Salt minion to be installed on the same machine as the Salt master. Once the Salt minion is installed, the minion configuration file must be pointed to the local Salt master:
    master: 127.0.0.1
    Once the Salt master has been "salted" with a Salt minion, it can be targeted just like any other minion. If the minion on the salted master is running, the minion can be targeted via any usual salt command. Additionally, the salt-callcommand can execute operations to enforce state on the salted master without requiring the minion to be running.
  17. Is Targeting Using Grain Data Secure?

    Answer :
    Because grains can be set by users that have access to the minion configuration files on the local system, grains are considered less secure than other identifiers in Salt. Use caution when targeting sensitive operations or setting pillar values based on grain data.
    When possible, you should target sensitive operations and data using the Minion ID. If the Minion ID of a system changes, the Salt Minion's public key must be re-accepted by an administrator on the Salt Master, making it less vulnerable to impersonation attacks.
  18. Why Did The Value For A Grain Change On Its Own?

    Answer :
    This is usually the result of an upstream change in an OS distribution that replaces or removes something that Salt was using to detect the grain. Fortunately, when this occurs,
    you can use Salt to fix it with a command similar to the following:
    salt -G 'grain:ChangedValue' grains.setvals "{'grain': 'OldValue'}"
    (Replacing grain, ChangedValue, and OldValue with the grain and values that you want to change / set.)
    You should also file an issue describing the change so it can be fixed in Salt.

Comments

  1. I found your blog very interesting and very informative. I think your blog is great information source & I like your way of writing and explaining the topics.If you want More Details About Mule soft Interview Questions Click here.

    ReplyDelete
  2. Great content.Blue prism is booming now a days. Looking forward for more posts in future.
    rpa training in bangalore
    best blue prism online training

    ReplyDelete
  3. The information which you have provided is very good. It is very useful who is looking for selenium certification | selenium interview questions

    ReplyDelete

Post a Comment

Popular posts from this blog

Blue Prism Free Totorial

Enterprise Robotic Process Automation Software RPA  Software Robots that Automate Business Processes across your entire Enterprise Robotic Process Automation (RPA) is an emerging technology of process automation based on Software Robots/Artificial Intelligence workers. RPA is the significant technological innovation of screen scraping. RPA provides new platforms which are sufficiently mature, scalable and reliable for use in large enterprises. Robotic Process Automation delivers profits by enhancing the reliability across numerous industries and organizations. These software robots interpret, trigger, compare, acquire results, and communicate with other systems just like a human. They perform a vast range of repetitive tasks without tire and mistakes. These robots even integrate readily and are easy to maintain. Interested in mastering  RPA Training ? Enroll now for FREE demo at   Tekslate . Empowering your Business with RPA Incorporating RPA to handle business p

Selenium interview Questions

If you're looking for Selenium Interview Questions and Answers for Experienced & Freshers, you are at right place. There are a lot of opportunities for many reputed companies in the world. According to research Selenium has a market share of about 27.7%. So, You still have opportunities to move ahead in your career in Selenium. Mindmajix offers advanced Selenium Interview Questions 2018 that helps you in cracking your interview & acquire your dream career as Selenium Developer. Top 35 Selenium Interview Questions And Answers : The entire set of Selenium interview questions is divided into three sections: Basic level Advanced level TestNG framework for Selenium Accelerate your career with Selenium Online Training and become an expert in Selenium. A. Basic Level  – Selenium Interview Questions 1. What are the significant changes in upgrades in various Selenium versions? Selenium v1 included only three suite of tools: Selenium I

MuleSoft Interview Question And Answers

If you're looking for MuleSoft Interview Questions for Experienced & Freshers, you are at right place. There are lot of opportunities from many reputed companies in the world. According to research, MuleSoft has a market share of about 5.9%. So, You still have an opportunity to move ahead in your career in Mule ESB. Tekslate offers advanced MuleSoft Interview Questions that help you in cracking your interview & acquire dream career. Learn how to use Mulesoft, from beginner basics to advanced techniques. Enroll for Free  Mule ESB Training   Demo! Q. What is Mule ESB? Mule ESB is a Java-based enterprise service bus (ESB) and integration platform, developer can connect their application with ESB. Mule use service oriented architecture. Apart from of the different technologies the applications use, including JMS, Web Services, SMTP, HTTP. The advantage of ESB, it’s allow communicate different application. Messages can be any format SOAP to JSON. Mule ESB Development pr