This is a development profile that includes additional resources for:
- copying the Salt code to the admin node
- copying the manifests to the admin node
- running custom provisioning scripts
- assigning roles to machines
- running the orchestration
All these steps are optional: they can be enabled/disabled by
setting some TF_VAR_x
s.
Enable this profile by doing:
make -C $PROJECT_ROOT_DIR dev-profile-apply
You can set some vars for modifying the cluster creation:
# you can run the Makefile target
cd $PROJECT_ROOT_DIR
env TF_VAR_img_refresh="false" TF_VAR_orchestrate="true" make dev-apply
# or just Terraform
env TF_VAR_img_refresh="false" TF_VAR_orchestrate="true" terraform apply
It is a bit annoying to provide many vars in command line, so you can also invoke Terraform with some variables file(s), ie:
cd $PROJECT_ROOT_DIR
terraform apply -var-file=profiles/devel/images-staging-b.tfvars
make -C $PROJECT_ROOT_DIR dev-profile-clean
You can add a autorun.local.sh
script in resources/{admin,nodes}/
for being executed automatically when creating the cluster.
You can extend an exiting profile by adding your own .local.tf
files
(these files will not be added to git). For example, you can run some
extra stuff in the Admin Node in the devel profile with:
cd $PROJECT_ROOT_DIR && cat <<EOF> profiles/devel/profile-devel-custom.local.tf
resource "null_resource" "run_extra_stuff" {
# add any dependencies necessary with 'depends_on = []'
connection {
host = "${libvirt_domain.admin.network_interface.0.addresses.0}"
password = "${var.password}"
}
provisioner "remote-exec" {
inline = [
"echo 'Running extra stuff'",
]
}
}
EOF
make dev-profile-apply