I have created this ops-agent policy to install ops-agent on all my running Ubuntu 22.04 VMs, but the policy exists in the Cloud console when I navigate to Monitoring -> Dashboards -> VM instances, it shows that it's Legacy agent is installed (image below) and the agent seems uninstalled, what I'm missing here? what is the best way to install the ops agent automatically in any created VM managed by Instance Group?
gcloud beta compute instances ops-agents policies describe ops-agents-stag-policy --project=PROJECT-NAME
agent_rules:
- enable_autoupgrade: true
package_state: installed
type: ops-agent
version: 2.*.*
assignment:
group_labels:
- env: PROJECT-NAME
product: programs
instances: []
os_types:
- short_name: ubuntu
version: '22.04'
zones:
- europe-west1-b
create_time: '2024-02-14T13:23:07.226508Z'
description: A stag policy for programs.
etag: 0000000000000-ae63-468c-997f-0000000000000
id: projects/0000000000000/guestPolicies/ops-agents-stag-policy
update_time: '2024-02-14T13:23:07.226508Z'
I want to use project level police, which is the opposite of what that question is looking for.
Hi,
Try this terraform module https://github.com/terraform-google-modules/terraform-google-cloud-operations/tree/master/modules/ag...
This looks like a startup script and not a fleet policy.
Use the module from README file https://github.com/terraform-google-modules/terraform-google-cloud-operations/blob/master/modules/ag... or check out this link https://registry.terraform.io/modules/terraform-google-modules/cloud-operations/google/latest/submod...