-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Katello content_views: add CV and CCV (#150)
Implements Katello (Composite) Content Views. Tested with Foreman 3.7 / Katello 4.9 for Creation/Update/Deletion. Refs #140 Signed-off-by: Dominik Pataky <[email protected]>
- Loading branch information
Showing
7 changed files
with
967 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
|
||
# foreman_katello_content_view | ||
|
||
|
||
(Composite) Content Views create an abstract view on a collection of repositories and allow versioning of these views. Additional fine tuning can be done with package filters. | ||
|
||
|
||
## Example Usage | ||
|
||
``` | ||
# Autogenerated example with required keys | ||
data "foreman_katello_content_view" "example" { | ||
name = "my content view" | ||
} | ||
``` | ||
|
||
|
||
## Argument Reference | ||
|
||
The following arguments are supported: | ||
|
||
- `name` - (Required) Name of the content view. | ||
|
||
|
||
## Attributes Reference | ||
|
||
The following attributes are exported: | ||
|
||
- `auto_publish` - Relevant for Composite Content Views: 'Automatically publish a new version of the composite content view whenever one of its content views is published. Autopublish will only happen for component views that use the 'Always use latest version' option.' | ||
- `component_ids` - Relevant for CCVs: list of CV IDs. | ||
- `composite` - Is this Content View a Composite CV? | ||
- `description` - Description for the (composite) content view | ||
- `filter` - Content view filters and their rules. Currently read-only, to be used as data source | ||
- `label` - Label for the (composite) content view. Cannot be changed after creation. By default set to the name, with underscores as spaces replacement. | ||
- `name` - Name of the content view. | ||
- `organization_id` - | ||
- `repository_ids` - List of repository IDs. | ||
- `solve_dependencies` - Relevant for Content Views: 'This will solve RPM and module stream dependencies on every publish of this content view. Dependency solving significantly increases publish time (publishes can take over three times as long) and filters will be ignored when adding packages to solve dependencies. Also, certain scenarios involving errata may still cause dependency errors.' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
|
||
# foreman_katello_content_view | ||
|
||
|
||
(Composite) Content Views create an abstract view on a collection of repositories and allow versioning of these views. Additional fine tuning can be done with package filters. | ||
|
||
|
||
## Example Usage | ||
|
||
``` | ||
# Autogenerated example with required keys | ||
resource "foreman_katello_content_view" "example" { | ||
component_ids = [1, 4] | ||
composite = false | ||
name = "My new CV" | ||
repository_ids = [1, 4, 5] | ||
} | ||
``` | ||
|
||
|
||
## Argument Reference | ||
|
||
The following arguments are supported: | ||
|
||
- `auto_publish` - (Optional) Relevant for Composite Content Views: 'Automatically publish a new version of the composite content view whenever one of its content views is published. Autopublish will only happen for component views that use the 'Always use latest version' option.' | ||
- `component_ids` - (Optional) Relevant for CCVs: list of CV IDs. | ||
- `composite` - (Optional) Is this Content View a Composite CV? | ||
- `description` - (Optional) Description for the (composite) content view | ||
- `label` - (Optional, Force New) Label for the (composite) content view. Cannot be changed after creation. By default set to the name, with underscores as spaces replacement. | ||
- `name` - (Required) Name of the (composite) content view. | ||
- `organization_id` - (Optional) | ||
- `repository_ids` - (Optional) List of repository IDs. | ||
- `solve_dependencies` - (Optional) Relevant for Content Views: 'This will solve RPM and module stream dependencies on every publish of this content view. Dependency solving significantly increases publish time (publishes can take over three times as long) and filters will be ignored when adding packages to solve dependencies. Also, certain scenarios involving errata may still cause dependency errors.' | ||
|
||
|
||
## Attributes Reference | ||
|
||
The following attributes are exported: | ||
|
||
- `auto_publish` - Relevant for Composite Content Views: 'Automatically publish a new version of the composite content view whenever one of its content views is published. Autopublish will only happen for component views that use the 'Always use latest version' option.' | ||
- `component_ids` - Relevant for CCVs: list of CV IDs. | ||
- `composite` - Is this Content View a Composite CV? | ||
- `description` - Description for the (composite) content view | ||
- `filter` - Content view filters and their rules. Currently read-only, to be used as data source | ||
- `label` - Label for the (composite) content view. Cannot be changed after creation. By default set to the name, with underscores as spaces replacement. | ||
- `name` - Name of the (composite) content view. | ||
- `organization_id` - | ||
- `repository_ids` - List of repository IDs. | ||
- `solve_dependencies` - Relevant for Content Views: 'This will solve RPM and module stream dependencies on every publish of this content view. Dependency solving significantly increases publish time (publishes can take over three times as long) and filters will be ignored when adding packages to solve dependencies. Also, certain scenarios involving errata may still cause dependency errors.' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Simple Content View data source | ||
data "foreman_katello_content_view" "ubuntu2204" { | ||
name = "Ubuntu 22.04" | ||
} | ||
|
||
// Query a repository to use its ID in the Content View | ||
data "foreman_katello_repository" "ubuntu2204" { | ||
name = "Ubuntu 22.04" | ||
} | ||
|
||
// Create a new Content View with one repository and one filter | ||
resource "foreman_katello_content_view" "test_cv_write" { | ||
name = "Test CV for Ubuntu Sec" | ||
repository_ids = [data.foreman_katello_repository.ubuntu2204.id] | ||
composite = false | ||
|
||
filter { | ||
name = "my filter 1" | ||
type = "deb" | ||
inclusion = true | ||
description = "Filters all packages except those with name 'testfilter-*'" | ||
|
||
rule { | ||
name = "testfilter-*" | ||
} | ||
} | ||
} |
Oops, something went wrong.