tech:ansible_uri_-_tower_api
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Prochaine révision | Révision précédente | ||
| tech:ansible_uri_-_tower_api [2025/03/24 15:06] – créée - modification externe 127.0.0.1 | tech:ansible_uri_-_tower_api [2026/06/07 19:12] (Version actuelle) – modification externe 127.0.0.1 | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| + | < | ||
| + | {{tag> | ||
| + | |||
| + | # Ansible uri - Tower API | ||
| + | |||
| + | Avec curl | ||
| + | ~~~bash | ||
| + | curl -k -u username:' | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | } | ||
| + | }' | ||
| + | ~~~ | ||
| + | |||
| + | Via Ansible | ||
| + | ~~~yaml | ||
| + | # | ||
| + | --- | ||
| + | |||
| + | - hosts: localhost | ||
| + | |||
| + | tasks: | ||
| + | - name: call api | ||
| + | register: plop | ||
| + | uri: | ||
| + | url: https:// | ||
| + | method: POST | ||
| + | force: true | ||
| + | force_basic_auth: | ||
| + | user: username | ||
| + | password: ' | ||
| + | validate_certs: | ||
| + | # body_format: | ||
| + | body_format: | ||
| + | headers: | ||
| + | Content-Type: | ||
| + | body: | | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | } | ||
| + | } | ||
| + | status_code: | ||
| + | |||
| + | - name: DEBUG 10 | ||
| + | debug: var=plop | ||
| + | ~~~ | ||
| + | |||
| + | Ou encore | ||
| + | |||
| + | ~~~yaml | ||
| + | # | ||
| + | --- | ||
| + | |||
| + | - hosts: localhost | ||
| + | |||
| + | tasks: | ||
| + | - name: call api | ||
| + | register: plop | ||
| + | uri: | ||
| + | url: https:// | ||
| + | method: POST | ||
| + | force: true | ||
| + | force_basic_auth: | ||
| + | user: username | ||
| + | password: ' | ||
| + | validate_certs: | ||
| + | body_format: | ||
| + | headers: | ||
| + | Content-Type: | ||
| + | src: plop.json | ||
| + | status_code: | ||
| + | ~~~ | ||
| + | |||
| + | `plop.json` | ||
| + | ~~~javascript | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | } | ||
| + | } | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ## Pb | ||
| + | |||
| + | ### Pb de logs tronqués | ||
| + | |||
| + | Consulter la sortie : https://< | ||
| + | |||
| + | |||
