Skip to content

Instantly share code, notes, and snippets.

@larstobi
Created June 25, 2015 12:07
Show Gist options
  • Save larstobi/a03ac1cdf34e341ff459 to your computer and use it in GitHub Desktop.
Save larstobi/a03ac1cdf34e341ff459 to your computer and use it in GitHub Desktop.
resource "cloudstack_instance" "app" {
count = "2"
# name = "${var.resource_prefix}-app-${count.index}"
name = "app"
service_offering = "${var.default_service_offering}"
network = "${var.default_network}"
template = "${var.default_template}"
zone = "${var.default_zone}"
expunge = true
# connection {
# key_file = "${var.connection_ssh_key_file}"
# }
provisioner "local-exec" {
command = "echo \"[${self.name}]\n${self.ipaddress}\" > inventory.app.${count.index} && ansible-playbook --tags=authorized_users -i inventory.app.${count.index} appservers.yml"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment