-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.drone.yml
More file actions
41 lines (38 loc) · 1.09 KB
/
Copy path.drone.yml
File metadata and controls
41 lines (38 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
---
kind: pipeline
type: docker
name: k8s-cluster
steps:
- name: initialize aws plugin for terraform
image: samuellucas/ansibleterraform:latest
environment:
AWS_ACCESS_KEY_ID:
from_secret: aws_access
AWS_SECRET_ACCESS_KEY:
from_secret: aws_secret
commands:
- terraform init
- name: create aws infra
image: samuellucas/ansibleterraform:latest
environment:
AWS_ACCESS_KEY_ID:
from_secret: aws_access
AWS_SECRET_ACCESS_KEY:
from_secret: aws_secret
commands:
- terraform apply -auto-approve
- name: apply ansible playbook
image: samuellucas/ansibleterraform:latest
environment:
AWS_ACCESS_KEY_ID:
from_secret: aws_access
AWS_SECRET_ACCESS_KEY:
from_secret: aws_secret
PRIVATE_KEY:
from_secret: private_key
commands:
- mkdir -p ~/.ssh/
- echo "$PRIVATE_KEY" > ~/.ssh/id_rsa
- unset PRIVATE_KEY
- chmod 600 ~/.ssh/id_rsa
- ansible-playbook --u ubuntu --ssh-common-args='-o StrictHostKeyChecking=no' --private-key ~/.ssh/id_rsa site.yml