29 lines
679 B
YAML
29 lines
679 B
YAML
---
|
|
- name: Get laravelio Service Info
|
|
kubernetes.core.k8s_info:
|
|
api_version: v1
|
|
kind: Service
|
|
namespace: default
|
|
label_selectors:
|
|
- "app=laravelio"
|
|
register: service_info
|
|
until: service_info.resources[0].status.loadBalancer.ingress[0].ip is defined
|
|
retries: 60
|
|
delay: 10
|
|
|
|
- name: Store app_ip
|
|
set_fact:
|
|
app_ip: "{{ service_info.resources[0].status.loadBalancer.ingress[0].ip }}"
|
|
- name: Print app_ip
|
|
debug:
|
|
var: app_ip
|
|
|
|
- name: Update app_ip in Inventory
|
|
lineinfile:
|
|
path: inventory/gcp.yml
|
|
regexp: '^ app_ip: (.*)$'
|
|
line: ' app_ip: {{ app_ip }}'
|
|
backrefs: yes
|
|
|
|
- name: Refresh Inventory
|
|
meta: refresh_inventory
|