Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
Integration-tests
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
PIACERE
public
demos
Integration-tests
Commits
f0dc6989
Commit
f0dc6989
authored
2 years ago
by
mbartmanski@7bulls.com
Browse files
Options
Downloads
Patches
Plain Diff
fix terraform
parent
3a4a5909
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
terraform/main.tf
+23
-30
23 additions, 30 deletions
terraform/main.tf
with
23 additions
and
30 deletions
terraform/main.tf
+
23
−
30
View file @
f0dc6989
...
@@ -23,12 +23,12 @@ data "openstack_networking_network_v2" "external" {
...
@@ -23,12 +23,12 @@ data "openstack_networking_network_v2" "external" {
# Create virtual machine
# Create virtual machine
resource
"openstack_compute_instance_v2"
"vm1"
{
resource
"openstack_compute_instance_v2"
"vm1"
{
name
=
"
concrete_vm
"
name
=
"
nginx_host
"
image_name
=
"Ubuntu-Focal-20.04-Daily-2022-04-19"
image_name
=
"Ubuntu-Focal-20.04-Daily-2022-04-19"
flavor_name
=
"small"
flavor_name
=
"small"
key_pair
=
openstack_compute_keypair_v2
.
user1
.
name
key_pair
=
openstack_compute_keypair_v2
.
user1
.
name
network
{
network
{
port
=
openstack_networking_port_v2
.
net1_networking_port
.
id
port
=
openstack_networking_port_v2
.
net1_
subnet_
networking_port
.
id
}
}
}
}
...
@@ -47,50 +47,44 @@ resource "openstack_compute_floatingip_associate_v2" "vm1_floating_ip_associatio
...
@@ -47,50 +47,44 @@ resource "openstack_compute_floatingip_associate_v2" "vm1_floating_ip_associatio
# Router interface configuration
# Router interface configuration
resource
"openstack_networking_router_interface_v2"
"net1_router_interface"
{
resource
"openstack_networking_router_interface_v2"
"net1_
subnet_
router_interface"
{
router_id
=
openstack_networking_router_v2
.
router
.
id
router_id
=
openstack_networking_router_v2
.
router
.
id
subnet_id
=
openstack_networking_subnet_v2
.
net1_subnet
.
id
subnet_id
=
openstack_networking_subnet_v2
.
net1_subnet
_subnet
.
id
}
}
## Network
## Network
# Create Network
# Create Network
resource
"openstack_networking_network_v2"
"
net1
"
{
resource
"openstack_networking_network_v2"
"
ostack2
"
{
name
=
"concrete_net"
name
=
"concrete_net"
}
}
# Create network port
# Subnet
resource
"openstack_networking_port_v2"
"net1_networking_port"
{
resource
"openstack_networking_subnet_v2"
"net1_subnet_subnet"
{
name
=
"net1"
name
=
"net1_subnet_subnet"
network_id
=
openstack_networking_network_v2
.
net1
.
id
network_id
=
openstack_networking_network_v2
.
ostack2
.
id
cidr
=
"16.0.0.0/24"
dns_nameservers
=
[
"8.8.8.8"
,
"8.8.8.4"
]
}
# Attach networking port
resource
"openstack_networking_port_v2"
"net1_subnet_networking_port"
{
name
=
"concrete_net"
network_id
=
openstack_networking_network_v2
.
ostack2
.
id
admin_state_up
=
true
admin_state_up
=
true
security_group_ids
=
[
security_group_ids
=
[
data
.
openstack_networking_secgroup_v2
.
default
.
id
#default flavour id
openstack_compute_secgroup_v2
.
icmp
.
id
,
openstack_compute_secgroup_v2
.
http
.
id
,
openstack_compute_secgroup_v2
.
https
.
id
,
openstack_compute_secgroup_v2
.
ssh
.
id
,
]
]
fixed_ip
{
fixed_ip
{
subnet_id
=
openstack_networking_subnet_v2
.
net1_subnet
.
id
subnet_id
=
openstack_networking_subnet_v2
.
net1_subnet_subnet
.
id
}
}
data
"openstack_identity_project_v3"
"test_tenant"
{
name
=
"demo"
}
}
data
"openstack_networking_secgroup_v2"
"default"
{
name
=
"default"
tenant_id
=
data
.
openstack_identity_project_v3
.
test_tenant
.
id
}
}
# Subnet configuration
resource
"openstack_networking_subnet_v2"
"net1_subnet"
{
name
=
"net1_subnet"
network_id
=
openstack_networking_network_v2
.
net1
.
id
cidr
=
"16.0.0.0/24"
dns_nameservers
=
[
"8.8.8.8"
,
"8.8.8.4"
]
}
# Create router
# Create router
resource
"openstack_networking_router_v2"
"router"
{
## 1router, not parametric
resource
"openstack_networking_router_v2"
"router"
{
## 1router, not parametric
...
@@ -102,7 +96,7 @@ resource "openstack_networking_router_v2" "router" { ## 1router, not parametric
...
@@ -102,7 +96,7 @@ resource "openstack_networking_router_v2" "router" { ## 1router, not parametric
# Create ssh keys
# Create ssh keys
resource
"openstack_compute_keypair_v2"
"user1"
{
resource
"openstack_compute_keypair_v2"
"user1"
{
name
=
"
integration
-test"
name
=
"
user
-test"
public_key
=
""
public_key
=
""
}
}
...
@@ -154,4 +148,3 @@ resource "openstack_compute_secgroup_v2" "ssh" {
...
@@ -154,4 +148,3 @@ resource "openstack_compute_secgroup_v2" "ssh" {
}
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment