diff --git a/controller/Orchestrator.py b/controller/Orchestrator.py index 5048bfd85be06e6f071f274edb65d4231449babe..8d532b89c8c6992b4939b724d3a3aa2d69774de3 100644 --- a/controller/Orchestrator.py +++ b/controller/Orchestrator.py @@ -36,8 +36,8 @@ def choose_plugin(parameters, template_generated_folder): metadata_root_folder["iac"].append("terraform") input_data = step["data"] iac_output_folder = template_generated_folder + "terraform" - plugin_metadata = {"input": ["openstack_username", "openstack_password", "openstack_auth_url"], - "output": [], "engine": "terraform"} + # plugin_metadata = {"input": ["openstack_username", "openstack_password", "openstack_auth_url"], + plugin_metadata = {"input": [], "output": [], "engine": "terraform"} save_file(plugin_metadata, iac_output_folder + "/config.yaml", output_extensions="YAML") TerraformPlugin.create_files(input_data, iac_output_folder) save_file(metadata_root_folder, template_generated_folder + "/config.yaml", output_extensions="YAML") @@ -49,6 +49,7 @@ def save_file(data, file_path, output_extensions="json"): file = open(file_path, "w") if isinstance(data, dict) and output_extensions == "YAML": data = yaml.dump(data) + data = "---\n" + data + "..." if isinstance(data, dict): data = json.dumps(data, indent=2, sort_keys=True) print(data) diff --git a/input_file_generated/ir.json b/input_file_generated/ir.json index bb2e1c474d6b64c859169b3e85af25641afc9cd7..d6ad467ed3c99f64d8c915076991853f51ffb0cb 100644 --- a/input_file_generated/ir.json +++ b/input_file_generated/ir.json @@ -3,46 +3,13 @@ "steps": [ { "data": { - "computingGroup": [ + "credentials": [ { - "cidr": [ - "0.0.0.0/0" - ], - "fromPort": -1, - "kind": "EGRESS", - "name": "out_all", - "protocol": "-1", - "toPort": -1 - }, - { - "cidr": [ - "0.0.0.0/0" - ], - "fromPort": 80, - "kind": "INGRESS", - "name": "http", - "protocol": "tcp", - "toPort": 80 - }, - { - "cidr": [ - "0.0.0.0/0" - ], - "fromPort": 443, - "kind": "INGRESS", - "name": "https", - "protocol": "tcp", - "toPort": 443 - }, - { - "cidr": [ - "0.0.0.0/0" - ], - "fromPort": 22, - "kind": "INGRESS", - "name": "ssh", - "protocol": "tcp", - "toPort": 22 + "algorithm": "RSA", + "bits": 4096, + "keyfile": "/home/user1/.ssh/openstack.key", + "name": "ssh_key", + "user": "ubuntu" } ], "networks": [ diff --git a/output_file_example/nginx_openstack/ansible/config.yaml b/output_file_example/nginx_openstack/ansible/config.yaml index c5ca1ce28c5813eb4d537446288ad4da913c762f..f5b9945aea768b2e8fa0d458646b3db9ed9d1ae5 100644 --- a/output_file_example/nginx_openstack/ansible/config.yaml +++ b/output_file_example/nginx_openstack/ansible/config.yaml @@ -1,5 +1,5 @@ --- -input: ~ -output: ~ +input: [] +output: [] engine: ansible ... diff --git a/output_file_example/nginx_openstack/terraform/config.yaml b/output_file_example/nginx_openstack/terraform/config.yaml index d0ab1b89457a04ab34ba0e951872da989f9df2de..54f446cb906877c64ffb8adf442a47bb53ef3b01 100644 --- a/output_file_example/nginx_openstack/terraform/config.yaml +++ b/output_file_example/nginx_openstack/terraform/config.yaml @@ -1,8 +1,5 @@ --- -input: - - openstack_username - - openstack_password - - openstack_auth_url -output: ~ engine: terraform +input: [] +output: [] ... diff --git a/output_files_generated/nginx_openstack/config.yaml b/output_files_generated/nginx_openstack/config.yaml index cb3ec8c5c3c16d77e9f05e8db21ff23661dbf242..76cd9909f5fef039100743c17b8baddd69ddb525 100644 --- a/output_files_generated/nginx_openstack/config.yaml +++ b/output_files_generated/nginx_openstack/config.yaml @@ -1,2 +1,4 @@ +--- iac: - terraform +... \ No newline at end of file diff --git a/output_files_generated/nginx_openstack/terraform/main.tf b/output_files_generated/nginx_openstack/terraform/main.tf index 86d3b834c4129cdc4485c8da1a7bcb5af865e676..d2458c3acb5e0fea19b063e8de82c4789cbbded9 100644 --- a/output_files_generated/nginx_openstack/terraform/main.tf +++ b/output_files_generated/nginx_openstack/terraform/main.tf @@ -98,47 +98,3 @@ resource "openstack_networking_router_interface_v2" "net1_router_interface" { subnet_id = openstack_networking_subnet_v2.net1_subnet.id } -resource "openstack_compute_secgroup_v2" "out_all" { - name = "out_all" - description = "Security group rule for port -1" - rule { - from_port = -1 - to_port = -1 - ip_protocol = "-1" - cidr = "0.0.0.0/0" - } -} - -resource "openstack_compute_secgroup_v2" "http" { - name = "http" - description = "Security group rule for port 80" - rule { - from_port = 80 - to_port = 80 - ip_protocol = "tcp" - cidr = "0.0.0.0/0" - } -} - -resource "openstack_compute_secgroup_v2" "https" { - name = "https" - description = "Security group rule for port 443" - rule { - from_port = 443 - to_port = 443 - ip_protocol = "tcp" - cidr = "0.0.0.0/0" - } -} - -resource "openstack_compute_secgroup_v2" "ssh" { - name = "ssh" - description = "Security group rule for port 22" - rule { - from_port = 22 - to_port = 22 - ip_protocol = "tcp" - cidr = "0.0.0.0/0" - } -} -