Further updates
* Add user-data for instance * Add heat specific rules * Start of MAAS bits
This commit is contained in:
parent
8c7106eac4
commit
6fb9ff2880
14
init.tf
Normal file
14
init.tf
Normal file
@ -0,0 +1,14 @@
|
||||
terraform {
|
||||
required_providers {
|
||||
maas = {
|
||||
source = "maas/maas"
|
||||
version = "~>1.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
provider "maas" {
|
||||
api_version = "2.0"
|
||||
api_key = "cP5gj8RyemEhBLvyKG:AmRXEzR8MPAbRPWGBH:7T9LPemF3gAPe3qwr47rXAkLWZysjeRB"
|
||||
api_url = "http://10.0.1.253:5240/MAAS"
|
||||
}
|
@ -21,3 +21,8 @@ variable "cloud" {
|
||||
type = string
|
||||
default = ""
|
||||
}
|
||||
|
||||
variable "heat_domain_id" {
|
||||
type = string
|
||||
default = ""
|
||||
}
|
||||
|
@ -1,2 +1,3 @@
|
||||
cloud = "arif-home"
|
||||
domain_id = "3fd5a53e08e243b49ac3b171d57b4e4a"
|
||||
heat_domain_id = "cf34d55eaf294678971be7ad732be0d2"
|
||||
|
@ -24,6 +24,8 @@ resource "openstack_compute_instance_v2" "test_server_01" {
|
||||
network {
|
||||
name = "private"
|
||||
}
|
||||
|
||||
user_data = file("user-data.yaml")
|
||||
}
|
||||
|
||||
resource "openstack_networking_floatingip_v2" "fip" {
|
||||
|
4
openstack/init/user-data.yaml
Normal file
4
openstack/init/user-data.yaml
Normal file
@ -0,0 +1,4 @@
|
||||
#cloud-config
|
||||
password: ubuntu
|
||||
chpasswd: {expire: False}
|
||||
ssh_pwauth: True
|
@ -1,3 +1,7 @@
|
||||
data "openstack_identity_role_v3" "admin"{
|
||||
name = "admin"
|
||||
}
|
||||
|
||||
data "openstack_identity_role_v3" "Member" {
|
||||
name = "Member"
|
||||
}
|
||||
|
16
openstack/stsstack_init/01-heat-roles.tf
Normal file
16
openstack/stsstack_init/01-heat-roles.tf
Normal file
@ -0,0 +1,16 @@
|
||||
resource "openstack_identity_user_v3" "heat_domain_admin" {
|
||||
domain_id = var.heat_domain_id
|
||||
name = "heat_domain_admin"
|
||||
|
||||
password = "Ht8NdKTGdpJjRsS4V33tsVW4mSztgZMs" # leader-get heat-domain-admin-passwd
|
||||
}
|
||||
|
||||
resource "openstack_identity_role_assignment_v3" "heat_admin_role_assignment" {
|
||||
domain_id = var.heat_domain_id
|
||||
user_id = openstack_identity_user_v3.heat_domain_admin.id
|
||||
role_id = data.openstack_identity_role_v3.admin.id
|
||||
}
|
||||
|
||||
resource "openstack_identity_role_v3" "heat_stack_user" {
|
||||
name = "heat_stack_user"
|
||||
}
|
Loading…
Reference in New Issue
Block a user