@
nosun 好几个月了,又翻了一下我的解决办法,希望有帮助。
```
- hosts: testvbox
become: true
tasks:
- name: Modify /etc/sudoers
lineinfile:
dest: /etc/sudoers
regexp: '^Defaults env_reset'
line: 'Defaults env_reset,!tty_tickets'
- name: Copy Paraview bin files
synchronize:
src: /etc/ansible/files/ParaView-5.3.0-Qt5-OpenGL2-MPI-Linux-64bit/bin/
dest: /usr/local/bin/
- name: Copy Paraview lib files
synchronize:
src: /etc/ansible/files/ParaView-5.3.0-Qt5-OpenGL2-MPI-Linux-64bit/lib/
dest: /usr/local/lib/
archive: no
links: yes
recursive: yes
- name: Restore /etc/sudoers
lineinfile:
dest: /etc/sudoers
regexp: '^Defaults env_reset,!tts_tickets'
line: 'Defaults env_reset'
```