之前没用过Ansible,有谁知道怎么写一个简单的playbook卸载nano,在Linux服务器上安装vim?我想您需要包含一个选项来配置您在执行上述操作后想要的文本编辑器首选项。
干杯
编辑
这就是我到目前为止所得到的......
---
# Playbook to uninstall nano and install vim
- hosts: all
remote_user: luca
sudo: yes
tasks:
- name: uninstall nano
action: command: sudo apt-get purge nano
- name: Install vim
action: command: sudo apt-get install vim