Mengenal Tasks Ansible
Tasks
Unit-unit tindakan di Ansible. Anda dapat menjalankan satu tugas sekali saja dengan perintah ad-hoc.
Contoh tugas dengan perintah ad-hoc
ansible atlanta -m ansible.builtin.copy -a "src=/etc/hosts dest=/tmp/hosts"
Contoh tugas dalam playbook
tasks:- name: ensure apache is at the latest versionapt:name: apache2state: latest- name: write the apache config filetemplate:src: /srv/httpd.j2dest: /etc/httpd.conf