- name: Install required packages package: name="{{ item }}" state=present with_items: - python2-requests - name: Install script flagging PRs on dist-git upon test results being published copy: src: files/flag_ci_pr.py dest: /usr/local/bin/flag_ci_pr.py mode: 0755 - name: Run the script command: /usr/local/bin/flag_ci_pr.py '{{ msg | to_json }}' register: output environment: API_TOKEN: "{{ api_token_flag_pr_ci }}" API_TOKEN_STG: "{{ api_token_flag_pr_ci_stg }}" - name: Show the output of the script debug: msg: "Output of the script: {{ output }}"