Skip to content

Commit

Permalink
aws-docker-login: add role
Browse files Browse the repository at this point in the history
  • Loading branch information
naisanzaa committed Jan 18, 2024
1 parent 7dd7b49 commit 9c15022
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 0 deletions.
8 changes: 8 additions & 0 deletions playbooks/aws-docker-login.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
- hosts: all
roles:
- aws-docker-login
vars:
- REGION:
- USERNAME:
- REMOTE_REGISTRY:
5 changes: 5 additions & 0 deletions playbooks/roles/aws-docker-login/defaults/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
REGION:
USERNAME:
PASSWORD_STDIN:
REMOTE_REGISTRY:
4 changes: 4 additions & 0 deletions playbooks/roles/aws-docker-login/meta/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
dependencies:
- defaults
- docker
8 changes: 8 additions & 0 deletions playbooks/roles/aws-docker-login/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
- name: login
shell: |
aws ecr get-login-password --region {{ REGION }} | docker login --username {{ USERNAME }} --password-stdin {{ REMOTE_REGISTRY }}
when:
- REGION
- USERNAME
- REMOTE_REGISTRY
1 change: 1 addition & 0 deletions playbooks/roles/aws-docker-login/vars/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
---

0 comments on commit 9c15022

Please sign in to comment.