apiVersion: policy.open-cluster-management.io/v1
kind: Policy
metadata:
  name: policy-config-cm-INDEX
  annotations:
    policy.open-cluster-management.io/standards: NIST 800-53
    policy.open-cluster-management.io/categories: CM Configuration Management
    policy.open-cluster-management.io/controls: CM-2 Baseline
spec:
  remediationAction: inform
  disabled: false
  policy-templates:
    - objectDefinition:
        apiVersion: policy.open-cluster-management.io/v1
        kind: ConfigurationPolicy
        metadata:
          name: policy-user-ca-bundle-INDEX
        spec:
          remediationAction: inform # will be overridden by remediationAction in parent policy
          severity: low
          namespaceSelector:
            include: ['default']
          object-templates:
            - complianceType: musthave
              objectDefinition:
                kind: ConfigMap
                apiVersion: v1
                metadata:
                  name: user-ca-bundle-INDEX
                  namespace: default
                data:
                  ca-bundle.crt: |-
                    '{{hub fromConfigMap "" "config-cm-INDEX" "value" hub}}'
---
apiVersion: policy.open-cluster-management.io/v1
kind: PlacementBinding
metadata:
  name: binding-policy-config-INDEX
placementRef:
  name: placement-policy-config-INDEX
  kind: PlacementRule
  apiGroup: apps.open-cluster-management.io
subjects:
- name: policy-config-cm-INDEX
  kind: Policy
  apiGroup: policy.open-cluster-management.io
---
apiVersion: apps.open-cluster-management.io/v1
kind: PlacementRule
metadata:
  name: placement-policy-config-INDEX
spec:
  clusterConditions:
  - status: 'True'
    type: ManagedClusterConditionAvailable
  clusterSelector:
    matchExpressions:
      - {key: vendor, operator: In, values: ['OpenShift']}
