Created
March 20, 2019 14:47
-
-
Save felipe1982/a2b210cc86fa3cdd3e6ce6354648d495 to your computer and use it in GitHub Desktop.
This file contains 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
--- | |
# | |
# Run this command on your local laptop to: | |
# 1. Create Remote "Origin" for codecommit repo | |
# 2. Configure Credential Helper for IAM authentication to repository. | |
# | |
- hosts: 'youi-ops-np' | |
connection: local | |
tasks: | |
- name: Check if "origin" exists | |
command: git remote | |
register: git_remote | |
- name: Delete remote origin if it exists | |
command: git remote rm origin | |
when: "'origin' in git_remote.stdout" | |
- name: Create Git Remote | |
command: 'git remote add origin {{ codecommit_repo_url }}' | |
- name: Configure AWS Credential Helper | |
command: >- | |
git config --local | |
credential.https://git-codecommit.{{ aws_region }}.amazonaws.com.helper | |
'!aws --profile "{{ inventory_hostname }}" codecommit credential-helper $@' | |
- name: Configure AWS Use Http Path | |
command: >- | |
git config --local | |
credential.https://git-codecommit.{{ aws_region }}.amazonaws.com.usehttppath | |
true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment