Closed neevnuv closed 11 months ago
Maybe their properties should be defined in the AnsibleInventory CRD like this:
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: ansibleinventories.tower.ansible.com
spec:
versions:
- name: v1alpha1
schema:
openAPIV3Schema:
description: Inventory is the Schema for the inventories API
properties:
apiVersion:
type: string
kind:
type: string
metadata:
type: object
spec:
properties:
kind:
type: string
default: ""
enum: ["", "smart", "constructed"]
description: Kind defines the desired kind of inventory; inventory, smart inventory or constructed inventory
variables:
type: object
description: Variables defines the desired variables you add to your inventory
description: Spec defines the desired state of Inventory
type: object
x-kubernetes-preserve-unknown-fields: true
In the collection awx.awx.inventory, when creating\deleting\changing an inventory the kind is a string, and the variables are a dictionary. Thats why in the cr the kind should be a string (we might make it chosen our of an enum) and the variables should either be a string or an object.
Linking Pull Request #139
@neevnuv Thank you for your PR, I just merged it here, so we can close this out now.
Ansible Inventory CRD only allows defining:
As of now we cannot create an inventory that contain inventory kind and variables. I propose we add properties for all those properties to the CRD.