From 4c55887aa107cdc926ede3ca739de3003aa78a69 Mon Sep 17 00:00:00 2001 From: John Hoyt Date: Thu, 27 Nov 2025 09:29:39 -0500 Subject: [PATCH 1/2] macOS: update ansible_ to ansible_facts to quiet deprecation warnings ansible 2.24 will deprecate INJECT_FACTS_AS_VARS default to 'True' The suggested fix is to use: `ansible_facts["fact_name"]` (no `ansible_` prefix) instead. --- .github/workflows/ansible.yml | 0 roles/mythtv/tasks/homebrew_macosx.yml | 9 +++++++-- roles/mythtv/tasks/macports_macosx.yml | 9 +++++++-- roles/perl/tasks/main.yml | 2 +- 4 files changed, 15 insertions(+), 5 deletions(-) mode change 100644 => 100755 .github/workflows/ansible.yml diff --git a/.github/workflows/ansible.yml b/.github/workflows/ansible.yml old mode 100644 new mode 100755 diff --git a/roles/mythtv/tasks/homebrew_macosx.yml b/roles/mythtv/tasks/homebrew_macosx.yml index 8735a7e..bb659ec 100644 --- a/roles/mythtv/tasks/homebrew_macosx.yml +++ b/roles/mythtv/tasks/homebrew_macosx.yml @@ -60,13 +60,18 @@ set_fact: openssl_path: "{{ pkgmgr_prefix }}/opt/openssl/" +# get the python version specified by user in ansible_python_interpreter or defaulted by the interpreter +- name: Gather specific Python facts + ansible.builtin.shell: "{{ ansible_python_interpreter | default('python3') }} -c 'import sys; print(f\"{sys.version_info.major}.{sys.version_info.minor}\")'" + register: python_version + # python_package_suffix and python_exe_suffix are required to aide in development of the python venv - name: homebrew_macosx | Develop python package version suffixes set_fact: python_package_suffix: - '{{ ansible_python.version.major }}{{ ansible_python.version.minor }}' + "{{ python_version.stdout | replace('.', '') }}" python_exe_suffix: - '{{ ansible_python.version.major }}.{{ ansible_python.version.minor }}' + "{{ python_version.stdout }}" ... diff --git a/roles/mythtv/tasks/macports_macosx.yml b/roles/mythtv/tasks/macports_macosx.yml index 3cbee07..665f65a 100644 --- a/roles/mythtv/tasks/macports_macosx.yml +++ b/roles/mythtv/tasks/macports_macosx.yml @@ -69,14 +69,19 @@ qt_version: qt6 when: qt5 is undefined or not qt5 +# get the python version specified by user in ansible_python_interpreter or defaulted by the interpreter +- name: Gather specific Python facts + ansible.builtin.shell: "{{ ansible_python_interpreter | default('python3') }} -c 'import sys; print(f\"{sys.version_info.major}.{sys.version_info.minor}\")'" + register: python_version + # python_package_suffix and python_exe_suffix are required to install the correct python ports # and to aide in development of the python venv - name: macports_macosx | Develop python package version suffixes set_fact: python_package_suffix: - '{{ ansible_python.version.major }}{{ ansible_python.version.minor }}' + "{{ python_version.stdout | replace('.', '') }}" python_exe_suffix: - '{{ ansible_python.version.major }}.{{ ansible_python.version.minor }}' + "{{ python_version.stdout }}" ... diff --git a/roles/perl/tasks/main.yml b/roles/perl/tasks/main.yml index 0b10454..8e3f846 100644 --- a/roles/perl/tasks/main.yml +++ b/roles/perl/tasks/main.yml @@ -19,7 +19,7 @@ include_tasks: file: '{{ item }}' with_first_found: - - files: '{{ ansible_pkg_mgr }}_{{ distro }}.yml' + - files: '{{ ansible_facts["pkg_mgr"] }}_{{ distro }}.yml' skip: true - name: 'Optionally perform any installation operations' From 35a372c34fac087d6b995b8f7e6fe0ca1bbf817e Mon Sep 17 00:00:00 2001 From: John Hoyt Date: Thu, 27 Nov 2025 19:21:38 -0500 Subject: [PATCH 2/2] macOS: update perl/cpanm mirror Recently cpan.cpantesters.org has started to have download issues. Fix this by moving downloads to metacpan.org --- roles/perl/tasks/cpanm_install.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/roles/perl/tasks/cpanm_install.yml b/roles/perl/tasks/cpanm_install.yml index d8c61aa..eaa29ce 100644 --- a/roles/perl/tasks/cpanm_install.yml +++ b/roles/perl/tasks/cpanm_install.yml @@ -2,12 +2,13 @@ # # install perl modules with ansible's cpanm capabiltiy # +# --mirror 'http://cpan.cpantesters.org/' --- - name: 'cpanm_install | Install perl modules' become: false command: cpanm - --mirror 'http://cpan.cpantesters.org/' + --mirror 'https://metacpan.org/' --force {{ perl_modules | join(' ') }} ignore_errors: yes