Skip to content

Commit

Permalink
Merge pull request #20 from valiantlynx:working
Browse files Browse the repository at this point in the history
this might fix it
  • Loading branch information
valiantlynx authored Apr 12, 2024
2 parents 3d06abb + 53cc5e5 commit 2ecf468
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
20 changes: 13 additions & 7 deletions ansible/roles/docker_deploy/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,25 @@
dest: "{{ ansible_env.HOME }}/nginx/nginx.conf"
mode: "0644"

- name: Stop existing Docker Compose services
command: docker-compose down --remove-orphans
become: true
args:
chdir: "{{ ansible_env.HOME }}/"

- name: wipe out everything docker might have, images, container, volumes, etc
command: docker system prune -a --volumes --force
become: true
args:
chdir: "{{ ansible_env.HOME }}/"

- name: Create 'monitoring' network if it does not exist
become: true # Escalate if necessary for Docker commands
ansible.builtin.command: docker network create monitoring
register: network_creation
failed_when: network_creation.rc != 0 and 'already exists' not in network_creation.stderr
ignore_errors: true

- name: Stop existing Docker Compose services
command: docker-compose down --remove-orphans
become: true
args:
chdir: "{{ ansible_env.HOME }}/"

- name: Pull the latest images with Docker Compose
command: docker-compose pull
become: true # Escalate if necessary for Docker commands
Expand Down Expand Up @@ -102,7 +108,7 @@
- name: Debug - Show openssl command output
ansible.builtin.debug:
msg: "{{ cert_check.stdout }} within the next 864000 seconds (10 days)"
when: cert_file.stat.exists
when: cert_check.stdout

- name: Obtain SSL certificates with Certbot if needed
command: docker-compose -f docker-compose.certbot.yml run --rm certbot
Expand Down
2 changes: 1 addition & 1 deletion terraform/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ variable "cloudflare_zone_ids" {
},
{
name = "chattergun",
service = "valiantos",
service = "chattergun",
port = 3000
},
{
Expand Down

0 comments on commit 2ecf468

Please sign in to comment.