
다음 줄이 있으므로 특별히 바꾸고 싶습니다.
client_encryption_options:
enabled: true
에게
client_encryption_options:
enabled: false
client_encryption_options:
enabled: true
# If enabled and optional is set to true, encrypted and unencrypted connections over native transport are handled.
optional: false
keystore: XXXXXX
keystore_password: XXXXX
# Set require_client_auth to true to require two-way host certificate validation
require_client_auth: true
#
# Set truststore and truststore_password if require_client_auth is true
답변1
입력은 YAML 파일이므로 yq
다음 과 같은 명령줄 YAML 파서를 사용할 수 있습니다.https://kislyuk.github.io/yq/
yq -y '.client_encryption_options.enabled |= false' file.yml
이렇게 하면 최상위 개체 enabled
의 키 값이 로 업데이트됩니다 .client_encryption_options
false
현재 위치에서 변경하려면 yq
해당 --in-place
또는 -i
옵션과 함께 사용하세요.
이는 JSON 래퍼를 yq
둘러싼 래퍼 jq
이므로 문서에서 주석을 제거합니다.
yq
에서 프로그램을 사용하는 경우https://mikefarah.gitbook.io/yq/, 예를 들어 Ubuntu를 yq
사용하여 설치하면 얻을 수 있는 것입니다.snap
yq eval '.client_encryption_options.enabled |= false' file.yml
... 내부 편집을 수행하려면 해당 --inplace
또는 옵션을 사용하세요.-i
yq
파일에서 주석은 제거되지 않습니다 .