运行分子时,日志以颜色显示:
molecule lint -s preprod
--> [36mValidating schema /home/singuliere/software/enough/infrastructure/molecule/letsencrypt-nginx/molecule.yml.[0m
[0m[0m[0m[32mValidation 成功完成。[0m [0m[0m[0m--> [36mValidating schema /home/singuliere/software/enough/infrastructure/molecule/postfix/molecule.yml.[0m ...
可以通过管道将输出禁用cat
(它仅在输出为 tty 时显示)
molecule lint -s preprod | cat
--> 验证模式 /home/singuliere/software/enough/infrastructure/molecule/letsencrypt-nginx/molecule.yml。验证成功完成。...
有没有永久的方法来做同样的事情?我尝试在环境中设置ANSIBLE_NOCOLOR =true 但它没有达到预期的效果。