Debug School

Nicholas
Nicholas

Posted on

Playbook sample

- name: install git and wget
  hosts: web

  tasks:
  - name: Install git in ubuntu
    ansible.builtin.apt:
      name: "git"
      state: latest

  - name: Install wget in ubuntu
    ansible.builtin.apt:
      name: "wget"
      state: latest

  - name: run cmd
    ansible.builtin.cmd:ls

  - name: run bash shell
    ansible.builtin.shell: somescript.sh >> somelog.txt
    args:
      chdir: somedir/
Enter fullscreen mode Exit fullscreen mode

Top comments (0)