-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2b4fb58
commit 7e63cc9
Showing
1 changed file
with
47 additions
and
47 deletions.
There are no files selected for viewing
94 changes: 47 additions & 47 deletions
94
ansible/roles/websites_container/tasks/websites_container.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,52 @@ | ||
--- | ||
- name: Deploy SSL Certificate and Private Key | ||
- name: Deploy SSL Certificate and Private Key and Start Docker Container | ||
hosts: droplet | ||
tasks: | ||
- name: set up ssl | ||
block: | ||
- name: Create SSL directory if it doesn't exist | ||
file: | ||
path: /home/playtechnique/ssl | ||
state: directory | ||
mode: '0700' | ||
owner: playtechnique | ||
group: playtechnique | ||
- name: SSL setup | ||
block: | ||
- name: Create SSL directory if it doesn't exist | ||
file: | ||
path: /home/playtechnique/ssl | ||
state: directory | ||
mode: '0700' | ||
owner: playtechnique | ||
group: playtechnique | ||
|
||
- name: Install SSL Private Key | ||
copy: | ||
content: "{{ ssl_private_key }}" | ||
dest: /home/playtechnique/ssl/private.key | ||
mode: '0600' | ||
owner: playtechnique | ||
group: playtechnique | ||
- name: Install SSL Private Key | ||
copy: | ||
content: "{{ ssl_private_key }}" | ||
dest: /home/playtechnique/ssl/private.key | ||
mode: '0600' | ||
owner: playtechnique | ||
group: playtechnique | ||
|
||
- name: Install SSL Certificate | ||
copy: | ||
content: "{{ ssl_certificate }}" | ||
dest: /home/playtechnique/ssl/certificate.crt | ||
mode: '0644' | ||
owner: playtechnique | ||
group: playtechnique | ||
|
||
- name: Re-create websites container | ||
docker_container: | ||
name: website | ||
image: docker.io/playtechnique/website:latest | ||
state: started | ||
recreate: yes | ||
pull: true | ||
exposed_ports: | ||
- 8080 | ||
published_ports: | ||
- "443:8080" | ||
volumes: | ||
- /home/playtechnique/ssl:/etc/ssl/playtechnique:ro | ||
command: | ||
- "/andrew" | ||
- "-c" | ||
- "/etc/ssl/playtechnique/certificate.crt" | ||
- "-p" | ||
- "/etc/ssl/playtechnique/private.key" | ||
- "/website" | ||
- "0.0.0.0:8080" | ||
- "https://playtechnique.io" | ||
- name: Install SSL Certificate | ||
copy: | ||
content: "{{ ssl_certificate }}" | ||
dest: /home/playtechnique/ssl/certificate.crt | ||
mode: '0644' | ||
owner: playtechnique | ||
group: playtechnique | ||
|
||
- name: Re-create websites container | ||
docker_container: | ||
name: website | ||
image: docker.io/playtechnique/website:latest | ||
state: started | ||
recreate: yes | ||
pull: true | ||
exposed_ports: | ||
- 8080 | ||
published_ports: | ||
- "443:8080" | ||
volumes: | ||
- /home/playtechnique/ssl:/etc/ssl/playtechnique:ro | ||
command: | ||
- "/andrew" | ||
- "-c" | ||
- "/etc/ssl/playtechnique/certificate.crt" | ||
- "-p" | ||
- "/etc/ssl/playtechnique/private.key" | ||
- "/website" | ||
- "0.0.0.0:8080" | ||
- "https://playtechnique.io" |