Skip to content

Commit

Permalink
Integration errors are resolved for ignition.yml
Browse files Browse the repository at this point in the history
Signed-off-by: Chandan Abhyankar <[email protected]>
  • Loading branch information
Chandan-Abhyankar committed Oct 17, 2023
1 parent 4f18ad4 commit 60838cb
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 27 deletions.
30 changes: 15 additions & 15 deletions ansible/support/tasks/ignition.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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"
shell: "restorecon -vR /var/www/html/ignition || true"
9 changes: 5 additions & 4 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
18 changes: 10 additions & 8 deletions modules/4_pvs_support/pvs_support.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
]
}
Expand Down Expand Up @@ -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
Expand All @@ -214,9 +215,10 @@ resource "null_resource" "latest_ignition" {
inline = [<<EOF
nmcli device up env3
echo 'Running ocp4-upi-compute-powervs playbook for ignition...'
cd ocp4-upi-compute-powervs/support
ANSIBLE_LOG_PATH=/root/.openshift/ocp4-upi-compute-powervs-support.log ansible-playbook -e @vars/vars.yaml tasks/ignition.yml --become
cd /root/ocp4-upi-compute/intel/support
#cd ocp4-upi-compute-powervs-ibmcloud/support
ANSIBLE_LOG_PATH=/root/.openshift/ocp4-upi-compute-intel-support.log ansible-playbook -e @vars/vars.yaml tasks/ignition.yml --become
EOF
]
}
}
}

0 comments on commit 60838cb

Please sign in to comment.