Skip to content
Snippets Groups Projects
Commit fcaa658f authored by debora.benedetto@hpe.com's avatar debora.benedetto@hpe.com
Browse files

remove output_file_generated folder from gitignore, add ssh_key file generation for ansible

parent 04b41506
No related branches found
No related tags found
No related merge requests found
output "instance_server_public_key_" {
value = openstack_compute_keypair_v2.ssh_key.public_key
}
output "instance_server_private_key_" {
value = openstack_compute_keypair_v2.ssh_key.private_key
}
output "instance_ip_nginx-host" {
value = openstack_compute_floatingip_associate_v2.vm1_floating_ip_association.floating_ip
}
......@@ -56,6 +56,7 @@ def create_files(parameters, output_path):
ansible_output_file_path = output_path + "/".join([language, resource_name]) + ".yaml"
inventory_output_file_path = output_path + "/".join([language, "inventory"]) + ".j2"
config_output_file_path = output_path + "/".join([language, "config"]) + ".yaml"
ssh_key_output_file_path = output_path + "/".join([language, "ssh_key.j2"])
template = TemplateUtils.read_template(ansible_template_path)
template_filled = TemplateUtils.edit_template(template, resource_params)
......@@ -66,5 +67,6 @@ def create_files(parameters, output_path):
TemplateUtils.write_template(inventory_template_filled, inventory_output_file_path)
TemplateUtils.write_template(template_filled, ansible_output_file_path)
TemplateUtils.write_template(config_template_filled, config_output_file_path)
TemplateUtils.write_template("{{ instance_server_private_key }}", ssh_key_output_file_path)
logging.info("File available at: {}".format(output_path))
......@@ -25,6 +25,7 @@ from jinja2 import Template
def get_context(c):
return c
def find_template_path(iac_language, key, resource_name):
try:
properties_reader = configparser.ConfigParser()
......
......@@ -13,7 +13,6 @@
# limitations under the License.
#-------------------------------------------------------------------------
#}
---
input:
- instance_ip_{{ node.vm_name }}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment