Debug School

Srikanth K N
Srikanth K N

Posted on

Run a bash script from ansible


---
- name: Install git package on Web servers
  hosts: web

  tasks:
  - name: install a package called git
    ansible.builtin.apt:
        name: "git"
        state: present
  - name: install a package called wget
    ansible.builtin.apt:
        name: "wget"
        state: present
  - name: Copy shell script
    ansible.builtin.copy:
      src: sree_input.sh
      dest: /usr/bin/sree_input.sh
  - name: assign executable permissions to a files
    ansible.builtin.file:
        path: /usr/bin/
        owner: root
        group: root
        mode: +x
  - name: run a bash script
    ansible.builtin.script: /usr/bin/sree_input.sh
Enter fullscreen mode Exit fullscreen mode

Top comments (0)