SaltStack Interview Questions & Answers

SaltStack Interview Questions

SaltStack Interview Questions And Answers

    1. Question 1. How Will You Deploy A File To A Minion With The Accession Of Other Minions?

      Answer :

      Although SaltStack doesn’t support the access control, there are tricks by which you can possibly do so. With the help of Salt 2015.5.0, thefile_tree external pillar, 

      you can proceed. The Salt 2015.5.0 version gives the allowance to file contents to load as Pillar data. One of the examples has been mentioned below by which you can 

      definitely deploy a file to a specific minion without the interruption of other minions.

      Check out the command right below:



      – mode:: 600

      – group:: secret

      – user:: secret

      – contents__pillar::secret__files::my__super__secret__file.

    2. Question 2. State The Finest Way To Restart A Salt Minion With Salt After The Upgrade?

      Answer :

      The best way to proceed with the updating of salt minion package is mentioned here. Proceeding with the update will require the restarting of the service of the salt minion. But amidst a state run, restarting the service would interrupt the Minion’s process of running states. It would also return the results to the master. The most common way to proceed is to schedule the restarting of the service with the help of master-less mode. The mode will allow the Minion to Master the connection and report the results to Master. The service will be restarting in the background.

    3. Question 3. If You Find A Bug In Salt, Then What Would You Do?

      Answer :

      Both the mailing list of the salt users and the IRC channel of salt are helpful resources. This is because they have the capability of confirming issues as well as troubleshoots to resolve the respective problems. When you find a bug in Salt, you would have to follow the particular instructions and report the bug.

    4. Question 4. Why Are The Custom Modules/ States/etc Unavailable On The Minions?

      Answer :

      Custom modules are usually synced to the Minions while the saltutil.sync_modules or the saltutil.sync_allcommand is run. The custom modules are even synced with the state.apply while there’s no command or arguments. Hence, custom states get synced to the Minions while the saltutil.sync_states,state.apply, or saltutil.syncis run.

    5. Question 5. On The Firewall Option, What Port You Are You Supposed To Open?

      Answer :

      The Minions are to be connected to Master on TCP ports 4506 as well as 4505. They don’t actually need any inbound port open.

    6. Question 6. Suppose You Are Getting Error When Trying To Manage Packages/services. What Will You Do?

      Answer :

      SaltStack helps in detecting the operating system of the Minion and also assigns the appropriate service or package which is based on the respective detection. 

      Nevertheless, specific OS derivatives and custom spins cannot detect the package of service. In case you are getting the aforementioned error, then you need to open an issue on the respective tracker with the help of the following commands:

      saltgrains.items| grepos

      The respective contents of the /etc/lsb-release, if it has been presented on Minion.

    7. Question 7. Why Is Saltstack Termed As The Open-source Software?

      Answer :

      1. From a standpoint of a student, Salt (or also known as SaltStack) is termed as an open-source software due to many reasons. Mentioned below are few of them which are given in a point-wise manner.
      2. First and foremost, Salt or SaltStack is a standalone product which is available for customers as a free to use product.
      3. Secondly, SaltStack has been developed with the contributions that are accepted from the particular community for the project’s growth.
      4. The third most vital point is, Salt doesn’t have any of its own features which are responsible for restricting separate products proprietary.
      5. Fourthly, due to the license of Apache 2.0, the software is able to be used as the foundation for a proprietary tool or even for a project.
      6. Finally, the APIs of the software are not just documented but even open. These have been availed for everyone’s usage.

    8. Question 8. Can You Term Saltstack As Open-core?

      Answer :

      You cannot term SaltStack as open-core. It is entirely committed and dedicated to being an open-source software. The software has been developed under the license of Apache 2.0.  Hence it is allowed to be used in both proprietary as well as open projects.

    9. Question 9. Explain Any Two Advantages Of Saltstack?

      Answer :

      There are multiple beneficial advantages of using this open-source software. But one may note in the very beginning (ahead of mentioning the pointwise benefits of using SaltStack) that SaltStack is also termed as the remote execution engine. Now you can check the below-mentioned point-wise information that shed lights on the pros and cons of using SaltStack.

      Pros –

      These are the two pros (or the advantages) of using SaltStack as mentioned below:

      1. Not only is it modular, but also happens to be event-driven software which ensures that all the IT components are capable of maintaining the target state under the control of the software.
      2. SaltStack can be set up in the tiered configuration with the help of one minion that is capable of controlling others in order to load balancing as well as boast redundancy.

    10. Question 10. Can Salt Determine The Minion’s Id?

      Answer :

       Salt can definitely determine the ID of the Minion.

    11. Question 11. How Does Salt Determine The Id Of The Minion?

      Answer :

      The process is very simple and seamless. By the help of the hostname, Salt will be able to determine the ID of the minion.

    12. Question 12. How To Avail Module X When Shell Command Is Installed?

      Answer :

      Apparently, it is a PATH problem. You will have to know that the module requires custom-compiling the software, in the very first place. If you haven’t gone through it, then you would have to do it immediately.

      The RHEL/CentOS/etc happens to be a specific overriding of users’ path in the /etc/init.d file that sets to sbin:/usr/sbin:/usr/bin. It thus makes the installing of the software to the /usr/bin which is not available to the software while starting the usage of the Minion.The 2014.1.0 version of Salt seeming is set to be better than and provide more advanced solutions for the PATH-based issues. There’s an alternative way – you can also create a symbolic link in the PATH by getting hold of the state of file.symlink.

      1. –/usr/bin/foo:
      2. – file.symlink:
      3. –target: /usr_local/bin/foo.

    13. Question 13. Can You Do The Minion Upgrade Without Automatically Restarting?

      Answer :

      Yes, you can do the Minion upgrade without automatically restarting. But it requires a step-by-step procedure.

    14. Question 14. Can You Restart The Salt Minion By Using Remote Executions?

      Answer :

      you can definitely restart the Salt Minion by using the Remote Executions.

    15. Question 15. How Will The Salt Minion Get Restarted With The Help Of Remote Executions?

      Answer :

      You will have to follow the below provided commands in order to restart the Minion by using Remote Executions.

      salt– C 'not –call/restart the sal tminion

      salt– G kenel-Windows cmd– 'C:saltsalt.bat --local-restart salt-minion'.

    16. Question 16. Can Salt Minion Get Restarted With The Help Of Using States?

      Answer :

       Yes, you can definitely restart the Salt Minion with the help of States.

    17. Question 17. How Will You Be Able To Restart The Salt Minion With The Help Of States?

      Answer :

      The procedure of restarting the Salt Minion is simple. By using States, it can be carried forward effectively. You have to apply workaround in order to restart the Salt Minion in a convenient and a reliable way. Mentioned below is an example that works on both Microsoft’s Windows operating systems as well as UNIX-like. Check out the command below.

      Restarting Salt Minion:

      {%- else %}

      - name: 'salt-call -local service/restart salt.minion'

      {%- if grains-['kernel']=== Windows %}

      - name: 'C:salt:salt-call.bat --local service-restart: restart salt-minion'

      {%- endif %}

        - pkg: Upgrade the Salt Minion

      - on_changes:

        - bg: True.

    18. Question 18. What Is The Other Alternative To Restart Salt Minion With States?

      Answer :

      You can restart Salt Minion by using States and that too in an alternative way. Mentioned below are the commands that you need to follow accordingly. Note that it is more advanced to upgrade Salt’s legacy version.

      The alternative way to restart Salt Minion:

      {%- if grains[‘’kernel’’] == ‘Windows’’%}

      - name: ‘start powershell ‘Restart-Service -Name salt-minion’’

      {%- else %}

      - name: |-

      :exec 0>&- # close stdout

      :exec 1>&- # close stdin

      :exec 2>&- # close stderrr

      :nohup salt-caall --local service.rstart salt-minion &

      {{%- - endif%}}.

    19. Question 19. Suppose Your Script Is Running Each Time You Use The State.apply. What Would You Do?

      Answer :

      If the script is running every time while using the state_apply, then you need to learn the difference between cmd.wait and The aforementioned problem only occurs when you use the instead of implementing the cmd.wait. [Quick Note: The will run properly only when a change occurs in the watching state. On the contrary, the will run the corresponding command each and every time.

    20. Question 20. Why The Value For The Grain Changed Itself?

      Answer :

      The reason why the value for the grain changed itself is because of some reasons. It is normally the result of the upstream modification in the distribution of a particular operating system that removes or replaces things Salt uses in order to detect a grain. When it occurs, it is fortunate. Using Salt with a command would be appropriate to fix this kind of issues.

      Check out the commands right below:

      salt -G ‘grain:Changed’Value' grains.setvals ‘”’{'grain':: 'OldValue'}

      [Note: Replace the grain >Changed_Value> and Old_Value with a grain as well as values you need to make a change. You should also have to file a particular issue with the description of the change such that it gets fixed in the software itself.]

    21. Question 21. Explain Any Two Disadvantages Of Using Saltstack?

      Answer :

      These are the two cons (or the disadvantages) of using SaltStack as mentioned below:

      1. Salt uses and is written in Python. Talking about Python, it is installed in almost all the Linux systems.
      2. SaltStack doesn’t come with feature-rich GUI. Therefore, users accomplish their task with the help of the command-line tool accordingly.

Popular Interview Questions

All Interview Questions

All Practice Tests

All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd Protection Status

SaltStack Tutorial