Skip to content

Clean up skeleton directory #711

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

{{ cookiecutter.description }}

See the main README.md in the repo root for an overview and general install instructions. Any environment-specific instructions should be added here.
See the main README.md in the repository root for an overview and general install instructions. Any environment-specific instructions should be added here.
2 changes: 0 additions & 2 deletions environments/skeleton/{{cookiecutter.environment}}/activate
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,3 @@ echo "Setting PKR_VAR_repo_root to $PKR_VAR_repo_root"
if [ -f "$APPLIANCES_ENVIRONMENT_ROOT/ansible.cfg" ]; then
export ANSIBLE_CONFIG=$APPLIANCES_ENVIRONMENT_ROOT/ansible.cfg
fi


Original file line number Diff line number Diff line change
@@ -1 +1 @@
grafana_auth_anonymous: true
grafana_auth_anonymous: true
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module "additional" {
cluster_domain_suffix = var.cluster_domain_suffix
key_pair = var.key_pair
environment_root = var.environment_root

# can be set for group, defaults to top-level value:
image_id = lookup(each.value, "image_id", var.cluster_image_id)
vnic_types = lookup(each.value, "vnic_types", var.vnic_types)
Expand All @@ -21,7 +21,7 @@ module "additional" {
root_volume_type = lookup(each.value, "root_volume_type", var.root_volume_type)
gateway_ip = lookup(each.value, "gateway_ip", var.gateway_ip)
nodename_template = lookup(each.value, "nodename_template", var.cluster_nodename_template)

# optionally set for group:
networks = concat(var.cluster_networks, lookup(each.value, "extra_networks", []))
# here null means "use module var default"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module "compute" {
cluster_domain_suffix = var.cluster_domain_suffix
key_pair = var.key_pair
environment_root = var.environment_root

# can be set for group, defaults to top-level value:
image_id = lookup(each.value, "image_id", var.cluster_image_id)
vnic_types = lookup(each.value, "vnic_types", var.vnic_types)
Expand All @@ -38,7 +38,7 @@ module "compute" {
control_address = openstack_networking_port_v2.control[var.cluster_networks[0].network].all_fixed_ips[0]
security_group_ids = [for o in data.openstack_networking_secgroup_v2.nonlogin: o.id]
baremetal_nodes = data.external.baremetal_nodes.result

# input dict validation:
group_name = each.key
group_keys = keys(each.value)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ resource "openstack_networking_port_v2" "control" {
}

resource "openstack_compute_instance_v2" "control" {

name = split(".", local.control_fqdn)[0]
image_id = var.cluster_image_id
flavor_name = var.control_node_flavor
key_pair = var.key_pair

# root device:
block_device {
uuid = var.cluster_image_id
Expand Down Expand Up @@ -81,7 +81,7 @@ resource "openstack_compute_instance_v2" "control" {
user_data = <<-EOF
#cloud-config
fqdn: ${local.control_fqdn}

bootcmd:
%{for volume in local.control_volumes}
- BLKDEV=$(readlink -f $(ls /dev/disk/by-id/*${substr(volume.id, 0, 20)}* | head -n1 )); blkid -o value -s TYPE $BLKDEV || mke2fs -t ext4 -L ${lower(reverse(split("-", volume.name))[0])} $BLKDEV
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module "login" {
cluster_domain_suffix = var.cluster_domain_suffix
key_pair = var.key_pair
environment_root = var.environment_root

# can be set for group, defaults to top-level value:
image_id = lookup(each.value, "image_id", var.cluster_image_id)
vnic_types = lookup(each.value, "vnic_types", var.vnic_types)
Expand All @@ -21,7 +21,7 @@ module "login" {
root_volume_type = lookup(each.value, "root_volume_type", var.root_volume_type)
gateway_ip = lookup(each.value, "gateway_ip", var.gateway_ip)
nodename_template = lookup(each.value, "nodename_template", var.cluster_nodename_template)

# optionally set for group:
networks = concat(var.cluster_networks, lookup(each.value, "extra_networks", []))
# here null means "use module var default"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ locals {

# Workaround for lifecycle meta-argument only taking static values
compute_instances = var.ignore_image_changes ? openstack_compute_instance_v2.compute_fixed_image : openstack_compute_instance_v2.compute

# Define fully qualified nodenames here to avoid repetition
fqdns = {
for n in var.nodes: n => templatestring(
Expand Down Expand Up @@ -61,7 +61,7 @@ resource "openstack_networking_port_v2" "compute" {
subnet_id = data.openstack_networking_subnet_v2.subnet[each.value.net.network].id
ip_address = try(var.ip_addresses[each.value.net.network][each.value.node_idx], null)
}

no_security_groups = lookup(each.value.net, "no_security_groups", false)
security_group_ids = lookup(each.value.net, "no_security_groups", false) ? [] : var.security_group_ids

Expand Down Expand Up @@ -128,7 +128,7 @@ resource "openstack_compute_instance_v2" "compute_fixed_image" {
resource "openstack_compute_instance_v2" "compute" {

for_each = var.ignore_image_changes ? [] : toset(var.nodes)

name = split(".", local.fqdns[each.key])[0]
image_id = var.image_id
flavor_name = var.flavor
Expand All @@ -146,7 +146,7 @@ resource "openstack_compute_instance_v2" "compute" {
delete_on_termination = true
}
}

dynamic "network" {
for_each = {for net in var.networks: net.network => net}
content {
Expand Down
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this whitespace needed for indented tofu heredoc-style strings?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unsure, I need to test it.

Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ variable "group_keys" {
error_message = <<-EOT
Node group '${var.group_name}' contains invalid key(s) ${
join(", ", setsubtract(var.group_keys, var.allowed_keys))}.

Valid keys are ${join(", ", var.allowed_keys)}.
EOT
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ variable "additional_nodegroups" {
Keys are names of groups.
Values are a mapping as for the "login" variable, with the addition of
the optional entry:

security_group_ids: List of strings giving IDs of security groups
to apply. If not specified the groups from the
variable nonlogin_security_groups are applied.
Expand Down
Loading