tuxinvader / tuxinvader.launchpad / 1.0.4 / module / wait_interactive_login Perform the OAUTH authorization process for using a launchpad with a user account | "added in version" 1.0.0 of tuxinvader.launchpad" Authors: Mark Boddington (@TuxInvader)tuxinvader.launchpad.wait_interactive_login (1.0.4) — module
Install with ansible-galaxy collection install tuxinvader.launchpad:==1.0.4
collections: - name: tuxinvader.launchpad version: 1.0.4
This task should be called in a loop after `start_interactive_login` and retry until \ the user has authorized the request token. The task will return LP_ACCESS_TOKEN and \ LP_ACCESS_SECRET which can then be used as environment vars for authenticated Launchpad access.
# Start the interactive login process by generating a request token and presenting url to user - name: Start Interactive login start_interactive_login: register: login_start
- name: Prompt user debug: msg: "Please open this URL to authorize Ansible access: {{ login_start.authorization_url }}"
# Wait for the token exchange to be completed by the user, and return the OAUTH tokens - name: Wait for auth to complete wait_interactive_login: credentials: "{{ login_start.credentials | to_json }}" delay: 5 retries: 12 register: login_done until: login_done.LP_ACCESS_TOKEN is defined
- name: Display Tokens debug: msg: "Please Add these to your environment: LP_ACCESS_TOKEN={{ login_done.LP_ACCESS_TOKEN }} LP_ACCESS_SECRET={{ login_done.LP_ACCESS_SECRET }}"
credentials: description: The OAUTH request token output from start_interactive_login required: true type: str
LP_ACCESS_SECRET: description: The Access token secret for authenticated LP access. Add to your environment. returned: changed sample: cFmGdmkXCTjRdfc5pRVvd8933bv8R7pmSkbXbmpPC2Ddkasjdklagp5gK32xK9VlxqPmRcRcnvJskKj7xN type: str LP_ACCESS_TOKEN: description: The Access token for authenticated LP access. Add to your environment. returned: changed sample: TWGbLbMX892jdbffzQF5 type: str