styxmx 发表于 2018-7-28 13:42:20

Ansible 操作 windowws 中文乱码问题解决办法

ansible win_test -m win_shell -a 'Set-Item -Path env:PYTHONIOENCODING -Value "utf-8"; python d:\test\stat.py'  

  
# playbook
  
---
  
- hosts: win_test
  
gather_facts: no
  
tasks:
  
    - name: run Python script with utf-8 output
  
      win_command: Python.exe d:\test\stat.py
  
      environment:
  
      PYTHONIOENCODING: utf-8
页: [1]
查看完整版本: Ansible 操作 windowws 中文乱码问题解决办法