tasks.yml 547 B

12345678910111213141516171819202122232425
  1. ---
  2. - name: Playbook
  3. hosts: localhost
  4. gather_facts: no
  5. connection: local
  6. tasks:
  7. - shell: /usr/bin/uptime
  8. register: shell_out
  9. - debug: msg="{{ shell_out.stdout }}"
  10. - name: "Call api"
  11. uri:
  12. url: "http://192.168.0.17:8000/app"
  13. HEADER_Content-Type: "application/json"
  14. method: POST
  15. user: admin
  16. password: secret
  17. force_basic_auth: yes
  18. status_code: 201
  19. body_format: json
  20. body: >
  21. {"app_name": "music", "state": "stop"}