From 0c8d000ca32a5bcd642fd956458e9cc8d7fcf0a9 Mon Sep 17 00:00:00 2001 From: Sumit Solanki Date: Wed, 18 Dec 2024 19:36:15 +0530 Subject: [PATCH] OpenShift Client issue has been resolved along with DNS issue (#367) This is pull request is having fix for below two issue (ABI Disconnected) [OpenShift Client in not getting download from file_server ](https://github.com/IBM/Ansible-OpenShift-Provisioning/issues/366) [ABI: On fresh z/VM bastion ABI playbook is not installing tessia base lib](https://github.com/IBM/Ansible-OpenShift-Provisioning/issues/365) --------- Signed-off-by: Sumit Solanki Co-authored-by: Sumit Solanki --- roles/disconnected_mirror_images/tasks/main.yaml | 7 +++++++ roles/disconnected_mirror_images/templates/resolv.conf.j2 | 3 +++ roles/dns/templates/dns.db.j2 | 2 +- roles/offline_artifacts/tasks/main.yaml | 2 +- 4 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 roles/disconnected_mirror_images/templates/resolv.conf.j2 diff --git a/roles/disconnected_mirror_images/tasks/main.yaml b/roles/disconnected_mirror_images/tasks/main.yaml index 26bd6cc0..2f2b7bc0 100644 --- a/roles/disconnected_mirror_images/tasks/main.yaml +++ b/roles/disconnected_mirror_images/tasks/main.yaml @@ -2,6 +2,13 @@ - name: mirror artifacts in disconnected mode tags: mirror_artifacts block: + - name: Setting Up nameserver on mirror host to resolve DNS + ansible.builtin.template: + src: resolv.conf.j2 + dest: /etc/resolv.conf + owner: root + group: root + mode: "644" - name: Get user home directory tags: mirror_artifacts shell: > diff --git a/roles/disconnected_mirror_images/templates/resolv.conf.j2 b/roles/disconnected_mirror_images/templates/resolv.conf.j2 new file mode 100644 index 00000000..e640d670 --- /dev/null +++ b/roles/disconnected_mirror_images/templates/resolv.conf.j2 @@ -0,0 +1,3 @@ +search {{ env.cluster.networking.base_domain }} +nameserver {{ env.bastion.networking.nameserver1 }} +{{ ('nameserver ' + env.bastion.networking.nameserver2) if env.bastion.networking.nameserver2 is defined else '' }} diff --git a/roles/dns/templates/dns.db.j2 b/roles/dns/templates/dns.db.j2 index f4d36fe2..40e64db9 100644 --- a/roles/dns/templates/dns.db.j2 +++ b/roles/dns/templates/dns.db.j2 @@ -32,7 +32,7 @@ apps.{{ env.cluster.networking.metadata_name }} IN CNAME {{ env.bastion.netw {% if disconnected.enabled %} ;entry for mirror host. -{{ env.cluster.networking.metadata_name }}.{{ env.cluster.networking.metadata_name }}.{{ env.cluster.networking.base_domain }}. IN A {{ env.file_server.ip }} +{{ env.cluster.networking.metadata_name }}.{{ env.cluster.networking.metadata_name }}.{{ env.cluster.networking.base_domain }}. IN A {{ disconnected.mirroring.host.ip }} {% endif %} ;EOF diff --git a/roles/offline_artifacts/tasks/main.yaml b/roles/offline_artifacts/tasks/main.yaml index 8f342f26..0d5c4c0d 100644 --- a/roles/offline_artifacts/tasks/main.yaml +++ b/roles/offline_artifacts/tasks/main.yaml @@ -25,7 +25,7 @@ remote_src: yes loop: - "{{ env.file_server.protocol }}://{{ env.file_server.user + ':' + env.file_server.pass + '@' if env.file_server.protocol == 'ftp' else '' }}{{ env.file_server.ip }}{{ ':' + env.file_server.port if env.file_server.port | default('') | length > 0 else '' }}/{{ disconnected.mirroring.file_server.clients_dir }}/{{ disconnected.mirroring.file_server.oc_mirror_tgz }}" - - "{{ env.file_server.protocol }}://{{ env.file_server.user + ':' + env.file_server.pass + '@' if env.file_server.protocol == 'ftp' else '' }}{{ env.file_server.ip }}{{ ':' + env.file_server.port if env.file_server.port | default('') | length > 0 else '' }}/{{ disconnected.mirroring.file_server.clients_dir }}/{{ disconnected.mirroring.client_download.ocp_client_tgz }}" + - "{{ disconnected.mirroring.client_download.ocp_download_url }}{{ disconnected.mirroring.client_download.ocp_client_tgz }}" - name: Copy kubectl, oc, and oc-mirror binaries to /usr/local/sbin become: true