This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.5.4.4.3. Ansible로 전송된 추가 변수
추가 변수는 Ansible로 보낸 다음 Operator에서 관리할 수 있습니다. CR(사용자 정의 리소스)의 spec
섹션은 키-값 쌍을 추가 변수로 전달합니다. 이는 ansible-playbook
명령에 전달된 추가 변수와 동일합니다.
또한 Operator는 CR 이름 및 CR 네임스페이스에 대한 meta
필드에 추가 변수를 전달합니다.
다음 CR 예제의 경우
Ansible에 추가 변수로 전달되는 구조는 다음과 같습니다.
message
및 newParameter
필드는 최상위 레벨에서 추가 변수로 설정되며, meta
는 Operator에 정의된 CR에 대한 관련 메타데이터를 제공합니다. meta
필드는 Ansible의 점 표기법을 사용하여 액세스할 수 있습니다. 예를 들면 다음과 같습니다.
--- - debug: msg: "name: {{ ansible_operator_meta.name }}, {{ ansible_operator_meta.namespace }}"
---
- debug:
msg: "name: {{ ansible_operator_meta.name }}, {{ ansible_operator_meta.namespace }}"