From 60838cb9bdda1f061ca6aad80099aed4dded77c0 Mon Sep 17 00:00:00 2001 From: Chandan Abhyankar Date: Tue, 17 Oct 2023 02:25:27 -0700 Subject: [PATCH] Integration errors are resolved for ignition.yml Signed-off-by: Chandan Abhyankar --- ansible/support/tasks/ignition.yml | 30 ++++++++++++++-------------- main.tf | 9 +++++---- modules/4_pvs_support/pvs_support.tf | 18 +++++++++-------- 3 files changed, 30 insertions(+), 27 deletions(-) diff --git a/ansible/support/tasks/ignition.yml b/ansible/support/tasks/ignition.yml index e3c370f..a6165c6 100644 --- a/ansible/support/tasks/ignition.yml +++ b/ansible/support/tasks/ignition.yml @@ -27,18 +27,18 @@ shell: "semanage fcontext -a -t httpd_sys_rw_content_t /var/www/html/ignition/worker.ign || true" - name: Download the Ignition file block: - - name: Loop until TARGET_MTU is correct - ansible.builtin.uri: - url: "{{ openshift_machine_config_url }}" - method: GET - return_content: true - headers: - "Accept": "application/vnd.coreos.ignition+json;version=3.2.0" - ignore_errors: true - register: result - retries: 120 - delay: 10 - until: 'result.status in [200]' +# - name: Loop until TARGET_MTU is correct +# ansible.builtin.uri: +# url: "{{ openshift_machine_config_url }}" +# method: GET +# return_content: true +# headers: +# "Accept": "application/vnd.coreos.ignition+json;version=3.2.0" +# ignore_errors: true +# register: result +# retries: 120 +# delay: 10 +# until: 'result.status in [200]' # This conditional is updated when the MTU is changed - and "TARGET_MTU=9100" in result.content - name: Downloading the ignition file get_url: @@ -60,8 +60,8 @@ headers: "Accept": "application/vnd.coreos.ignition+json;version=3.2.0" ignore_errors: true - environment: - https_proxy: http://{{ vpc_support_server_ip }}:3128 + # environment: + # https_proxy: http://{{ vpc_support_server_ip }}:3128 - name: Verify the ignition file exists ansible.builtin.shell: stat /var/www/html/ignition/worker.ign @@ -75,4 +75,4 @@ mode: u+rwx,g-rx,o-rx - name: Best effort SELinux repair - Apache - shell: "restorecon -vR /var/www/html/ignition || true" \ No newline at end of file + shell: "restorecon -vR /var/www/html/ignition || true" diff --git a/main.tf b/main.tf index 23b553e..47a8303 100644 --- a/main.tf +++ b/main.tf @@ -64,7 +64,7 @@ module "vpc_prepare" { # key_id = module.vpc_prepare.key_id powervs_machine_cidr = var.powervs_machine_cidr } - +/* module "transit_gateway" { providers = { ibm = ibm.vpc @@ -78,12 +78,13 @@ module "transit_gateway" { vpc_region = var.vpc_region resource_group = module.vpc.vpc_resource_group } - +*/ module "support" { providers = { ibm = ibm.powervs } - depends_on = [module.transit_gateway] + depends_on = [module.vpc_prepare] + #depends_on = [module.transit_gateway] source = "./modules/4_pvs_support" private_key_file = var.private_key_file @@ -100,7 +101,7 @@ module "image" { providers = { ibm = ibm.vpc } - depends_on = [module.vpc_prepare] + depends_on = [module.support] source = "./modules/5_image" name_prefix = local.name_prefix diff --git a/modules/4_pvs_support/pvs_support.tf b/modules/4_pvs_support/pvs_support.tf index 1ba4d5f..77361ac 100644 --- a/modules/4_pvs_support/pvs_support.tf +++ b/modules/4_pvs_support/pvs_support.tf @@ -46,12 +46,12 @@ resource "null_resource" "setup" { provisioner "file" { content = templatefile("${path.module}/templates/inventory.tpl", local.helpernode_inventory) - destination = "ocp4-upi-compute/intel/support/inventory" + destination = "/root/ocp4-upi-compute/intel/support/inventory" } provisioner "file" { content = templatefile("${path.module}/templates/vars.yaml.tpl", local.helpernode_vars) - destination = "ocp4-upi-compute/intel/support/vars/vars.yaml" + destination = "/root/ocp4-upi-compute/intel/support/vars/vars.yaml" } # Copies the custom route for env3 @@ -65,8 +65,8 @@ resource "null_resource" "setup" { nmcli device up env3 echo 'Running ocp4-upi-compute/intel/ playbook...' -cd ocp4-upi-compute/intel/support -ANSIBLE_LOG_PATH=/root/.openshift/ocp4-upi-compute/intel/-support.log ansible-playbook -e @vars/vars.yaml tasks/main.yml --become +cd /root/ocp4-upi-compute/intel/support +ANSIBLE_LOG_PATH=/root/.openshift/ocp4-upi-compute/intel/support.log ansible-playbook -e @vars/vars.yaml tasks/main.yml --become EOF ] } @@ -200,7 +200,8 @@ EOF # Dev Note: do this as the last step so we get a good worker ignition file downloaded. resource "null_resource" "latest_ignition" { - depends_on = [null_resource.wait_on_mcp] +# depends_on = [null_resource.wait_on_mcp] + depends_on = [null_resource.set_routing_via_host] connection { type = "ssh" user = var.rhel_username @@ -214,9 +215,10 @@ resource "null_resource" "latest_ignition" { inline = [<