• 此例例⽤用到了了 Play*1, Task*3 和 Module*3 (command, apt, lineinfile)。
31 $ vim example.yml --- - name: This is a Super-basic playbook. hosts: all tasks: - name: Hello World command: echo "Hello World" - name: Install Vim & Emacs become: yes apt: name={{ item }} state=present with_items: - vim - emacs # 去去,emacs 走。 - name: use vi-mode in readline become: yes lineinfile: dest=/etc/inputrc line="set editing-mode vi" Task 1 Task 2 Task 3