Reset 2FA from user vmudryi in staging #13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Reset 2FA | |
| run-name: Reset 2FA from user ${{ inputs.user }} in ${{ inputs.environment }} | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| user: | |
| description: User to remove 2FA from | |
| type: string | |
| required: true | |
| environment: | |
| type: choice | |
| description: Infrastructure to provision | |
| default: | |
| required: true | |
| options: | |
| - staging | |
| - production | |
| - demo1 | |
| jobs: | |
| approve: | |
| environment: ${{ inputs.environment }} | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 60 | |
| steps: | |
| - name: Waiting for manual approval | |
| if: ${{ (vars.APPROVAL_REQUIRED || 'false') == 'true' }} | |
| uses: trstringer/manual-approval@v1 | |
| with: | |
| secret: ${{ github.TOKEN }} | |
| approvers: ${{ vars.GH_APPROVERS }} | |
| minimum-approvals: 1 | |
| issue-title: "Reset 2FA from user ${{ inputs.user }} in ${{ inputs.environment }}" | |
| issue-body: > | |
| Please approve or deny Reset 2FA from user ${{ inputs.user }} in | |
| ${{ inputs.environment }} initiated from GitHub Actions by ${{ github.actor }}. | |
| exclude-workflow-initiator-as-approver: false | |
| reset: | |
| needs: approve | |
| environment: ${{ inputs.environment }} | |
| runs-on: | |
| - self-hosted | |
| - ${{ inputs.environment }} | |
| - node | |
| timeout-minutes: 60 | |
| steps: | |
| - name: checkout repository | |
| uses: actions/checkout@v5 | |
| - name: Run Ansible Playbook | |
| uses: dawidd6/action-ansible-playbook@v4 | |
| env: | |
| ANSIBLE_PERSISTENT_COMMAND_TIMEOUT: 10 | |
| ANSIBLE_SSH_TIMEOUT: 10 | |
| ANSIBLE_SSH_RETRIES: 5 | |
| with: | |
| requirements: galaxy-requirements.yml | |
| playbook: reset-2fa.yml | |
| directory: ./infrastructure/server-setup | |
| # Add --verbose to get more output | |
| options: |- | |
| --inventory inventory/${{ inputs.environment }}.yml | |
| --extra-vars user=${{ inputs.user }} |