Skip to content

Commit

Permalink
fix: ignition
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Bastide <[email protected]>
  • Loading branch information
prb112 committed Dec 14, 2023
1 parent c5142b4 commit e149840
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 34 deletions.
46 changes: 13 additions & 33 deletions ansible/support/tasks/ignition.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,7 @@
---
- hosts: all

####################################################################################
# Verify and Validate prior to starting execution
pre_tasks:
- name: Verify Ansible version.
assert:
that: "ansible_version.full is version_compare('2.12', '>=')"
msg: >
"You must update Ansible to at least 2.12"
####################################################################################
tasks:

- name: Create Apache directories for installing
file:
path: "{{ item }}"
Expand All @@ -23,44 +12,35 @@

- name: Disable fcontext
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
# validate_certs: false
# 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:
- name: Loop until TARGET_MTU is correct
ansible.builtin.uri:
url: "{{ openshift_machine_config_url }}"
dest: /var/www/html/ignition/worker.ign
validate_certs: false
method: GET
return_content: true
headers:
"Accept": "application/vnd.coreos.ignition+json;version=3.2.0"
validate_certs: false
ignore_errors: true
register: result
retries: 120
delay: 10
until: '"Request failed: <urlopen error timed out>" not in result.msg'
- name: Downloading the ignition file using a https_proxy
until: 'result.status in [200] and "mpath" not in result.content'

- name: Downloading the ignition file
get_url:
url: "{{ openshift_machine_config_url }}"
dest: /var/www/html/ignition/worker.ign
validate_certs: false
headers:
"Accept": "application/vnd.coreos.ignition+json;version=3.2.0"
ignore_errors: true
# environment:
# https_proxy: http://{{ vpc_support_server_ip }}:3128
register: result
retries: 120
delay: 10
until: '"Request failed: <urlopen error timed out>" not in result.msg'

- name: Verify the ignition file exists
ansible.builtin.shell: stat /var/www/html/ignition/worker.ign
Expand Down
1 change: 0 additions & 1 deletion modules/4_pvs_support/pvs_support.tf
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,6 @@ 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.set_routing_via_host]
connection {
type = "ssh"
Expand Down

0 comments on commit e149840

Please sign in to comment.