Mengenal Tasks Ansible

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 version
    apt:
      name: apache2
      state: latest
  - name: write the apache config file
    template:
      src: /srv/httpd.j2
      dest: /etc/httpd.conf

Next Post Previous Post
No Comment
Add Comment
comment url