我之前没有使用Ansible,有没有人知道如何编写一个卸载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
Run Code Online (Sandbox Code Playgroud)