TASK [net481 : Check if .net 4.8 is installed] **************************************************************************************************************************************************************************
task path: /etc/ansible/roles/net481/tasks/main.yml:1
[WARNING]: conditional statements should not include jinja2 templating delimiters such as {{ }} or {% %}. Found: ‘4.8’ in {{ script_run }}
fatal: [xxxxx]: FAILED! => {
“msg”: “The conditional check ‘‘4.8’ in {{ script_run }}’ failed. The error was: error while evaluating conditional (‘4.8’ in {{ script_run }}): ‘script_run’ is undefined\n\nThe error appears to be in ‘/etc/ansible/roles/net481/tasks/main.yml’: line 1, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Check if .net 4.8 is installed\n ^ here\n”
}
Role is this:
import_role:
name: net481
when: “‘4.8’ in {{ script_run }}”
Task Ran:
name: Check if .net 4.8 is installed
ansible.windows.win_shell:
(Get-ItemProperty “HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full”).version -lt 4.8
register: script_run - name: Install .net 4.8, if not installed
Bonjour. je suis nouveau dans l’utilisation de ansible. Besoin d’aide
Comment pointer sur la nouvelle version de ansible puisqu’on me dit que ansible2.7.10 est dépassé.
voici le message d’erreur. Je vous remercie.
/home/user-ansible/ansible2.7.10/local/lib/python2.7/site-packages/ansible/parsing/vault/init.py:41: CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in the next release.
from cryptography.exceptions import InvalidSignature
ERROR! - the directory ./apache already exists.you can use --force to re-initialize this directory,
however it will reset any main.yml files that may have
been modified there already.