Entities, package shares, and users
Applies to: Medulla – Entities
Version: All
Environment: On-Premise
Category: Entities / package shares
Entities, package shares, and users
Understand the concepts
1. What is a package share?
A share is a folder of packages shared among users. Packages are separated from one another by shares.
2. What is an entity?
An entity is a logical grouping of computers. Computers are separated from one another by entities.
3. What can a user do with a package?
A user can deploy any package they see on any computer they see.
| What the user sees | What they can do |
|---|---|
| A package + a computer | Deploy this package on this computer |
| A package, but not the computer | Nothing |
| A computer, but not the package | Nothing |
4. Is there a connection between entities and shares?
No, none. Entities organize computers, while shares organize packages: these are two independent systems.
A user who can view the computers in an entity can therefore view packages contained in a share linked to multiple entities.
5. What is the default configuration?
Medulla comes with a global share. All users with access to it see the same packages.
6. Can packages be separated by team?
Yes. If needed, you can create specific shares for each user team, in addition to the global share.
7. If a technician creates a package for their entity, will other entities see it?
If the server only has the default share, yes. The package is created in the global share, so it is visible to other entities that have access to that share.
Procedures
8. How do I add a share?
A share is created by adding a row to the pkgs_shares table in the pkgs database.
| Field | Required | Role | Example |
|---|---|---|---|
name |
Yes | Share name | global |
comments |
Yes | Description | Global Packages |
uri |
Yes | Medulla service URI | pulse |
ars_name |
Yes | Relay server name (ARS) | pulse |
ars_id |
Yes | Relay server ID | 1 |
share_path |
Yes | Share folder on the server | /var/lib/pulse2/packages/sharing/global |
id |
No | Share ID | 1 |
type |
No | Share type | global |
Example: creating the global share.
INSERT IGNORE INTO pkgs.pkgs_shares
(id, name, comments, type, uri, ars_name, ars_id, share_path)
VALUES
(1, 'global', 'Global Packages', 'global', 'pulse', 'pulse', 1,
'/var/lib/pulse2/packages/sharing/global')
9. How do I assign users to a share?
User permissions on a share are defined by rules added to the pkgs_rules_local table in the pkgs database. Each rule specifies who has which permissions on which share.
| Field | Role | Example |
|---|---|---|
subject |
Who it applies to: a username or a regular expression | root or .* |
permission |
Permission type: r or rw |
rw |
pkgs_shares_id |
Affected share (the share id in pkgs_shares) |
1 |
The pkgs_rules_algos_id and order fields are included as-is in the examples below.
Example 1: The root user has write permissions on the global share
INSERT IGNORE INTO pkgs.pkgs_rules_local
(pkgs_rules_algos_id, `order`, subject, permission, pkgs_shares_id)
VALUES (1, 10, 'root', 'rw', 1)
Example 2: All users have write permissions on the global share
INSERT IGNORE INTO pkgs.pkgs_rules_local
(pkgs_rules_algos_id, `order`, subject, permission, pkgs_shares_id)
VALUES (1, 20, '.*', 'rw', 1)
These two rules are part of the default configuration: this is why all users have access to the global share.
Summary
| Concept | Separates | Defined in |
|---|---|---|
| Entity | Computers | Logical organization of computers |
| Share | Packages | pkgs_shares table |
| User permissions | Who has what permissions on which share | pkgs_rules_local table |
Entities and shares are independent: a user can deploy a package to a computer only if they can see both the package (via a share) and the computer (via an entity).