0

I am new to ansible and trying to write a new playbook which goes to

a) A certain folder b) clean the env c)pulls the code d) and builds it

Here is my playbook, help is deeply appreciated. :)

    - name: Shell examples
    hosts: all
    tasks:
     - name: mulitline shell
       shell: |
              cd /home/ec2-user/node
              echo -e "\n pulling the code in here" 'pwd'
              git clean  -d  -f .
              git pull
              npm install
Julian Schmuckli
  • 3,681
  • 11
  • 37
  • 64
Jarvis
  • 41
  • 3
  • what is the issue with your code ? – P.... Jun 14 '21 at 15:09
  • Ansible is not a mean to throw all your shell command like this. You should consider using the proper modules to do all this: https://docs.ansible.com/ansible/latest/collections/ansible/builtin/git_module.html & https://docs.ansible.com/ansible/latest/collections/community/general/npm_module.html – β.εηοιτ.βε Jun 14 '21 at 18:56

0 Answers0