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