| --- |
| - hosts: haproxy |
| become: true |
| vars: |
| client_id: ameQ5tEp9iNLsPvwjCAKTejD561knLfW |
| client_secret: RXb4mGcWgXcLa6m7 |
| haproxy_socket: '/var/lib/haproxy/stats' |
| haproxy_chroot: '/var/lib/haproxy' |
| haproxy_user: 'haproxy' |
| haproxy_group: 'haproxy' |
| haproxy_frontend_name: 'all' |
| haproxy_frontend_bind_address: '*' |
| haproxy_frontend_port: "{{ edge_proxy_port }}" |
| haproxy_frontend_mode: 'http' |
| haproxy_backend_name: 'app' |
| haproxy_backend_mode: 'http' |
| haproxy_backend_balance_method: 'roundrobin' |
| haproxy_backend_httpchk: '' |
| |
| roles: |
| - apigee-opdk-haproxy-rmp |
| |
| tasks: |
| - name: Install http-tools |
| yum: |
| name: http-tools |
| state: present |
| |
| - name: Use haproxy |
| ignore_errors: yes |
| connection: local |
| tags: ['run-proxy'] |
| become: no |
| uri: |
| url: "http://{{ inventory_hostname }}:{{ edge_proxy_port }}/oauth/client_credential/accesstoken" |
| method: POST |
| headers: |
| Host: "api.tmobile.com" |
| Content-Type: "application/x-www-form-urlencoded" |
| body: grant_type=client_credentials&client_id={{ client_id }}&client_secret={{ client_secret }} |
| async: 1 |
| poll: 0 |
| with_sequence: start=1 end="{{ end | default(5000) }}" |