diff --git a/roles/mongodb/tasks/validate-vars.yml b/roles/mongodb/tasks/validate-vars.yml index f6fd378e..09a6a02c 100644 --- a/roles/mongodb/tasks/validate-vars.yml +++ b/roles/mongodb/tasks/validate-vars.yml @@ -69,6 +69,26 @@ mongodb_package_dependencies: "{{ mongodb_package_dependencies_default[ansible_distribution_major_version] }}" when: mongodb_package_dependencies is not defined + - name: Validate offline install directory for the target OS + when: offline_install_enabled | bool + block: + - name: Stat offline packages directory on the control node + ansible.builtin.stat: + path: "{{ mongodb_offline_control_node_root }}" + register: mongodb_offline_dir_stat + delegate_to: localhost + become: false + + - name: Assert offline packages directory exists on the control node + ansible.builtin.assert: + that: + - mongodb_offline_dir_stat.stat.exists + - mongodb_offline_dir_stat.stat.isdir + fail_msg: >- + Offline packages directory {{ mongodb_offline_control_node_root }} does not exist. + Ensure offline packages have been downloaded for + {{ ansible_distribution }} {{ ansible_distribution_major_version }}. + - name: Print MongoDB installation details ansible.builtin.debug: msg: diff --git a/roles/platform/tasks/validate-vars.yml b/roles/platform/tasks/validate-vars.yml index ca149664..d77f4296 100644 --- a/roles/platform/tasks/validate-vars.yml +++ b/roles/platform/tasks/validate-vars.yml @@ -127,6 +127,26 @@ - "Python Platform dependencies: {{ platform_python_app_dependencies }}" when: not offline_install_enabled | bool + - name: Validate offline install directory for the target OS + when: offline_install_enabled | bool + block: + - name: Stat offline packages directory on the control node + ansible.builtin.stat: + path: "{{ platform_offline_control_node_root }}" + register: platform_offline_dir_stat + delegate_to: localhost + become: false + + - name: Assert offline packages directory exists on the control node + ansible.builtin.assert: + that: + - platform_offline_dir_stat.stat.exists + - platform_offline_dir_stat.stat.isdir + fail_msg: >- + Offline packages directory {{ platform_offline_control_node_root }} does not exist. + Ensure offline packages have been downloaded for + {{ ansible_distribution }} {{ ansible_distribution_major_version }}. + - name: Print Itential Platform installation details (offline) ansible.builtin.debug: msg: "Offline install using packages from {{ platform_offline_control_node_root }}" diff --git a/roles/redis/tasks/validate-vars.yml b/roles/redis/tasks/validate-vars.yml index ca38f5bf..64072d63 100644 --- a/roles/redis/tasks/validate-vars.yml +++ b/roles/redis/tasks/validate-vars.yml @@ -114,6 +114,26 @@ msg: "Redis packages: {{ redis_packages }}" when: not redis_install_from_source | bool + - name: Validate offline install directory for the target OS + when: offline_install_enabled | bool + block: + - name: Stat offline packages directory on the control node + ansible.builtin.stat: + path: "{{ redis_offline_control_node_root }}" + register: redis_offline_dir_stat + delegate_to: localhost + become: false + + - name: Assert offline packages directory exists on the control node + ansible.builtin.assert: + that: + - redis_offline_dir_stat.stat.exists + - redis_offline_dir_stat.stat.isdir + fail_msg: >- + Offline packages directory {{ redis_offline_control_node_root }} does not exist. + Ensure offline packages have been downloaded for + {{ ansible_distribution }} {{ ansible_distribution_major_version }}. + - name: Print Redis installation details (offline) ansible.builtin.debug: msg: "Redis offline install using files from {{ redis_offline_control_node_root }}"