Top 100+ Salt (software) Interview Questions And Answers
Question 1. Is Salt Open-center?
Answer :
No. Salt is 100% devoted to being open-source, which includes all of our APIs. It is developed beneath the Apache 2.Zero license, allowing it to be used in each open and proprietary initiatives.
To amplify on this a bit:
There is a whole lot argument over the real definition of "open core". From our point of view, Salt is open supply due to the fact
It is a standalone product that all of us is unfastened to use.
It is developed within the open with contributions everyday from the community for the best of the challenge.
There aren't any functions of Salt itself which might be confined to split proprietary products disbursed by SaltStack, Inc.
Because of our Apache 2.0 license, Salt may be used as the foundation for a venture or even a proprietary tool.
Our APIs are open and documented (any loss of documentation is an oversight in preference to an intentional choice through SaltStack the employer) and available to be used by everyone.
SaltStack the enterprise does make proprietary merchandise which use Salt and its libraries, like business enterprise is unfastened to do, but we achieve this via the APIs, NOT via forking Salt and creating a exceptional, closed-source version of it for paying customers.
Question 2. I Think I Found A Bug! What Should I Do?
Answer :
The salt-customers mailing list in addition to the salt IRC channel can each be beneficial assets to affirm if others are seeing the difficulty and to help with instant debugging.
To record a worm to the Salt assignment, please comply with the commands in reporting a trojan horse.
Python Interview Questions
Question three. What Ports Should I Open On My Firewall?
Answer :
Minions want in an effort to connect with the Master on TCP ports 4505 and 4506. Minions do no longer want any inbound ports open.
Question four. My Script Runs Every Time I Run A State.Follow. Why?
Answer :
You are probably the use of cmd.Run as opposed to cmd.Wait. A cmd.Wait country will most effective run when there has been a change in a nation that it is looking.
A cmd.Run kingdom will run the corresponding command every time (except it's miles averted from running by the except or onlyif arguments).
Python Tutorial
Question five. How Does Salt Determine The Minion's Id?
Answer :
If the Minion identity isn't configured explicitly (the use of the identification parameter), Salt will determine the identification based on the hostname.
Git (software) Interview Questions
Question 6. I'm Trying To Manage Packages/offerings But I Get An Error Saying That The State Is Not Available. Why?
Answer :
Salt detects the Minion's operating system and assigns the appropriate package deal or carrier management module based on what is detected. However, for positive custom spins and OS derivatives this detection fails. In cases like this, an problem need to be opened on our tracker, with the following information:
The output of the following command:
salt <minion_id> grains.Items and many others/lsb-release, if present on the Minion.
Question 7. Why Aren't My Custom Modules/states/and so forth. 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 way of country.Follow whilst run with none arguments.
Similarly, custom states are synced to Minions while state.Apply, saltutil.Sync_states, or saltutil.Sync_all is administered.
Custom states are also synced by means of country.Apply whilst run without any arguments.
Other custom kinds (renderers, outputters, and so on.) have similar behavior, see the documentation for the saltutilmodule for greater data.
This reactor instance can be used to robotically sync custom types when the minion connects to the grasp, to help with this fowl-and-egg difficulty.
Git (software) Tutorial Javascript Advanced Interview Questions
Question eight. Module X Isn't Available, Even Though The Shell Command It Uses Is Installed. Why?
Answer :
This is most likely a PATH difficulty. Did you custom-collect the software program which the module requires? RHEL/CentOS/and so forth. In particular override the foundation consumer's course in /and many others/init.D/capabilities, putting it to /sbin:/usr/sbin:/bin:/usr/bin, making software program established into /usr/local/bin unavailable to Salt while the Minion is started out using the initscript. In model 2014.1.0, Salt can have a better solution for those type of PATH-related troubles, however recompiling the software program to put in it into a place within the PATH ought to solve the issue within the period in-between. Alternatively, you can create a symbolic link within the PATH using a record.Symlink nation.
/usr/bin/foo:
report.Symlink:
- goal: /usr/neighborhood/bin/foo
Question nine. Can I Run Different Versions Of Salt On My Master And Minion?
Answer :
This depends at the versions. In preferred, it is advocated that Master and Minion variations healthy.
When upgrading Salt, the grasp(s) should usually be upgraded first. Backwards compatibility for minions strolling more moderen variations of salt than their masters isn't always assured.
Whenever possible, backwards compatibility among new masters and antique minions might be preserved. Generally, the handiest exception to this coverage is in case of a safety vulnerability.
Recent examples of backwards compatibility breakage include the 0.17.1 release (wherein all backwards compatibility was damaged due to a protection restoration), and the 2014.1.0 launch (which retained compatibility among 2014.1.0 masters and 0.17 minions, however broke compatibility for 2014.1.Zero minions and older masters).
Puppet (software program) Interview Questions
Question 10. Does Salt Support Backing Up Managed Files?
Answer :
Yes. Salt gives an easy to use addition to your document.Managed states that can help you again up documents thru backup_mode, backup_mode can be configured on a consistent with state foundation, or inside the minion config (word that if set inside the minion config this would truely be the default method to use, you still need to specify that the document have to be backed up!).
Javascript Advanced Tutorial
Question eleven. Is It Possible To Deploy A File To A Specific Minion, Without Other Minions Having Access To It?
Answer :
The Salt fileserver does no longer yet help access control, however it's miles still viable to do that. As of Salt 2015.Five.0, thefile_tree outside pillar is to be had, and permits the contents of a file to be loaded as Pillar statistics. This outside pillar is capable of assigning Pillar values both to person minions, and to nodegroups. See the documentation for info on how to set this up.
Once the external pillar has been installation, the data may be pushed to a minion via a document.Managed country, using thecontents_pillar argument:
/and so on/my_super_secret_file:
file.Controlled:
- consumer: mystery
- group: mystery
- mode: six hundred
- contents_pillar: secret_files:my_super_secret_file
In this situation, the supply document could be located in a listing called secret_files under the file_tree course 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.
WxPython Interview Questions
Question 12. What Is The Best Way To Restart A Salt Minion Daemon Using Salt After Upgrade?
Answer :
Updating the salt-minion bundle requires a restart of the salt-minion carrier. But restarting the provider whilst within the middle of a country run interrupts the manner of the Minion going for walks states and sending effects again to the Master. A commonplace manner to workaround this is to agenda restarting of the Minion provider the usage of masterless mode in spite of everything different states have been carried out. This permits the minion to keep Minion to Master connection alive for the Minion to document the final outcomes to the Master, whilst the service is restarting within the heritage.
Python Interview Questions
Question 13. Upgrade Without Automatic Restart?
Answer :
Doing the Minion upgrade seems to be a handiest country for your SLS document at first. But the running structures along with Debian GNU/Linux, Ubuntu and their derivatives begin the provider after the package installation by default. To prevent this, we want to create policy layer a good way to prevent the Minion service to restart proper after the improve:
%- if grains['os_family'] == 'Debian' %
Disable beginning services:
document.Managed:
- name: /usr/sbin/policy-rc.D
- consumer: root
- group: root
- mode: 0755
- contents:
- '#!/bin/sh'
- exit 101
# do now not touch if already exists
- replace: False
- prereq:
- pkg: Upgrade Salt Minion
%- endif %
Upgrade Salt Minion:
pkg.Established:
- call: salt-minion
- model: 2016.Eleven.3% if grains['os_family'] == 'Debian' %+ds-1% endif %
- order: closing
Enable Salt Minion:
service.Enabled:
- call: salt-minion
- require:
- pkg: Upgrade Salt Minion
%- if grains['os_family'] == 'Debian' %
Enable starting services:
record.Absent:
- call: /usr/sbin/coverage-rc.D
- onchanges:
- pkg: Upgrade Salt Minion
%- endif %
Puppet (software program) Tutorial
Question 14. Restart Using States?
Answer :
Now we can observe the workaround to restart the Minion in reliable way. The following example works on each UNIX-like and Windows working structures:
Restart Salt Minion:
cmd.Run:
%- if grains['kernel'] == 'Windows' %
- call: 'C:saltsalt-call.Bat --neighborhood provider.Restart salt-minion'
%- else %
- call: 'salt-call --local service.Restart salt-minion'
%- endif %
- bg: True
- onchanges:
- pkg: Upgrade Salt Minion
However, it requires extra advanced tricks to improve from legacy version of Salt (earlier than 2016.3.0), wherein executing instructions within the background isn't supported:
Restart Salt Minion:
cmd.Run:
%- if grains['kernel'] == 'Windows' %
- name: 'begin powershell "Restart-Service -Name salt-minion"'
%- else %
# fork and disown the procedure
- name: zero>&- # close stdin
exec 1>&- # near stdout
exec 2>&- # near stderr
nohup salt-name --local service.Restart salt-minion &
%- endif %
Question 15. Restart Using Remote Executions?
Answer :
Restart the Minion from the command line:
salt -G kernel:Windows cmd.Run_bg 'C:saltsalt-call.Bat --nearby service.Restart salt-minion'
salt -C 'no longer G@kernel:Windows' cmd.Run_bg 'salt-name --local provider.Restart salt-minion'
Ansible (software) Interview Questions
Question 16. Salting The Salt Master?
Answer :
In order to configure a grasp server via states, the Salt master can also be "salted" with the intention to enforce country on the Salt master as well as the Salt minions. Salting the Salt master requires a Salt minion to be mounted on the same system because the Salt master. Once the Salt minion is installed, the minion configuration record 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 could be centered just like some other minion. If the minion at the salted grasp is running, the minion can be focused via any typical salt command. Additionally, the salt-callcommand can execute operations to put into effect nation at the salted grasp without requiring the minion to be walking.
WxPython Tutorial
Question 17. Is Targeting Using Grain Data Secure?
Answer :
Because grains may be set by way of customers that have access to the minion configuration files on the nearby gadget, grains are taken into consideration less comfortable than other identifiers in Salt. Use warning while concentrated on touchy operations or placing pillar values based totally on grain statistics.
When possible, you should target touchy operations and facts the usage of the Minion ID. If the Minion ID of a machine changes, the Salt Minion's public key need to be re-widely wide-spread by an administrator at the Salt Master, making it much less prone to impersonation assaults.
Devops Chef Interview Questions
Question 18. Why Did The Value For A Grain Change On Its Own?
Answer :
This is normally the end result of an upstream change in an OS distribution that replaces or gets rid of something that Salt became the use of to come across the grain. Fortunately, when this takes place,
you can use Salt to restoration 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 which you want to exchange / set.)
You need to additionally record an issue describing the trade so it is able to be constant in Salt.
Git (software) Interview Questions
