bash line cont
Build and Publish Docker Image / Build and Push Docker Image (push) Successful in 2m51s Details

This commit is contained in:
Isaac Johnson 2026-10-06 09:22:54 -05:00
parent 922d3c3d91
commit c0d52933d3
1 changed files with 31 additions and 31 deletions

View File

@ -43,8 +43,8 @@
set -x
export
whoami
gcloud compute addresses describe {{ static_ip_name }}
--region={{ gcp_region }}
gcloud compute addresses describe {{ static_ip_name }} \
--region={{ gcp_region }} \
--project={{ gcp_project }}
register: ip_check
failed_when: false
@ -54,9 +54,9 @@
ansible.builtin.shell:
executable: /bin/bash
cmd: |
gcloud compute addresses create {{ static_ip_name }}
--region={{ gcp_region }}
--project={{ gcp_project }}
gcloud compute addresses create {{ static_ip_name }} \
--region={{ gcp_region }} \
--project={{ gcp_project }} \
--description="Static IP for Uptime Kuma"
when: ip_check.rc != 0
@ -67,7 +67,7 @@
ansible.builtin.shell:
executable: /bin/bash
cmd: |
gcloud compute firewall-rules describe {{ firewall_rule_name }}
gcloud compute firewall-rules describe {{ firewall_rule_name }} \
--project={{ gcp_project }}
register: fw_check
failed_when: false
@ -77,11 +77,11 @@
ansible.builtin.shell:
executable: /bin/bash
cmd: |
gcloud compute firewall-rules create {{ firewall_rule_name }}
--project={{ gcp_project }}
--allow=tcp:3001
--target-tags=uptime-kuma
--source-ranges=0.0.0.0/0
gcloud compute firewall-rules create {{ firewall_rule_name }} \
--project={{ gcp_project }} \
--allow=tcp:3001 \
--target-tags=uptime-kuma \
--source-ranges=0.0.0.0/0 \
--description="Allow traffic to Uptime Kuma UI & API"
when: fw_check.rc != 0
@ -92,8 +92,8 @@
ansible.builtin.shell:
executable: /bin/bash
cmd: |
gcloud compute instances describe {{ instance_name }}
--zone={{ gcp_zone }}
gcloud compute instances describe {{ instance_name }} \
--zone={{ gcp_zone }} \
--project={{ gcp_project }}
register: instance_check
failed_when: false
@ -103,14 +103,14 @@
ansible.builtin.shell:
executable: /bin/bash
cmd: |
gcloud compute instances create-with-container {{ instance_name }}
--project={{ gcp_project }}
--zone={{ gcp_zone }}
--machine-type={{ machine_type }}
--tags=uptime-kuma
--address={{ static_ip_name }}
--boot-disk-size=20GB
--container-image=louislam/uptime-kuma:1
gcloud compute instances create-with-container {{ instance_name }} \
--project={{ gcp_project }} \
--zone={{ gcp_zone }} \
--machine-type={{ machine_type }} \
--tags=uptime-kuma \
--address={{ static_ip_name }} \
--boot-disk-size=20GB \
--container-image=louislam/uptime-kuma:1 \
--container-mount-host-path=host-path=/var/uptime-kuma,mount-path=/app/data,mode=rw
when: instance_check.rc != 0
@ -120,9 +120,9 @@
- name: Fetch instance public IP address
ansible.builtin.shell:
cmd: |
gcloud compute instances describe {{ instance_name }}
--zone={{ gcp_zone }}
--project={{ gcp_project }}
gcloud compute instances describe {{ instance_name }} \
--zone={{ gcp_zone }} \
--project={{ gcp_project }} \
--format="value(networkInterfaces[0].accessConfigs[0].natIP)"
executable: /bin/bash
register: vm_ip