- 1 year ago
Installing packages on windows minion with salt state files
To install packages on a Windows minion using Salt State files, you can use the win_pkg
module of SaltStack. Here's an example of a State file that installs Notepad++
:
yamlnotepadplusplus:
pkg.installed:
- name: Notepad++
- version: 8.1.2
- refresh: True
In this example, the pkg.installed
state is used to install the Notepad++
package. The name
parameter specifies the name of the package, and the version
parameter specifies the version of the package to install. The refresh
parameter is used to refresh the package database before installation.
You can also use the win_chocolatey
module to install packages from Chocolatey. Here's an example:
yamlnotepadplusplus:
chocolatey.installed:
- name: notepadplusplus
- version: 8.1.2
- source: chocolatey
In this example, the chocolatey.installed
state is used to install Notepad++
from Chocolatey. The name
parameter specifies the name of the package, and the version
parameter specifies the version of the package to install. The source
parameter specifies the package source, which in this case is chocolatey
.
Make sure that the Salt minion has the necessary permissions to install packages on the Windows machine. If you encounter issues, you may need to run the Salt minion as an administrator.