forked from ovh/pci-test
pci-test ex3
This commit is contained in:
parent
7a1433eb61
commit
cd81e92142
41
.gitignore
vendored
Normal file
41
.gitignore
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
#.gitignore
|
||||
#ex3/*.terraform*
|
||||
#ex3/terraform*
|
||||
|
||||
# Local .terraform directories
|
||||
**/.terraform*
|
||||
|
||||
# .tfstate files
|
||||
*.tfstate
|
||||
*.tfstate.*
|
||||
|
||||
# Crash log files
|
||||
crash.log
|
||||
crash.*.log
|
||||
|
||||
# Exclude all .tfvars files, which are likely to contain sensitive data, such as
|
||||
# password, private keys, and other secrets. These should not be part of version
|
||||
# control as they are data points which are potentially sensitive and subject
|
||||
# to change depending on the environment.
|
||||
*.tfvars
|
||||
*.tfvars.json
|
||||
|
||||
# Ignore override files as they are usually used to override resources locally and so
|
||||
# are not checked in
|
||||
override.tf
|
||||
override.tf.json
|
||||
*_override.tf
|
||||
*_override.tf.json
|
||||
|
||||
# Ignore transient lock info files created by terraform apply
|
||||
.terraform.tfstate.lock.info
|
||||
|
||||
# Include override files you do wish to add to version control using negated pattern
|
||||
# !example_override.tf
|
||||
|
||||
# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan
|
||||
# example: *tfplan*
|
||||
|
||||
# Ignore CLI configuration files
|
||||
.terraformrc
|
||||
terraform.rc
|
31
ex3/main.tf
Normal file
31
ex3/main.tf
Normal file
@ -0,0 +1,31 @@
|
||||
terraform {
|
||||
required_version = ">= 0.14.0"
|
||||
required_providers {
|
||||
openstack = {
|
||||
source = "terraform-provider-openstack/openstack"
|
||||
version = "~> 1.53.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
resource "openstack_networking_floatingip_v2" "_3245829148481055-FIP" {
|
||||
pool = "Ext-Net"
|
||||
}
|
||||
|
||||
resource "openstack_compute_instance_v2" "_3245829148481055-pci-test-ex3" {
|
||||
name = "_3245829148481055-pci-test-ex3"
|
||||
image_id = "d2083aa0-94ee-491d-a20c-0c8db1acdb96"
|
||||
flavor_name = "d2-4"
|
||||
key_pair = "3245829148481055-KP"
|
||||
security_groups = ["default"]
|
||||
user_data = "#cloud-config\npackages:\n - nginx\nruncmd:\n - systemctl enable nginx\n - systemctl start nginx"
|
||||
|
||||
network {
|
||||
name = "3245829148481055-int-net"
|
||||
}
|
||||
}
|
||||
|
||||
resource "openstack_compute_floatingip_associate_v2" "_3245829148481055-FIP" {
|
||||
floating_ip = "${openstack_networking_floatingip_v2._3245829148481055-FIP.address}"
|
||||
instance_id = "${openstack_compute_instance_v2._3245829148481055-pci-test-ex3.id}"
|
||||
}
|
@ -1 +0,0 @@
|
||||
# Placeholder
|
Loading…
Reference in New Issue
Block a user