The file server is a location for storing both Salt-specific files, such as top files or state files, as well as files that can be distributed to minions, such as system configuration files. In the File Server workspace, you can view, author, and save state files (YAML), modules, and text files.

Files in SaltStack Config are useful for configuring states you can then apply through jobs. Jobs are used to run remote execution tasks, apply states, and start Salt runners. See Jobs for more information.

Files are also used to iterate over pillar entries in an associated pillar. Pillars are structures of data defined on the Salt master and passed through to one or more minions, using targets. They allow confidential, targeted data to be securely sent only to the relevant minion. See Pillars.

In the File Server workspace, you can create new files and clone existing ones. You can also edit and delete files.

Note: As part of VMware’s initiative to remove problematic terminology, the term Salt master will be replaced with a better term in SaltStack Config and related products and documentation. This terminology update may take a few release cycles before it is fully complete.

Accessing the File Server workspace

To use the File Server workspace, click Config > File Server on the side menu.

Creating a file

To create a new file:

  1. In the File Server workspace, click Create.
  2. Under base, enter the base environment name.
  3. Under Path Name, enter the path to the file, and file name.
    Note: File names do not have to be unique as long as the files are in different paths or environments. This might result in different items displaying with the same name in the SaltStack Config user interface.
  4. Enter the file body and click Save.

You can now view the file in the file server. Only Superusers can view files created by other users.

Cloning a file

To copy or duplicate a file:

  1. In the File Server workspace, select the file you want to clone.
  2. Click Clone.

A copy of the file is now available in the file server, with -2 appended to the file name.

Deleting a file

To delete a file:

  1. In the File Server workspace, select the required file.
  2. Click Delete.
  3. In the confirmation dialog, click Confirm.

Integration with existing file servers

If you have existing file server backends configured, such as Git or S3, they continue to work as expected, and jobs created and executed in the user interface can use these backends with no additional configuration.

If you plan to use the SaltStack Config file server in conjunction with other file servers, be aware that files that exist in user interface take precedence if they also exist in other file servers.

fileserver_backend:
    -sseapi
    -roots
    -git

You can change this behavior by re-ordering the entries in the fileserver_backend section in the /etc/salt/master.d/raas.conf file.

Environments

SaltStack Config file server provides the ability to define multiple file environments.

Environments let you isolate files that have the same path and name. By default, files and pillar data exist in the base environment. This is the environment you select when you create a state run job.

You can select the environment in which you want to create a file by specifying it during creation. See Creating a file.

File server access

Users do not need file server privileges to run jobs. For example, if you create a job that runs the apache/init.sls file (state.applyapache), users with access to this job can run it even though they can’t view, edit, or delete the apache/init.sls file directly.

Only Superusers can view files created by other users. Only the Superuser and Admin default roles are granted access to view and make changes to the file server. See Roles and permissions.