Remove public IPs after deployment

This commit is contained in:
Johannes Rothe 2023-09-15 22:02:17 +02:00
parent c822168ea2
commit bf54e16aef
Signed by: onjen
GPG Key ID: 73F092605AF3286C
2 changed files with 27 additions and 11 deletions

12
ansible/group_vars/all Normal file
View File

@ -0,0 +1,12 @@
terraform_vars:
location: "nbg1"
network_zone: "eu-central"
server_count: 3
subnetwork_ip_range: "10.0.0.0/24"
lb_internal_ip: "10.0.0.100"
lb_external_ip: "167.235.105.161"
lb_service_id: 1399502
public_ipv4: True
ssh_keys:
- "rothe.pub"
- "alt.pub"

View File

@ -8,17 +8,7 @@
project_path: ../terraform/
state: present
complex_vars: true
variables:
location: "nbg1"
network_zone: "eu-central"
server_count: 3
subnetwork_ip_range: "10.0.0.0/24"
lb_internal_ip: "10.0.0.100"
lb_external_ip: "167.235.105.161"
lb_service_id: 1399502
ssh_keys:
- "rothe.pub"
- "alt.pub"
variables: "{{ terraform_vars }}"
register: tf_out
- debug: var=tf_out
@ -78,3 +68,17 @@
- php
- glusterfs
- wordpress
- name: Remove public IP
hosts: localhost
gather_facts: false
tasks:
- name: Remove public Ip
community.general.terraform:
project_path: ../terraform/
state: present
complex_vars: true
variables: "{{ terraform_vars | combine({'public_ipv4': False}) }}"
register: tf_out
- debug: var=tf_out