Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Add example for ops-agent-policy module README. #121

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/ops_agent_policy_install_all/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Ops Agent Policy Example

This example illustrates how to use the `ops-agent-policy` module to install the ops agent on all VMs in a zone.
This example illustrates how to use the `ops-agent-policy` module to install the ops agent on all VMs within a GCP project.

<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
## Inputs
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Ops Agent Policy Example

This example illustrates how to use the `ops-agent-policy` module to install the ops agent on all VMs in a zone.
This example illustrates how to use the `ops-agent-policy` module to install the ops agent on all VMs in a region.

<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
## Inputs
Expand Down
32 changes: 30 additions & 2 deletions modules/ops-agent-policy/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,38 @@
# Agent Policy

This module is used to install/uninstall the ops agent in GCE.
This module is used to install/uninstall the ops agent in Google Cloud Engine VM's using [ops agent policies](https://cloud.google.com/stackdriver/docs/solutions/agents/ops-agent/agent-policies).

## Usage

Functional examples are included in the [examples](./../../examples) directory.
Basic usage of this module is as follows:

Sample module to install [Ops Agent](https://cloud.google.com/stackdriver/docs/solutions/ops-agent) on all Debian 12 VMs with the label "goog-ops-agent-policy=enabled".
```hcl
module "ops_agent_policy" {
source = "github.com/terraform-google-modules/terraform-google-cloud-operations/modules/ops-agent-policy"
project = "<PROJECT ID>"
zone = "<ZONE>"
assignment_id = "example-ops-agent-policy"
agents_rule = {
package_state = "installed"
version = "latest"
}
instance_filter = {
all = false
inventories = [{
os_short_name = "debian"
os_version = "12"
}]
inclusion_labels = [{
labels = {
goog-ops-agent-policy = "enabled"
}
}]
}
}
```

Functional examples are included in the [examples](./../../examples) directory with the prefix `ops_agent_policy`.

<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
## Inputs
Expand Down