status
stringclasses
1 value
repo_name
stringlengths
9
24
repo_url
stringlengths
28
43
issue_id
int64
1
104k
updated_files
stringlengths
8
1.76k
title
stringlengths
4
369
body
stringlengths
0
254k
issue_url
stringlengths
37
56
pull_url
stringlengths
37
54
before_fix_sha
stringlengths
40
40
after_fix_sha
stringlengths
40
40
report_datetime
timestamp[ns, tz=UTC]
language
stringclasses
5 values
commit_datetime
timestamp[us, tz=UTC]
closed
ansible/ansible
https://github.com/ansible/ansible
78,195
["lib/ansible/plugins/become/runas.py", "lib/ansible/plugins/become/su.py", "lib/ansible/plugins/become/sudo.py"]
Become plugins have wrong pluralization in description
### Summary Builtin become module descriptions start "This become plugins allows", the plural "plugins" is not consistant with the rest of the sentance. PR incoming. ### Issue Type Documentation Report ### Component Name lib/ansible/plugins/become/ ### Ansible Version ```console $ ansible --version [WARNING]: You are running the development version of Ansible. You should only run Ansible from "devel" if you are modifying the Ansible engine, or trying out features under development. This is a rapidly changing source of code and can become unstable at any point. ansible [core 2.14.0.dev0] config file = /Users/alex/.ansible.cfg configured module search path = ['/Users/alex/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /Users/alex/src/ansible/v/lib/python3.10/site-packages/ansible ansible collection location = /Users/alex/.ansible/collections:/usr/share/ansible/collections executable location = v/bin/ansible python version = 3.10.5 (main, Jun 23 2022, 17:14:57) [Clang 13.1.6 (clang-1316.0.21.2.5)] (/Users/alex/src/ansible/v/bin/python) jinja version = 3.1.2 libyaml = True ``` ### Configuration ```console # if using a version older than ansible-core 2.12 you should omit the '-t all' $ ansible-config dump --only-changed -t all [WARNING]: You are running the development version of Ansible. You should only run Ansible from "devel" if you are modifying the Ansible engine, or trying out features under development. This is a rapidly changing source of code and can become unstable at any point. CONFIG_FILE() = /Users/alex/.ansible.cfg GALAXY_SERVER_LIST(/Users/alex/.ansible.cfg) = ['release_galaxy'] ``` ### OS / Environment macOS 12.4 Darwin kintha 21.5.0 Darwin Kernel Version 21.5.0: Tue Apr 26 21:08:37 PDT 2022; root:xnu-8020.121.3~4/RELEASE_ARM64_T6000 arm64 ### Additional Information The sentances will be grammatically correct. ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/78195
https://github.com/ansible/ansible/pull/78196
7ec8916097a4c4281215c127c80ed07c5b0b370d
e10851d495fd073e22bdd78ec45a1f8019604b35
2022-07-03T21:02:18Z
python
2022-07-05T15:19:39Z
closed
ansible/ansible
https://github.com/ansible/ansible
78,193
["changelogs/fragments/dnf-fix-locale-language.yml", "lib/ansible/modules/dnf.py"]
dnf: "No packages match" filter ignored on non-English locales
### Summary Removing a wildcard package using a non-English locale produces a failure that is normally filtered out when `en_*` locale is set. This issue was originally tested against Ansible 2.9.27 on Alma 8. For the sake of thoroughness in this bug report, it's tested against devel. Error looks to be related to filtering in [ _sanitize_dnf_error_msg_remove](https://github.com/ansible/ansible/blob/7ec8916097a4c4281215c127c80ed07c5b0b370d/lib/ansible/modules/dnf.py#L422) method in dnf.py. ### Issue Type Bug Report ### Component Name dnf ### Ansible Version ```console $ ansible --version ansible [core 2.14.0.dev0] config file = /etc/ansible/ansible.cfg configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /root/ansible/build/lib/ansible ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections executable location = ./bin/ansible python version = 3.9.12 (05fbe3aa5b0845e6c37239768aa455451aa5faba, Mar 29 2022, 08:15:34)[PyPy 7.3.9 with GCC 10.2.1 20210130 (Red Hat 10.2.1-11)] (/usr/local/share/python/pyenv/versions/pypy3.9-7.3.9/bin/python) jinja version = 3.1.2 libyaml = True ``` ``` ### Configuration ```console # if using a version older than ansible-core 2.12 you should omit the '-t all' $ ansible-config dump --only-changed -t all CONFIG_FILE() = /etc/ansible/ansible.cfg ``` ``` ### OS / Environment Rocky Linux 8.6 ### Steps to Reproduce <!--- Paste example playbooks or commands between quotes below --> ```bash dnf install -y glibc-langpack-de env LANGUAGE=de_DE PYTHONPATH=$(pwd)/build/lib ./bin/ansible -m dnf -a "name=foo* state=absent" localhost ``` ### Expected Results ```bash # env LANGUAGE=de_DE PYTHONPATH=$(pwd)/build/lib ./bin/ansible -m dnf -a "name=foo* state=absent" localhost [WARNING]: You are running the development version of Ansible. You should only run Ansible from "devel" if you are modifying the Ansible engine, or trying out features under development. This is a rapidly changing source of code and can become unstable at any point. localhost | SUCCESS => { "changed": false, "msg": "Nothing to do", "rc": 0, "results": [ "foo* is not installed" ] } ``` ### Actual Results ```console # env LANGUAGE=de_DE PYTHONPATH=$(pwd)/build/lib ./bin/ansible -m dnf -a "name=foo* state=absent" localhost ansible [core 2.14.0.dev0] config file = /etc/ansible/ansible.cfg configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /root/ansible/build/lib/ansible ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections executable location = ./bin/ansible python version = 3.9.12 (05fbe3aa5b0845e6c37239768aa455451aa5faba, Mar 29 2022, 08:15:34)[PyPy 7.3.9 with GCC 10.2.1 20210130 (Red Hat 10.2.1-11)] (/usr/local/share/python/pyenv/versions/pypy3.9-7.3.9/bin/python) jinja version = 3.1.2 libyaml = True Using /etc/ansible/ansible.cfg as config file setting up inventory plugins host_list declined parsing /etc/ansible/hosts as it did not pass its verify_file() method script declined parsing /etc/ansible/hosts as it did not pass its verify_file() method auto declined parsing /etc/ansible/hosts as it did not pass its verify_file() method Parsed /etc/ansible/hosts inventory source with ini plugin Loading callback plugin minimal of type stdout, v2.0 from /root/ansible/build/lib/ansible/plugins/callback/minimal.py Skipping callback 'default', as we already have a stdout callback. Skipping callback 'minimal', as we already have a stdout callback. Skipping callback 'oneline', as we already have a stdout callback. META: ran handlers <127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: root <127.0.0.1> EXEC /bin/sh -c 'echo ~root && sleep 0' <127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /root/.ansible/tmp `"&& mkdir "` echo /root/.ansible/tmp/ansible-tmp-1656872847.309763-1625687-262384129527042 `" && echo ansible-tmp-1656872847.309763-1625687-262384129527042="` echo /root/.ansible/tmp/ansible-tmp-1656872847.309763-1625687-262384129527042 `" ) && sleep 0' Using module file /root/ansible/build/lib/ansible/modules/dnf.py <127.0.0.1> PUT /root/.ansible/tmp/ansible-local-1625641dm2mqnnl/tmpz76lr8y_ TO /root/.ansible/tmp/ansible-tmp-1656872847.309763-1625687-262384129527042/AnsiballZ_dnf.py <127.0.0.1> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1656872847.309763-1625687-262384129527042/ /root/.ansible/tmp/ansible-tmp-1656872847.309763-1625687-262384129527042/AnsiballZ_dnf.py && sleep 0' <127.0.0.1> EXEC /bin/sh -c '/usr/local/share/python/pyenv/versions/pypy3.9-7.3.9/bin/python /root/.ansible/tmp/ansible-tmp-1656872847.309763-1625687-262384129527042/AnsiballZ_dnf.py && sleep 0' <127.0.0.1> EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-tmp-1656872847.309763-1625687-262384129527042/ > /dev/null 2>&1 && sleep 0' localhost | FAILED! => { "changed": false, "failures": [ "foo* - Keine �bereinstimmung f�r Argumente: foo*" ], "invocation": { "module_args": { "allow_downgrade": false, "allowerasing": false, "autoremove": false, "bugfix": false, "cacheonly": false, "conf_file": null, "disable_excludes": null, "disable_gpg_check": false, "disable_plugin": [], "disablerepo": [], "download_dir": null, "download_only": false, "enable_plugin": [], "enablerepo": [], "exclude": [], "install_repoquery": true, "install_weak_deps": true, "installroot": "/", "list": null, "lock_timeout": 30, "name": [ "foo*" ], "nobest": false, "releasever": null, "security": false, "skip_broken": false, "sslverify": true, "state": "absent", "update_cache": false, "update_only": false, "validate_certs": true } }, "msg": "Failed to install some of the specified packages", "rc": 1, "results": [] } ``` ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/78193
https://github.com/ansible/ansible/pull/78233
b1dd2af4cac9df517ce8216eaa97e66c0b15d90a
630616103eaf1d19918725f9c9d2e541d58e5ade
2022-07-03T18:34:48Z
python
2022-07-12T07:10:25Z
closed
ansible/ansible
https://github.com/ansible/ansible
78,187
["docs/docsite/rst/user_guide/intro_adhoc.rst"]
Add note about package managers
### Summary Recent user noted they had to dig into the source code to realize a package manager module didn't support all the plugins of that package manager. While each module should note this, we can also mention it at: https://docs.ansible.com/ansible/latest/user_guide/intro_adhoc.html#managing-packages ### Issue Type Documentation Report ### Component Name docs/docsite/rst/user_guide/intro_adhoc.rst ### Ansible Version ```console $ ansible --version 2.14 ``` ### Configuration ```console # if using a version older than ansible-core 2.12 you should omit the '-t all' $ ansible-config dump --only-changed -t all none ``` ### OS / Environment none ### Additional Information none ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/78187
https://github.com/ansible/ansible/pull/78260
0590ce065ce51c208bce863365fa981cd931ce93
fedd3869987d9b3aa123622355ae9160a5594198
2022-07-01T15:39:47Z
python
2022-07-14T17:10:24Z
closed
ansible/ansible
https://github.com/ansible/ansible
78,178
["changelogs/fragments/atomic_cache_files.yml", "lib/ansible/plugins/cache/__init__.py"]
Unexpected Exception: The object retrieved for localhost must be a MutableMapping but was a <class 'NoneType'>
### Summary Ansible is running in a nightly CI, but recently we're seeing this exception popping up randonly: ``` 2022-06-30 20:57:35,092 p=226 u=psap-ci-runner n=ansible | ERROR! Unexpected Exception, this is probably a bug: The object retrieved for localhost must be a MutableMapping but was a <class 'NoneType'> 2022-06-30 20:57:35,093 p=226 u=psap-ci-runner n=ansible | to see the full traceback, use -vvv 2022-06-30 20:57:35,094 p=226 u=psap-ci-runner n=ansible | the full traceback was: Traceback (most recent call last): File "/opt/venv/bin/ansible-playbook", line 123, in <module> exit_code = cli.run() File "/opt/venv/lib/python3.9/site-packages/ansible/cli/playbook.py", line 128, in run results = pbex.run() File "/opt/venv/lib/python3.9/site-packages/ansible/executor/playbook_executor.py", line 169, in run result = self._tqm.run(play=play) File "/opt/venv/lib/python3.9/site-packages/ansible/executor/task_queue_manager.py", line 282, in run play_return = strategy.run(iterator, play_context) File "/opt/venv/lib/python3.9/site-packages/ansible/plugins/strategy/linear.py", line 326, in run results += self._wait_on_pending_results(iterator) File "/opt/venv/lib/python3.9/site-packages/ansible/plugins/strategy/__init__.py", line 810, in _wait_on_pending_results results = self._process_pending_results(iterator) File "/opt/venv/lib/python3.9/site-packages/ansible/plugins/strategy/__init__.py", line 133, in inner results = func(self, iterator, one_pass=one_pass, max_passes=max_passes, do_handlers=do_handlers) File "/opt/venv/lib/python3.9/site-packages/ansible/plugins/strategy/__init__.py", line 698, in _process_pending_results self._variable_manager.set_host_facts(target_host, result_item['ansible_facts'].copy()) File "/opt/venv/lib/python3.9/site-packages/ansible/vars/manager.py", line 628, in set_host_facts raise TypeError('The object retrieved for {0} must be a MutableMapping but was' TypeError: The object retrieved for localhost must be a MutableMapping but was a <class 'NoneType'> ``` It's certainly coming from [this part of the code](https://github.com/ansible/ansible/blob/b56d73796e85f162d50b4fcd5930035183032d4a/lib/ansible/vars/manager.py#L671): ``` if not isinstance(host_cache, MutableMapping): raise TypeError('The object retrieved for {0} must be a MutableMapping but was' ' a {1}'.format(host, type(host_cache))) ``` This always happens in the first tasks (but not the first), see the [playbook logs stored there](https://gcsweb-ci.apps.ci.l2s4.p1.openshiftapps.com/gcs/origin-ci-test/pr-logs/pull/openshift-psap_ci-artifacts/404/pull-ci-openshift-psap-ci-artifacts-master-ods-jh-on-ocp/1542599037834760192/artifacts/jh-on-ocp/test/artifacts/001__sutest_rhods__deploy_ldap/_ansible.log). ### Issue Type Bug Report ### Component Name ansible-playbook ### Ansible Version ```console # running from a nightly build container, installed with Pip with `ansible==2.9.*` ansible 2.9.27 config file = /etc/ansible/ansible.cfg configured module search path = ['/opt/ci-artifacts/src/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /opt/venv/lib/python3.9/site-packages/ansible executable location = /opt/venv/bin/ansible python version = 3.9.7 (default, Sep 13 2021, 08:18:39) [GCC 8.5.0 20210514 (Red Hat 8.5.0-3)] ``` ### Configuration ```console # if using a version older than ansible-core 2.12 you should omit the '-t all' $ ansible-config dump --only-changed -t all ANSIBLE_NOCOWS(/etc/ansible/ansible.cfg) = True CACHE_PLUGIN(/etc/ansible/ansible.cfg) = yaml CACHE_PLUGIN_CONNECTION(env: ANSIBLE_CACHE_PLUGIN_CONNECTION) = /logs/artifacts/ansible_facts CACHE_PLUGIN_TIMEOUT(/etc/ansible/ansible.cfg) = 0 DEFAULT_CALLBACK_PLUGIN_PATH(/etc/ansible/ansible.cfg) = ['/opt/ci-artifacts/src/callback_plugins'] DEFAULT_FORKS(/etc/ansible/ansible.cfg) = 20 DEFAULT_GATHERING(/etc/ansible/ansible.cfg) = smart DEFAULT_HOST_LIST(/etc/ansible/ansible.cfg) = ['/etc/ansible/inventory/hosts'] DEFAULT_LOG_PATH(env: ANSIBLE_LOG_PATH) = /logs/artifacts/000__/_ansible.log DEFAULT_REMOTE_USER(/etc/ansible/ansible.cfg) = root DEFAULT_ROLES_PATH(/etc/ansible/ansible.cfg) = ['/opt/ci-artifacts/roles'] DEFAULT_STDOUT_CALLBACK(/etc/ansible/ansible.cfg) = human_log DEFAULT_TIMEOUT(/etc/ansible/ansible.cfg) = 30 ENABLE_TASK_DEBUGGER(/etc/ansible/ansible.cfg) = False HOST_KEY_CHECKING(/etc/ansible/ansible.cfg) = False INVENTORY_IGNORE_EXTS(/etc/ansible/ansible.cfg) = ['secrets.py', '.pyc', '.cfg', '.crt', '.ini'] INVENTORY_UNPARSED_IS_FAILED(/etc/ansible/ansible.cfg) = True RETRY_FILES_ENABLED(/etc/ansible/ansible.cfg) = False RETRY_FILES_SAVE_PATH(/etc/ansible/ansible.cfg) = /tmp/ansible-installer-retries ``` ### OS / Environment OpenShift / Red Hat UBI 8 ### Steps to Reproduce happens randomly ### Expected Results The first steps of our playbooks (the `check_deps` role) are as follows, when Ansible doesn't crash. [Example](https://gcsweb-ci.apps.ci.l2s4.p1.openshiftapps.com/gcs/origin-ci-test/pr-logs/pull/openshift-psap_ci-artifacts/404/pull-ci-openshift-psap-ci-artifacts-master-ods-jh-on-ocp/1542599037834760192/artifacts/jh-on-ocp/test/artifacts/000__sutest_rhods__deploy_ods/_ansible.log): ``` 2022-06-30 20:57:34,290 p=225 u=psap-ci-runner n=ansible | ansible-playbook 2.9.27 config file = /etc/ansible/ansible.cfg configured module search path = ['/opt/ci-artifacts/src/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /opt/venv/lib/python3.9/site-packages/ansible executable location = /opt/venv/bin/ansible-playbook python version = 3.9.7 (default, Sep 13 2021, 08:18:39) [GCC 8.5.0 20210514 (Red Hat 8.5.0-3)] 2022-06-30 20:57:34,290 p=225 u=psap-ci-runner n=ansible | Using /etc/ansible/ansible.cfg as config file 2022-06-30 20:57:34,547 p=225 u=psap-ci-runner n=ansible | Skipping callback 'actionable', as we already have a stdout callback. 2022-06-30 20:57:34,547 p=225 u=psap-ci-runner n=ansible | Skipping callback 'counter_enabled', as we already have a stdout callback. 2022-06-30 20:57:34,547 p=225 u=psap-ci-runner n=ansible | Skipping callback 'debug', as we already have a stdout callback. 2022-06-30 20:57:34,547 p=225 u=psap-ci-runner n=ansible | Skipping callback 'dense', as we already have a stdout callback. 2022-06-30 20:57:34,547 p=225 u=psap-ci-runner n=ansible | Skipping callback 'dense', as we already have a stdout callback. 2022-06-30 20:57:34,547 p=225 u=psap-ci-runner n=ansible | Skipping callback 'full_skip', as we already have a stdout callback. 2022-06-30 20:57:34,547 p=225 u=psap-ci-runner n=ansible | Skipping callback 'human_log', as we already have a stdout callback. 2022-06-30 20:57:34,547 p=225 u=psap-ci-runner n=ansible | Skipping callback 'json', as we already have a stdout callback. 2022-06-30 20:57:34,548 p=225 u=psap-ci-runner n=ansible | Skipping callback 'minimal', as we already have a stdout callback. 2022-06-30 20:57:34,548 p=225 u=psap-ci-runner n=ansible | Skipping callback 'null', as we already have a stdout callback. 2022-06-30 20:57:34,548 p=225 u=psap-ci-runner n=ansible | Skipping callback 'oneline', as we already have a stdout callback. 2022-06-30 20:57:34,548 p=225 u=psap-ci-runner n=ansible | Skipping callback 'selective', as we already have a stdout callback. 2022-06-30 20:57:34,548 p=225 u=psap-ci-runner n=ansible | Skipping callback 'skippy', as we already have a stdout callback. 2022-06-30 20:57:34,548 p=225 u=psap-ci-runner n=ansible | Skipping callback 'stderr', as we already have a stdout callback. 2022-06-30 20:57:34,548 p=225 u=psap-ci-runner n=ansible | Skipping callback 'unixy', as we already have a stdout callback. 2022-06-30 20:57:34,548 p=225 u=psap-ci-runner n=ansible | Skipping callback 'yaml', as we already have a stdout callback. 2022-06-30 20:57:34,549 p=225 u=psap-ci-runner n=ansible | PLAYBOOK: tmpa2h6yqh5 ********************************************************** 2022-06-30 20:57:34,549 p=225 u=psap-ci-runner n=ansible | 1 plays in /opt/ci-artifacts/src/tmpa2h6yqh5 2022-06-30 20:57:34,551 p=225 u=psap-ci-runner n=ansible | PLAY [Run rhods_deploy_ods role] *********************************************** 2022-06-30 20:57:34,558 p=225 u=psap-ci-runner n=ansible | META: ran handlers 2022-06-30 20:57:34,563 p=225 u=psap-ci-runner n=ansible | 2022-06-30 20:57:34,598 p=225 u=psap-ci-runner n=ansible | --- 2022-06-30 20:57:34,598 p=225 u=psap-ci-runner n=ansible | 2022-06-30 20:57:34,598 p=225 u=psap-ci-runner n=ansible | 2022-06-30 20:57:34,598 p=225 u=psap-ci-runner n=ansible | --- 2022-06-30 20:57:34,599 p=225 u=psap-ci-runner n=ansible | roles/check_deps/tasks/main.yml:2 2022-06-30 20:57:34,599 p=225 u=psap-ci-runner n=ansible | TASK: check_deps : Fail if artifact_dir is not defined 2022-06-30 20:57:34,599 p=225 u=psap-ci-runner n=ansible | ==> SKIPPED | Conditional result was False 2022-06-30 20:57:34,599 p=225 u=psap-ci-runner n=ansible | when: artifact_dir is undefined 2022-06-30 20:57:34,601 p=225 u=psap-ci-runner n=ansible | 2022-06-30 20:57:34,630 p=225 u=psap-ci-runner n=ansible | --- 2022-06-30 20:57:34,630 p=225 u=psap-ci-runner n=ansible | 2022-06-30 20:57:34,631 p=225 u=psap-ci-runner n=ansible | 2022-06-30 20:57:34,631 p=225 u=psap-ci-runner n=ansible | --- 2022-06-30 20:57:34,631 p=225 u=psap-ci-runner n=ansible | roles/check_deps/tasks/main.yml:6 2022-06-30 20:57:34,631 p=225 u=psap-ci-runner n=ansible | TASK: check_deps : Fail if artifact_extra_logs_dir is not defined 2022-06-30 20:57:34,631 p=225 u=psap-ci-runner n=ansible | ==> SKIPPED | Conditional result was False 2022-06-30 20:57:34,631 p=225 u=psap-ci-runner n=ansible | when: artifact_extra_logs_dir is undefined 2022-06-30 20:57:34,634 p=225 u=psap-ci-runner n=ansible | 2022-06-30 20:57:35,093 p=225 u=psap-ci-runner n=ansible | --- 2022-06-30 20:57:35,093 p=225 u=psap-ci-runner n=ansible | 2022-06-30 20:57:35,093 p=225 u=psap-ci-runner n=ansible | 2022-06-30 20:57:35,093 p=225 u=psap-ci-runner n=ansible | --- 2022-06-30 20:57:35,093 p=225 u=psap-ci-runner n=ansible | roles/check_deps/tasks/main.yml:10 2022-06-30 20:57:35,093 p=225 u=psap-ci-runner n=ansible | TASK: check_deps : Create the artifact_extra_logs_dir directory 2022-06-30 20:57:35,093 p=225 u=psap-ci-runner n=ansible | - path: /logs/artifacts/000__sutest_rhods__deploy_ods 2022-06-30 20:57:35,094 p=225 u=psap-ci-runner n=ansible | - diff 2022-06-30 20:57:35,094 p=225 u=psap-ci-runner n=ansible | - before 2022-06-30 20:57:35,094 p=225 u=psap-ci-runner n=ansible | - path: /logs/artifacts/000__sutest_rhods__deploy_ods 2022-06-30 20:57:35,094 p=225 u=psap-ci-runner n=ansible | - mode: 02755 2022-06-30 20:57:35,094 p=225 u=psap-ci-runner n=ansible | - after 2022-06-30 20:57:35,094 p=225 u=psap-ci-runner n=ansible | - path: /logs/artifacts/000__sutest_rhods__deploy_ods 2022-06-30 20:57:35,094 p=225 u=psap-ci-runner n=ansible | - mode: 0755 2022-06-30 20:57:35,094 p=225 u=psap-ci-runner n=ansible | - uid: 1008050000 2022-06-30 20:57:35,094 p=225 u=psap-ci-runner n=ansible | - gid: 1008050000 2022-06-30 20:57:35,094 p=225 u=psap-ci-runner n=ansible | - owner: 1008050000 2022-06-30 20:57:35,094 p=225 u=psap-ci-runner n=ansible | - group: 1008050000 2022-06-30 20:57:35,094 p=225 u=psap-ci-runner n=ansible | - mode: 0755 2022-06-30 20:57:35,095 p=225 u=psap-ci-runner n=ansible | - state: directory 2022-06-30 20:57:35,095 p=225 u=psap-ci-runner n=ansible | - size: 85 2022-06-30 20:57:35,098 p=225 u=psap-ci-runner n=ansible | 2022-06-30 20:57:35,741 p=225 u=psap-ci-runner n=ansible | --- ``` ### Actual Results ```console https://gcsweb-ci.apps.ci.l2s4.p1.openshiftapps.com/gcs/origin-ci-test/pr-logs/pull/openshift-psap_ci-artifacts/404/pull-ci-openshift-psap-ci-artifacts-master-ods-jh-on-ocp/1542599037834760192/artifacts/jh-on-ocp/test/artifacts/001__sutest_rhods__deploy_ldap/_ansible.log 2022-06-30 20:57:34,290 p=226 u=psap-ci-runner n=ansible | ansible-playbook 2.9.27 config file = /etc/ansible/ansible.cfg configured module search path = ['/opt/ci-artifacts/src/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /opt/venv/lib/python3.9/site-packages/ansible executable location = /opt/venv/bin/ansible-playbook python version = 3.9.7 (default, Sep 13 2021, 08:18:39) [GCC 8.5.0 20210514 (Red Hat 8.5.0-3)] 2022-06-30 20:57:34,290 p=226 u=psap-ci-runner n=ansible | Using /etc/ansible/ansible.cfg as config file 2022-06-30 20:57:34,571 p=226 u=psap-ci-runner n=ansible | Skipping callback 'actionable', as we already have a stdout callback. 2022-06-30 20:57:34,571 p=226 u=psap-ci-runner n=ansible | Skipping callback 'counter_enabled', as we already have a stdout callback. 2022-06-30 20:57:34,571 p=226 u=psap-ci-runner n=ansible | Skipping callback 'debug', as we already have a stdout callback. 2022-06-30 20:57:34,571 p=226 u=psap-ci-runner n=ansible | Skipping callback 'dense', as we already have a stdout callback. 2022-06-30 20:57:34,571 p=226 u=psap-ci-runner n=ansible | Skipping callback 'dense', as we already have a stdout callback. 2022-06-30 20:57:34,571 p=226 u=psap-ci-runner n=ansible | Skipping callback 'full_skip', as we already have a stdout callback. 2022-06-30 20:57:34,571 p=226 u=psap-ci-runner n=ansible | Skipping callback 'human_log', as we already have a stdout callback. 2022-06-30 20:57:34,572 p=226 u=psap-ci-runner n=ansible | Skipping callback 'json', as we already have a stdout callback. 2022-06-30 20:57:34,572 p=226 u=psap-ci-runner n=ansible | Skipping callback 'minimal', as we already have a stdout callback. 2022-06-30 20:57:34,572 p=226 u=psap-ci-runner n=ansible | Skipping callback 'null', as we already have a stdout callback. 2022-06-30 20:57:34,572 p=226 u=psap-ci-runner n=ansible | Skipping callback 'oneline', as we already have a stdout callback. 2022-06-30 20:57:34,572 p=226 u=psap-ci-runner n=ansible | Skipping callback 'selective', as we already have a stdout callback. 2022-06-30 20:57:34,572 p=226 u=psap-ci-runner n=ansible | Skipping callback 'skippy', as we already have a stdout callback. 2022-06-30 20:57:34,572 p=226 u=psap-ci-runner n=ansible | Skipping callback 'stderr', as we already have a stdout callback. 2022-06-30 20:57:34,572 p=226 u=psap-ci-runner n=ansible | Skipping callback 'unixy', as we already have a stdout callback. 2022-06-30 20:57:34,572 p=226 u=psap-ci-runner n=ansible | Skipping callback 'yaml', as we already have a stdout callback. 2022-06-30 20:57:34,572 p=226 u=psap-ci-runner n=ansible | PLAYBOOK: tmpyhukbfg0 ********************************************************** 2022-06-30 20:57:34,572 p=226 u=psap-ci-runner n=ansible | 1 plays in /opt/ci-artifacts/src/tmpyhukbfg0 2022-06-30 20:57:34,575 p=226 u=psap-ci-runner n=ansible | PLAY [Run rhods_deploy_ldap role] ********************************************** 2022-06-30 20:57:34,584 p=226 u=psap-ci-runner n=ansible | META: ran handlers 2022-06-30 20:57:34,588 p=226 u=psap-ci-runner n=ansible | 2022-06-30 20:57:34,623 p=226 u=psap-ci-runner n=ansible | --- 2022-06-30 20:57:34,623 p=226 u=psap-ci-runner n=ansible | 2022-06-30 20:57:34,623 p=226 u=psap-ci-runner n=ansible | 2022-06-30 20:57:34,623 p=226 u=psap-ci-runner n=ansible | --- 2022-06-30 20:57:34,623 p=226 u=psap-ci-runner n=ansible | roles/check_deps/tasks/main.yml:2 2022-06-30 20:57:34,623 p=226 u=psap-ci-runner n=ansible | TASK: check_deps : Fail if artifact_dir is not defined 2022-06-30 20:57:34,623 p=226 u=psap-ci-runner n=ansible | ==> SKIPPED | Conditional result was False 2022-06-30 20:57:34,623 p=226 u=psap-ci-runner n=ansible | when: artifact_dir is undefined 2022-06-30 20:57:34,626 p=226 u=psap-ci-runner n=ansible | 2022-06-30 20:57:34,658 p=226 u=psap-ci-runner n=ansible | --- 2022-06-30 20:57:34,659 p=226 u=psap-ci-runner n=ansible | 2022-06-30 20:57:34,659 p=226 u=psap-ci-runner n=ansible | 2022-06-30 20:57:34,659 p=226 u=psap-ci-runner n=ansible | --- 2022-06-30 20:57:34,659 p=226 u=psap-ci-runner n=ansible | roles/check_deps/tasks/main.yml:6 2022-06-30 20:57:34,659 p=226 u=psap-ci-runner n=ansible | TASK: check_deps : Fail if artifact_extra_logs_dir is not defined 2022-06-30 20:57:34,659 p=226 u=psap-ci-runner n=ansible | ==> SKIPPED | Conditional result was False 2022-06-30 20:57:34,659 p=226 u=psap-ci-runner n=ansible | when: artifact_extra_logs_dir is undefined 2022-06-30 20:57:34,663 p=226 u=psap-ci-runner n=ansible | 2022-06-30 20:57:35,092 p=226 u=psap-ci-runner n=ansible | ERROR! Unexpected Exception, this is probably a bug: The object retrieved for localhost must be a MutableMapping but was a <class 'NoneType'> 2022-06-30 20:57:35,093 p=226 u=psap-ci-runner n=ansible | to see the full traceback, use -vvv 2022-06-30 20:57:35,094 p=226 u=psap-ci-runner n=ansible | the full traceback was: Traceback (most recent call last): File "/opt/venv/bin/ansible-playbook", line 123, in <module> exit_code = cli.run() File "/opt/venv/lib/python3.9/site-packages/ansible/cli/playbook.py", line 128, in run results = pbex.run() File "/opt/venv/lib/python3.9/site-packages/ansible/executor/playbook_executor.py", line 169, in run result = self._tqm.run(play=play) File "/opt/venv/lib/python3.9/site-packages/ansible/executor/task_queue_manager.py", line 282, in run play_return = strategy.run(iterator, play_context) File "/opt/venv/lib/python3.9/site-packages/ansible/plugins/strategy/linear.py", line 326, in run results += self._wait_on_pending_results(iterator) File "/opt/venv/lib/python3.9/site-packages/ansible/plugins/strategy/__init__.py", line 810, in _wait_on_pending_results results = self._process_pending_results(iterator) File "/opt/venv/lib/python3.9/site-packages/ansible/plugins/strategy/__init__.py", line 133, in inner results = func(self, iterator, one_pass=one_pass, max_passes=max_passes, do_handlers=do_handlers) File "/opt/venv/lib/python3.9/site-packages/ansible/plugins/strategy/__init__.py", line 698, in _process_pending_results self._variable_manager.set_host_facts(target_host, result_item['ansible_facts'].copy()) File "/opt/venv/lib/python3.9/site-packages/ansible/vars/manager.py", line 628, in set_host_facts raise TypeError('The object retrieved for {0} must be a MutableMapping but was' TypeError: The object retrieved for localhost must be a MutableMapping but was a <class 'NoneType'> ``` ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/78178
https://github.com/ansible/ansible/pull/78208
e10851d495fd073e22bdd78ec45a1f8019604b35
f6419a53f6e954e5fae8cd3102619dadb6938272
2022-07-01T06:48:54Z
python
2022-07-07T17:50:49Z
closed
ansible/ansible
https://github.com/ansible/ansible
78,169
["test/units/galaxy/test_collection_install.py"]
Test failure on systems where bin==sbin
### Summary With ansible-core 2.13 out, I wanted to finally reenable running tests for Ansible when packaging it for Voidlinux, which we couldn't on 2.12 due to Python 3.10 support missing. Now that I've reenabled the tests, I'm having trouble running them though. The problem seems to be that Voidlinux ships with `/bin`, `/sbin`, and `/usr/sbin` linked to `/usr/bin`, while the test assumes that setting `PATH=""` is enough to make sure that `get_bin_path` can't find `git`. Problem is: `get_bin_path` looks in `PATH`, but also explicitly adds `/sbin`, `/usr/sbin` and `/usr/local/sbin` (see https://github.com/ansible/ansible/blob/v2.13.1/lib/ansible/module_utils/common/process.py#L12-L44). Thus, it finds a git executable, and the error message that the tests wants to be triggered isn't actually triggered. ``` =================================== FAILURES =================================== _______________ test_concrete_artifact_manager_scm_no_executable _______________ [gw6] linux -- Python 3.10.5 /usr/bin/python monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7f7dff16e110> def test_concrete_artifact_manager_scm_no_executable(monkeypatch): url = 'https://github.com/org/repo' version = 'commitish' mock_subprocess_check_call = MagicMock() monkeypatch.setattr(collection.concrete_artifact_manager.subprocess, 'check_call', mock_subprocess_check_call) mock_mkdtemp = MagicMock(return_value='') monkeypatch.setattr(collection.concrete_artifact_manager, 'mkdtemp', mock_mkdtemp) error = re.escape( "Could not find git executable to extract the collection from the Git repository `https://github.com/org/repo`" ) with mock.patch.dict(os.environ, {"PATH": ""}): > with pytest.raises(AnsibleError, match=error): E Failed: DID NOT RAISE <class 'ansible.errors.AnsibleError'> test/units/galaxy/test_collection_install.py:189: Failed - generated xml file: /builddir/ansible-core-2.13.1/test/results/junit/python3.10-controller-units.xml - ``` ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/78169
https://github.com/ansible/ansible/pull/78173
6bcb494f8306615f2b8741dad23529fdcd94626c
1562672bd1d5a6bd300c09112e812ac040893ef6
2022-06-30T11:11:46Z
python
2022-06-30T17:19:44Z
closed
ansible/ansible
https://github.com/ansible/ansible
78,156
["changelogs/fragments/78156-undefined-check-in-finalize.yml", "lib/ansible/template/__init__.py", "lib/ansible/template/native_helpers.py", "test/integration/targets/template/runme.sh", "test/integration/targets/template/undefined_in_import-import.j2", "test/integration/targets/template/undefined_in_import.j2", "test/integration/targets/template/undefined_in_import.yml"]
ansible-core 2.13 ignores error in import in template
### Summary When I do {% import %} in some jinja template and that imported template contains errors or raises an exception, it is just ignored. Before 2.13 I saw the error when running the playbook with the exception from the imported template. With 2.13 it is just ignored and everything is green. At least such mistakes are ignored: `{{ _undefined_name }}`, `{{ {}['missing_attribute'] }}`, but division on zero still yields an error: `{{ 0/0 }}`. I tried different combinations of ansible 2.12 & 2.13 with jinja2 3.0 & 3.1. The problem arises only with ansible 2.13 with both jinja versions. ### Issue Type Bug Report ### Component Name jinja2 ### Ansible Version ```console $ ansible --version ansible [core 2.13.1] config file = /home/user/.ansible.cfg configured module search path = ['/home/user/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /home/user/soft/ansible-test-2.13.1/lib/python3.10/site-packages/ansible ansible collection location = /home/user/.ansible/collections:/usr/share/ansible/collections executable location = ./bin/ansible python version = 3.10.5 (main, Jun 8 2022, 02:00:39) [GCC 10.2.1 20201203] jinja version = 3.1.2 libyaml = True ``` ### Configuration ```console # if using a version older than ansible-core 2.12 you should omit the '-t all' $ ansible-config dump --only-changed -t all ``` ### OS / Environment Void Linux ### Steps to Reproduce <!--- Paste example playbooks or commands between quotes below --> ```yaml (paste below) --- - hosts: localhost connection: local tasks: - name: test template: dest: "test.txt" src: test1.j2 ``` test1.j2: ``` {% import 'test2.j2' as t %} ``` test2.j2: ``` {{ _error }} {{ {}["error"] }} ``` ### Expected Results With ansible 2.12 I get an error: ``` TASK [test] ******************************************************************** An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ansible.errors.AnsibleUndefinedVariable: '_error' is undefined fatal: [localhost]: FAILED! => {"changed": false, "msg": "AnsibleUndefinedVariable: '_error' is undefined"} ``` ### Actual Results ```console $ ansible-playbook -CD test.yml [WARNING]: No inventory was parsed, only implicit localhost is available [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all' PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [test] ******************************************************************** --- before +++ after: /home/user/.ansible/tmp/ansible-local-17138l0v8fvxh/tmpla8gx7_o/test1.j2 @@ -0,0 +1 @@ + changed: [localhost] PLAY RECAP ********************************************************************* localhost : ok=2 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 ``` ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/78156
https://github.com/ansible/ansible/pull/78165
953a86f5a6cc740885021625390dbacf00313200
17d52c8d647c4181922db42c91dc2828cdd79387
2022-06-27T18:52:09Z
python
2022-06-30T19:05:39Z
closed
ansible/ansible
https://github.com/ansible/ansible
78,141
["changelogs/fragments/78141-template-fix-convert_data.yml", "lib/ansible/plugins/lookup/template.py", "lib/ansible/template/__init__.py", "test/integration/targets/template/tasks/main.yml", "test/integration/targets/template/templates/json_macro.j2"]
Results of macros are converted to Python data structures if possible in ansible-core 2.13
### Summary While templating a JSON file where the JSON was created as part of a template (without using `to_json`) and where a macro was used to template some repeated parts, we found out that the generated JSON file was invalid JSON after switching from ansible-core 2.12 to ansible-core 2.13. The problem seems to be that if the output of a macro looks like something that could be a Pyhon `repr()` result, it is converted back to Python datastructures. ### Issue Type Bug Report ### Component Name templar ### Ansible Version ```console 2.13.0 devel branch ``` ### Configuration ```console default ``` ### OS / Environment Linux ### Steps to Reproduce ```.bash ansible localhost -m debug -a "msg='{% macro foo() %}{ "'"'"foo"'"'": "'"'"bar"'"'" }{% endmacro %}Test: {{ foo() }}'" ``` Or as a task: ```.yaml - hosts: localhost tasks: - debug: msg: >- {% macro foo() %}{ "foo": "bar" }{% endmacro %}Test: {{ foo() }} ``` ### Expected Results ``` "Test: {\"foo\": \"bar\"}" ``` ### Actual Results ```console "Test: {'foo': 'bar'}" ``` (This has `'` instead of `"`, so this isn't valid JSON.) ``` ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/78141
https://github.com/ansible/ansible/pull/78259
de810d5799dcd3c74efccf699413a4a50b027785
9afdb7fec199c16b33d356ef8c6ab2a1ef812323
2022-06-24T11:53:48Z
python
2022-07-14T19:14:25Z
closed
ansible/ansible
https://github.com/ansible/ansible
78,131
["changelogs/fragments/apt-remove_allow-change-held-packages.yml", "lib/ansible/modules/apt.py", "test/integration/targets/apt/tasks/apt.yml"]
Implement allow_change_held_packages for remove
### Summary I need to fully purge and then reinstall a number of packages that also have their versions pinned. I was expecting the argument `allow_change_held_packages` to work, but apparently it's only implemented for the `install` side, not the `remove` side. ### Issue Type Feature Idea ### Component Name apt ### Additional Information <!--- Paste example playbooks or commands between quotes below --> ```yaml (paste below) - name: Remove foo ansible.builtin.apt: allow_change_held_packages: yes state: absent name: - foo ``` ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/78131
https://github.com/ansible/ansible/pull/78203
26a477561168cd731c86fb1ceffb0394c81cb0a7
e2450d4886c43528ee8a870cc23cac73afdc6144
2022-06-23T16:31:53Z
python
2022-11-02T16:02:04Z
closed
ansible/ansible
https://github.com/ansible/ansible
78,130
["docs/docsite/rst/user_guide/playbooks_conditionals.rst"]
On Conditionals with imports
### Summary https://docs.ansible.com/ansible/latest/user_guide/playbooks_conditionals.html#conditionals-with-imports says: > Thus if `x` is initially undefined, the `debug` task will be skipped. Please write there down, what will happen with the `debug` task, if `x` is initially defined. ### Issue Type Documentation Report ### Component Name docs/docsite/rst/user_guide/playbooks_conditionals.rst ### Ansible Version ```console Not applicable. ``` ### Configuration ```console Not applicable. ``` ### OS / Environment Not applicable. ### Additional Information Not applicable. ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/78130
https://github.com/ansible/ansible/pull/78138
1562672bd1d5a6bd300c09112e812ac040893ef6
7ec84c511fc5df4a10b4f1b146d0195f690b6a5d
2022-06-23T16:29:17Z
python
2022-06-30T17:51:50Z
closed
ansible/ansible
https://github.com/ansible/ansible
78,112
["changelogs/fragments/78112-adhoc-args-as-json.yml", "docs/docsite/rst/user_guide/intro_adhoc.rst", "lib/ansible/cli/adhoc.py", "test/integration/targets/adhoc/runme.sh"]
Allow ansible -a to parse from json
### Summary Using the adhoc `ansible` cmd parses the value of `-a` uses the key=value splitter. It would be good for it to support parsing from json allowing people to specify nested structures and have the command/win_command/shell/etc modules support extra options outside the hardcoded list at https://github.com/ansible/ansible/blob/e8a77626a3b33832783433817108cbfbb84227ea/lib/ansible/parsing/splitter.py#L91. ### Issue Type Feature Idea ### Component Name ansible ### Additional Information <!--- Paste example playbooks or commands between quotes below --> ```yaml (paste below) ``` ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/78112
https://github.com/ansible/ansible/pull/78114
d8fefba20e8023822749d538db7e69f0fc86710e
ad79c1e0d032eb5dda216055ffc393043de4b380
2022-06-21T19:28:58Z
python
2022-08-03T01:24:12Z
closed
ansible/ansible
https://github.com/ansible/ansible
78,104
["docs/docsite/rst/reference_appendices/glossary.rst"]
Improperly rendered hyperlinks to `galaxy.ansible.com`
### Summary At https://docs.ansible.com/ansible/latest/reference_appendices/glossary.html#term-Collection-name the text behind: See community.general <https://galaxy.ansible.com/community/general>`_ on Galaxy. in the definitions of “community.general (collection)” and “community.network (collection)” is not rendered as hyperlink (so twice not rendered properly). ### Issue Type Documentation Report ### Component Name docs/docsite/rst/reference_appendices/glossary.rst ### Ansible Version ```console Online documentation ``` ### Configuration ```console # if using a version older than ansible-core 2.12 you should omit the '-t all' $ ansible-config dump --only-changed -t all Not applicable ``` ### OS / Environment Not applicable ### Additional Information No additional information ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/78104
https://github.com/ansible/ansible/pull/78152
4594c0c6094fcf801caeef27a5170d39d2207b08
4bd7e50612d4bff228506ea6f419abe2935bb04d
2022-06-21T17:30:19Z
python
2022-06-27T19:46:44Z
closed
ansible/ansible
https://github.com/ansible/ansible
78,076
["docs/docsite/rst/images/ansible_basic.svg"]
Minor change to the getting started diagram
### Summary I was looking through the new Ansible getting started guide and noticed one of the nodes in the diagram has a duplicate label. s/node 2/node 3 ### Issue Type Documentation Report ### Component Name https://github.com/ansible/ansible/blob/devel/docs/docsite/rst/images/ansible_basic.svg ### Ansible Version ```console $ ansible --version ansible [core 2.12.6] config file = /etc/ansible/ansible.cfg configured module search path = ['/home/dnaro/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/lib/python3.10/site-packages/ansible ansible collection location = /home/dnaro/.ansible/collections:/usr/share/ansible/collections executable location = /usr/bin/ansible python version = 3.10.4 (main, Mar 25 2022, 00:00:00) [GCC 12.0.1 20220308 (Red Hat 12.0.1-0)] jinja version = 3.0.3 libyaml = True ``` ### Configuration ```console $ ansible-config dump --only-changed -t all BECOME: ====== CACHE: ===== CALLBACK: ======== CLICONF: ======= CONNECTION: ========== HTTPAPI: ======= INVENTORY: ========= LOOKUP: ====== :...skipping... BECOME: ====== CACHE: ===== CALLBACK: ======== CLICONF: ======= CONNECTION: ========== HTTPAPI: ======= INVENTORY: ========= LOOKUP: ====== NETCONF: :...skipping... BECOME: ====== CACHE: ===== CALLBACK: ======== CLICONF: ======= CONNECTION: ========== HTTPAPI: ======= INVENTORY: ========= LOOKUP: ====== NETCONF: ======= :...skipping... BECOME: ====== CACHE: ===== CALLBACK: ======== CLICONF: ======= CONNECTION: ========== HTTPAPI: ======= INVENTORY: ========= LOOKUP: ====== NETCONF: ======= SHELL: :...skipping... BECOME: ====== CACHE: ===== CALLBACK: ======== CLICONF: ======= CONNECTION: ========== HTTPAPI: ======= INVENTORY: ========= LOOKUP: ====== NETCONF: ======= SHELL: ===== :...skipping... BECOME: ====== CACHE: ===== CALLBACK: ======== CLICONF: ======= CONNECTION: ========== HTTPAPI: ======= INVENTORY: ========= LOOKUP: ====== NETCONF: ======= SHELL: ===== VARS: :...skipping... BECOME: ====== CACHE: ===== CALLBACK: ======== CLICONF: ======= CONNECTION: ========== HTTPAPI: ======= INVENTORY: ========= LOOKUP: ====== NETCONF: ======= SHELL: ===== VARS: ==== (END)...skipping... BECOME: ====== CACHE: ===== CALLBACK: ======== CLICONF: ======= CONNECTION: ========== HTTPAPI: ======= INVENTORY: ========= LOOKUP: ====== NETCONF: ======= SHELL: ===== VARS: ==== ~ (END)...skipping... BECOME: ====== CACHE: ===== CALLBACK: ======== CLICONF: ======= CONNECTION: ========== HTTPAPI: ======= INVENTORY: ========= LOOKUP: ====== NETCONF: ======= SHELL: ===== VARS: ==== ~ ~ (END)...skipping... BECOME: ====== CACHE: ===== CALLBACK: ======== CLICONF: ======= CONNECTION: ========== HTTPAPI: ======= INVENTORY: ========= LOOKUP: ====== NETCONF: ======= SHELL: ===== VARS: ==== ~ ~ ~ (END)...skipping... BECOME: ====== CACHE: ===== CALLBACK: ======== CLICONF: ======= CONNECTION: ========== HTTPAPI: ======= INVENTORY: ========= LOOKUP: ====== NETCONF: ======= SHELL: ===== VARS: ==== ~ ~ ~ ~ (END)...skipping... BECOME: ====== CACHE: ===== CALLBACK: ======== CLICONF: ======= CONNECTION: ========== HTTPAPI: ======= INVENTORY: ========= LOOKUP: ====== NETCONF: ======= SHELL: ===== VARS: ==== ~ ~ ~ ~ ``` ### OS / Environment Fedora 36 ### Additional Information It corrects something that is wrong. ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/78076
https://github.com/ansible/ansible/pull/78077
3e3f8cb00414da85805f97e132145af625026c5a
59f3f1b625281d8948aabc2aa1373b22e6428ba9
2022-06-17T09:21:18Z
python
2022-06-23T18:30:41Z
closed
ansible/ansible
https://github.com/ansible/ansible
78,073
["docs/docsite/rst/community/contributions_collections.rst"]
Add tutorial links to the docs
### Summary We have some great tutorials for community folks to use here: https://www.ansible.com/products/ansible-community-training We should add them to the docs :-) Since most are focused on the developer experience, especially collections, we can add them to: https://docs.ansible.com/ansible/devel/community/contributions_collections.html ### Issue Type Documentation Report ### Component Name docs/docsite/rst/community/contributions_collections.rst ### Ansible Version ```console $ ansible --version 2.14 ``` ### Configuration ```console # if using a version older than ansible-core 2.12 you should omit the '-t all' $ ansible-config dump --only-changed -t all none ``` ### OS / Environment none ### Additional Information none ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/78073
https://github.com/ansible/ansible/pull/78084
ea351f0ae2bca23cdd7c24547a6607a50186a116
717f178870529ce222a752845dc295ad6f5ee874
2022-06-16T21:00:32Z
python
2022-06-17T18:20:07Z
closed
ansible/ansible
https://github.com/ansible/ansible
78,069
["lib/ansible/modules/dnf.py"]
ansible/builtin/dnf_module: Parameters document "list" but no examples given
### Summary in ansible/builtin/dnf_module in the parameter section the parameter `list` is documented with > "Various (non-idempotent) commands for usage with /usr/bin/ansible and not playbooks. See examples." but there are no examples given for the usage of this parameter ### Issue Type Documentation Report ### Component Name collections/ansible/builtin/dnf_module ### Ansible Version ```console this is a documentation bug in the recent online version and its regardless of my running ansible version. See: https://docs.ansible.com/ansible/latest/collections/ansible/builtin/dnf_module.html#ansible-collections-ansible-builtin-dnf-module ``` ### Configuration ```console this is a documentation bug in the recent online version and its regardless of my running ansible version. See: https://docs.ansible.com/ansible/latest/collections/ansible/builtin/dnf_module.html#ansible-collections-ansible-builtin-dnf-module ``` ### OS / Environment this is a documentation bug in the recent online version and its regardless of my running OS Environment. See: https://docs.ansible.com/ansible/latest/collections/ansible/builtin/dnf_module.html#ansible-collections-ansible-builtin-dnf-module ### Additional Information Providing Examples, on how to sensibly use the `list` parameter of the dnf module, would make it usable. Otherwise there will be an illogical reference from the parameterlist "See examples" when there are no examples explaining the usage. ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/78069
https://github.com/ansible/ansible/pull/78484
2e8082ebb0faf042a26f5c51fa70b9ce0a819f43
8dc097989b88f4f4bf40434016faabbeb5e25d5f
2022-06-16T16:22:16Z
python
2022-08-17T17:59:55Z
closed
ansible/ansible
https://github.com/ansible/ansible
78,063
["lib/ansible/modules/apt_key.py", "lib/ansible/modules/apt_repository.py"]
ansible.builtin.apt_key adds keys to a deprecated location
### Summary When adding non-PPA repositories to Ubuntu 22.04 (Jammy) using `ansible.builtin.apt_key` the key is added to a deprecated location (`/etc/apt/trusted.gpg`). I've seen a few reported issues where this was fixed for `ansible.builtin.apt_repository` but that only applies to PPAs which you can't always use (ie: Docker does not provide an official PPA) ### Issue Type Bug Report ### Component Name apt ### Ansible Version ```console $ ansible --version ansible [core 2.12.6] config file = /Users/ahrenstein/.ansible.cfg configured module search path = ['/Users/ahrenstein/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /opt/homebrew/Cellar/ansible/5.9.0/libexec/lib/python3.10/site-packages/ansible ansible collection location = /Users/ahrenstein/.ansible/collections:/usr/share/ansible/collections executable location = /opt/homebrew/bin/ansible python version = 3.10.4 (main, Apr 26 2022, 19:36:29) [Clang 13.1.6 (clang-1316.0.21.2)] jinja version = 3.1.2 libyaml = True ``` ### Configuration ```console DEFAULT_REMOTE_USER(/Users/ahrenstein/.ansible.cfg) = root HOST_KEY_CHECKING(/Users/ahrenstein/.ansible.cfg) = False BECOME: ====== CACHE: ===== CALLBACK: ======== CLICONF: ======= CONNECTION: ========== paramiko_ssh: ____________ host_key_checking(/Users/ahrenstein/.ansible.cfg) = False remote_user(/Users/ahrenstein/.ansible.cfg) = root ssh: ___ host_key_checking(/Users/ahrenstein/.ansible.cfg) = False remote_user(/Users/ahrenstein/.ansible.cfg) = root HTTPAPI: ======= INVENTORY: ========= LOOKUP: ====== NETCONF: ======= SHELL: ===== VARS: ==== ``` ### OS / Environment Ansible Host: macOS 12.4 (ARM) Target OS: Ubuntu 22.04 (x86_64) ### Steps to Reproduce Deploy the Docker GPG key and repo ```yaml - name: Add the Docker repository GPG key ansible.builtin.apt_key: url: https://download.docker.com/linux/ubuntu/gpg when: ansible_distribution == 'Ubuntu' - name: (Ubuntu) Add the Docker repository apt_repository: repo: 'deb https://download.docker.com/linux/ubuntu {{ ansible_distribution_release }} stable' state: present - name: Refresh apt cache apt: update-cache: yes ``` Run `apt-get update` on the server ### Expected Results apt cache refreshes without deprecation warnings ### Actual Results ```console $ apt-get update Hit:1 http://us.archive.ubuntu.com/ubuntu jammy InRelease Hit:2 http://us.archive.ubuntu.com/ubuntu jammy-updates InRelease Get:3 http://us.archive.ubuntu.com/ubuntu jammy-backports InRelease [99.8 kB] Hit:4 http://us.archive.ubuntu.com/ubuntu jammy-security InRelease Hit:5 https://download.docker.com/linux/ubuntu jammy InRelease Fetched 99.8 kB in 0s (247 kB/s) Reading package lists... Done W: https://download.docker.com/linux/ubuntu/dists/jammy/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details. ``` ``` ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/78063
https://github.com/ansible/ansible/pull/80872
9f4dfff69bfc9f33a487e1c7fee2fbce64c62c9c
0775e991d51e2fe9c38a4d862cd32a9f704d4915
2022-06-15T14:50:01Z
python
2023-05-25T15:37:59Z
closed
ansible/ansible
https://github.com/ansible/ansible
78,058
["changelogs/fragments/78058-yum-releasever-latest.yml", "lib/ansible/modules/yum.py", "test/integration/targets/yum/tasks/yuminstallroot.yml"]
yum module "latest" and releasever errors out
### Summary The yum module fails when releasever is used and state=latest ### Issue Type Bug Report ### Component Name yum ### Ansible Version ```console $ ansible --version ansible [core 2.11.12] ``` ### Configuration ```console # if using a version older than ansible-core 2.12 you should omit the '-t all' $ ansible-config dump --only-changed -t all ``` ### OS / Environment SL7 ### Steps to Reproduce <!--- Paste example playbooks or commands between quotes below --> ```yaml (paste below) - name: ww_slurm_4, install slurm and munge packages yum: name: "{{ item.1 }}" state: "latest" installroot: "{{ ww_image_root }}/{{ item.0 }}/rootfs" # releasever: "{{ ansible_distribution_major_version }}" releasever: "7" disable_gpg_check: true loop: "{{ ww_images | product(['slurm-slurmd', 'slurm-pam_slurm', 'munge'] | list )}}" register: ww_import notify: build ww container ``` ### Expected Results I expect this to update the package in the chroot environment or stay the same. Present works, but latest does not. when releasever is commented both latest and present work. ### Actual Results ```console failed: [queue] (item=['compute', 'munge']) => {"ansible_loop_var": "item", "changed": false, "item": ["compute", "munge"], "module_stderr": "Shared connection to 10.214.69.133 closed.\r\n", "module_stdout": "\r\nTraceback (most recent call last):\r\n File \"/home/admin/.ansible/tmp/ansible-tmp-1655242496.2998235-85460-72716949132464/AnsiballZ_yum.py\", line 100, in <module>\r\n _ansiballz_main()\r\n File \"/home/admin/.ansible/tmp/ansible-tmp-1655242496.2998235-85460-72716949132464/AnsiballZ_yum.py\", line 92, in _ansiballz_main\r\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\r\n File \"/home/admin/.ansible/tmp/ansible-tmp-1655242496.2998235-85460-72716949132464/AnsiballZ_yum.py\", line 41, in invoke_module\r\n run_name='__main__', alter_sys=True)\r\n File \"/usr/lib64/python2.7/runpy.py\", line 176, in run_module\r\n fname, loader, pkg_name)\r\n File \"/usr/lib64/python2.7/runpy.py\", line 82, in _run_module_code\r\n mod_name, mod_fname, mod_loader, pkg_name)\r\n File \"/usr/lib64/python2.7/runpy.py\", line 72, in _run_code\r\n exec code in run_globals\r\n File \"/tmp/ansible_ansible.legacy.yum_payload_wj2O6u/ansible_ansible.legacy.yum_payload.zip/ansible/modules/yum.py\", line 1728, in <module>\r\n File \"/tmp/ansible_ansible.legacy.yum_payload_wj2O6u/ansible_ansible.legacy.yum_payload.zip/ansible/modules/yum.py\", line 1724, in main\r\n File \"/tmp/ansible_ansible.legacy.yum_payload_wj2O6u/ansible_ansible.legacy.yum_payload.zip/ansible/modules/yum.py\", line 1695, in run\r\n File \"/tmp/ansible_ansible.legacy.yum_payload_wj2O6u/ansible_ansible.legacy.yum_payload.zip/ansible/modules/yum.py\", line 1577, in ensure\r\n File \"/tmp/ansible_ansible.legacy.yum_payload_wj2O6u/ansible_ansible.legacy.yum_payload.zip/ansible/modules/yum.py\", line 1438, in latest\r\nAttributeError: 'NoneType' object has no attribute 'extend'\r\n", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1} ``` ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/78058
https://github.com/ansible/ansible/pull/78066
630616103eaf1d19918725f9c9d2e541d58e5ade
2bc2153c01beb4305bb639dbbe342dc925ce66e1
2022-06-14T21:41:52Z
python
2022-07-12T10:38:47Z
closed
ansible/ansible
https://github.com/ansible/ansible
78,042
["changelogs/fragments/43191-72638-ansible_failed_task-fixes.yml", "docs/docsite/rst/playbook_guide/playbooks_blocks.rst", "lib/ansible/executor/play_iterator.py", "lib/ansible/plugins/strategy/__init__.py", "test/integration/targets/blocks/43191-2.yml", "test/integration/targets/blocks/43191.yml", "test/integration/targets/blocks/runme.sh"]
Block with `rescue` containing block with `always` inside. Strange stats behavior.
### Summary I have a strange behavior of `rescued` stat after run. I expected it to be equal 1 since there was a rescue block execution but instead it has value of 0. This is caused by block-with-always role inside block with rescue. Is this expected behavior? How can I make sure if rescue block was actually executed in this scenario, if I'm only able to get an error? ### Issue Type Bug Report ### Component Name block ### Ansible Version ```console ansible [core 2.13.0] ``` ### Configuration ```console All defaults ``` ### OS / Environment Arch Linux. ### Steps to Reproduce Here's my main playbook: ``` --- - name: Ansible Blocks hosts: localhost gather_facts: false tasks: - name: kek block: - name: Run Main Role import_role: name: mainerrrole rescue: - name: Rescue block (perform recovery) debug: msg: "Something went wrong, cleaning up.." ``` Here's the `mainerrrole` code ``` - name: Deploy block: - name: ERR ROLE Failing intentionally by role command: "ls -l /tmp/does-not-exist" always: - name: Cleanup import_role: name: okrole ``` Here's the `okrole` code ``` - name: OK ROLE List home directory content command: "ls -l ~/" ``` ### Expected Results Expected run stats to contain rescued=1 since there was a rescue block execution in logs. ### Actual Results ```console ansible-playbook play.yml [WARNING]: No inventory was parsed, only implicit localhost is available [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all' _______________________ < PLAY [Ansible Blocks] > ----------------------- \ ^__^ \ (oo)\_______ (__)\ )\/\ ||----w | || || _____________________________________________________________ < TASK [mainerrrole : ERR ROLE Failing intentionally by role] > ------------------------------------------------------------- \ ^__^ \ (oo)\_______ (__)\ )\/\ ||----w | || || fatal: [localhost]: FAILED! => {"changed": true, "cmd": ["ls", "-l", "/tmp/does-not-exist"], "delta": "0:00:00.005622", "end": "2022-06-13 14:44:50.711257", "msg": "non-zero return code", "rc": 2, "start": "2022-06-13 14:44:50.705635", "stderr": "ls: cannot access '/tmp/does-not-exist': No such file or directory", "stderr_lines": ["ls: cannot access '/tmp/does-not-exist': No such file or directory"], "stdout": "", "stdout_lines": []} _____________________________________________________ < TASK [okrole : OK ROLE List home directory content] > ----------------------------------------------------- \ ^__^ \ (oo)\_______ (__)\ )\/\ ||----w | || || changed: [localhost] ________________________________________ < TASK [Rescue block (perform recovery)] > ---------------------------------------- \ ^__^ \ (oo)\_______ (__)\ )\/\ ||----w | || || ok: [localhost] => { "msg": "Something went wrong, cleaning up.." } ____________ < PLAY RECAP > ------------ \ ^__^ \ (oo)\_______ (__)\ )\/\ ||----w | || || localhost : ok=2 changed=1 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0 ``` ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/78042
https://github.com/ansible/ansible/pull/78676
848143640ba88f34e6e952faba4e1b5fd1c1b2dd
fd19ff231055c439c6a2e9bb590fef09818b2afc
2022-06-13T04:58:40Z
python
2022-09-06T15:11:49Z
closed
ansible/ansible
https://github.com/ansible/ansible
78,017
["changelogs/fragments/permission-denied-spwd-module.yml", "lib/ansible/modules/user.py"]
Permission denied in user module while generating SSH keys - spwd.getspnam raises exception
### Summary "Permission denied" error is raised in "user" module of Ansible devel version when trying to generate SSH keys for user. ```yaml - name: Generate test key file user: name: "{{ ansible_env.USER }}" generate_ssh_key: yes ssh_key_file: .ssh/shade_id_rsa ``` ------------------------------------------- ``` TASK [Generate test key file] ********************************************************************************************************************************************************************************************************** task path: /home/sshnaidm/sources/various/check.yml:44 An exception occurred during task execution. To see the full traceback, use -vvv. The error was: PermissionError: [Errno 13] Permission denied fatal: [192.168.2.139]: FAILED! => { "changed": false, "rc": 1 } MSG: MODULE FAILURE See stdout/stderr for the exact error MODULE_STDOUT: Traceback (most recent call last): File "/home/ubuntu/.ansible/tmp/ansible-tmp-1654761822.346774-223712-66579943034035/AnsiballZ_user.py", line 107, in <module> _ansiballz_main() File "/home/ubuntu/.ansible/tmp/ansible-tmp-1654761822.346774-223712-66579943034035/AnsiballZ_user.py", line 99, in _ansiballz_main invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS) File "/home/ubuntu/.ansible/tmp/ansible-tmp-1654761822.346774-223712-66579943034035/AnsiballZ_user.py", line 47, in invoke_module runpy.run_module(mod_name='ansible.modules.user', init_globals=dict(_module_fqn='ansible.modules.user', _modlib_path=modlib_path), File "/usr/lib/python3.8/runpy.py", line 207, in run_module return _run_module_code(code, init_globals, run_name, mod_spec) File "/usr/lib/python3.8/runpy.py", line 97, in _run_module_code _run_code(code, mod_globals, init_globals, File "/usr/lib/python3.8/runpy.py", line 87, in _run_code exec(code, run_globals) File "/tmp/ansible_user_payload_wqpo2tmz/ansible_user_payload.zip/ansible/modules/user.py", line 3221, in <module> File "/tmp/ansible_user_payload_wqpo2tmz/ansible_user_payload.zip/ansible/modules/user.py", line 3207, in main File "/tmp/ansible_user_payload_wqpo2tmz/ansible_user_payload.zip/ansible/modules/user.py", line 1055, in set_password_expire PermissionError: [Errno 13] Permission denied MODULE_STDERR: Shared connection to 192.168.2.139 closed. ``` This error is thrown by https://github.com/ansible/ansible/blob/2f0530396b0bdb025c94b354cde95604ff1fd349/lib/ansible/modules/user.py#L1055 I've found an old issue that was fixed: #39472 by PR #40341 but I don't see this fix anymore, or probably it was introduced again in commit https://github.com/ansible/ansible/commit/dbde2c2ae3b03469abbe8f2c98b50ffedcf7975f Since then devel branch module fails. ### Issue Type Bug Report ### Component Name user ### Ansible Version ```console $ ansible --version [WARNING]: You are running the development version of Ansible. You should only run Ansible from "devel" if you are modifying the Ansible engine, or trying out features under development. This is a rapidly changing source of code and can become unstable at any point. ansible [core 2.14.0.dev0] (devel 5f5c4ef2ef) last updated 2022/06/08 23:07:15 (GMT +300) config file = /home/sshnaidm/sources/various/ansible.cfg configured module search path = ['/home/sshnaidm/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /home/sshnaidm/venvs/ansible-dev/src/ansible-core/lib/ansible ansible collection location = /home/sshnaidm/.ansible/collections:/usr/share/ansible/collections executable location = /home/sshnaidm/venvs/ansible-dev/bin/ansible python version = 3.9.12 (main, Mar 25 2022, 00:00:00) [GCC 11.2.1 20220127 (Red Hat 11.2.1-9)] (/home/sshnaidm/venvs/ansible-dev/bin/python) jinja version = 3.1.2 libyaml = True ``` ### Configuration ```console # if using a version older than ansible-core 2.12 you should omit the '-t all' $ ansible-config dump --only-changed -t all ANSIBLE_FORCE_COLOR(/home/user/sources/various/ansible.cfg) = True CONFIG_FILE() = /home/user/sources/various/ansible.cfg DEFAULT_ACTION_PLUGIN_PATH(/home/user/sources/various/ansible.cfg) = ['/home/user/sources/various/action_plugins', '/usr/share/ansible/plugins/action', '/home/user/venvs/ansible-dev/share/ansible/plugins/action', '/home/user/venvs/ansible-dev/lib/python2.7/site-packages/ara/plugins/action', '/home/user/venvs/ansible-dev/lib/python3.6/site-packages/ara/plugins/action', '/home/user/.local/lib/python3.7/site-packages/ara/plugins/action'] DEFAULT_CALLBACK_PLUGIN_PATH(/home/user/sources/various/ansible.cfg) = ['/home/user/.local/lib/python3.7/site-packages/ara/plugins/callback', '/home/user/venvs/ansible-dev/lib/python2.7/site-packages/ara/plugins/callback', '/home/user/venvs/ansible-dev/lib/python3.6/site-packages/ara/plugins/callback', '/usr/local/lib/python3.7/dist-packages/ara/plugins/callback', '/usr/local/lib/python2.7/dist-packages/ara/plugins/callback', '/nonexistent'] DEFAULT_LOAD_CALLBACK_PLUGINS(/home/user/sources/various/ansible.cfg) = True DEFAULT_ROLES_PATH(/home/user/sources/various/ansible.cfg) = ['/etc/ansible/roles', '/home/user/sources/ansible/test/integration/targets'] DEFAULT_STDOUT_CALLBACK(/home/user/sources/various/ansible.cfg) = debug DEFAULT_TEST_PLUGIN_PATH(/home/user/sources/various/ansible.cfg) = ['/usr/lib/python2.7/site-packages/tripleo-quickstart/test_plugins', '/home/user/venvs/ansible-dev/usr/local/share/tripleo-quickstart/test_plugins', '/home/user/sources/various/test_plugins'] ``` ### OS / Environment Fedora 34 ### Steps to Reproduce <!--- Paste example playbooks or commands between quotes below --> ```yaml (paste below) - name: Generate test key file user: name: "{{ ansible_env.USER }}" generate_ssh_key: yes ssh_key_file: .ssh/shade_id_rsa ``` ### Expected Results SSH keys are generated and no exception ### Actual Results ```console TASK [Generate test key file] ********************************************************************************************************************************************************************************************************** task path: /home/sshnaidm/sources/various/check.yml:44 An exception occurred during task execution. To see the full traceback, use -vvv. The error was: PermissionError: [Errno 13] Permission denied fatal: [192.168.2.139]: FAILED! => { "changed": false, "rc": 1 } MSG: MODULE FAILURE See stdout/stderr for the exact error MODULE_STDOUT: Traceback (most recent call last): File "/home/ubuntu/.ansible/tmp/ansible-tmp-1654761822.346774-223712-66579943034035/AnsiballZ_user.py", line 107, in <module> _ansiballz_main() File "/home/ubuntu/.ansible/tmp/ansible-tmp-1654761822.346774-223712-66579943034035/AnsiballZ_user.py", line 99, in _ansiballz_main invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS) File "/home/ubuntu/.ansible/tmp/ansible-tmp-1654761822.346774-223712-66579943034035/AnsiballZ_user.py", line 47, in invoke_module runpy.run_module(mod_name='ansible.modules.user', init_globals=dict(_module_fqn='ansible.modules.user', _modlib_path=modlib_path), File "/usr/lib/python3.8/runpy.py", line 207, in run_module return _run_module_code(code, init_globals, run_name, mod_spec) File "/usr/lib/python3.8/runpy.py", line 97, in _run_module_code _run_code(code, mod_globals, init_globals, File "/usr/lib/python3.8/runpy.py", line 87, in _run_code exec(code, run_globals) File "/tmp/ansible_user_payload_wqpo2tmz/ansible_user_payload.zip/ansible/modules/user.py", line 3221, in <module> File "/tmp/ansible_user_payload_wqpo2tmz/ansible_user_payload.zip/ansible/modules/user.py", line 3207, in main File "/tmp/ansible_user_payload_wqpo2tmz/ansible_user_payload.zip/ansible/modules/user.py", line 1055, in set_password_expire PermissionError: [Errno 13] Permission denied MODULE_STDERR: Shared connection to 192.168.2.139 closed. ``` ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/78017
https://github.com/ansible/ansible/pull/78040
95df5cb740c5a5cef165459f6f7ad72dd7ad2772
30a923fb5c164d6cd18280c02422f75e611e8fb2
2022-06-09T08:24:42Z
python
2022-06-14T15:19:23Z
closed
ansible/ansible
https://github.com/ansible/ansible
77,972
["changelogs/fragments/ansible-test-validate-modules-docs-only-docstring.yml", "test/lib/ansible_test/_util/controller/sanity/validate-modules/validate_modules/main.py"]
A module should be allowed to have a module docstring
https://github.com/ansible/ansible/blob/1706d35fc476e36fcced25435c2f1c2401536376/test/lib/ansible_test/_util/controller/sanity/validate-modules/validate_modules/main.py#L414 When a module is in place to provide documentation for an action, it should be allowed to have a doc string. Without a docstring users of pydocstring will need to suppress: ``` ************* Module plugins.modules.git_away plugins/modules/git_away.py:1:0: C0114: Missing module docstring (missing-module-docstring) ************* Module plugins.modules.git_here plugins/modules/git_here.py:1:0: C0114: Missing module docstring (missing-module-docstring) ``` With a doc string the module is treated as a "real" module and fails sanity: ``` ansible-module-not-initialized: Execution of the module did not result in initialization of AnsibleModule ``` PEP257 suggests modules should have a docstring, and is generally considered a good practice to inform future developers of the purpose of the file and can be used for documentation generation as well.
https://github.com/ansible/ansible/issues/77972
https://github.com/ansible/ansible/pull/77987
6e78425f8d6edbfd95faf5c3c2c05c6d3f038758
5b3557f8ba5c176eb7d2de21b3a4da3dcab3bada
2022-06-06T14:47:13Z
python
2022-06-08T17:41:01Z
closed
ansible/ansible
https://github.com/ansible/ansible
77,957
["changelogs/fragments/78624-copy-remote-src-check-mode.yml", "lib/ansible/modules/copy.py", "test/integration/targets/copy/tasks/check_mode.yml"]
copy module does not reflect 'changed' for mode in check mode with remote_src: yes
### Summary I use the `ansible.builtin.copy` module. Unfortunately, there is a combination of parameters where check mode prints `ok`, although when running in run mode, there is an actual change. Unexpected malfunction is reproducible tested on `2.9.27`, `2.12.6` and `2.13.0` ### Issue Type Bug Report ### Component Name copy ### Ansible Version ```console $ ansible --version ansible 2.9.27 config file = None configured module search path = ['/home/phoffmann/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /home/phoffmann/.local/share/virtualenvs/ansible-2.9-TCZdLugh/lib/python3.8/site-packages/ansible executable location = /home/phoffmann/.local/share/virtualenvs/ansible-2.9-TCZdLugh/bin/ansible python version = 3.8.12 (default, Apr 8 2022, 11:41:59) [GCC 9.4.0] $ ansible --version ansible [core 2.12.6] config file = None configured module search path = ['/home/phoffmann/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /home/phoffmann/.pyenv/versions/3.8.12/lib/python3.8/site-packages/ansible ansible collection location = /home/phoffmann/.ansible/collections:/usr/share/ansible/collections executable location = /home/phoffmann/.pyenv/versions/3.8.12/bin/ansible python version = 3.8.12 (default, Apr 8 2022, 11:41:59) [GCC 9.4.0] jinja version = 3.1.2 libyaml = True $ ansible --version ansible [core 2.13.0] config file = None configured module search path = ['/home/phoffmann/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /home/phoffmann/.local/share/virtualenvs/ansible-2.13-v8S06Uvz/lib/python3.8/site-packages/ansible ansible collection location = /home/phoffmann/.ansible/collections:/usr/share/ansible/collections executable location = /home/phoffmann/.local/share/virtualenvs/ansible-2.13-v8S06Uvz/bin/ansible python version = 3.8.12 (default, Apr 8 2022, 11:41:59) [GCC 9.4.0] jinja version = 3.1.2 libyaml = True ``` ### Configuration ```console $ ansible-config dump --only-changed -t all ``` ### OS / Environment Ubuntu 20.04 ### Steps to Reproduce ```yaml --- - hosts: localhost tasks: - name: create file file: path: /tmp/ansible_foo state: touch owner: '{{ ansible_env.USER }}' group: '{{ ansible_env.USER }}' mode: 0600 - name: Copy file with permissions copy: src: /tmp/ansible_foo dest: /tmp/ansible_foo2 mode: 0644 remote_src: yes - name: create file file: path: /tmp/ansible_foo2 owner: '{{ ansible_env.USER }}' group: '{{ ansible_env.USER }}' mode: 0600 ``` ### Expected Results I expect task `Copy file with permissions` to print `changed` Expected Result: ``` TASK [Copy file with permissions] ******************************************************************************************************************** --- before +++ after @@ -1,4 +1,4 @@ { - "mode": "0600", + "mode": "0644", "path": "/tmp/ansible_foo2" } ``` It prints the expected `changed` as soon as `remote_src: yes` is removed. ### Actual Results ```console TASK [Copy file with permissions] ******************************************************************************************************************** ok: [localhost] ``` ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/77957
https://github.com/ansible/ansible/pull/78624
c564c6e21e4538b475df2ae4b3f66b73decff160
b7a0e0d79278906c57c6dfc637d0e0b09b45db34
2022-06-02T15:25:14Z
python
2023-03-08T20:40:01Z
closed
ansible/ansible
https://github.com/ansible/ansible
77,928
["changelogs/fragments/79227-update-vendored-distro.yaml", "lib/ansible/module_utils/distro/_distro.py", "test/sanity/ignore.txt"]
Failed to get Debian minor version
### Summary This is a follow up to issue #74481, which was closed, but the fix doesn't address the problem described in this issues. Here a (slightly modified) copy of my comment on the above issue: PR #74721 doesn't solve the problem reported in issue #74481. This PR adds a new `ansible_distribution_minor_version` fact. But issue #74481 is about the `ansible_distribution_version` fact sometimes doesn't include the minor version. Here a list of `ansible_distribution_version` facts gathered for my Debian hosts: 6.0.8 7.6 7.7 7.11 8 8.2 8.10 8.11 9.6 9.12 9.13 10 11 You see that for Debian 8 `ansible_distribution_version` is sometimes with and without the minor version. From Debian 10 the fact doesn't include the minor version. For CentOS `ansible_distribution_version` always include the minor version: 7.4 7.5 7.6 7.8 7.9 8.3 8.4 8.5 To make `ansible_distribution_version` consistent between distributions the minor version should be added to this fact for Debian hosts. ### Issue Type Bug Report ### Component Name lib/ansible/modules/setup.py ### Ansible Version ```console ansible [core 2.12.6] ``` ### Configuration ```console NA ``` ### OS / Environment Debian ### Steps to Reproduce NA ### Expected Results NA ### Actual Results ```console NA ``` ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/77928
https://github.com/ansible/ansible/pull/79227
505b29b2a981eabb2dd84bc66d37704bab91c3f9
f79a54ae22b59d4c9bab0fb71d95c63b2e4b834b
2022-05-30T06:30:58Z
python
2022-11-23T19:44:15Z
closed
ansible/ansible
https://github.com/ansible/ansible
77,927
["changelogs/fragments/77936-add-pyyaml-version.yml", "requirements.txt", "test/lib/ansible_test/_data/requirements/ansible.txt"]
AttributeError: module 'collections' has no attribute 'Hashable'
### Summary It seems an upgrade broke my ansible configuration on Fedora 36 not much to say any commands is followed by the output past down in the issue. I have seen this error, but for another package "Spades", don't know what it is, don't have installed on my machine : - https://github.com/ablab/spades/issues/873 - https://github.com/ablab/spades/issues/863 - https://github.com/pyinvoke/invoke/pull/803 Kernel: 5.17.7-300.fc36.x86_64 Best regards. ### Issue Type Bug Report ### Component Name dnf ### Ansible Version ```console $ ansible rpm -qa | grep ansible ansible-core-2.12.5-1.fc36.noarch ansible-5.8.0-1.fc36.noarch ``` ### Configuration ```console $ ansible-config dump --only-changed -t all Traceback (most recent call last): File "/usr/bin/ansible-config", line 65, in <module> import ansible.constants as C File "/usr/lib/python3.10/site-packages/ansible/constants.py", line 180, in <module> config = ConfigManager() File "/usr/lib/python3.10/site-packages/ansible/config/manager.py", line 291, in __init__ self._base_defs = self._read_config_yaml_file(defs_file or ('%s/base.yml' % os.path.dirname(__file__))) File "/usr/lib/python3.10/site-packages/ansible/config/manager.py", line 312, in _read_config_yaml_file return yaml_load(config_def) or {} File "/home/paco.garcia/.local/lib/python3.10/site-packages/yaml/__init__.py", line 72, in load return loader.get_single_data() File "/home/paco.garcia/.local/lib/python3.10/site-packages/yaml/constructor.py", line 37, in get_single_data return self.construct_document(node) File "/home/paco.garcia/.local/lib/python3.10/site-packages/yaml/constructor.py", line 46, in construct_document for dummy in generator: File "/home/paco.garcia/.local/lib/python3.10/site-packages/yaml/constructor.py", line 398, in construct_yaml_map value = self.construct_mapping(node) File "/home/paco.garcia/.local/lib/python3.10/site-packages/yaml/constructor.py", line 204, in construct_mapping return super().construct_mapping(node, deep=deep) File "/home/paco.garcia/.local/lib/python3.10/site-packages/yaml/constructor.py", line 126, in construct_mapping if not isinstance(key, collections.Hashable): AttributeError: module 'collections' has no attribute 'Hashable' ``` ### OS / Environment OS: Fedora release 36 (Thirty Six) x86_64 ### Steps to Reproduce ### Expected Results Any ansible commands return the same output bellow. ### Actual Results ```console Traceback (most recent call last): File "/usr/bin/ansible-config", line 65, in <module> import ansible.constants as C File "/usr/lib/python3.10/site-packages/ansible/constants.py", line 180, in <module> config = ConfigManager() File "/usr/lib/python3.10/site-packages/ansible/config/manager.py", line 291, in __init__ self._base_defs = self._read_config_yaml_file(defs_file or ('%s/base.yml' % os.path.dirname(__file__))) File "/usr/lib/python3.10/site-packages/ansible/config/manager.py", line 312, in _read_config_yaml_file return yaml_load(config_def) or {} File "/home/paco.garcia/.local/lib/python3.10/site-packages/yaml/__init__.py", line 72, in load return loader.get_single_data() File "/home/paco.garcia/.local/lib/python3.10/site-packages/yaml/constructor.py", line 37, in get_single_data return self.construct_document(node) File "/home/paco.garcia/.local/lib/python3.10/site-packages/yaml/constructor.py", line 46, in construct_document for dummy in generator: File "/home/paco.garcia/.local/lib/python3.10/site-packages/yaml/constructor.py", line 398, in construct_yaml_map value = self.construct_mapping(node) File "/home/paco.garcia/.local/lib/python3.10/site-packages/yaml/constructor.py", line 204, in construct_mapping return super().construct_mapping(node, deep=deep) File "/home/paco.garcia/.local/lib/python3.10/site-packages/yaml/constructor.py", line 126, in construct_mapping if not isinstance(key, collections.Hashable): AttributeError: module 'collections' has no attribute 'Hashable' ``` ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/77927
https://github.com/ansible/ansible/pull/77936
f9d4c26143c86e4aab0ed0727446c11300cb32eb
e89176caacbe068b2094bb4cc31e9a104aa3b295
2022-05-28T01:48:40Z
python
2022-06-07T16:26:56Z
closed
ansible/ansible
https://github.com/ansible/ansible
77,911
["changelogs/fragments/78325-ansible-galaxy-fix-caching-paginated-responses-from-v3-servers.yml", "lib/ansible/galaxy/api.py", "test/units/galaxy/test_api.py"]
ansible-galaxy fails to install collection from GalaxyNG when there are many versions
### Summary Given I have installed GalaxyNG and published custom content and synchronized content from galaxy.ansible.com, when I try to install collections listed in a `requirements.yml` via a modern version of `ansible-galaxy` configured to use GalaxyNG, `ansible-galaxy` fails when encountering the `community.vmware` collection. If you comment out `community.vmware` from `requirements.yml`, all other collections (custom published and synchronized) install fine. If you uncomment `community.vmware` and use an older version of `ansible-galaxy` (e.g., Ansible 2.9.12), all collections install fine. ### Issue Type Bug Report ### Component Name ansible-galaxy ### Ansible Version ```console $ ansible --version # works (Ansible 2.9.12 installed via pip) ansible 2.9.12 config file = /home/ben/workspace/kiewit/ansible/playbooks/ap_foo/ansible.cfg configured module search path = ['/home/ben/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /home/ben/venv3_ansible-2.9.12/lib/python3.8/site-packages/ansible executable location = /home/ben/venv3_ansible-2.9.12/bin/ansible python version = 3.8.10 (default, Mar 15 2022, 12:22:08) [GCC 9.4.0] # fails (Ansible 4.2.0 installed via pip) ansible [core 2.11.2] config file = /home/ben/workspace/kiewit/ansible/playbooks/ap_foo/ansible.cfg configured module search path = ['/home/ben/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /home/ben/venv3_ansible-4.2.0/lib/python3.8/site-packages/ansible ansible collection location = /home/ben/workspace/kiewit/ansible/playbooks/ap_foo/collections:/home/ben/.ansible/collections:/usr/share/ansible/collections executable location = /home/ben/venv3_ansible-4.2.0/bin/ansible python version = 3.8.10 (default, Mar 15 2022, 12:22:08) [GCC 9.4.0] jinja version = 3.0.1 libyaml = True # fails (Ansible 5.8.0 installed via pip) ansible [core 2.12.6] config file = /home/ben/workspace/kiewit/ansible/playbooks/ap_foo/ansible.cfg configured module search path = ['/home/ben/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /home/ben/venv3_ansible-5.8.0/lib/python3.8/site-packages/ansible ansible collection location = /home/ben/workspace/kiewit/ansible/playbooks/ap_foo/collections:/home/ben/.ansible/collections:/usr/share/ansible/collections executable location = /home/ben/venv3_ansible-5.8.0/bin/ansible python version = 3.8.10 (default, Mar 15 2022, 12:22:08) [GCC 9.4.0] jinja version = 3.1.2 libyaml = True ``` ### Configuration ```console $ ansible-config dump --only-changed -t all ANSIBLE_NOCOWS(/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/ansible.cfg) = True CACHE_PLUGIN(/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/ansible.cfg) = jsonfile CACHE_PLUGIN_CONNECTION(/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/ansible.cfg) = $HOME/ansible/facts CACHE_PLUGIN_TIMEOUT(/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/ansible.cfg) = 600 CALLBACKS_ENABLED(/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/ansible.cfg) = ['timer', 'profile_roles', 'profile_tasks', 'junit'] COLLECTIONS_PATHS(/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/ansible.cfg) = ['/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/collections', '/home/ben/.ansible/collections', '/usr/share/ansible/col> DEFAULT_FORKS(/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/ansible.cfg) = 20 DEFAULT_GATHERING(/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/ansible.cfg) = smart DEFAULT_INVENTORY_PLUGIN_PATH(/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/ansible.cfg) = ['/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/plugins/inventory', '/home/ben/.ansible/plugins/inventory',> DEFAULT_LOAD_CALLBACK_PLUGINS(/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/ansible.cfg) = True DEFAULT_ROLES_PATH(/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/ansible.cfg) = ['/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/roles', '/home/ben/.ansible/roles', '/usr/share/ansible/roles', '/etc/> DEFAULT_STDOUT_CALLBACK(/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/ansible.cfg) = yaml DEFAULT_VAULT_IDENTITY_LIST(/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/ansible.cfg) = ['vcenter@~/workspace/kiewit/ansible_vaults/vcenter', 'azure@~/workspace/kiewit/ansible_vaults/azure', 'ansible_use> DEFAULT_VAULT_PASSWORD_FILE(env: ANSIBLE_VAULT_PASSWORD_FILE) = /home/ben/workspace/kiewit/ansible_vaults/molecule GALAXY_SERVER_LIST(/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/ansible.cfg) = ['kiewit_published', 'kiewit_community'] HOST_KEY_CHECKING(/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/ansible.cfg) = False INVENTORY_ENABLED(/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/ansible.cfg) = ['host_list', 'script', 'auto', 'yaml', 'ini', 'toml', 'vmware_vm_inventory', 'azure_rm', 'ldap_inventory'] RETRY_FILES_ENABLED(/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/ansible.cfg) = True VARIABLE_PRECEDENCE(/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/ansible.cfg) = ['all_plugins_inventory', 'groups_plugins_inventory', 'all_inventory', 'groups_inventory', 'all_plugins_play', 'groups_plug> ``` ### OS / Environment Ubuntu 20.04 running Ansible installed via `pip` into a virtual environment. ### Steps to Reproduce ```yaml --- # requirements.yml collections: - name: azure.azcollection version: 1.7.0 - name: community.vmware version: 1.17.0 - name: community.general version: 4.5.0 - name: community.windows version: 1.9.0 # custom published collection - name: kiewit.content version: 1.4.0 ``` ```bash ansible-galaxy collection install -r collections/requirements.yml -p collections/ -vvvvv --force ``` GalaxyNG installed, custom collection published, remote collections synchronized to GalaxyNG via the following requirements.yml ```yaml --- collections: - name: azure.azcollection - name: community.vmware - name: community.general - name: community.windows ``` Notice there are 316 community.vmware versions: ![image](https://user-images.githubusercontent.com/1863643/170338419-bae493ac-3e23-48d7-92ec-442d0dec3b96.png) ### Expected Results I expect all listed requirements to be forcefully re-installed. ### Actual Results ```console # # Failing with `ansible-galaxy` via Ansible 5.8.0 # ansible-galaxy [core 2.12.6] config file = /home/ben/workspace/kiewit/ansible/playbooks/ap_foo/ansible.cfg configured module search path = ['/home/ben/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /home/ben/venv3_ansible-5.8.0/lib/python3.8/site-packages/ansible ansible collection location = /home/ben/workspace/kiewit/ansible/playbooks/ap_foo/collections:/home/ben/.ansible/collections:/usr/share/ansible/collections executable location = /home/ben/venv3_ansible-5.8.0/bin/ansible-galaxy python version = 3.8.10 (default, Mar 15 2022, 12:22:08) [GCC 9.4.0] jinja version = 3.1.2 libyaml = True Using /home/ben/workspace/kiewit/ansible/playbooks/ap_foo/ansible.cfg as config file Reading requirement file at '/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/collections/requirements.yml' Starting galaxy collection install process Found installed collection azure.azcollection:1.7.0 at '/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/collections/ansible_collections/azure/azcollection' Found installed collection ansible.windows:1.10.0 at '/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/collections/ansible_collections/ansible/windows' Found installed collection community.vmware:2.5.0 at '/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/collections/ansible_collections/community/vmware' Found installed collection community.general:4.5.0 at '/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/collections/ansible_collections/community/general' Found installed collection community.windows:1.9.0 at '/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/collections/ansible_collections/community/windows' Found installed collection kiewit.content:1.4.0 at '/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/collections/ansible_collections/kiewit/content' Process install dependency map Initial connection to galaxy_server: https://kneawxalp311.kiewitplaza.com/api/galaxy/content/published/ Found API version 'v3' with Galaxy server kiewit_published (https://kneawxalp311.kiewitplaza.com/api/galaxy/content/published/) Opened /home/ben/.ansible/galaxy_token Calling Galaxy at https://kneawxalp311.kiewitplaza.com/api/galaxy/content/published/v3/collections/azure/azcollection/ Initial connection to galaxy_server: https://kneawxalp311.kiewitplaza.com/api/galaxy/content/community/ Found API version 'v3' with Galaxy server kiewit_community (https://kneawxalp311.kiewitplaza.com/api/galaxy/content/community/) Opened /home/ben/.ansible/galaxy_token Calling Galaxy at https://kneawxalp311.kiewitplaza.com/api/galaxy/content/community/v3/collections/azure/azcollection/ Calling Galaxy at https://kneawxalp311.kiewitplaza.com/api/galaxy/content/published/v3/collections/community/vmware/ Calling Galaxy at https://kneawxalp311.kiewitplaza.com/api/galaxy/content/community/v3/collections/community/vmware/ Calling Galaxy at https://kneawxalp311.kiewitplaza.com/api/galaxy/content/community/v3/collections/community/vmware/versions/?limit=100 Calling Galaxy at https://kneawxalp311.kiewitplaza.com/api/galaxy/content/community/v3/plugin/ansible/content/community/collections/index/community/vmware/versions/?limit=100&offset=100 [WARNING]: Skipping Galaxy server https://kneawxalp311.kiewitplaza.com/api/galaxy/content/community/. Got an unexpected error when getting available versions of collection community.vmware: '/api/galaxy/content/community/v3/plugin/ansible/content/community/collections/index/community/vmware/versions/' ERROR! Failed to resolve the requested dependencies map. Could not satisfy the following requirements: * community.vmware:2.5.0 (direct request) # # Working via ansible-galaxy provided in Ansible 2.9.12 # ansible-galaxy 2.9.12 config file = /home/ben/workspace/kiewit/ansible/playbooks/ap_foo/ansible.cfg configured module search path = ['/home/ben/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /home/ben/venv3_ansible-2.9.12/lib/python3.8/site-packages/ansible executable location = /home/ben/venv3_ansible-2.9.12/bin/ansible-galaxy python version = 3.8.10 (default, Mar 15 2022, 12:22:08) [GCC 9.4.0] Using /home/ben/workspace/kiewit/ansible/playbooks/ap_foo/ansible.cfg as config file Reading requirement file at '/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/collections/requirements.yml' Found installed collection azure.azcollection:1.7.0 at '/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/collections/ansible_collections/azure/azcollection' Found installed collection ansible.windows:1.10.0 at '/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/collections/ansible_collections/ansible/windows' Found installed collection community.vmware:2.5.0 at '/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/collections/ansible_collections/community/vmware' Found installed collection community.general:4.5.0 at '/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/collections/ansible_collections/community/general' Found installed collection community.windows:1.9.0 at '/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/collections/ansible_collections/community/windows' Found installed collection kiewit.content:1.4.0 at '/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/collections/ansible_collections/kiewit/content' Process install dependency map Initial connection to galaxy_server: https://kneawxalp311.kiewitplaza.com/api/galaxy/content/published/ Opened /home/ben/.ansible/galaxy_token Calling Galaxy at https://kneawxalp311.kiewitplaza.com/api/galaxy/content/published/ Found API version 'v3' with Galaxy server kiewit_published (https://kneawxalp311.kiewitplaza.com/api/galaxy/content/published/) Calling Galaxy at https://kneawxalp311.kiewitplaza.com/api/galaxy/content/published/v3/collections/azure/azcollection/versions/1.7.0/ Initial connection to galaxy_server: https://kneawxalp311.kiewitplaza.com/api/galaxy/content/community/ Opened /home/ben/.ansible/galaxy_token Calling Galaxy at https://kneawxalp311.kiewitplaza.com/api/galaxy/content/community/ Processing requirement collection 'azure.azcollection' Collection requirement 'azure.azcollection' is the name of a collection Collection 'azure.azcollection' is not available from server kiewit_published https://kneawxalp311.kiewitplaza.com/api/galaxy/content/published/ Found API version 'v3' with Galaxy server kiewit_community (https://kneawxalp311.kiewitplaza.com/api/galaxy/content/community/) Calling Galaxy at https://kneawxalp311.kiewitplaza.com/api/galaxy/content/community/v3/collections/azure/azcollection/versions/1.7.0/ Calling Galaxy at https://kneawxalp311.kiewitplaza.com/api/galaxy/content/published/v3/collections/community/vmware/versions/2.5.0/ Collection 'azure.azcollection' obtained from server kiewit_community https://kneawxalp311.kiewitplaza.com/api/galaxy/content/community/ Processing requirement collection 'community.vmware' Collection requirement 'community.vmware' is the name of a collection Calling Galaxy at https://kneawxalp311.kiewitplaza.com/api/galaxy/content/community/v3/collections/community/vmware/versions/2.5.0/ Collection 'community.vmware' is not available from server kiewit_published https://kneawxalp311.kiewitplaza.com/api/galaxy/content/published/ Calling Galaxy at https://kneawxalp311.kiewitplaza.com/api/galaxy/content/published/v3/collections/community/general/versions/4.5.0/ Collection 'community.vmware' obtained from server kiewit_community https://kneawxalp311.kiewitplaza.com/api/galaxy/content/community/ Processing requirement collection 'community.general' Collection requirement 'community.general' is the name of a collection Calling Galaxy at https://kneawxalp311.kiewitplaza.com/api/galaxy/content/community/v3/collections/community/general/versions/4.5.0/ Collection 'community.general' is not available from server kiewit_published https://kneawxalp311.kiewitplaza.com/api/galaxy/content/published/ Calling Galaxy at https://kneawxalp311.kiewitplaza.com/api/galaxy/content/published/v3/collections/community/windows/versions/1.9.0/ Collection 'community.general' obtained from server kiewit_community https://kneawxalp311.kiewitplaza.com/api/galaxy/content/community/ Processing requirement collection 'community.windows' Collection requirement 'community.windows' is the name of a collection Calling Galaxy at https://kneawxalp311.kiewitplaza.com/api/galaxy/content/community/v3/collections/community/windows/versions/1.9.0/ Collection 'community.windows' is not available from server kiewit_published https://kneawxalp311.kiewitplaza.com/api/galaxy/content/published/ Calling Galaxy at https://kneawxalp311.kiewitplaza.com/api/galaxy/content/published/v3/collections/kiewit/content/versions/1.4.0/ Collection 'community.windows' obtained from server kiewit_community https://kneawxalp311.kiewitplaza.com/api/galaxy/content/community/ Processing requirement collection 'kiewit.content' Collection requirement 'kiewit.content' is the name of a collection Calling Galaxy at https://kneawxalp311.kiewitplaza.com/api/galaxy/content/community/v3/collections/ansible/windows/versions/ Collection 'kiewit.content' obtained from server kiewit_published https://kneawxalp311.kiewitplaza.com/api/galaxy/content/published/ Processing requirement collection 'ansible.windows' - as dependency of community.windows Collection requirement 'ansible.windows' is the name of a collection Calling Galaxy at https://kneawxalp311.kiewitplaza.com/api/galaxy/content/community/v3/plugin/ansible/content/community/collections/index/ansible/windows/versions/?limit=10&offset=10 Collection 'ansible.windows' obtained from server kiewit_community https://kneawxalp311.kiewitplaza.com/api/galaxy/content/community/ Starting collection install process Installing 'azure.azcollection:1.7.0' to '/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/collections/ansible_collections/azure/azcollection' Downloading https://kneawxalp311.kiewitplaza.com/api/galaxy/v3/plugin/ansible/content/community/collections/artifacts/azure-azcollection-1.7.0.tar.gz to /home/ben/.ansible/tmp/ansible-local-20811912wtbig7j/tmp7pjnjmnu Validating downloaded file hash 28041b95da141c55e01cc491f004b64cd9a7c7d2d28e622825543309744f689a with expected hash 28041b95da141c55e01cc491f004b64cd9a7c7d2d28e622825543309744f689a Installing 'community.vmware:2.5.0' to '/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/collections/ansible_collections/community/vmware' Downloading https://kneawxalp311.kiewitplaza.com/api/galaxy/v3/plugin/ansible/content/community/collections/artifacts/community-vmware-2.5.0.tar.gz to /home/ben/.ansible/tmp/ansible-local-20811912wtbig7j/tmp7pjnjmnu Validating downloaded file hash 4e3aaabdf4802af8ba9c08c77e464c1e0a52abcd7dec7d3aa51b1f865eadfe2a with expected hash 4e3aaabdf4802af8ba9c08c77e464c1e0a52abcd7dec7d3aa51b1f865eadfe2a Installing 'community.general:4.5.0' to '/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/collections/ansible_collections/community/general' Downloading https://kneawxalp311.kiewitplaza.com/api/galaxy/v3/plugin/ansible/content/community/collections/artifacts/community-general-4.5.0.tar.gz to /home/ben/.ansible/tmp/ansible-local-20811912wtbig7j/tmp7pjnjmnu Validating downloaded file hash c191817d1c19fef2ec2927d65dbec65f3f0bbba60523b95ec163a48ba39dbcf0 with expected hash c191817d1c19fef2ec2927d65dbec65f3f0bbba60523b95ec163a48ba39dbcf0 Installing 'community.windows:1.9.0' to '/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/collections/ansible_collections/community/windows' Downloading https://kneawxalp311.kiewitplaza.com/api/galaxy/v3/plugin/ansible/content/community/collections/artifacts/community-windows-1.9.0.tar.gz to /home/ben/.ansible/tmp/ansible-local-20811912wtbig7j/tmp7pjnjmnu Validating downloaded file hash 63909e16fc055e39266127098f7c11e9da5e6000b231be5bdac74c1758ef9e9b with expected hash 63909e16fc055e39266127098f7c11e9da5e6000b231be5bdac74c1758ef9e9b Installing 'kiewit.content:1.4.0' to '/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/collections/ansible_collections/kiewit/content' Downloading https://kneawxalp311.kiewitplaza.com/api/galaxy/v3/plugin/ansible/content/published/collections/artifacts/kiewit-content-1.4.0.tar.gz to /home/ben/.ansible/tmp/ansible-local-20811912wtbig7j/tmp7pjnjmnu Validating downloaded file hash 5c72fee203e0e927ab7451cd0d7206c549f4280208f464ec0d5078711c70beda with expected hash 5c72fee203e0e927ab7451cd0d7206c549f4280208f464ec0d5078711c70beda Skipping 'ansible.windows' as it is already installed ``` ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/77911
https://github.com/ansible/ansible/pull/78325
1429672213af648aef239138745d593e2920ebdd
5728d72cda94e24314a95befb0130b9e773f1035
2022-05-25T18:21:23Z
python
2022-07-21T21:18:07Z
closed
ansible/ansible
https://github.com/ansible/ansible
77,908
["docs/docsite/rst/user_guide/windows_winrm.rst"]
Incorrect python-devel package name in Kerberos system requirements for windows remote management
### Summary The section on installing the kerberos system requirements mentions `python-devel` for RHEL/Centos/fedora. On RHEL8 at least the package name needs to be python36-devel, python38-devel or python39-devel depending on the version of python used by ansible. The version installed from Red Hat's repos will use python3.6 AFAICT. ### Issue Type Documentation Report ### Component Name ansible/docs/docsite/rst/user_guide/windows_winrm.rst ### Ansible Version ```console ansible --version ansible 2.9.27 config file = /home/bram.mertens/workspace/clean-abxcfg/ansible.cfg configured module search path = ['/home/bram.mertens/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/lib/python3.6/site-packages/ansible executable location = /usr/bin/ansible python version = 3.6.8 (default, Sep 9 2021, 07:49:02) [GCC 8.5.0 20210514 (Red Hat 8.5.0-3)] ``` ### Configuration ```console not applicable ``` ### OS / Environment RHEL8 ### Additional Information Adding this will allow users to install the right package and use the winrm modules. ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/77908
https://github.com/ansible/ansible/pull/78037
3a5a61b7830cdd5767b6efca955d15477d2c015a
681dc6eab9156229f75cf42f19b05c900c557863
2022-05-25T13:47:35Z
python
2022-06-16T17:29:03Z
closed
ansible/ansible
https://github.com/ansible/ansible
77,868
["changelogs/fragments/apt_fail_on_autoremove.yml", "lib/ansible/modules/apt.py", "test/integration/targets/apt/tasks/repo.yml", "test/integration/targets/apt/tasks/upgrade_scenarios.yml"]
Apt module "fail_on_autoremove=yes" sends invalid switch to aptitude
### Summary The apt module runs `aptitude` on the target host. When `fail_on_autoremove=yes`, the `--no-remove` switch is added to the command line. This switch is valid for `apt`, but not for `aptitude`, so the command fails. ### Issue Type Bug Report ### Component Name apt ### Ansible Version ```console $ ansible --version [DEPRECATION WARNING]: Ansible will require Python 3.8 or newer on the controller starting with Ansible 2.12. Current version: 3.7.3 (default, Jan 22 2021, 20:04:44) [GCC 8.3.0]. This feature will be removed from ansible-core in version 2.12. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg. ansible [core 2.11.9] config file = /etc/ansible/ansible.cfg configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/local/lib/python3.7/dist-packages/ansible ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections executable location = /usr/local/bin/ansible python version = 3.7.3 (default, Jan 22 2021, 20:04:44) [GCC 8.3.0] jinja version = 3.0.3 libyaml = True ``` ### Configuration ```console $ ansible-config dump --only-changed -t all [DEPRECATION WARNING]: Ansible will require Python 3.8 or newer on the controller starting with Ansible 2.12. Current version: 3.7.3 (default, Jan 22 2021, 20:04:44) [GCC 8.3.0]. This feature will be removed from ansible-core in version 2.12. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg. usage: ansible-config [-h] [--version] [-v] {list,dump,view} ... ansible-config: error: unrecognized arguments: -t all usage: ansible-config [-h] [--version] [-v] {list,dump,view} ... View ansible configuration. positional arguments: {list,dump,view} list Print all config options dump Dump configuration view View configuration file optional arguments: --version show program's version number, config file location, configured module search path, module location, executable location and exit -h, --help show this help message and exit -v, --verbose verbose mode (-vvv for more, -vvvv to enable connection debugging) ``` ### OS / Environment Debian 10, aptitude 0.8.11 ### Steps to Reproduce <!--- Paste example playbooks or commands between quotes below --> ``` ansible 'all:!internal_windows:!ucs' -b -m apt -a "update_cache=yes upgrade=yes fail_on_autoremove=yes" ``` ### Expected Results Expected target servers' apt packages to be upgraded. ### Actual Results ```console tallis | FAILED! => { "ansible_facts": { "discovered_interpreter_python": "/usr/bin/python3" }, "changed": false, "msg": "'/usr/bin/aptitude safe-upgrade' failed: /usr/bin/aptitude: unrecognized option '--no-remove'\n", "rc": 1, "stdout": "aptitude 0.8.11\nUsage: aptitude [-S fname] [-u|-i]\n aptitude [options] <action> ...\n\nActions (if none is specified, aptitude will enter interactive mode):\n\n install Install/upgrade packages.\n remove Remove packages.\n purge Remove packages and their configuration files.\n hold Place packages on hold.\n unhold Cancel a hold command for a package.\n markauto Mark packages as having been automatically installed.\n unmarkauto Mark packages as having been manually installed.\n forbid-version Forbid aptitude from upgrading to a specific package version.\n update Download lists of new/upgradable packages.\n safe-upgrade Perform a safe upgrade.\n full-upgrade Perform an upgrade, possibly installing and removing packages.\n build-dep Install the build-dependencies of packages.\n forget-new Forget what packages are \"new\".\n search Search for a package by name and/or expression.\n show Display detailed info about a package.\n showsrc Display detailed info about a source package (apt wrapper).\n versions Displays the versions of specified packages.\n clean Erase downloaded package files.\n autoclean Erase old downloaded package files.\n changelog View a package's changelog.\n download Download the .deb file for a package (apt wrapper).\n source Download source package (apt wrapper).\n reinstall Reinstall a currently installed package.\n why Explain why a particular package should be installed.\n why-not Explain why a particular package cannot be installed.\n\n add-user-tag Add user tag to packages/patterns.\n remove-user-tag Remove user tag from packages/patterns.\n\nOptions:\n -h This help text.\n --no-gui Do not use the GTK GUI even if available.\n -s Simulate actions, but do not actually perform them.\n -d Only download packages, do not install or remove anything.\n -P Always prompt for confirmation of actions.\n -y Assume that the answer to simple yes/no questions is 'yes'.\n -F format Specify a format for displaying search results; see the manual.\n -O order Specify how search results should be sorted; see the manual.\n -w width Specify the display width for formatting search results.\n -f Aggressively try to fix broken packages.\n -V Show which versions of packages are to be installed.\n -D Show the dependencies of automatically changed packages.\n -Z Show the change in installed size of each package.\n -v Display extra information. (may be supplied multiple times).\n -t [release] Set the release from which packages should be installed.\n -q In command-line mode, suppress the incremental progress\n indicators.\n -o key=val Directly set the configuration option named 'key'.\n --with(out)-recommends Specify whether or not to treat recommends as\n strong dependencies.\n -S fname Read the aptitude extended status info from fname.\n -u Download new package lists on startup.\n (terminal interface only)\n -i Perform an install run on startup.\n (terminal interface only)\n\nSee the manual page for a complete list and description of all the options.\n\nThis aptitude does not have Super Cow Powers.\n", "stdout_lines": [ "aptitude 0.8.11", "Usage: aptitude [-S fname] [-u|-i]", " aptitude [options] <action> ...", "", "Actions (if none is specified, aptitude will enter interactive mode):", "", " install Install/upgrade packages.", " remove Remove packages.", " purge Remove packages and their configuration files.", " hold Place packages on hold.", " unhold Cancel a hold command for a package.", " markauto Mark packages as having been automatically installed.", " unmarkauto Mark packages as having been manually installed.", " forbid-version Forbid aptitude from upgrading to a specific package version.", " update Download lists of new/upgradable packages.", " safe-upgrade Perform a safe upgrade.", " full-upgrade Perform an upgrade, possibly installing and removing packages.", " build-dep Install the build-dependencies of packages.", " forget-new Forget what packages are \"new\".", " search Search for a package by name and/or expression.", " show Display detailed info about a package.", " showsrc Display detailed info about a source package (apt wrapper).", " versions Displays the versions of specified packages.", " clean Erase downloaded package files.", " autoclean Erase old downloaded package files.", " changelog View a package's changelog.", " download Download the .deb file for a package (apt wrapper).", " source Download source package (apt wrapper).", " reinstall Reinstall a currently installed package.", " why Explain why a particular package should be installed.", " why-not Explain why a particular package cannot be installed.", "", " add-user-tag Add user tag to packages/patterns.", " remove-user-tag Remove user tag from packages/patterns.", "", "Options:", " -h This help text.", " --no-gui Do not use the GTK GUI even if available.", " -s Simulate actions, but do not actually perform them.", " -d Only download packages, do not install or remove anything.", " -P Always prompt for confirmation of actions.", " -y Assume that the answer to simple yes/no questions is 'yes'.", " -F format Specify a format for displaying search results; see the manual.", " -O order Specify how search results should be sorted; see the manual.", " -w width Specify the display width for formatting search results.", " -f Aggressively try to fix broken packages.", " -V Show which versions of packages are to be installed.", " -D Show the dependencies of automatically changed packages.", " -Z Show the change in installed size of each package.", " -v Display extra information. (may be supplied multiple times).", " -t [release] Set the release from which packages should be installed.", " -q In command-line mode, suppress the incremental progress", " indicators.", " -o key=val Directly set the configuration option named 'key'.", " --with(out)-recommends Specify whether or not to treat recommends as", " strong dependencies.", " -S fname Read the aptitude extended status info from fname.", " -u Download new package lists on startup.", " (terminal interface only)", " -i Perform an install run on startup.", " (terminal interface only)", "", "See the manual page for a complete list and description of all the options.", "", "This aptitude does not have Super Cow Powers." ] } ``` ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/77868
https://github.com/ansible/ansible/pull/81445
5deb4ee99118b2b1990d45bd06c7a23a147861f6
2e6d849bdb80364b5229f4b9190935e84ee9bfe8
2022-05-20T17:17:22Z
python
2023-08-23T15:42:03Z
closed
ansible/ansible
https://github.com/ansible/ansible
77,857
["changelogs/fragments/type_shim_exception_swallow.yml", "lib/ansible/module_utils/compat/typing.py"]
"AttributeError: module 'typing_extensions' has no attribute 'OrderedDictTypedDict'" traceback when gathering facts from Ubuntu 20.04 host
### Summary When an Ansible control node running Ubuntu 20.04 attempts to gather facts from itself with `ansible.builtin.gather_facts` using the latest devel branch of ansible-core, the module fails with a traceback. ansible-core 2.13.0 is affected by this issue as well. 2.12.5 is not affected by this issue. ### Issue Type Bug Report ### Component Name gather_facts ### Ansible Version ```console (venv) christopher@ubuntu-playground:~/Ansible/possible-facts-bug$ ansible --version [WARNING]: You are running the development version of Ansible. You should only run Ansible from "devel" if you are modifying the Ansible engine, or trying out features under development. This is a rapidly changing source of code and can become unstable at any point. ansible [core 2.14.0.dev0] config file = None configured module search path = ['/home/christopher/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /home/christopher/Ansible/possible-facts-bug/venv/lib/python3.8/site-packages/ansible ansible collection location = /home/christopher/.ansible/collections:/usr/share/ansible/collections executable location = /home/christopher/Ansible/possible-facts-bug/venv/bin/ansible python version = 3.8.10 (default, Mar 15 2022, 12:22:08) [GCC 9.4.0] (/home/christopher/Ansible/possible-facts-bug/venv/bin/python) jinja version = 3.1.2 libyaml = True ``` ### Configuration ```console (venv) christopher@ubuntu-playground:~/Ansible/possible-facts-bug$ ansible-config dump --only-changed -t all [WARNING]: You are running the development version of Ansible. You should only run Ansible from "devel" if you are modifying the Ansible engine, or trying out features under development. This is a rapidly changing source of code and can become unstable at any point. CONFIG_FILE() = None BECOME: ====== runas: _____ become_user(REQUIRED) = None CACHE: ===== jsonfile: ________ _uri(REQUIRED) = None CALLBACK: ======== CLICONF: ======= CONNECTION: ========== HTTPAPI: ======= INVENTORY: ========= constructed: ___________ plugin(REQUIRED) = None generator: _________ plugin(REQUIRED) = None LOOKUP: ====== config: ______ _terms(REQUIRED) = None dict: ____ _terms(REQUIRED) = None env: ___ _terms(REQUIRED) = None file: ____ _terms(REQUIRED) = None fileglob: ________ _terms(REQUIRED) = None indexed_items: _____________ _terms(REQUIRED) = None ini: ___ _terms(REQUIRED) = None items: _____ _terms(REQUIRED) = None lines: _____ _terms(REQUIRED) = None nested: ______ _raw(REQUIRED) = None password: ________ _terms(REQUIRED) = None pipe: ____ _terms(REQUIRED) = None subelements: ___________ _terms(REQUIRED) = None together: ________ _terms(REQUIRED) = None unvault: _______ _terms(REQUIRED) = None varnames: ________ _terms(REQUIRED) = None vars: ____ _terms(REQUIRED) = None NETCONF: ======= SHELL: ===== VARS: ==== ``` ### OS / Environment Observed when an Ubuntu 20.04 host (which happens to be the Ansible control node as well) is targeted. Sample inventory file: ``` (venv) christopher@ubuntu-playground:~/Ansible/possible-facts-bug$ tree -I venv . └── hosts 0 directories, 1 file (venv) christopher@ubuntu-playground:~/Ansible/possible-facts-bug$ cat hosts --- all: hosts: ubuntu-playground.chrisjhart.net: ansible_host: "192.168.10.51" ansible_user: "christopher" ansible_password: "H0meLab" ansible_become_password: "H0meLab" ``` ### Steps to Reproduce Sample inventory file: ``` (venv) christopher@ubuntu-playground:~/Ansible/possible-facts-bug$ tree -I venv . └── hosts 0 directories, 1 file (venv) christopher@ubuntu-playground:~/Ansible/possible-facts-bug$ cat hosts --- all: hosts: ubuntu-playground.chrisjhart.net: ansible_host: "192.168.10.51" ansible_user: "christopher" ansible_password: "H0meLab" ansible_become_password: "H0meLab" ``` Reproduce this issue with the `ansible -i hosts -m ansible.builtin.gather_facts ubuntu-playground.chrisjhart.net` command. ### Expected Results Facts should be gathered from the Ansible control node successfully if targeted. This works in ansible-core 2.12.5. ``` (venv) christopher@ubuntu-playground:~/Ansible/possible-facts-bug$ pip install ansible-core==2.12.5 Collecting ansible-core==2.12.5 Using cached ansible-core-2.12.5.tar.gz (7.8 MB) Requirement already satisfied: PyYAML in ./venv/lib/python3.8/site-packages (from ansible-core==2.12.5) (6.0) Requirement already satisfied: cryptography in ./venv/lib/python3.8/site-packages (from ansible-core==2.12.5) (37.0.2) Requirement already satisfied: jinja2 in ./venv/lib/python3.8/site-packages (from ansible-core==2.12.5) (3.1.2) Requirement already satisfied: packaging in ./venv/lib/python3.8/site-packages (from ansible-core==2.12.5) (21.3) Requirement already satisfied: resolvelib<0.6.0,>=0.5.3 in ./venv/lib/python3.8/site-packages (from ansible-core==2.12.5) (0.5.4) Requirement already satisfied: cffi>=1.12 in ./venv/lib/python3.8/site-packages (from cryptography->ansible-core==2.12.5) (1.15.0) Requirement already satisfied: MarkupSafe>=2.0 in ./venv/lib/python3.8/site-packages (from jinja2->ansible-core==2.12.5) (2.1.1) Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in ./venv/lib/python3.8/site-packages (from packaging->ansible-core==2.12.5) (3.0.9) Requirement already satisfied: pycparser in ./venv/lib/python3.8/site-packages (from cffi>=1.12->cryptography->ansible-core==2.12.5) (2.21) Building wheels for collected packages: ansible-core Building wheel for ansible-core (setup.py) ... error ERROR: Command errored out with exit status 1: command: /home/christopher/Ansible/possible-facts-bug/venv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-8a160x6y/ansible-core/setup.py'"'"'; __file__='"'"'/tmp/pip-install-8a160x6y/ansible-core/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-3735x_8c cwd: /tmp/pip-install-8a160x6y/ansible-core/ Complete output (6 lines): usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] or: setup.py --help [cmd1 cmd2 ...] or: setup.py --help-commands or: setup.py cmd --help error: invalid command 'bdist_wheel' ---------------------------------------- ERROR: Failed building wheel for ansible-core Running setup.py clean for ansible-core Failed to build ansible-core Installing collected packages: ansible-core Attempting uninstall: ansible-core Found existing installation: ansible-core 2.14.0.dev0 Uninstalling ansible-core-2.14.0.dev0: Successfully uninstalled ansible-core-2.14.0.dev0 Running setup.py install for ansible-core ... done Successfully installed ansible-core-2.12.5 (venv) christopher@ubuntu-playground:~/Ansible/possible-facts-bug$ ansible -i hosts -m ansible.builtin.gather_facts ubuntu-playground.chrisjhart.net | grep SUCCESS ubuntu-playground.chrisjhart.net | SUCCESS => { (venv) christopher@ubuntu-playground:~/Ansible/possible-facts-bug$ python -m pip install https://github.com/ansible/ansible/archive/devel.tar.gz Collecting https://github.com/ansible/ansible/archive/devel.tar.gz Using cached https://github.com/ansible/ansible/archive/devel.tar.gz Installing build dependencies ... done Getting requirements to build wheel ... done Preparing wheel metadata ... done Requirement already satisfied: resolvelib<0.6.0,>=0.5.3 in ./venv/lib/python3.8/site-packages (from ansible-core==2.14.0.dev0) (0.5.4) Requirement already satisfied: packaging in ./venv/lib/python3.8/site-packages (from ansible-core==2.14.0.dev0) (21.3) Requirement already satisfied: cryptography in ./venv/lib/python3.8/site-packages (from ansible-core==2.14.0.dev0) (37.0.2) Requirement already satisfied: PyYAML in ./venv/lib/python3.8/site-packages (from ansible-core==2.14.0.dev0) (6.0) Requirement already satisfied: jinja2>=3.0.0 in ./venv/lib/python3.8/site-packages (from ansible-core==2.14.0.dev0) (3.1.2) Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in ./venv/lib/python3.8/site-packages (from packaging->ansible-core==2.14.0.dev0) (3.0.9) Requirement already satisfied: cffi>=1.12 in ./venv/lib/python3.8/site-packages (from cryptography->ansible-core==2.14.0.dev0) (1.15.0) Requirement already satisfied: MarkupSafe>=2.0 in ./venv/lib/python3.8/site-packages (from jinja2>=3.0.0->ansible-core==2.14.0.dev0) (2.1.1) Requirement already satisfied: pycparser in ./venv/lib/python3.8/site-packages (from cffi>=1.12->cryptography->ansible-core==2.14.0.dev0) (2.21) Building wheels for collected packages: ansible-core Building wheel for ansible-core (PEP 517) ... done Created wheel for ansible-core: filename=ansible_core-2.14.0.dev0-py3-none-any.whl size=2097686 sha256=cb61c006e233500f064688a6d6bbfe272fdb5e0d0a4b8d9bc80dbdbe58617f07 Stored in directory: /tmp/pip-ephem-wheel-cache-2r1h9any/wheels/8c/45/49/f37d83e18a917d0761921cc61a5e1056a364fbbdf41f633983 Successfully built ansible-core Installing collected packages: ansible-core Attempting uninstall: ansible-core Found existing installation: ansible-core 2.12.5 Uninstalling ansible-core-2.12.5: Successfully uninstalled ansible-core-2.12.5 Successfully installed ansible-core-2.14.0.dev0 (venv) christopher@ubuntu-playground:~/Ansible/possible-facts-bug$ ansible -i hosts -m ansible.builtin.gather_facts ubuntu-playground.chrisjhart.net | grep FAILURE [WARNING]: You are running the development version of Ansible. You should only run Ansible from "devel" if you are modifying the Ansible engine, or trying out features under development. This is a rapidly changing source of code and can become unstable at any point. "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", ``` ### Actual Results ```console (venv) christopher@ubuntu-playground:~/Ansible/possible-facts-bug$ ansible -i hosts -m ansible.builtin.gather_facts ubuntu-playground.chrisjhart.net [WARNING]: You are running the development version of Ansible. You should only run Ansible from "devel" if you are modifying the Ansible engine, or trying out features under development. This is a rapidly changing source of code and can become unstable at any point. ubuntu-playground.chrisjhart.net | FAILED! => { "ansible_facts": {}, "changed": false, "failed_modules": { "ansible.legacy.setup": { "ansible_facts": { "discovered_interpreter_python": "/usr/bin/python3" }, "exception": "Traceback (most recent call last):\r\n File \"/home/christopher/.ansible/tmp/ansible-tmp-1652983732.2403364-4039422-225017112537627/AnsiballZ_setup.py\", line 107, in <module>\r\n _ansiballz_main()\r\n File \"/home/christopher/.ansible/tmp/ansible-tmp-1652983732.2403364-4039422-225017112537627/AnsiballZ_setup.py\", line 99, in _ansiballz_main\r\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\r\n File \"/home/christopher/.ansible/tmp/ansible-tmp-1652983732.2403364-4039422-225017112537627/AnsiballZ_setup.py\", line 47, in invoke_module\r\n runpy.run_module(mod_name='ansible.modules.setup', init_globals=dict(_module_fqn='ansible.modules.setup', _modlib_path=modlib_path),\r\n File \"/usr/lib/python3.8/runpy.py\", line 207, in run_module\r\n return _run_module_code(code, init_globals, run_name, mod_spec)\r\n File \"/usr/lib/python3.8/runpy.py\", line 97, in _run_module_code\r\n _run_code(code, mod_globals, init_globals,\r\n File \"/usr/lib/python3.8/runpy.py\", line 87, in _run_code\r\n exec(code, run_globals)\r\n File \"/tmp/ansible_ansible.legacy.setup_payload_4kdoi295/ansible_ansible.legacy.setup_payload.zip/ansible/modules/setup.py\", line 168, in <module>\r\n File \"<frozen importlib._bootstrap>\", line 991, in _find_and_load\r\n File \"<frozen importlib._bootstrap>\", line 975, in _find_and_load_unlocked\r\n File \"<frozen importlib._bootstrap>\", line 655, in _load_unlocked\r\n File \"<frozen importlib._bootstrap>\", line 618, in _load_backward_compatible\r\n File \"<frozen zipimport>\", line 259, in load_module\r\n File \"/tmp/ansible_ansible.legacy.setup_payload_4kdoi295/ansible_ansible.legacy.setup_payload.zip/ansible/module_utils/facts/__init__.py\", line 34, in <module>\r\n File \"<frozen importlib._bootstrap>\", line 991, in _find_and_load\r\n File \"<frozen importlib._bootstrap>\", line 975, in _find_and_load_unlocked\r\n File \"<frozen importlib._bootstrap>\", line 655, in _load_unlocked\r\n File \"<frozen importlib._bootstrap>\", line 618, in _load_backward_compatible\r\n File \"<frozen zipimport>\", line 259, in load_module\r\n File \"/tmp/ansible_ansible.legacy.setup_payload_4kdoi295/ansible_ansible.legacy.setup_payload.zip/ansible/module_utils/facts/compat.py\", line 33, in <module>\r\n File \"<frozen importlib._bootstrap>\", line 991, in _find_and_load\r\n File \"<frozen importlib._bootstrap>\", line 975, in _find_and_load_unlocked\r\n File \"<frozen importlib._bootstrap>\", line 655, in _load_unlocked\r\n File \"<frozen importlib._bootstrap>\", line 618, in _load_backward_compatible\r\n File \"<frozen zipimport>\", line 259, in load_module\r\n File \"/tmp/ansible_ansible.legacy.setup_payload_4kdoi295/ansible_ansible.legacy.setup_payload.zip/ansible/module_utils/facts/default_collectors.py\", line 31, in <module>\r\n File \"<frozen importlib._bootstrap>\", line 991, in _find_and_load\r\n File \"<frozen importlib._bootstrap>\", line 975, in _find_and_load_unlocked\r\n File \"<frozen importlib._bootstrap>\", line 655, in _load_unlocked\r\n File \"<frozen importlib._bootstrap>\", line 618, in _load_backward_compatible\r\n File \"<frozen zipimport>\", line 259, in load_module\r\n File \"/tmp/ansible_ansible.legacy.setup_payload_4kdoi295/ansible_ansible.legacy.setup_payload.zip/ansible/module_utils/compat/typing.py\", line 8, in <module>\r\n * Two classes whose instances can be type arguments in addition to types: ForwardRef and TypeVar\r\nAttributeError: module 'typing_extensions' has no attribute 'OrderedDictTypedDict'\r\n", "failed": true, "module_stderr": "Shared connection to 192.168.10.51 closed.\r\n", "module_stdout": "Traceback (most recent call last):\r\n File \"/home/christopher/.ansible/tmp/ansible-tmp-1652983732.2403364-4039422-225017112537627/AnsiballZ_setup.py\", line 107, in <module>\r\n _ansiballz_main()\r\n File \"/home/christopher/.ansible/tmp/ansible-tmp-1652983732.2403364-4039422-225017112537627/AnsiballZ_setup.py\", line 99, in _ansiballz_main\r\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\r\n File \"/home/christopher/.ansible/tmp/ansible-tmp-1652983732.2403364-4039422-225017112537627/AnsiballZ_setup.py\", line 47, in invoke_module\r\n runpy.run_module(mod_name='ansible.modules.setup', init_globals=dict(_module_fqn='ansible.modules.setup', _modlib_path=modlib_path),\r\n File \"/usr/lib/python3.8/runpy.py\", line 207, in run_module\r\n return _run_module_code(code, init_globals, run_name, mod_spec)\r\n File \"/usr/lib/python3.8/runpy.py\", line 97, in _run_module_code\r\n _run_code(code, mod_globals, init_globals,\r\n File \"/usr/lib/python3.8/runpy.py\", line 87, in _run_code\r\n exec(code, run_globals)\r\n File \"/tmp/ansible_ansible.legacy.setup_payload_4kdoi295/ansible_ansible.legacy.setup_payload.zip/ansible/modules/setup.py\", line 168, in <module>\r\n File \"<frozen importlib._bootstrap>\", line 991, in _find_and_load\r\n File \"<frozen importlib._bootstrap>\", line 975, in _find_and_load_unlocked\r\n File \"<frozen importlib._bootstrap>\", line 655, in _load_unlocked\r\n File \"<frozen importlib._bootstrap>\", line 618, in _load_backward_compatible\r\n File \"<frozen zipimport>\", line 259, in load_module\r\n File \"/tmp/ansible_ansible.legacy.setup_payload_4kdoi295/ansible_ansible.legacy.setup_payload.zip/ansible/module_utils/facts/__init__.py\", line 34, in <module>\r\n File \"<frozen importlib._bootstrap>\", line 991, in _find_and_load\r\n File \"<frozen importlib._bootstrap>\", line 975, in _find_and_load_unlocked\r\n File \"<frozen importlib._bootstrap>\", line 655, in _load_unlocked\r\n File \"<frozen importlib._bootstrap>\", line 618, in _load_backward_compatible\r\n File \"<frozen zipimport>\", line 259, in load_module\r\n File \"/tmp/ansible_ansible.legacy.setup_payload_4kdoi295/ansible_ansible.legacy.setup_payload.zip/ansible/module_utils/facts/compat.py\", line 33, in <module>\r\n File \"<frozen importlib._bootstrap>\", line 991, in _find_and_load\r\n File \"<frozen importlib._bootstrap>\", line 975, in _find_and_load_unlocked\r\n File \"<frozen importlib._bootstrap>\", line 655, in _load_unlocked\r\n File \"<frozen importlib._bootstrap>\", line 618, in _load_backward_compatible\r\n File \"<frozen zipimport>\", line 259, in load_module\r\n File \"/tmp/ansible_ansible.legacy.setup_payload_4kdoi295/ansible_ansible.legacy.setup_payload.zip/ansible/module_utils/facts/default_collectors.py\", line 31, in <module>\r\n File \"<frozen importlib._bootstrap>\", line 991, in _find_and_load\r\n File \"<frozen importlib._bootstrap>\", line 975, in _find_and_load_unlocked\r\n File \"<frozen importlib._bootstrap>\", line 655, in _load_unlocked\r\n File \"<frozen importlib._bootstrap>\", line 618, in _load_backward_compatible\r\n File \"<frozen zipimport>\", line 259, in load_module\r\n File \"/tmp/ansible_ansible.legacy.setup_payload_4kdoi295/ansible_ansible.legacy.setup_payload.zip/ansible/module_utils/compat/typing.py\", line 8, in <module>\r\n * Two classes whose instances can be type arguments in addition to types: ForwardRef and TypeVar\r\nAttributeError: module 'typing_extensions' has no attribute 'OrderedDictTypedDict'\r\n", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1 } }, "msg": "The following modules failed to execute: ansible.legacy.setup\n" } ``` ```pytb Traceback (most recent call last): File "/home/christopher/.ansible/tmp/ansible-tmp-1652983732.2403364-4039422-225017112537627/AnsiballZ_setup.py", line 107, in <module> _ansiballz_main() File "/home/christopher/.ansible/tmp/ansible-tmp-1652983732.2403364-4039422-225017112537627/AnsiballZ_setup.py", line 99, in _ansiballz_main invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS) File "/home/christopher/.ansible/tmp/ansible-tmp-1652983732.2403364-4039422-225017112537627/AnsiballZ_setup.py", line 47, in invoke_module runpy.run_module(mod_name='ansible.modules.setup', init_globals=dict(_module_fqn='ansible.modules.setup', _modlib_path=modlib_path), File "/usr/lib/python3.8/runpy.py", line 207, in run_module return _run_module_code(code, init_globals, run_name, mod_spec) File "/usr/lib/python3.8/runpy.py", line 97, in _run_module_code _run_code(code, mod_globals, init_globals, File "/usr/lib/python3.8/runpy.py", line 87, in _run_code exec(code, run_globals) File "/tmp/ansible_ansible.legacy.setup_payload_4kdoi295/ansible_ansible.legacy.setup_payload.zip/ansible/modules/setup.py", line 168, in <module> File "<frozen importlib._bootstrap>", line 991, in _find_and_load File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 655, in _load_unlocked File "<frozen importlib._bootstrap>", line 618, in _load_backward_compatible File "<frozen zipimport>", line 259, in load_module File "/tmp/ansible_ansible.legacy.setup_payload_4kdoi295/ansible_ansible.legacy.setup_payload.zip/ansible/module_utils/facts/__init__.py", line 34, in <module> File "<frozen importlib._bootstrap>", line 991, in _find_and_load File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 655, in _load_unlocked File "<frozen importlib._bootstrap>", line 618, in _load_backward_compatible File "<frozen zipimport>", line 259, in load_module File "/tmp/ansible_ansible.legacy.setup_payload_4kdoi295/ansible_ansible.legacy.setup_payload.zip/ansible/module_utils/facts/compat.py", line 33, in <module> File "<frozen importlib._bootstrap>", line 991, in _find_and_load File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 655, in _load_unlocked File "<frozen importlib._bootstrap>", line 618, in _load_backward_compatible File "<frozen zipimport>", line 259, in load_module File "/tmp/ansible_ansible.legacy.setup_payload_4kdoi295/ansible_ansible.legacy.setup_payload.zip/ansible/module_utils/facts/default_collectors.py", line 31, in <module> File "<frozen importlib._bootstrap>", line 991, in _find_and_load File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 655, in _load_unlocked File "<frozen importlib._bootstrap>", line 618, in _load_backward_compatible File "<frozen zipimport>", line 259, in load_module File "/tmp/ansible_ansible.legacy.setup_payload_4kdoi295/ansible_ansible.legacy.setup_payload.zip/ansible/module_utils/compat/typing.py", line 8, in <module> * Two classes whose instances can be type arguments in addition to types: ForwardRef and TypeVar AttributeError: module 'typing_extensions' has no attribute 'OrderedDictTypedDict' ``` ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/77857
https://github.com/ansible/ansible/pull/77860
e7e1d592a699f02e591965e252751e3b24c7220d
813afcbbb48a17e2221b926d3cf86fcdf0459555
2022-05-19T18:19:43Z
python
2022-05-25T19:41:06Z
closed
ansible/ansible
https://github.com/ansible/ansible
77,849
["changelogs/fragments/78172-allow-force-deletion-of-group.yaml", "lib/ansible/modules/group.py", "test/integration/targets/group/tasks/tests.yml"]
ansible.builtin.group should support "force" option, corresponding to `groupdel --force`
### Summary As part of a project to rename a user, I created a second user and group with the same UID as the first, something with Ansible supports by expliciting setting the `uid` to an pre-existing value. Now the transition is complete and it's time to remove the old group. But Ansible can't do it, it fails with an error: "groupdel: cannot remove the primary group of user" Arguably, this could be a considered a bug with "groupdel", because I wasn't deleting the *only* primary group of the user. If `groupdel` allowed the deletion, the user still would have a primary group-- the new one with the same gid. It seems the solution that `groupdel` recommends though is to use the `--force` option, which is documented as being an override designed for cases like this. Here's the exact documentation for `--force` from `man groupdel`: > This option forces the removal of the group, even if there's some user having the group as the primary one. Ansible should support `force: true` for the `group` builtin, defaulting to false. When `true`, On Linux call `groupdel` with the `-f` option. Support using the longer `--force` flag was only fixed more recently (https://github.com/shadow-maint/shadow/pull/290). Since `-f` has been supported for longer, it should be used instead. ### Issue Type Feature Idea ### Component Name group ### Additional Information ```yaml force: yes ``` ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/77849
https://github.com/ansible/ansible/pull/78172
a3531ac422c727df0748812c73a38f9950eebda9
d72326b6af7dab2b2fdf0a13e6ae6946b734375e
2022-05-18T20:41:48Z
python
2022-11-09T20:52:27Z
closed
ansible/ansible
https://github.com/ansible/ansible
77,803
["changelogs/fragments/a-g-col-install-directory-with-trailing-sep.yml", "lib/ansible/galaxy/dependency_resolution/dataclasses.py", "test/integration/targets/ansible-galaxy-collection/tasks/install.yml"]
ansible-galaxy collection install of local collection fails if collection directory ends with '/'
### Summary When trying to install a collection from a local directory, it fails if the directory has a trailing slash (/). If the trailing slash is removed, the installation succeeds. ### Issue Type Bug Report ### Component Name ansible-galaxy ### Ansible Version ```console $ ansible --version ansible [core 2.14.0.dev0] config file = /etc/ansible/ansible.cfg configured module search path = ['/home/redacted/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /home/redacted/.virtualenvs/dev-ansible/lib/python3.10/site-packages/ansible ansible collection location = /home/redacted/.ansible/collections:/usr/share/ansible/collections executable location = /home/redacted/.virtualenvs/dev-ansible/bin/ansible python version = 3.10.4 (main, Apr 8 2022, 17:35:13) [GCC 9.4.0] (/home/redacted/.virtualenvs/dev-ansible/bin/python3) jinja version = 3.1.2 libyaml = True ``` ### Configuration ```console $ ansible-config dump --only-changed CONFIG_FILE() = /etc/ansible/ansible.cfg ``` ### OS / Environment Ubuntu 20.04 Python 3.10.4 ### Steps to Reproduce <!--- Paste example playbooks or commands between quotes below --> ```yaml (paste below) ansible-galaxy collection install -vvvvvv -f -p ~/devcollections ansible-collection-dir/ ``` ### Expected Results I expected the collection to be installed. ### Actual Results The relevant part of the output is "b'ansible-collection-dir/lugins/README.md'". As can be seen, the "plugins" directory name is being truncated by one character. ```console ansible-galaxy [core 2.14.0.dev0] config file = /etc/ansible/ansible.cfg configured module search path = ['/home/redacted/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /home/redacted/.virtualenvs/dev-ansible/lib/python3.10/site-packages/ansible ansible collection location = /home/redacted/.ansible/collections:/usr/share/ansible/collections executable location = /home/redacted/.virtualenvs/dev-ansible/bin/ansible-galaxy python version = 3.10.4 (main, Apr 8 2022, 17:35:13) [GCC 9.4.0] (/home/redacted/.virtualenvs/dev-ansible/bin/python3) jinja version = 3.1.2 libyaml = True Using /etc/ansible/ansible.cfg as config file Starting galaxy collection install process [WARNING]: The specified collections path '/home/redacted/devcollections' is not part of the configured Ansible collections paths '/home/redacted/.ansible/collections:/usr/share/ansible/collections'. The installed collection will not be picked up in an Ansible run, unless within a playbook-adjacent collections directory. Process install dependency map Starting collection install process Installing 'mynamespace.mycollection:1.0.0' to '/home/redacted/devcollections/ansible_collections/mynamespace.mycollection' Skipping 'ansible-collection-dir/.git' for collection build Skipping 'ansible-collection-dir/galaxy.yml' for collection build ERROR! Unexpected Exception, this is probably a bug: [Errno 2] No such file or directory: b'ansible-collection-dir/lugins/README.md' the full traceback was: Traceback (most recent call last): File "/home/redacted/.virtualenvs/dev-ansible/lib/python3.10/site-packages/ansible/cli/__init__.py", line 623, in cli_executor exit_code = cli.run() File "/home/redacted/.virtualenvs/dev-ansible/lib/python3.10/site-packages/ansible/cli/galaxy.py", line 646, in run return context.CLIARGS['func']() File "/home/redacted/.virtualenvs/dev-ansible/lib/python3.10/site-packages/ansible/cli/galaxy.py", line 102, in method_wrapper return wrapped_method(*args, **kwargs) File "/home/redacted/.virtualenvs/dev-ansible/lib/python3.10/site-packages/ansible/cli/galaxy.py", line 1300, in execute_install self._execute_install_collection( File "/home/redacted/.virtualenvs/dev-ansible/lib/python3.10/site-packages/ansible/cli/galaxy.py", line 1328, in _execute_install_collection install_collections( File "/home/redacted/.virtualenvs/dev-ansible/lib/python3.10/site-packages/ansible/galaxy/collection/__init__.py", line 719, in install_collections install(concrete_coll_pin, output_path, artifacts_manager) File "/home/redacted/.virtualenvs/dev-ansible/lib/python3.10/site-packages/ansible/galaxy/collection/__init__.py", line 1276, in install install_src(collection, b_artifact_path, b_collection_path, artifacts_manager) File "/home/redacted/.virtualenvs/dev-ansible/lib/python3.10/site-packages/ansible/galaxy/collection/__init__.py", line 1410, in install_src collection_output_path = _build_collection_dir( File "/home/redacted/.virtualenvs/dev-ansible/lib/python3.10/site-packages/ansible/galaxy/collection/__init__.py", line 1205, in _build_collection_dir existing_is_exec = os.stat(src_file).st_mode & stat.S_IXUSR FileNotFoundError: [Errno 2] No such file or directory: b'ansible-collection-dir/lugins/README.md' ``` ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/77803
https://github.com/ansible/ansible/pull/79110
676b731e6f7d60ce6fd48c0d1c883fc85f5c6537
964e678a7fa3b0745f9302e7a3682851089d09d2
2022-05-13T18:29:08Z
python
2023-04-17T19:24:55Z
closed
ansible/ansible
https://github.com/ansible/ansible
77,792
["changelogs/fragments/77792-fix-facts-discovery-specific-interface-names.yml", "lib/ansible/module_utils/facts/network/linux.py"]
linux ip address discovery fails for interface named 'primary'
### Summary If a network interface is named 'primary', the current set of `ip addr` commands issued by module_utils/facts/network/linux.py will not give the desired results, resulting in wrong ansible facts. The fix seems very simple, instead of: ``` args = [ip_path, 'addr', 'show', 'primary', device] ... args = [ip_path, 'addr', 'show', 'secondary', device] ``` We can do: ``` args = [ip_path, 'addr', 'show', 'primary', 'dev', device] ... args = [ip_path, 'addr', 'show', 'secondary', 'dev', device] ``` By adding "dev" keyword, then it makes it clear that `ip addr` command should return data from that specific device, regardless of whether the device name conflicts with another `ip addr show` keyword (such as "primary", "secondary", "deprecated", "dadfailed", "temporary", etc) ### Issue Type Bug Report ### Component Name facts ### Ansible Version ```console $ ansible --version ansible [core 2.11.8] config file = None configured module search path = ['/Users/rob.muir/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /Users/rob.muir/workspace/geos/build/.env/lib/python3.9/site-packages/ansible ansible collection location = /Users/rob.muir/.ansible/collections:/usr/share/ansible/collections executable location = /Users/rob.muir/workspace/geos/build/.env/bin/ansible python version = 3.9.1 (default, Dec 28 2020, 11:24:06) [Clang 12.0.0 (clang-1200.0.32.28)] jinja version = 3.1.1 libyaml = False ``` ### Configuration ```console $ ansible-config dump --only-changed <no output> ``` ### OS / Environment MacOS X controller, Centos 7 host ### Steps to Reproduce <!--- Paste example playbooks or commands between quotes below --> ``` # Add network interface named "primary" ip link add primary type dummy # Add some IP addresses to the device to test discovery ip address add 192.168.50.1/24 dev primary ip address add 192.168.50.2/24 dev primary ip address add 192.168.51.1/24 dev primary # set interface "UP" ip link set primary up # discover facts ``` ### Expected Results Expect ansible to discover IP addresses (both primary and secondary) correctly,. ``` ok: [test] => { "hostvars": { "test": { "ansible_all_ipv4_addresses": [ "192.168.50.1", "192.168.51.1", "192.168.50.2", "10.0.2.15" ], ``` ### Actual Results ```console Unfortunately, today any actual secondary addresses will be missing. Also there will be duplicates, which happens because the interface name collides with a special keyword to `ip address show` and because we arent supplying `dev` to make it unambiguous: ok: [test] => { "hostvars": { "test": { "ansible_all_ipv4_addresses": [ "10.0.2.15", "192.168.50.1", "192.168.51.1", "10.0.2.15", "192.168.50.1", "192.168.51.1", "10.0.2.15" ], ``` ``` ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/77792
https://github.com/ansible/ansible/pull/77793
400475acc033ea146c8dc4929e347166ee85c0e6
0f882d010fda19c9bc591a3eb0b6ded6249886c3
2022-05-13T13:06:57Z
python
2022-05-23T06:58:31Z
closed
ansible/ansible
https://github.com/ansible/ansible
77,788
["changelogs/fragments/77789-catch-keyerror-lookup-dict.yml", "lib/ansible/template/__init__.py", "test/integration/targets/templating_lookups/runme.sh", "test/integration/targets/templating_lookups/template_lookups/mock_lookup_plugins/77788.py", "test/integration/targets/templating_lookups/template_lookups/tasks/main.yml"]
lookup plugin broken when wantlist=False
### Summary Copied from amazon.aws https://github.com/ansible-collections/amazon.aws/issues/633 https://github.com/ansible/ansible/pull/75587 appears to have broken amazon.aws.lookup_aws_account_attribute when running wantlist=False ### Issue Type Bug Report ### Component Name lib/ansible/template/__init__.py ### Ansible Version ```console $ ansible --version ansible [core 2.14.0.dev0] (devel f75bb09a8b) last updated 2022/05/12 17:31:50 (GMT -400) config file = None configured module search path = ['/home/josephtorcasso/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /home/josephtorcasso/633/ansible/lib/ansible ansible collection location = /home/josephtorcasso/.ansible/collections:/usr/share/ansible/collections executable location = /home/josephtorcasso/633/venv/bin/ansible python version = 3.10.4 (main, Mar 25 2022, 00:00:00) [GCC 11.2.1 20220127 (Red Hat 11.2.1-9)] (/home/josephtorcasso/633/venv/bin/python3) jinja version = 3.1.2 libyaml = True ``` ### Configuration ```console $ ansible-config dump --only-changed ``` ### OS / Environment Fedora 35 ### Steps to Reproduce <!--- Paste example playbooks or commands between quotes below --> Running integration tests for ansible.aws lookup_aws_account_attribute ### Expected Results Expected tests to pass using wantlist=False ### Actual Results ```console TASK [lookup_aws_account_attribute : Fetch all account attributes (wantlist=False)] ******************************************************************************************************************************* task path: /root/ansible_collections/amazon/aws/tests/output/.tmp/integration/lookup_aws_account_attribute-bjtiq49h-ÅÑŚÌβŁÈ/tests/integration/targets/lookup_aws_account_attribute/tasks/main.yaml:50 The full traceback is: Traceback (most recent call last): File "/root/ansible/lib/ansible/executor/task_executor.py", line 503, in _execute self._task.post_validate(templar=templar) File "/root/ansible/lib/ansible/playbook/task.py", line 283, in post_validate super(Task, self).post_validate(templar) File "/root/ansible/lib/ansible/playbook/base.py", line 650, in post_validate value = templar.template(getattr(self, name)) File "/root/ansible/lib/ansible/template/__init__.py", line 874, in template d[k] = self.template( File "/root/ansible/lib/ansible/template/__init__.py", line 842, in template result = self.do_template( File "/root/ansible/lib/ansible/template/__init__.py", line 1101, in do_template res = ansible_concat(rf, convert_data, myenv.variable_start_string) File "/root/ansible/lib/ansible/template/native_helpers.py", line 60, in ansible_concat head = list(islice(nodes, 2)) File "<template>", line 13, in root File "/usr/lib/python3.10/dist-packages/jinja2/runtime.py", line 349, in call return __obj(*args, **kwargs) File "/root/ansible/lib/ansible/template/__init__.py", line 1013, in _lookup if isinstance(ran[0], NativeJinjaText): KeyError: 0 fatal: [testhost]: FAILED! => { "changed": false } ``` ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/77788
https://github.com/ansible/ansible/pull/77789
5e50284693cb5531eb4265a0ab94b35be89457f6
c9ce7d08a256646abdaccc80b480b8b9c2df9f1b
2022-05-13T01:16:52Z
python
2022-05-17T16:24:53Z
closed
ansible/ansible
https://github.com/ansible/ansible
77,776
["docs/docsite/rst/user_guide/quickstart.rst"]
Quickstart video does not exist
### Summary At the top of the page "Ansible Quickstart Guide" https://docs.ansible.com/ansible/latest/user_guide/quickstart.html#quickstart-guide There is a link to "The [quickstart video](https://www.ansible.com/resources/videos/quick-start-video) is about 13 minutes long and gives you a high level introduction to Ansible" My expectation is that there will be a video on that page. My reality is that there is no video on that page. ### Issue Type Documentation Report ### Component Name NA ### Ansible Version ```console $ ansible --version NA ``` ### Configuration ```console $ ansible-config dump --only-changed NA ``` ### OS / Environment Chrome ### Additional Information NA ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/77776
https://github.com/ansible/ansible/pull/77779
654fff05e6f9ae51084dbc866ca30020aa960fb2
f75bb09a8b60870d640835f4309d318539fdef96
2022-05-11T15:12:31Z
python
2022-05-12T14:34:45Z
closed
ansible/ansible
https://github.com/ansible/ansible
77,698
["docs/docsite/rst/user_guide/become.rst"]
Ansible Unable To Run win_powershell with become: yes (Win32ErrorCode 1314)
### Summary https://docs.ansible.com/ansible/latest/user_guide/become.html#limitations-of-become-on-windows I am currently working on getting a AD service account built for Ansible to use to manage member servers and domain controllers in our domain. Both our Linux and Windows machines are joined to the same domain but for the sake of this issue, I am limiting my tests to Windows. I am using SSH to connect into our Windows hosts. I have followed the documentation linked and am now able to login to our hosts via SSH and run anything that does not use `become: yes`. However, when I try the following code block I get this error. ``` - name: Base Connection Tester hosts: tester-host gather_facts: no #debugger: on_failed tasks: # Windows - ansible.windows.win_whoami: - ansible.windows.win_powershell: script: | Write-Output "Hello world this is $(whoami) on $($env:COMPUTERNAME)" become: yes register: pwsh_output - debug: msg: "{{ pwsh_output.output[0] }}" vars: ansible_user: "[email protected]" ansible_become_user: "[email protected]" ansible_ssh_pass: "redacted" ansible_become_pass: "redacted" ansible_connection: ssh ansible_shell_type: powershell ansible_become_method: runas ansible_platform: windows ansible_shell_executable: None ``` ``` TASK [ansible.windows.win_whoami] ok: [tester-host] => { . . . "login_domain": "DOMAIN", "login_time": "2022-04-28T19:13:07.1060743+00:00", "logon_id": 14989898, "logon_server": "TESTER-HOST", "logon_type": "NetworkCleartext", "privileges": { "SeChangeNotifyPrivilege": "enabled-by-default", "SeDebugPrivilege": "enabled-by-default", "SeIncreaseWorkingSetPrivilege": "enabled-by-default" }, "rights": [], "token_type": "TokenPrimary", "upn": "[email protected]", "user_flags": [] } . . . TASK [ansible.windows.win_powershell] . . . The full traceback is: Exception calling "CreateProcessAsUser" with "9" argument(s): "CreateProcessWithTokenW() failed (A required privilege is not held by the client, Win32ErrorCode 1314)" At line:103 char:5 + $result = [Ansible.Become.BecomeUtil]::CreateProcessAsUser($usern ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : Win32Exception ScriptStackTrace: at <ScriptBlock>, <No file>: line 103 at <ScriptBlock><End>, <No file>: line 137 at <ScriptBlock>, <No file>: line 11 System.Management.Automation.MethodInvocationException: Exception calling "CreateProcessAsUser" with "9" argument(s): "CreateProcessWithTokenW() failed (A required privilege is not held by the client, Win32ErrorCode 1314)" ---> Ansible.Process.Win32Exception: CreateProcessWithTokenW() failed (A required privilege is not held by the client, Win32ErrorCode 1314) at Ansible.Become.BecomeUtil.CreateProcessAsUser(String username, String password, LogonFlags logonFlags, LogonType logonType, String lpApplicationName, String lpCommandLine, String lpCurrentDirectory, IDictionary environment, Byte[] stdin) in c:\Users\ansible\AppData\Local\Temp\qcsb3ejc.1.cs:line 309 at CallSite.Target(Closure , CallSite , Type , Object , Object , Object , Object , Object , Object , Object , Object , Object ) --- End of inner exception stack trace --- at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception) at System.Management.Automation.Interpreter.ActionCallInstruction`2.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame) fatal: [tester-host]: FAILED! => { "changed": false, "msg": "internal error: failed to become user '[email protected]': Exception calling \"CreateProcessAsUser\" with \"9\" argument(s): \"CreateProcessWithTokenW() failed (A required privilege is not held by the client, Win32ErrorCode 1314)\"" } ``` In the documentation it says that the user needs to inherit the `SeAllowLogOnLocally` privilege in order for the become process to succeed. After some research I found [this issue from 2018](https://github.com/ansible/ansible/issues/40310) which seemed similar to my issue. I followed their verification steps and can confirm that the ansible user is getting the permissions it needs. On the tester-host I checked the Local Security Policy and saw the following. ![image](https://user-images.githubusercontent.com/42121635/165967322-997871d9-7ea8-485c-9068-a87b968384de.png) My ansible account can log on locally, debug programs, and log on as a service and yes in the `win_whoami` output I do not see this `SeAllowLogOnLocally` privilege listed which is puzzling. My end goal is to create a least privilege domain account that Ansible can use to manage our Windows domain joined instances (and hopefully even the domain controllers). I would love to update the documentation to be more detailed but first I have to figure out what exactly I am missing here. Any help or tips that anyone is willing to share would be greatly appreciated. Thanks! ### Issue Type Documentation Report ### Component Name https://docs.ansible.com/ansible/latest/user_guide/become.html ### Ansible Version ```console $ ansible --version ansible [core 2.12.2] config file = /home/picnicsecurity/ansible.cfg configured module search path = ['/home/picnicsecurity/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/lib/python3/dist-packages/ansible ansible collection location = /home/picnicsecurity/.ansible/collections:/usr/share/ansible/collections executable location = /usr/bin/ansible python version = 3.8.10 (default, Mar 15 2022, 12:22:08) [GCC 9.4.0] jinja version = 2.10.1 libyaml = True ``` ### Configuration ```console $ ansible-config dump --only-changed ``` ### OS / Environment $ cat /etc/os-release NAME="Ubuntu" VERSION="20.04.3 LTS (Focal Fossa)" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 20.04.3 LTS" VERSION_ID="20.04" HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" VERSION_CODENAME=focal UBUNTU_CODENAME=focal ### Additional Information Provides a straightforward guide on how to allow Ansible to SSH into domain joined Windows hosts since not everyone uses WinRM. ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/77698
https://github.com/ansible/ansible/pull/77722
fbc5b3f9c520f3c360020fa5bf4290f8b875203e
dd094a4413ff7f8af018f105c296005675215236
2022-04-29T14:52:03Z
python
2022-05-05T14:16:37Z
closed
ansible/ansible
https://github.com/ansible/ansible
77,690
["changelogs/fragments/77693-actually-ignore-unreachable.yml", "lib/ansible/plugins/callback/default.py", "lib/ansible/plugins/strategy/__init__.py"]
`ignore_unreachable` counts stats differently than `ignore_errors`
### Summary When using `ignore_errors`, following things happen (which i'd expect): 1. Task output shows `...ignoring` 2. `ok` and `ignored` counters are increased But using `ignore_unreachable` yields in a completely different result: 1. Task output **does not** show `...ignoring` 2. `unreachable` and `skipped` counters are increased instead I would expect `ignore_unreachable` to behave just like `ignore_errors`. --- There is a similiar issue https://github.com/ansible/ansible/issues/76895, which was closed by @mkrizek [comment](https://github.com/ansible/ansible/issues/76895#issuecomment-1026986479) stating that `ignore_errors` does not affect `failed` counter. However, my testing reveals that's not the case (at least with recent versions) ### Issue Type Bug Report ### Component Name stats ### Ansible Version ```console $ ansible --version ansible [core 2.12.5] config file = /etc/ansible/ansible.cfg configured module search path = ['/home/kristian/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /home/kristian/playground/ansible-ingore-unreachable-stats/venv/lib/python3.8/site-packages/ansible ansible collection location = /home/kristian/.ansible/collections:/usr/share/ansible/collections executable location = /home/kristian/playground/ansible-ingore-unreachable-stats/venv/bin/ansible python version = 3.8.12 (default, Dec 27 2021, 16:48:07) [GCC 11.1.0] jinja version = 3.1.2 libyaml = True ``` ### Configuration ```console $ ansible-config dump --only-changed No custom config, all defaults ``` ### OS / Environment - Arch Linux (kernel version 5.17.4-arch1-1) - Python 3.10.4 - ansible-core installed via pip (inside fresh venv) ### Steps to Reproduce Quick and dirty "one-liner": ```shell ansible-playbook <(cat <<PLAYBOOK - hosts: localhost gather_facts: false become: false vars: # Simulate unreachable host using invalid configuration ansible_connection: ssh ansible_ssh_user: "non-existent-user" tasks: - name: failed task fail: msg=failure ignore_errors: true - name: unreachable task action: ping ignore_unreachable: true PLAYBOOK ) ``` ### Expected Results I'd expect to `ignore_unreachable` behave just like `ignore_errors` does: ```diff TASK [failed task] ********************************************************************************************************************************************************************************************************************* fatal: [localhost]: FAILED! => {"changed": false, "msg": "failure"} ...ignoring TASK [unreachable task] **************************************************************************************************************************************************************************************************************** fatal: [localhost]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: Warning: Permanently added '127.0.0.1' (ED25519) to the list of known hosts.\r\[email protected]: Permission denied (publickey,password).", "skip_reason": "Host localhost is unreachable", "unreachable": true} +...ignoring PLAY RECAP ***************************************************************************************************************************************************************************************************************************** -localhost : ok=1 changed=0 unreachable=1 failed=0 skipped=1 rescued=0 ignored=1 +localhost : ok=2 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=2 ``` ### Actual Results ```console ansible-playbook [core 2.12.5] config file = /etc/ansible/ansible.cfg configured module search path = ['/home/kristian/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /home/kristian/playground/ansible-ingore-unreachable-stats/venv/lib/python3.8/site-packages/ansible ansible collection location = /home/kristian/.ansible/collections:/usr/share/ansible/collections executable location = /home/kristian/playground/ansible-ingore-unreachable-stats/venv/bin/ansible-playbook python version = 3.8.12 (default, Dec 27 2021, 16:48:07) [GCC 11.1.0] jinja version = 3.1.2 libyaml = True Using /etc/ansible/ansible.cfg as config file host_list declined parsing /etc/ansible/hosts as it did not pass its verify_file() method Skipping due to inventory source not existing or not being readable by the current user script declined parsing /etc/ansible/hosts as it did not pass its verify_file() method auto declined parsing /etc/ansible/hosts as it did not pass its verify_file() method Skipping due to inventory source not existing or not being readable by the current user yaml declined parsing /etc/ansible/hosts as it did not pass its verify_file() method Skipping due to inventory source not existing or not being readable by the current user ini declined parsing /etc/ansible/hosts as it did not pass its verify_file() method Skipping due to inventory source not existing or not being readable by the current user toml declined parsing /etc/ansible/hosts as it did not pass its verify_file() method [WARNING]: No inventory was parsed, only implicit localhost is available [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all' Skipping callback 'default', as we already have a stdout callback. Skipping callback 'minimal', as we already have a stdout callback. Skipping callback 'oneline', as we already have a stdout callback. PLAYBOOK: 13 ********************************************************************************************************************************************************************************************************************************* 1 plays in /proc/self/fd/13 PLAY [localhost] ***************************************************************************************************************************************************************************************************************************** META: ran handlers TASK [failed task] *************************************************************************************************************************************************************************************************************************** task path: /proc/self/fd/13:9 fatal: [localhost]: FAILED! => { "changed": false, "msg": "failure" } ...ignoring TASK [unreachable task] ********************************************************************************************************************************************************************************************************************** task path: /proc/self/fd/13:13 <127.0.0.1> ESTABLISH SSH CONNECTION FOR USER: non-existent-user <127.0.0.1> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="non-existent-user"' -o ConnectTimeout=10 -o 'ControlPath="/home/kristian/.ansible/cp/58aadfbad3"' 127.0.0.1 '/bin/sh -c '"'"'echo ~non-existent-user && sleep 0'"'"'' <127.0.0.1> (255, b'', b"Warning: Permanently added '127.0.0.1' (ED25519) to the list of known hosts.\r\[email protected]: Permission denied (publickey,password).\r\n") fatal: [localhost]: UNREACHABLE! => { "changed": false, "msg": "Failed to connect to the host via ssh: Warning: Permanently added '127.0.0.1' (ED25519) to the list of known hosts.\r\[email protected]: Permission denied (publickey,password).", "skip_reason": "Host localhost is unreachable", "unreachable": true } META: ran handlers META: ran handlers PLAY RECAP *********************************************************************************************************************************************************************************************************************************** localhost : ok=1 changed=0 unreachable=1 failed=0 skipped=1 rescued=0 ignored=1 ``` ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/77690
https://github.com/ansible/ansible/pull/77693
e6075109d0374d1ea476a25043c69ec2bdfee365
9767cda50746f79ba435be1e025e5b6cf487ed74
2022-04-29T09:16:13Z
python
2022-06-01T14:10:59Z
closed
ansible/ansible
https://github.com/ansible/ansible
77,675
["changelogs/fragments/doc_errors.yml", "lib/ansible/parsing/plugin_docs.py"]
ansible-test sanity - Include which documentation block is being parsed when raising "Unknown DOCUMENTATION error"
### Summary It would be helpful if the generic `Unknown DOCUMENTATION error` indicated which of the documentation blocks was being parsed the the time the exception was hit. ### Issue Type Feature Idea ### Component Name ansible-test ### Additional Information Locally I run `ansible-test sanity --docker default -vv` using the devel branch to try and keep ahead of new sanity tests (I know this is expected to break from time to time, and I'm good with that). I hit the following error: ``` ERROR: plugins/modules/ec2_snapshot_info.py:0:0: documentation-error: Unknown DOCUMENTATION error, see TRACE: while scanning a simple key in "<unicode string>", line 72, column 13 could not find expected ':' in "<unicode string>", line 73, column 13 ``` Because I hadn't changed this module it took me some time to figure out where the failure was occurring, being able to narrow down which of the documentation blocks had some bad YAML would have saved me time. This is especially the case for these documentation tests because the line numbers aren't easy to trace. ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/77675
https://github.com/ansible/ansible/pull/77685
f5642cea28299857fd11aa77307f7ee04ef1edb3
0d6aa2e87ebd776fa6175616e8690b2a42fc119e
2022-04-28T09:07:44Z
python
2022-05-13T16:18:31Z
closed
ansible/ansible
https://github.com/ansible/ansible
77,669
["changelogs/fragments/config_load_by_name.yml", "lib/ansible/plugins/loader.py", "test/integration/targets/plugin_loader/runme.sh", "test/integration/targets/plugin_loader/use_coll_name.yml"]
Using core connection plugin's FQCN will crash `ansible-playbook`
### Summary When running `ansible-playbook` using connection plugin from `ansible.builtin` collection using it's FQCN, the whole process crashes. The crash happens during any configuration lookup using `AnsiblePlugin.get_option()` from said module with following exception: > Requested entry (plugin_type: connection plugin: ansible_collections.ansible.builtin.plugins.connection.ssh setting: host ) was not defined in configuration It doesn't matter if the connection plugin is specified via `--connection` argument, `connection:` keyword or `ansible_connection` variable. However, ad-hoc commands and ansible console does work using FQCN (which is recommended in the docs). --- **PS.** I'm willing to investigate this further and possibly even make a PR if someone with internal knowledge would point me in the right direction. ### Issue Type Bug Report ### Component Name ansible-playbook ### Ansible Version ```console $ ansible --version ansible [core 2.12.5] config file = /etc/ansible/ansible.cfg configured module search path = ['/home/kristian/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /home/kristian/playground/ansible-playbook-fqcn-issue/venv/lib/python3.10/site-packages/ansible ansible collection location = /home/kristian/.ansible/collections:/usr/share/ansible/collections executable location = /home/kristian/playground/ansible-playbook-fqcn-issue/venv/bin/ansible python version = 3.10.4 (main, Mar 23 2022, 23:05:40) [GCC 11.2.0] jinja version = 3.1.1 libyaml = True ``` ### Configuration ```console $ ansible-config dump --only-changed No custom config, all defaults ``` ### OS / Environment - Arch Linux (kernel version `5.17.4-arch1-1`) - Python 3.10.4 - `ansible-core` installed via pip (inside fresh venv) ### Steps to Reproduce Example playbook using `connection` keyword: ```yaml - hosts: all # Do not use implicit `localhost` as `local` plugin won't make configuration lookup in default configuration connection: ansible.builtin.ssh tasks: - ping: ``` Quick and dirty one-liner using `--connection` CLI argument instead: **PS!** Shell must support process substitution for the inline playbook (ie. bash or zsh) ```bash ansible-playbook -i localhost, --connection ansible.builtin.ssh <(echo "[{'hosts':'all','tasks':[{'action':'ping'}]}]") ``` > Note: Although it fails at fact gathering, it is no factor - it will fail without it as well ### Expected Results Excpected the command not to crash during connection plugin config lookup ### Actual Results ```console $ ansible-playbook -i localhost, --connection ansible.builtin.ssh -vvvv <(echo "[{'hosts':'all','tasks':[{'action':'ping'}]}]") /home/kristian/playground/ansible-playbook-fqcn-issue/venv/lib/python3.10/site-packages/paramiko/transport.py:236: CryptographyDeprecationWarning: Blowfish has been deprecated "class": algorithms.Blowfish, ansible-playbook [core 2.12.5] config file = /etc/ansible/ansible.cfg configured module search path = ['/home/kristian/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /home/kristian/playground/ansible-playbook-fqcn-issue/venv/lib/python3.10/site-packages/ansible ansible collection location = /home/kristian/.ansible/collections:/usr/share/ansible/collections executable location = /home/kristian/playground/ansible-playbook-fqcn-issue/venv/bin/ansible-playbook python version = 3.10.4 (main, Mar 23 2022, 23:05:40) [GCC 11.2.0] jinja version = 3.1.1 libyaml = True Using /etc/ansible/ansible.cfg as config file setting up inventory plugins Set default localhost to localhost Parsed localhost, inventory source with host_list plugin Loading callback plugin default of type stdout, v2.0 from /home/kristian/playground/ansible-playbook-fqcn-issue/venv/lib/python3.10/site-packages/ansible/plugins/callback/default.py Skipping callback 'default', as we already have a stdout callback. Skipping callback 'minimal', as we already have a stdout callback. Skipping callback 'oneline', as we already have a stdout callback. PLAYBOOK: 13 ********************************************************************************************************************************************************************************************************************************* Positional arguments: /proc/self/fd/13 verbosity: 4 connection: ansible.builtin.ssh timeout: 10 become_method: sudo tags: ('all',) inventory: ('localhost,',) forks: 5 1 plays in /proc/self/fd/13 PLAY [all] *********************************************************************************************************************************************************************************************************************************** TASK [Gathering Facts] *********************************************************************************************************************************************************************************************************************** task path: /proc/self/fd/13:1 The full traceback is: Traceback (most recent call last): File "/home/kristian/playground/ansible-playbook-fqcn-issue/venv/lib/python3.10/site-packages/ansible/plugins/__init__.py", line 58, in get_option option_value = C.config.get_config_value(option, plugin_type=get_plugin_class(self), plugin_name=self._load_name, variables=hostvars) File "/home/kristian/playground/ansible-playbook-fqcn-issue/venv/lib/python3.10/site-packages/ansible/config/manager.py", line 425, in get_config_value value, _drop = self.get_config_value_and_origin(config, cfile=cfile, plugin_type=plugin_type, plugin_name=plugin_name, File "/home/kristian/playground/ansible-playbook-fqcn-issue/venv/lib/python3.10/site-packages/ansible/config/manager.py", line 558, in get_config_value_and_origin raise AnsibleError('Requested entry (%s) was not defined in configuration.' % to_native(_get_entry(plugin_type, plugin_name, config))) ansible.errors.AnsibleError: Requested entry (plugin_type: connection plugin: ansible_collections.ansible.builtin.plugins.connection.ssh setting: host ) was not defined in configuration. During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/kristian/playground/ansible-playbook-fqcn-issue/venv/lib/python3.10/site-packages/ansible/executor/task_executor.py", line 158, in run res = self._execute() File "/home/kristian/playground/ansible-playbook-fqcn-issue/venv/lib/python3.10/site-packages/ansible/executor/task_executor.py", line 600, in _execute result = self._handler.run(task_vars=variables) File "/home/kristian/playground/ansible-playbook-fqcn-issue/venv/lib/python3.10/site-packages/ansible/plugins/action/gather_facts.py", line 100, in run res = self._execute_module(module_name=fact_module, module_args=mod_args, task_vars=task_vars, wrap_async=False) File "/home/kristian/playground/ansible-playbook-fqcn-issue/venv/lib/python3.10/site-packages/ansible/plugins/action/__init__.py", line 973, in _execute_module self._make_tmp_path() File "/home/kristian/playground/ansible-playbook-fqcn-issue/venv/lib/python3.10/site-packages/ansible/plugins/action/__init__.py", line 390, in _make_tmp_path tmpdir = self._remote_expand_user(self.get_shell_option('remote_tmp', default='~/.ansible/tmp'), sudoable=False) File "/home/kristian/playground/ansible-playbook-fqcn-issue/venv/lib/python3.10/site-packages/ansible/plugins/action/__init__.py", line 856, in _remote_expand_user data = self._low_level_execute_command(cmd, sudoable=False) File "/home/kristian/playground/ansible-playbook-fqcn-issue/venv/lib/python3.10/site-packages/ansible/plugins/action/__init__.py", line 1253, in _low_level_execute_command rc, stdout, stderr = self._connection.exec_command(cmd, in_data=in_data, sudoable=sudoable) File "/home/kristian/playground/ansible-playbook-fqcn-issue/venv/lib/python3.10/site-packages/ansible/plugins/connection/ssh.py", line 1276, in exec_command self.host = self.get_option('host') or self._play_context.remote_addr File "/home/kristian/playground/ansible-playbook-fqcn-issue/venv/lib/python3.10/site-packages/ansible/plugins/__init__.py", line 60, in get_option raise KeyError(to_native(e)) KeyError: 'Requested entry (plugin_type: connection plugin: ansible_collections.ansible.builtin.plugins.connection.ssh setting: host ) was not defined in configuration.' fatal: [localhost]: FAILED! => { "msg": "Unexpected failure during module execution.", "stdout": "" } PLAY RECAP *********************************************************************************************************************************************************************************************************************************** localhost : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0 ``` ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/77669
https://github.com/ansible/ansible/pull/77659
fb2f080b42c16e28262ba6b9c295332e09e2bfad
a3cc6a581ef191faf1c9ec102d1c116c4c2a8778
2022-04-27T22:32:29Z
python
2022-04-28T19:14:33Z
closed
ansible/ansible
https://github.com/ansible/ansible
77,660
["changelogs/fragments/ansible-require-blocking-io.yml", "lib/ansible/cli/__init__.py"]
Implement pre-flight checks for blocking stdin, stdout, stderr
### Summary Add preflight checks to `lib/ansible/cli/__init__.py` to ensure that `stdin`, `stdout`, and `stderr` are blocking, and not non-blocking. The `Display` class cannot handle the non-blocking case, and it's been decided to not attempt work arounds to allow this. We've experienced this happening in subprocesses where something like `ssh` sets these FDs as non-blocking and doesn't restore them to blocking, causing tracebacks. ### Issue Type Feature Idea ### Component Name ``` lib/ansible/cli/__init__.py ``` ### Additional Information <!--- Paste example playbooks or commands between quotes below --> ```yaml (paste below) ``` ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/77660
https://github.com/ansible/ansible/pull/77668
cc872a57f2e04924a0fc31bf4fed6400d189e265
f7c2b1986c5b6afce1d8fe83ce6bf26b535aa617
2022-04-27T15:22:47Z
python
2022-04-27T23:28:06Z
closed
ansible/ansible
https://github.com/ansible/ansible
77,658
["changelogs/fragments/ansible-require-utf8.yml", "docs/docsite/rst/porting_guides/porting_guide_core_2.14.rst", "lib/ansible/cli/__init__.py", "lib/ansible/utils/display.py", "test/integration/targets/connection/test.sh", "test/integration/targets/preflight_encoding/aliases", "test/integration/targets/preflight_encoding/tasks/main.yml", "test/integration/targets/preflight_encoding/vars/main.yml", "test/units/utils/test_display.py"]
Implement pre-flight checks for locale and fsencoding
### Summary Add preflight checks to `lib/ansible/cli/__init__.py` for both the local locale and the fsencoding to ensure they are `UTF-8`, and abort when they are not. We implicitly require this now, but have never strictly enforced it. Due to using `pathlib` in more places, to avoid undefined behavior in our codebase, due to the utf-8 expectation, check this early and fail fast. ### Issue Type Feature Idea ### Component Name ``` lib/ansible/cli/__init__.py ``` ### Additional Information We may also need to evaluate the `C` locale. I know some users are running ansible from devices with only the `C` locale. ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/77658
https://github.com/ansible/ansible/pull/78175
9950a86f734d24f4bb31261977ae8a616a5f04c5
b1dd2af4cac9df517ce8216eaa97e66c0b15d90a
2022-04-27T15:19:41Z
python
2022-07-11T14:22:27Z
closed
ansible/ansible
https://github.com/ansible/ansible
77,621
["docs/docsite/rst/dev_guide/developing_modules_general.rst"]
module tempfile.py causing circular import when following module hacking docs
### Summary I am trying to run my_test.py by following the documentation in [1]. This fails with this error: ``` ╰─➤ python -m ansible.modules.my_test /tmp/args.json Traceback (most recent call last): File "/usr/lib/python3.8/[runpy.py](http://runpy.py/)", line 194, in \_run\_module\_as\_main return \_run\_code(code, main\_globals, None, File "/usr/lib/python3.8/[runpy.py](http://runpy.py/)", line 87, in \_run\_code exec(code, run\_globals) File "/home/dohlemacher/cloud/ansible/lib/ansible/modules/[david.py](http://david.py/)", line 72, in \<module> from ansible.module\_utils.basic import AnsibleModule File "/home/dohlemacher/cloud/ansible/lib/ansible/module\_utils/[basic.py](http://basic.py/)", line 53, in \<module> import tempfile File "/home/dohlemacher/cloud/ansible/lib/ansible/modules/[tempfile.py](http://tempfile.py/)", line 79, in \<module> from tempfile import mkstemp, mkdtemp ImportError: cannot import name 'mkstemp' from partially initialized module 'tempfile' (most likely due to a circular import) (/home/dohlemacher/cloud/ansible/lib/ansible/modules/[tempfile.py](http://tempfile.py/)) ``` I found a closed ticket [2] that suggests renaming `modules/tempfile.py`. I did this. It fixes my circular dependency. With this hack of the ansible modules, the module runs: ``` ╰─➤ python -m ansible.modules.my_test /tmp/args.json {"changed": true, "original_message": "hello", "message": "goodbye", "invocation": {"module_args": {"name": "hello", "new": true}}} ``` [1] https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general.html#verifying-your-module-code-locally [2] https://github.com/ansible/ansible/issues/25333 ### Issue Type Documentation Report ### Component Name module hacking ### Ansible Version ```console ╰─➤ ansible --version ansible 2.10.9 config file = /etc/ansible/ansible.cfg configured module search path = ['/home/dohlemacher/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /home/dohlemacher/cloud/ansible/lib/ansible executable location = /home/dohlemacher/cloud/ansible/bin/ansible python version = 3.8.12 (default, Jan 15 2022, 18:39:47) [GCC 7.5.0] This also happens on the head of devel, but I tried release tag 2.10.9. ``` ╰─➤ git show-ref | grep devel d06d99cbb6a61db043436092663de8b20f6d2017 refs/heads/devel d06d99cbb6a61db043436092663de8b20f6d2017 refs/remotes/origin/devel c6d7baeec5bca7f02fc4ddbb7052f8de081f9cdf refs/remotes/origin/temp-2.10-devel ``` ### Configuration ```console $ ansible-config dump --only-changed ANSIBLE_SSH_ARGS(env: ANSIBLE_SSH_ARGS) = HOST_KEY_CHECKING(env: ANSIBLE_HOST_KEY_CHECKING) = False (END) ``` ### OS / Environment ``` ╰─➤ cat /etc/os-release NAME="Ubuntu" VERSION="18.04.5 LTS (Bionic Beaver)" ``` ### Steps to Reproduce Just follow https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general.html#creating-a-module ### Expected Results ``` ╰─➤ python -m ansible.modules.my_test /tmp/args.json {"changed": true, "original_message": "hello", "message": "goodbye", "invocation": {"module_args": {"name": "hello", "new": true}}} ``` ### Actual Results ```console ╰─➤ python -m ansible.modules.my_test /tmp/args.json Traceback (most recent call last): File "/usr/lib/python3.8/[runpy.py](http://runpy.py/)", line 194, in \_run\_module\_as\_main return \_run\_code(code, main\_globals, None, File "/usr/lib/python3.8/[runpy.py](http://runpy.py/)", line 87, in \_run\_code exec(code, run\_globals) File "/home/dohlemacher/cloud/ansible/lib/ansible/modules/[david.py](http://david.py/)", line 72, in \<module> from ansible.module\_utils.basic import AnsibleModule File "/home/dohlemacher/cloud/ansible/lib/ansible/module\_utils/[basic.py](http://basic.py/)", line 53, in \<module> import tempfile File "/home/dohlemacher/cloud/ansible/lib/ansible/modules/[tempfile.py](http://tempfile.py/)", line 79, in \<module> from tempfile import mkstemp, mkdtemp ImportError: cannot import name 'mkstemp' from partially initialized module 'tempfile' (most likely due to a circular import) (/home/dohlemacher/cloud/ansible/lib/ansible/modules/[tempfile.py](http://tempfile.py/)) ``` ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/77621
https://github.com/ansible/ansible/pull/77647
dd094a4413ff7f8af018f105c296005675215236
255745b3e6460558d7fae4492e14b570c0569631
2022-04-24T14:19:15Z
python
2022-05-05T14:35:05Z
closed
ansible/ansible
https://github.com/ansible/ansible
77,618
["lib/ansible/cli/galaxy.py"]
Missing `f` prefix on f-strings
Some strings looks like they're meant to be f-strings but are missing the `f` prefix meaning variable interpolation won't happen. https://github.com/ansible/ansible/blob/d06d99cbb6a61db043436092663de8b20f6d2017/lib/ansible/cli/galaxy.py#L154 I found this issue automatically. I'm a bot. Beep Boop 🦊. See other issues I found in your repo [here](https://codereview.doctor/ansible/ansible)
https://github.com/ansible/ansible/issues/77618
https://github.com/ansible/ansible/pull/77619
841bdb74eb3181f50b45ad62796ca7c4586f6790
578a815271a9a44a1f7d69888d6afef49e658d96
2022-04-23T22:14:53Z
python
2022-04-25T13:37:23Z
closed
ansible/ansible
https://github.com/ansible/ansible
77,582
["changelogs/fragments/git_fixes.yml", "lib/ansible/modules/git.py"]
Git module not accepting host key
### Summary If I create a new user and install ansible with: ``` [root@awx-devel ~]# useradd tester [root@awx-devel ~]# sudo su - tester [tester@awx-devel ~]$ python3 -m venv ~/ansible_git_test_venv [tester@awx-devel ~]$ source ~/ansible_git_test_venv/bin/activate (ansible_git_test_venv) [tester@awx-devel ~]$ pip install ansible==6.0.0a1 ``` And confirm I have the latest changes to the git module: ``` (ansible_git_test_venv) [tester@awx-devel ~]$ ansible-doc git | grep "Be aware that this disables a protection against MITM attacks" Be aware that this disables a protection against MITM attacks. ``` Then create a simple playbook like: ``` (ansible_git_test_venv) [tester@awx-devel ~]$ cat <<__EOF__ >./test.yml > --- > - name: Test git > hosts: localhost > connection: local > tasks: > - name: update project using git > git: > dest: "temp" > repo: "[email protected]:test/private_repo.git" > version: "HEAD" > force: "False" > accept_hostkey: True > register: git_result > > - debug: > var: git_result > __EOF__ ``` Running this playbook causes an issue: ``` (ansible_git_test_venv) [tester@awx-devel ~]$ ansible-playbook test.yml [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all' PLAY [Test git] **************************************************************************************************************************** TASK [Gathering Facts] **************************************************************************************************************************** ok: [localhost] TASK [update project using git] **************************************************************************************************************************** The authenticity of host 'github.com (140.82.112.4)' can't be established. ED25519 key fingerprint is SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU. This key is not known by any other names Are you sure you want to continue connecting (yes/no/[fingerprint])? It's not "respecting" the accept_hostkey parameter. ``` After doing some debugging I can see that the env var is correctly being set and that moves down into the subprocess running git but I can't find any documentation that the git client actually does anything with an environment variable called GIT_SSH_OPTS. ### Issue Type Bug Report ### Component Name git ### Ansible Version ```console $ ansible --version ansible [core 2.13.0b0] config file = /etc/ansible/ansible.cfg configured module search path = ['/home/tester/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /home/tester/ansible_git_test_venv/lib64/python3.10/site-packages/ansible ansible collection location = /home/tester/.ansible/collections:/usr/share/ansible/collections executable location = /home/tester/ansible_git_test_venv/bin/ansible python version = 3.10.3 (main, Mar 18 2022, 00:00:00) [GCC 11.2.1 20220127 (Red Hat 11.2.1-9)] jinja version = 3.1.1 libyaml = True ``` ### Configuration ```console $ ansible-config dump --only-changed ``` ### OS / Environment RHEL 8, Fedora 35 ### Steps to Reproduce <!--- Paste example playbooks or commands between quotes below --> ```yaml (paste below) ``` --- - name: Test git hosts: localhost connection: local tasks: - name: update project using git git: dest: "temp" repo: "[email protected]:test/private_repo.git" version: "HEAD" force: "False" accept_hostkey: True register: git_result - debug: var: git_result ### Expected Results I expected to not get prompted on the host key. ### Actual Results ```console TASK [update project using git] **************************************************************************************************************************** The authenticity of host 'github.com (140.82.112.4)' can't be established. ED25519 key fingerprint is SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU. This key is not known by any other names Are you sure you want to continue connecting (yes/no/[fingerprint])? It's not "respecting" the accept_hostkey parameter. ``` ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/77582
https://github.com/ansible/ansible/pull/77588
1b947eaf92b6833d2a4fd019a30d7b85406f1778
d06d99cbb6a61db043436092663de8b20f6d2017
2022-04-20T13:35:06Z
python
2022-04-21T20:44:42Z
closed
ansible/ansible
https://github.com/ansible/ansible
77,580
["changelogs/fragments/ainv_limit.yml", "lib/ansible/cli/inventory.py", "test/integration/targets/ansible-inventory/tasks/main.yml"]
filter the output of ansible-inventory --list
### Summary `ansible-inventory --graph` can be specified with a group though, the output is not a JSON format so that we cannot parse the output easily. It would be helpful for us if the `ansible-inventory --list` could accept the group name. ### Issue Type Feature Idea ### Component Name inventory ### Additional Information For example, I created an inventory file. ``` [groupA] host1 host2 host3 [groupA:children] groupA1 [groupB] host11 host12 [groupC] host21 host22 host23 host24 [groupC:children] groupA1 [groupA1] host101 host102 host103 host104 host105 ``` Then I can get filtered output with `ansible-inventory --graph`. It can catch all hosts in the child group as well. ``` $ ansible-inventory -i inventory --graph groupA @groupA: |--@groupA1: | |--host101 | |--host102 | |--host103 | |--host104 | |--host105 |--host1 |--host2 |--host3 ``` However `ansible-inventory --list` performs to output only for the whole hosts in the inventory. We need the filtered output as the `--graph` in a JSON format. ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/77580
https://github.com/ansible/ansible/pull/79596
58d84933fc4cc873b58e9500838fe80c59280189
e2f147bcec8d5e44f2aa4f73d86f9959e6eb8f2e
2022-04-20T09:30:31Z
python
2023-02-13T17:07:10Z
closed
ansible/ansible
https://github.com/ansible/ansible
77,574
["docs/docsite/rst/community/development_process.rst"]
Documentation Checklist - ansible-core 2.13 release
### Summary Documentation checklist to prepare for and deliver the ansible-core 2.13 release. See follow-on comment for the full checklist. ### Issue Type Documentation Report ### Component Name docs/docsite/sphinx_conf/core_conf.py ### Ansible Version ```console $ ansible --version 2.13 ``` ### Configuration ```console $ ansible-config dump --only-changed ``` ### OS / Environment n/a ### Additional Information n/a ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/77574
https://github.com/ansible/ansible/pull/77958
04c7abcbfe934d218f51894be204f718a17c7e72
85329beb90f436ad84daa4aced5f594ff4d84ec1
2022-04-19T18:10:50Z
python
2022-06-09T14:49:44Z
closed
ansible/ansible
https://github.com/ansible/ansible
77,564
["test/units/module_utils/basic/test_filesystem.py"]
SELinux filesystem unit test fails with: FileNotFoundError
### Summary When I run the unit test suite in ansible-core from the devel branch on Github (94c910), a single test fails in the `test/units/module_utils/basic/test_filesystem.py` module: `TestOtherFilesystem.test_module_utils_basic_ansible_module_set_directory_attributes_if_different` ``` def _check_rc(rc): if rc < 0: errno = get_errno() > raise OSError(errno, os.strerror(errno)) E FileNotFoundError: [Errno 2] No such file or directory lib/ansible/module_utils/compat/selinux.py:23: FileNotFoundError ``` ### Issue Type Bug Report ### Component Name selinux ### Ansible Version ```console $ ansible --version ansible [core 2.14.0.dev0] (devel 94c9106153) last updated 2022/04/15 15:03:57 (GMT +200) config file = /etc/ansible/ansible.cfg configured module search path = ['/home/rdiscala/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /home/rdiscala/src/ansible/lib/ansible ansible collection location = /home/rdiscala/.ansible/collections:/usr/share/ansible/collections executable location = /home/rdiscala/src/ansible/bin/ansible python version = 3.10.0 (default, Oct 4 2021, 00:00:00) [GCC 11.2.1 20210728 (Red Hat 11.2.1-1)] jinja version = 3.1.1 libyaml = True ``` ### Configuration ```console $ ansible-config dump --only-changed << NO OUTPUT >> ``` ### OS / Environment $ cat /etc/redhat-release Fedora release 35 (Thirty Five) ### Steps to Reproduce $ ansible-test units --venv --python 3.10 << OR>> $ pytest -r a --cov=. --cov-report=html --fulltrace --color yes test/units/module_utils/basic/test_filesystem.py ### Expected Results All tests pass ### Actual Results ```console ===================================================================== test session starts ===================================================================== platform linux -- Python 3.10.0, pytest-6.2.5, py-1.11.0, pluggy-0.13.1 rootdir: /home/rdiscala/src/ansible plugins: forked-1.4.0, xdist-1.34.0, mock-3.2.0, cov-3.0.0 collected 5 items test/units/module_utils/basic/test_filesystem.py .F... [100%] ========================================================================== FAILURES =========================================================================== ______________________________ TestOtherFilesystem.test_module_utils_basic_ansible_module_set_directory_attributes_if_different _______________________________ self = <ansible.module_utils.basic.AnsibleModule object at 0x7fcabf50b0d0>, path = '/path/to/file' def selinux_context(self, path): context = self.selinux_initial_context() if not self.selinux_enabled(): return context try: > ret = selinux.lgetfilecon_raw(to_native(path, errors='surrogate_or_strict')) lib/ansible/module_utils/basic.py:687: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ path = '/path/to/file' def lgetfilecon_raw(path): con = c_char_p() try: > rc = _selinux_lib.lgetfilecon_raw(path, byref(con)) lib/ansible/module_utils/compat/selinux.py:95: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ rc = -1 def _check_rc(rc): if rc < 0: errno = get_errno() > raise OSError(errno, os.strerror(errno)) E FileNotFoundError: [Errno 2] No such file or directory lib/ansible/module_utils/compat/selinux.py:23: FileNotFoundError During handling of the above exception, another exception occurred: self = <unittest.case._Outcome object at 0x7fcabf509810> test_case = <units.module_utils.basic.test_filesystem.TestOtherFilesystem testMethod=test_module_utils_basic_ansible_module_set_directory_attributes_if_different> isTest = True @contextlib.contextmanager def testPartExecutor(self, test_case, isTest=False): old_success = self.success self.success = True try: > yield /usr/lib64/python3.10/unittest/case.py:59: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <units.module_utils.basic.test_filesystem.TestOtherFilesystem testMethod=test_module_utils_basic_ansible_module_set_directory_attributes_if_different> result = <TestCaseFunction test_module_utils_basic_ansible_module_set_directory_attributes_if_different> def run(self, result=None): if result is None: result = self.defaultTestResult() startTestRun = getattr(result, 'startTestRun', None) stopTestRun = getattr(result, 'stopTestRun', None) if startTestRun is not None: startTestRun() else: stopTestRun = None result.startTest(self) try: testMethod = getattr(self, self._testMethodName) if (getattr(self.__class__, "__unittest_skip__", False) or getattr(testMethod, "__unittest_skip__", False)): # If the class or method was skipped. skip_why = (getattr(self.__class__, '__unittest_skip_why__', '') or getattr(testMethod, '__unittest_skip_why__', '')) self._addSkip(result, self, skip_why) return result expecting_failure = ( getattr(self, "__unittest_expecting_failure__", False) or getattr(testMethod, "__unittest_expecting_failure__", False) ) outcome = _Outcome(result) try: self._outcome = outcome with outcome.testPartExecutor(self): self._callSetUp() if outcome.success: outcome.expecting_failure = expecting_failure with outcome.testPartExecutor(self, isTest=True): > self._callTestMethod(testMethod) /usr/lib64/python3.10/unittest/case.py:591: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <units.module_utils.basic.test_filesystem.TestOtherFilesystem testMethod=test_module_utils_basic_ansible_module_set_directory_attributes_if_different> method = <bound method TestOtherFilesystem.test_module_utils_basic_ansible_module_set_directory_attributes_if_different of <uni...ilesystem.TestOtherFilesystem testMethod=test_module_utils_basic_ansible_module_set_directory_attributes_if_different>> def _callTestMethod(self, method): > method() /usr/lib64/python3.10/unittest/case.py:549: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <units.module_utils.basic.test_filesystem.TestOtherFilesystem testMethod=test_module_utils_basic_ansible_module_set_directory_attributes_if_different> def test_module_utils_basic_ansible_module_set_directory_attributes_if_different(self): from ansible.module_utils import basic basic._ANSIBLE_ARGS = None am = basic.AnsibleModule( argument_spec=dict(), ) file_args = { 'path': '/path/to/file', 'mode': None, 'owner': None, 'group': None, 'seuser': None, 'serole': None, 'setype': None, 'selevel': None, 'secontext': [None, None, None], 'attributes': None, } > self.assertEqual(am.set_directory_attributes_if_different(file_args, True), True) test/units/module_utils/basic/test_filesystem.py:159: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <ansible.module_utils.basic.AnsibleModule object at 0x7fcabf50b0d0>, file_args = {'attributes': None, 'group': None, 'mode': None, 'owner': None, ...} changed = True, diff = None, expand = True def set_directory_attributes_if_different(self, file_args, changed, diff=None, expand=True): > return self.set_fs_attributes_if_different(file_args, changed, diff, expand) lib/ansible/module_utils/basic.py:1184: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <ansible.module_utils.basic.AnsibleModule object at 0x7fcabf50b0d0>, file_args = {'attributes': None, 'group': None, 'mode': None, 'owner': None, ...} changed = True, diff = None, expand = True def set_fs_attributes_if_different(self, file_args, changed, diff=None, expand=True): # set modes owners and context as needed > changed = self.set_context_if_different( file_args['path'], file_args['secontext'], changed, diff ) lib/ansible/module_utils/basic.py:1163: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <ansible.module_utils.basic.AnsibleModule object at 0x7fcabf50b0d0>, path = '/path/to/file', context = [None, None, None], changed = True, diff = None def set_context_if_different(self, path, context, changed, diff=None): if not self.selinux_enabled(): return changed if self.check_file_absent_if_check_mode(path): return True > cur_context = self.selinux_context(path) lib/ansible/module_utils/basic.py:761: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <ansible.module_utils.basic.AnsibleModule object at 0x7fcabf50b0d0>, path = '/path/to/file' def selinux_context(self, path): context = self.selinux_initial_context() if not self.selinux_enabled(): return context try: ret = selinux.lgetfilecon_raw(to_native(path, errors='surrogate_or_strict')) except OSError as e: if e.errno == errno.ENOENT: > self.fail_json(path=path, msg='path %s does not exist' % path) lib/ansible/module_utils/basic.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <ansible.module_utils.basic.AnsibleModule object at 0x7fcabf50b0d0>, msg = 'path /path/to/file does not exist' kwargs = {'failed': True, 'invocation': {'module_args': {}}, 'msg': 'path /path/to/file does not exist', 'path': '/path/to/file'} def fail_json(self, msg, **kwargs): ''' return from the module, with an error message ''' kwargs['failed'] = True kwargs['msg'] = msg # Add traceback if debug or high verbosity and it is missing # NOTE: Badly named as exception, it really always has been a traceback if 'exception' not in kwargs and sys.exc_info()[2] and (self._debug or self._verbosity >= 3): if PY2: # On Python 2 this is the last (stack frame) exception and as such may be unrelated to the failure kwargs['exception'] = 'WARNING: The below traceback may *not* be related to the actual failure.\n' +\ ''.join(traceback.format_tb(sys.exc_info()[2])) else: kwargs['exception'] = ''.join(traceback.format_tb(sys.exc_info()[2])) self.do_cleanup_files() self._return_formatted(kwargs) > sys.exit(1) E SystemExit: 1 lib/ansible/module_utils/basic.py:1533: SystemExit -------------------------------------------------------------------- Captured stdout call --------------------------------------------------------------------- {"path": "/path/to/file", "failed": true, "msg": "path /path/to/file does not exist", "invocation": {"module_args": {}}} =================================================================== short test summary info =================================================================== FAILED test/units/module_utils/basic/test_filesystem.py::TestOtherFilesystem::test_module_utils_basic_ansible_module_set_directory_attributes_if_different ================================================================= 1 failed, 4 passed in 0.19s ================================================================= ``` ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/77564
https://github.com/ansible/ansible/pull/79510
042a55fbe01a723b165e694b26940ef672cf1da0
9acca5b3b9f954faee1347866d0312eb0ba3ef66
2022-04-19T13:32:08Z
python
2022-12-01T19:23:08Z
closed
ansible/ansible
https://github.com/ansible/ansible
77,560
["changelogs/fragments/77561-ansible-galaxy-coll-install-null-dependencies.yml", "lib/ansible/galaxy/collection/concrete_artifact_manager.py", "test/units/galaxy/test_collection_install.py"]
ansible-galaxy fail if dependencies is none
### Summary If `dependencies` in `galaxy.yml` is defined but not assigned any value, the installation would fail. Please note the `dependencies`. The installation would fail. ```yml namespace: my_namespace name: my_collection version: 1.0.0 readme: README.md authors: - your name <[email protected]> description: your collection description license: - GPL-2.0-or-later license_file: '' tags: [] dependencies: repository: http://example.com/repository documentation: http://docs.example.com homepage: http://example.com issues: http://example.com/issue/tracker build_ignore: [] ``` It works if `dependencies` is assigned to `{}`. ```yml namespace: my_namespace name: my_collection version: 1.0.0 readme: README.md authors: - your name <[email protected]> description: your collection description license: - GPL-2.0-or-later license_file: '' tags: [] dependencies: {} repository: http://example.com/repository documentation: http://docs.example.com homepage: http://example.com issues: http://example.com/issue/tracker build_ignore: [] ``` ### Issue Type Bug Report ### Component Name ansible-galaxy ### Ansible Version ```console $ ansible --version [WARNING]: You are running the development version of Ansible. You should only run Ansible from "devel" if you are modifying the Ansible engine, or trying out features under development. This is a rapidly changing source of code and can become unstable at any point. ansible [core 2.14.0.dev0] (devel abdd237de7) last updated 2022/04/19 11:12:55 (GMT +800) config file = None configured module search path = ['/Users/jackzhang/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /Users/jackzhang/src/github/ansible/lib/ansible ansible collection location = /Users/jackzhang/.ansible/collections:/usr/share/ansible/collections executable location = /Users/jackzhang/.pyenv/versions/v-397/bin/ansible python version = 3.9.7 (default, Oct 28 2021, 19:01:53) [Clang 12.0.5 (clang-1205.0.22.11)] jinja version = 3.1.1 libyaml = True ``` ### Configuration ```console $ ansible-config dump --only-changed CONFIG_FILE() = None ``` ### OS / Environment MacOS ### Steps to Reproduce <!--- Paste example playbooks or commands between quotes below --> ```shell $ ansible-galaxy collection init my_namespace.my_collection $ cd my_namespace.my_collection $ gsed -ri 's/^(dependencies:)(.*)$/\1/' galaxy.yml $ ansible-galaxy collection install -vvv . ``` ### Expected Results I expect the `my_namespace.my_collection` with `dependencies=None` can be installed successfully ### Actual Results ```console ansible-galaxy collection install -vvvv . [WARNING]: You are running the development version of Ansible. You should only run Ansible from "devel" if you are modifying the Ansible engine, or trying out features under development. This is a rapidly changing source of code and can become unstable at any point. ansible-galaxy [core 2.14.0.dev0] (devel abdd237de7) last updated 2022/04/19 11:12:55 (GMT +800) config file = None configured module search path = ['/Users/jackzhang/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /Users/jackzhang/src/github/ansible/lib/ansible ansible collection location = /Users/jackzhang/.ansible/collections:/usr/share/ansible/collections executable location = /Users/jackzhang/.pyenv/versions/v-397/bin/ansible-galaxy python version = 3.9.7 (default, Oct 28 2021, 19:01:53) [Clang 12.0.5 (clang-1205.0.22.11)] jinja version = 3.1.1 libyaml = True No config file found; using defaults Starting galaxy collection install process Found installed collection geerlingguy.testing:1.0.0 at '/Users/jackzhang/.ansible/collections/ansible_collections/geerlingguy/testing' Found installed collection lablabs.wireguard:0.1.1 at '/Users/jackzhang/.ansible/collections/ansible_collections/lablabs/wireguard' [WARNING]: Collection at '/Users/jackzhang/.ansible/collections/ansible_collections/foo/bar' does not have a MANIFEST.json file, nor has it galaxy.yml: cannot detect version. Found installed collection foo.bar:* at '/Users/jackzhang/.ansible/collections/ansible_collections/foo/bar' Found installed collection robertdebock.development_environment:2.1.1 at '/Users/jackzhang/.ansible/collections/ansible_collections/robertdebock/development_environment' Found installed collection containers.podman:1.9.3 at '/Users/jackzhang/.ansible/collections/ansible_collections/containers/podman' Found installed collection community.docker:2.3.0 at '/Users/jackzhang/.ansible/collections/ansible_collections/community/docker' Found installed collection community.general:4.7.0 at '/Users/jackzhang/.ansible/collections/ansible_collections/community/general' Found installed collection community.molecule:0.1.0 at '/Users/jackzhang/.ansible/collections/ansible_collections/community/molecule' Process install dependency map ERROR! Unexpected Exception, this is probably a bug: 'NoneType' object has no attribute 'items' the full traceback was: Traceback (most recent call last): File "/Users/jackzhang/src/github/ansible/lib/ansible/cli/__init__.py", line 601, in cli_executor exit_code = cli.run() File "/Users/jackzhang/src/github/ansible/lib/ansible/cli/galaxy.py", line 646, in run return context.CLIARGS['func']() File "/Users/jackzhang/src/github/ansible/lib/ansible/cli/galaxy.py", line 102, in method_wrapper return wrapped_method(*args, **kwargs) File "/Users/jackzhang/src/github/ansible/lib/ansible/cli/galaxy.py", line 1300, in execute_install self._execute_install_collection( File "/Users/jackzhang/src/github/ansible/lib/ansible/cli/galaxy.py", line 1328, in _execute_install_collection install_collections( File "/Users/jackzhang/src/github/ansible/lib/ansible/galaxy/collection/__init__.py", line 683, in install_collections dependency_map = _resolve_depenency_map( File "/Users/jackzhang/src/github/ansible/lib/ansible/galaxy/collection/__init__.py", line 1594, in _resolve_depenency_map return collection_dep_resolver.resolve( File "/Users/jackzhang/.pyenv/versions/3.9.7/envs/v-397/lib/python3.9/site-packages/resolvelib/resolvers.py", line 453, in resolve state = resolution.resolve(requirements, max_rounds=max_rounds) File "/Users/jackzhang/.pyenv/versions/3.9.7/envs/v-397/lib/python3.9/site-packages/resolvelib/resolvers.py", line 347, in resolve failure_causes = self._attempt_to_pin_criterion(name, criterion) File "/Users/jackzhang/.pyenv/versions/3.9.7/envs/v-397/lib/python3.9/site-packages/resolvelib/resolvers.py", line 207, in _attempt_to_pin_criterion criteria = self._get_criteria_to_update(candidate) File "/Users/jackzhang/.pyenv/versions/3.9.7/envs/v-397/lib/python3.9/site-packages/resolvelib/resolvers.py", line 198, in _get_criteria_to_update for r in self._p.get_dependencies(candidate): File "/Users/jackzhang/src/github/ansible/lib/ansible/galaxy/dependency_resolution/providers.py", line 425, in get_dependencies for dep_name, dep_req in req_map.items() AttributeError: 'NoneType' object has no attribute 'items' ``` ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/77560
https://github.com/ansible/ansible/pull/77561
4faa576ee9c0892668cd150307eae600f7cc4068
4d69c09695c8f78b95edf51314999be3c19b62eb
2022-04-19T07:59:36Z
python
2022-04-19T19:54:45Z
closed
ansible/ansible
https://github.com/ansible/ansible
77,556
["changelogs/fragments/apt_repository_sans_apt_key.yml", "lib/ansible/modules/apt_repository.py"]
apt_repository has fallen behind apt-add-repository's behavior regarding PPAs as of Ubuntu 22.04
### Summary With 22.04 right around the corner I've been testing some ansible on it to prepare for deploying 22.04 hosts. I've got everything worked out except for adding PPAs. `apt_repository` is still adding the PPA keys to `/etc/apt/trusted.gpg` instead of placing individual key files in `/etc/apt/trusted.gpg.d/`. `apt-add-repository` puts the individual key files in `/etc/apt/trusted.gpg.d`. This move has been ongoing for many years with the previous behavior being deprecated and generating warnings. ### Issue Type Bug Report ### Component Name apt_repository ### Ansible Version ```console $ ansible --version ansible 2.10.8 config file = None configured module search path = ['/home/wonko/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/lib/python3/dist-packages/ansible executable location = /usr/bin/ansible python version = 3.10.4 (main, Apr 2 2022, 09:04:19) [GCC 11.2.0] ``` ### Configuration ```console $ ansible-config dump --only-changed ``` ### OS / Environment Ubuntu 22.04 (beta) ### Steps to Reproduce <!--- Paste example playbooks or commands between quotes below --> ```yaml (paste below) - name: Add PPA apt_repository: repo: ppa:git-core/ppa state: present ``` ### Expected Results PPA is added to `/etc/apt/sources.list.d` and gpg key file to be place in `/etc/apt/trusted.gpg.d` ### Actual Results ```console W: http://ppa.launchpad.net/git-core/ppa/ubuntu/dists/jammy/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details. ``` ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/77556
https://github.com/ansible/ansible/pull/77340
a985021286dc6db977d4937e6a52b510ad856d7f
c83419627ad976e527c8aae915024cc6483fe08d
2022-04-18T19:09:17Z
python
2022-05-19T14:21:47Z
closed
ansible/ansible
https://github.com/ansible/ansible
77,537
["hacking/tests/gen_distribution_version_testcase.py", "lib/ansible/module_utils/facts/system/distribution.py", "test/units/module_utils/facts/system/distribution/fixtures/flatcar_2492.0.0.json", "test/units/module_utils/facts/system/distribution/fixtures/flatcar_3139.2.0.json"]
Wrong OS family fact reported for Flatcar
### Summary Ansible may report the wrong `ansible_os_family` fact on Flatcar Container Linux. The correct value is `Flatcar`, however some users are seeing `Flatcar Container Linux by Kinvolk` for the same fact under certain circumstances, which leads to wrong playbook behavior given that Ansible fails to identify Flatcar as the running distro. In https://github.com/ansible/ansible/pull/69627 we've contributed Ansible core logic which affects the value of `ansible_os_family` for Flatcar. Back then we've specified `/etc/flatcar/update.conf` as the file based on which to figure out the name of the distro (likely because that's how CoreOS - Flatcar's direct ancestor - used to do the same). **This decision no longer makes sense to us** given that this file isn't the authoritative place for the distro name. Moreover, `/etc/flatcar/update.conf` may sometimes be missing based on user-provided bootstrap configuration. ### Issue Type Bug Report ### Component Name Ansible core ### Ansible Version ```console $ ansible --version ansible [core 2.11.5] config file = None configured module search path = ['/home/me/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /home/me/.local/lib/python3.8/site-packages/ansible ansible collection location = /home/me/.ansible/collections:/usr/share/ansible/collections executable location = /home/me/.local/bin/ansible python version = 3.8.10 (default, Nov 26 2021, 20:14:08) [GCC 9.3.0] jinja version = 3.1.1 libyaml = True ``` ### Configuration ```console $ ansible-config dump --only-changed ``` ### OS / Environment Flatcar Container Linux 3139.2.0 for example ### Steps to Reproduce Follow the official [instructions](https://www.flatcar.org/docs/latest/installing/vms/qemu/) to run Flatcar locally on QEMU: ``` mkdir flatcar; cd flatcar wget https://stable.release.flatcar-linux.net/amd64-usr/3139.2.0/flatcar_production_qemu.sh wget https://stable.release.flatcar-linux.net/amd64-usr/3139.2.0/flatcar_production_qemu.sh.sig wget https://stable.release.flatcar-linux.net/amd64-usr/3139.2.0/flatcar_production_qemu_image.img.bz2 wget https://stable.release.flatcar-linux.net/amd64-usr/3139.2.0/flatcar_production_qemu_image.img.bz2.sig bzip2 -d flatcar_production_qemu_image.img.bz2 chmod +x flatcar_production_qemu.sh ssh-keygen -f key -q -N "" ./flatcar_production_qemu.sh -a ./key.pub -- -nographic ``` On another shell, SSH into the Flatcar VM: ``` cd flatcar ssh -p 2222 -i key core@localhost ``` Install PyPy (Flatcar doesn't ship with a Python interpreter): ``` cd /opt wget -O - https://downloads.python.org/pypy/pypy3.8-v7.3.9-linux64.tar.bz2 | sudo tar xjf - sudo ln -s /opt/pypy3.8-v7.3.9-linux64/bin/pypy /opt/bin/python ``` Run Ansible against the VM and print the OS family: ``` cat <<EOF >playbook.yaml - hosts: all user: core tasks: - name: Print distro debug: var: ansible_os_family EOF ansible-playbook playbook.yaml -i localhost:2222, --key-file ./key -e ansible_python_interpreter=/opt/bin/python -e ansible_port=2222 ``` Output: ``` PLAY [all] ***************************************************************************************************************************************************************************************************************************************************** TASK [Gathering Facts] *****************************************************************************************************************************************************************************************************************************************ok: [localhost] TASK [Print distro] ********************************************************************************************************************************************************************************************************************************************ok: [localhost] => { "ansible_os_family": "Flatcar Container Linux by Kinvolk" } PLAY RECAP *****************************************************************************************************************************************************************************************************************************************************localhost : ok=2 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 ``` SSH into the VM and populate `/etc/flatcar/update.conf` with dummy values: ``` printf "SERVER=foo\nGROUP=bar\n" | sudo tee /etc/flatcar/update.conf ``` Run the play book again: ``` ansible-playbook playbook.yaml -i localhost:2222, --key-file ./key -e ansible_python_interpreter=/opt/bin/python -e ansible_port=2222 ``` Output: ``` PLAY [all] ***************************************************************************************************************************************************************************************************************************************************** TASK [Gathering Facts] *****************************************************************************************************************************************************************************************************************************************ok: [localhost] TASK [Print distro] ********************************************************************************************************************************************************************************************************************************************ok: [localhost] => { "ansible_os_family": "Flatcar" } PLAY RECAP *****************************************************************************************************************************************************************************************************************************************************localhost : ok=2 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 ``` ### Expected Results I expected to always see `Flatcar` as `ansible_os_family` on Flatcar Container Linux. ### Actual Results ```console The value of `ansible_os_family` changes based on the existence of `/etc/flatcar/update.conf`. ``` ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/77537
https://github.com/ansible/ansible/pull/77635
77ba025a1301c62dd945fd0f18153c5eef9a0b77
fbd828673de3d4eed525a982d75ace39a1f9eef1
2022-04-14T13:04:38Z
python
2022-09-07T17:14:12Z
closed
ansible/ansible
https://github.com/ansible/ansible
77,535
["changelogs/fragments/77535-prevent-losing-unsafe-lookups.yml", "lib/ansible/template/__init__.py", "test/integration/targets/template/unsafe.yml", "test/units/template/test_templar.py"]
jinja parsing of lookup depends on input
### Summary Ansible is attempting to jinja template the return from a lookup if something in the lookup is a variable itself. But if nothing in the lookup is a template it's fine with not jinja templating the result of the lookup. Do you have an explanation for the below-described behavior? ### Issue Type Bug Report ### Component Name lookup ### Ansible Version ```console $ ansible --version ansible [core 2.12.4] config file = /home/myuser/.ansible.cfg configured module search path = ['/home/myuser/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/local/devenv-5/lib/python3.9/site-packages/ansible ansible collection location = /home/myuser/.ansible/collections:/usr/share/ansible/collections executable location = /usr/local/devenv-5/bin/ansible python version = 3.9.12 (main, Mar 25 2022, 00:00:00) [GCC 11.2.1 20220127 (Red Hat 11.2.1-9)] jinja version = 2.11.3 libyaml = True ``` ### Configuration ```console $ ansible-config dump --only-changed DEFAULT_LOG_PATH(/home/myuser/.ansible.cfg) = /home/myuser/ansible.log DEFAULT_STDOUT_CALLBACK(/home/myuser/.ansible.cfg) = yaml RETRY_FILES_ENABLED(/home/myuser/.ansible.cfg) = False ``` ### OS / Environment Fedora 35 ### Steps to Reproduce I was able to replicate this with the following playbook: <!--- Paste example playbooks or commands between quotes below --> ```yaml (paste below) --- - name: Test some kind of weird lookup thing hosts: localhost gather_facts: False vars: file_name: "lookup_test.yml.txt" #"{{ my_file }}" tasks: - name: Get file content set_fact: file_content: "{{ lookup('file', file_name) }}" - name: Print content debug: msg: "{{ content }}" vars: content: "{{ file_content }}" ``` Where lookup_test.yml.txt file was: ``` some_content: "---\nusername: \"{{ foobar }}\"" ``` And I get the same results you saw where, if I hard code the file name in the playbook, it works fine: ``` $ ansible-playbook lookup_test.yml -e my_file=lookup_test.yml.txt [WARNING]: No inventory was parsed, only implicit localhost is available [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all' PLAY [Test some kind of weird lookup thing] ********************************************************************************************************* TASK [Get file content] ***************************************************************************************************************************** ok: [localhost] TASK [Print content] ******************************************************************************************************************************** ok: [localhost] => { "msg": "some_content: \"---\\nusername: \\\"{{ foobar }}\\\"\"" } PLAY RECAP ****************************************************************************************************************************************** localhost : ok=2 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 ``` But if I remove the hard coded file name and make it a variable by changing the line: ``` file_name: "lookup_test.yml.txt" #"{{ my_file }}" ``` to ``` file_name: "{{ my_file }}" ``` It now fails: ``` $ ansible-playbook lookup_test.yml -e my_file=lookup_test.yml.txt [WARNING]: No inventory was parsed, only implicit localhost is available [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all' PLAY [Test some kind of weird lookup thing] ********************************************************************************************************* TASK [Get file content] ***************************************************************************************************************************** ok: [localhost] TASK [Print content] ******************************************************************************************************************************** fatal: [localhost]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: {{ file_content }}: some_content: \"---\\nusername: \\\"{{ foobar }}\\\"\": 'foobar' is undefined\n\nThe error appears to be in '/Users/my_user/test/lookup_test.yml': line 12, column 7, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n - name: Print content\n ^ here\n"} PLAY RECAP ****************************************************************************************************************************************** localhost : ok=1 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0 ``` ### Expected Results The file's content shout be printed as: ``` "some_content: \"---\\nusername: \\\"{{ foobar }}\\\"\"" ``` ### Actual Results ```console FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: {{ file_content }}: some_content: \"---\\nusername: \\\"{{ foobar }}\\\"\": 'foobar' is undefined\n\nThe error appears to be in '/Users/my_user/test/lookup_test.yml': line 12, column 7, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n - name: Print content\n ^ here\n"} ``` ``` ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/77535
https://github.com/ansible/ansible/pull/77609
6fdec4a6ab140462e86f2f0618a48243169fb2c9
3980eb8c09d170a861351f8aff4a1aa1a8cbb626
2022-04-14T09:45:06Z
python
2022-04-26T15:16:22Z
closed
ansible/ansible
https://github.com/ansible/ansible
77,519
["lib/ansible/plugins/inventory/yaml.py"]
Numerical Group name throws error in yaml formatted hosts file.
### Summary When attempting to run a simple playbook to get the hostname of a cisco 3750x ansible fails to parse the yaml formatted hosts file. Playbook works with an INI formatted hosts file, however in an effort to use ansible-vault I need to migrate my file to yaml format. ### Issue Type Bug Report ### Component Name apt ### Ansible Version ```console $ ansible --version ansible [core 2.12.4] config file = /etc/ansible/ansible.cfg configured module search path = ['/home/arcreigh/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/lib/python3/dist-packages/ansible ansible collection location = /home/arcreigh/.ansible/collections:/usr/share/ansible/collections executable location = /usr/bin/ansible python version = 3.8.10 (default, Mar 15 2022, 12:22:08) [GCC 9.4.0] jinja version = 2.10.1 libyaml = True ``` ### Configuration ```console $ ansible-config dump --only-changed N/A ``` ### OS / Environment Ubuntu 20.04 ### Steps to Reproduce <!--- Paste example playbooks or commands between quotes below --> ```yaml (paste below) #/etc/ansible/hosts --- all: children: Network: children: IOS: hosts: 3750: ansible_host: 3750.arc.net vars: ansible_connection: ansible.netcommon.network_cli ansible_network_os: cisco.ios.ios ansible_user: redacted ansible_password: redacted #/home/ansible/playbooks/cisco/get_hostname.yml --- - name: Get Cisco Device Hostname and Version connection: ansible.netcommon.network_cli gather_facts: false hosts: all tasks: - name: Get config for IOS device cisco.ios.ios_facts: gather_subset: all - name: Display config debug: msg: "The hostname is {{ ansible_net_hostname }} and the OS version is {{ ansible_net_version }}" ``` ### Expected Results Expected output would be The hostname is 3750.arc.net and the OS version is (insert ios version here) ### Actual Results ```console ansible-playbook -i /etc/ansible/hosts get_hostname.yml [WARNING]: * Failed to parse /etc/ansible/hosts with yaml plugin: argument of type 'int' is not iterable [WARNING]: * Failed to parse /etc/ansible/hosts with ini plugin: Invalid host pattern '---' supplied, '---' is normally a sign this is a YAML file. [WARNING]: Unable to parse /etc/ansible/hosts as an inventory source [WARNING]: No inventory was parsed, only implicit localhost is available [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all' PLAY [Get Cisco Device Hostname and Version] ************************************************************************************************************************************************* skipping: no hosts matched PLAY RECAP *********************************************************************************************************************************************************************************** ``` ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/77519
https://github.com/ansible/ansible/pull/77544
abdd237de70b4fab83f11df65262590a5fd93a3d
9280396e1991f2365c1df79cff83f323b0908c7a
2022-04-12T17:06:13Z
python
2022-04-19T15:06:59Z
closed
ansible/ansible
https://github.com/ansible/ansible
77,510
["changelogs/fragments/better_nohosts_error.yml", "lib/ansible/cli/__init__.py"]
Applying limit switch with an empty inventory group causes error not warning?
### Summary Hi, Firstly - it's probably rather strong to call this a bug - it's an inconsistency IMHO. I have a situation where from time to time my `[production_targets]` group in my inventory in empty - for example: ``` [integration_targets] dev-01 qa-01 [production_targets] [targets:children] integration_targets production_targets [targets:vars] ansible_user=apprunner ``` My expectation was an empty group would result in Ansible doing nothing and returning success - after all, nothing has failed here. This happens when the limit switch is not applied. However, at least the way I've described my inventory above seems to lead to an error, specifically when I **limit** to an empty group: ``` ansible-playbook /path/to/deploy.yml -i /path/to/inventory.ini -l production_targets ``` I get an error not a warning: **ERROR! Specified hosts and/or --limit does not match any hosts** However it seems if I don't use the limit switch this isn't an error, just a warning: **[WARNING]: No hosts matched, nothing to do** I understand the logic in throwing an error (although I think a consistent warning would be less surprising, with and without use of limit) so if my approach is wrong, can you please advise how I can configure ansible to accept a lack of matches in the inventory when also using the limit switch, and move on without throwing an error? Thanks! ### Issue Type Bug Report ### Component Name inventory ### Ansible Version ```console ansible [core 2.11.9] ``` ### Configuration ```console $ ansible-config dump --only-changed $ ``` ### OS / Environment Ubuntu 18.04 ### Steps to Reproduce Make yourself an inventory file: callend inv.ini: ``` [integration_targets] dev-01 qa-01 [production_targets] [targets:children] integration_targets production_targets [targets:vars] ansible_user=apprunner ``` Then you can demonstrate the problem just using command line ansible ``` $ ansible targets -i inv.ini -a "ls" -l production_targets ERROR! Specified hosts and/or --limit does not match any hosts $ ansible production_targets -i inv.ini -a "ls" [WARNING]: No hosts matched, nothing to do ``` ### Expected Results I'd expect no matches to give the same consistent error message, whether I apply a limit or not: ``` $ ansible targets -i inv.ini -a "ls" -l production_targets [WARNING]: No hosts matched, nothing to do $ ansible production_targets -i inv.ini -a "ls" [WARNING]: No hosts matched, nothing to do ``` ### Actual Results ```console The first command given an ERROR not a WARNING which seems inconsistent to me: $ ansible targets -i inv.ini -a "ls" -l production_targets ERROR! Specified hosts and/or --limit does not match any hosts $ ansible production_targets -i inv.ini -a "ls" [WARNING]: No hosts matched, nothing to do ``` ``` ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/77510
https://github.com/ansible/ansible/pull/77517
6e5f1d781ddfa34460af9c3dbb944f29e8ec743d
793bb200ecc84022c2778182fdd52c5fbacd8e08
2022-04-11T16:11:23Z
python
2022-04-14T17:06:34Z
closed
ansible/ansible
https://github.com/ansible/ansible
77,479
["changelogs/fragments/77493-ansible-galaxy-find-git-executable-before-using.yaml", "lib/ansible/galaxy/collection/concrete_artifact_manager.py", "test/units/galaxy/test_collection_install.py"]
ansible-galaxy [core 2.12.2] unable to install collection from git+ssh - No such file or directory: 'git' error
### Summary Attempting to install collections from bitbucket onto a shared ansible host for my team. when running the install command I get a No such file or directory: 'git' error. I have to use git+ssh for multiple reasons, primary being ssh access to our bitbucket is hosted on a non-standard port. This is working on a Ubuntu 20.04 focal WSL environment with the following configuration: ansible [core 2.12.2] config file = /etc/ansible/ansible.cfg configured module search path = ['/home/bmorris/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/lib/python3/dist-packages/ansible ansible collection location = /home/bmorris/.ansible/collections:/usr/share/ansible/collections executable location = /usr/bin/ansible python version = 3.8.10 (default, Mar 15 2022, 12:22:08) [GCC 9.4.0] jinja version = 2.10.1 libyaml = True However, I cannot get this to work on a Debian 11 Bullseye server with the same core version but newer python version. ### Issue Type Bug Report ### Component Name ansible-galaxy ### Ansible Version ```console $ ansible --version ansible [core 2.12.2] config file = /etc/ansible/ansible.cfg configured module search path = ['/home/bmorris/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/lib/python3/dist-packages/ansible ansible collection location = /home/bmorris/.ansible/collections:/usr/share/ansible/collections executable location = /usr/bin/ansible python version = 3.9.2 (default, Feb 28 2021, 17:03:44) [GCC 10.2.1 20210110] jinja version = 2.11.3 libyaml = True ``` ### Configuration ```console $ ansible-config dump --only-changed No changes reported ``` ### OS / Environment $ lsb_release -a No LSB modules are available. Distributor ID: Debian Description: Debian GNU/Linux 11 (bullseye) Release: 11 Codename: bullseye ### Steps to Reproduce ``` ansible-galaxy -vvv collection install git+ssh://[email protected]:7999/my_namespace/my_collections.git -p /my/collections/path/ ``` ### Expected Results ansible-galaxy installs the collections from the git repo over ssh to the specified destination. ### Actual Results ```console $ ansible-galaxy -vvv collection install git+ssh://[email protected]:7999/my_namespace/my_collections.git -p -p /my/collections/path/ [DEPRECATION WARNING]: Setting verbosity before the arg sub command is deprecated, set the verbosity after the sub command. This feature will be removed from ansible-core in version 2.13. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg. ansible-galaxy [core 2.12.2] config file = /etc/ansible/ansible.cfg configured module search path = ['/home/bmorris/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/lib/python3/dist-packages/ansible ansible collection location = /home/bmorris/.ansible/collections:/usr/share/ansible/collections executable location = /usr/bin/ansible-galaxy python version = 3.9.2 (default, Feb 28 2021, 17:03:44) [GCC 10.2.1 20210110] jinja version = 2.11.3 libyaml = True Using /etc/ansible/ansible.cfg as config file ERROR! Unexpected Exception, this is probably a bug: [Errno 2] No such file or directory: 'git' the full traceback was: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/ansible/galaxy/collection/concrete_artifact_manager.py", line 241, in get_direct_collection_meta return self._artifact_meta_cache[collection.src] KeyError: 'git+ssh://[email protected]:7999/my_namespace/my_collections.git' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/bin/ansible-galaxy", line 128, in <module> exit_code = cli.run() File "/usr/lib/python3/dist-packages/ansible/cli/galaxy.py", line 569, in run return context.CLIARGS['func']() File "/usr/lib/python3/dist-packages/ansible/cli/galaxy.py", line 86, in method_wrapper return wrapped_method(*args, **kwargs) File "/usr/lib/python3/dist-packages/ansible/cli/galaxy.py", line 1149, in execute_install requirements = self._require_one_of_collections_requirements( File "/usr/lib/python3/dist-packages/ansible/cli/galaxy.py", line 828, in _require_one_of_collections_requirements 'collections': [ File "/usr/lib/python3/dist-packages/ansible/cli/galaxy.py", line 829, in <listcomp> Requirement.from_string(coll_input, artifacts_manager) File "/usr/lib/python3/dist-packages/ansible/galaxy/dependency_resolution/dataclasses.py", line 195, in from_string return cls.from_requirement_dict(req, artifacts_manager) File "/usr/lib/python3/dist-packages/ansible/galaxy/dependency_resolution/dataclasses.py", line 321, in from_requirement_dict req_version = art_mgr.get_direct_collection_version(tmp_inst_req) File "/usr/lib/python3/dist-packages/ansible/galaxy/collection/concrete_artifact_manager.py", line 230, in get_direct_collection_version return self.get_direct_collection_meta(collection)['version'] # type: ignore[return-value] File "/usr/lib/python3/dist-packages/ansible/galaxy/collection/concrete_artifact_manager.py", line 243, in get_direct_collection_meta b_artifact_path = self.get_artifact_path(collection) File "/usr/lib/python3/dist-packages/ansible/galaxy/collection/concrete_artifact_manager.py", line 186, in get_artifact_path b_artifact_path = _extract_collection_from_git( File "/usr/lib/python3/dist-packages/ansible/galaxy/collection/concrete_artifact_manager.py", line 359, in _extract_collection_from_git subprocess.check_call(git_clone_cmd) File "/usr/lib/python3.9/subprocess.py", line 368, in check_call retcode = call(*popenargs, **kwargs) File "/usr/lib/python3.9/subprocess.py", line 349, in call with Popen(*popenargs, **kwargs) as p: File "/usr/lib/python3.9/subprocess.py", line 951, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, File "/usr/lib/python3.9/subprocess.py", line 1823, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: 'git' ``` ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/77479
https://github.com/ansible/ansible/pull/77493
eef0a1cef986ac5e92a5ae00b6b60ba7be5c77d9
477c55b0d231dcb62cfcec21fe93a8fee95b4215
2022-04-06T17:58:18Z
python
2022-04-08T17:41:53Z
closed
ansible/ansible
https://github.com/ansible/ansible
77,448
["lib/ansible/module_utils/facts/hardware/openbsd.py"]
Invalid memory facts on OpenBSD
### Summary When running `ansible -m setup host`, reported `ansible_memtotal_mb` fact changes between invocations. That's because `setup` reads available non-kernel memory, which fluctuates: https://github.com/ansible/ansible/blob/2797dc644aa8c809444ccac64cad63e0d9a3f9fe/lib/ansible/module_utils/facts/hardware/openbsd.py#L96-L97 To read total available memory, `hw.physmem` key should be used. Refer to the https://man.openbsd.org/sysctl.2 man, `HW_USERMEM` and `HW_PHYSMEM`. ### Issue Type Bug Report ### Component Name setup ### Ansible Version ```console All. https://github.com/ansible/ansible/blob/devel/lib/ansible/module_utils/facts/hardware/openbsd.py#L97 ``` ### Configuration ```console N/A ``` ### OS / Environment OpenBSD 7.0 ### Steps to Reproduce On OpenBSD host, run this few times: ``` ansible -m setup openbsd_host | grep memtotal ``` Total memory value will be fluctuation between calls. ### Expected Results I expect to see total installed memory. ### Actual Results ```console N/A ``` ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/77448
https://github.com/ansible/ansible/pull/79316
4759590467faa23776f527e049a1686505339d4f
eae42ec57e9ab1f80bca478ca87f784c0c65260b
2022-04-02T00:49:32Z
python
2022-11-08T15:30:12Z
closed
ansible/ansible
https://github.com/ansible/ansible
77,443
["changelogs/fragments/78678-add-a-g-install-offline.yml", "lib/ansible/cli/galaxy.py", "lib/ansible/galaxy/collection/__init__.py", "lib/ansible/galaxy/collection/galaxy_api_proxy.py", "lib/ansible/galaxy/dependency_resolution/__init__.py", "test/integration/targets/ansible-galaxy-collection/tasks/install_offline.yml", "test/integration/targets/ansible-galaxy-collection/templates/ansible.cfg.j2", "test/integration/targets/ansible-galaxy-collection/vars/main.yml", "test/units/galaxy/test_collection_install.py"]
ansible-galaxy performs a network call even if the dependencies are already satisfied
### Summary In the dependency resolution stage, ansible-galaxy appears to reference https://galaxy.ansible.com/api/v2/collections/xxx/yyy even though it successfully references a collection that exists in collections_paths. I have not tried with other modules, but I'm confident this pattern is consistent. I've verified it happens in recent versions as Ansible Core 2.12.4 or 2.12.0, but also in older versions as Ansible 2.9.25. Possible workarounds (for Ansible Core 2.12.x): - Specify where the dependencies are locally ```yaml [root@aap21 ~]# cat requirements.yaml collections: - source: amazon-aws-3.1.1.tar.gz type: file - source: community-aws-3.1.0.tar.gz type: file [root@aap21 ~]# ansible-galaxy collection install -r requirements.yaml -vvvv ansible-galaxy [core 2.12.0] config file = /etc/ansible/ansible.cfg configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/lib/python3.8/site-packages/ansible ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections executable location = /usr/bin/ansible-galaxy python version = 3.8.6 (default, Jan 22 2021, 11:41:28) [GCC 8.4.1 20200928 (Red Hat 8.4.1-1)] jinja version = 2.10.3 libyaml = True Using /etc/ansible/ansible.cfg as config file Reading requirement file at '/root/requirements.yaml' Starting galaxy collection install process Process install dependency map Starting collection install process Installing 'amazon.aws:3.1.1' to '/root/.ansible/collections/ansible_collections/amazon/aws' amazon.aws:3.1.1 was installed successfully Installing 'community.aws:3.1.0' to '/root/.ansible/collections/ansible_collections/community/aws' community.aws:3.1.0 was installed successfully <=== ``` - Manually install the dependencies **beforehand**, and then use `--no-deps` to install the final package (for Ansible Core 2.12.x AND Ansible 2.9.25) ```yaml [root@aap21 ~]# ansible-galaxy collection install amazon-aws-3.1.1.tar.gz Starting galaxy collection install process Process install dependency map Starting collection install process Installing 'amazon.aws:3.1.1' to '/root/.ansible/collections/ansible_collections/amazon/aws' amazon.aws:3.1.1 was installed successfully <==== [root@aap21 ~]# ansible-galaxy collection install community-aws-3.1.0.tar.gz -vvvv --no-deps ansible-galaxy [core 2.12.0] config file = /etc/ansible/ansible.cfg configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/lib/python3.8/site-packages/ansible ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections executable location = /usr/bin/ansible-galaxy python version = 3.8.6 (default, Jan 22 2021, 11:41:28) [GCC 8.4.1 20200928 (Red Hat 8.4.1-1)] jinja version = 2.10.3 libyaml = True Using /etc/ansible/ansible.cfg as config file Starting galaxy collection install process Found installed collection amazon.aws:3.1.1 at '/root/.ansible/collections/ansible_collections/amazon/aws' <== Process install dependency map Starting collection install process Installing 'community.aws:3.1.0' to '/root/.ansible/collections/ansible_collections/community/aws' community.aws:3.1.0 was installed successfully <=== ``` ### Issue Type Bug Report ### Component Name ansible-galaxy ### Ansible Version ```console $ ansible --version ansible [core 2.12.0] config file = /etc/ansible/ansible.cfg configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/lib/python3.8/site-packages/ansible ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections executable location = /usr/bin/ansible python version = 3.8.6 (default, Jan 22 2021, 11:41:28) [GCC 8.4.1 20200928 (Red Hat 8.4.1-1)] jinja version = 2.10.3 libyaml = True ``` ### Configuration ```console $ ansible-config dump --only-changed $ ``` ### OS / Environment ```console $ uname -a Linux aap21 4.18.0-240.1.1.el8_3.x86_64 #1 SMP Fri Oct 16 13:36:46 EDT 2020 x86_64 x86_64 x86_64 GNU/Linux $ cat /etc/redhat-release Red Hat Enterprise Linux release 8.3 (Ootpa) ``` ### Steps to Reproduce In an environment without internet access (or in an isolated environment), try to install a module that has dependencies already satisfied. ```yaml [root@aap21 ~]# ansible-galaxy collection install amazon-aws-3.1.1.tar.gz Starting galaxy collection install process Process install dependency map Starting collection install process Installing 'amazon.aws:3.1.1' to '/root/.ansible/collections/ansible_collections/amazon/aws' amazon.aws:3.1.1 was installed successfully <==== [root@aap21 ~]# ansible-galaxy collection install community-aws-3.1.0.tar.gz Starting galaxy collection install process Process install dependency map [WARNING]: Skipping Galaxy server https://galaxy.ansible.com/api/. Got an unexpected error when getting available versions of collection amazon.aws: Unknown error when attempting to call Galaxy at 'https://galaxy.ansible.com/api/v2/collections/amazon/aws/': <urlopen error [Errno 101] Network is unreachable> ERROR! Unknown error when attempting to call Galaxy at 'https://galaxy.ansible.com/api/v2/collections/amazon/aws/': <urlopen error [Errno 101] Network is unreachable> ``` ### Expected Results ```yaml [root@aap21 ~]# ansible-galaxy collection install amazon-aws-3.1.1.tar.gz Starting galaxy collection install process Process install dependency map Starting collection install process Installing 'amazon.aws:3.1.1' to '/root/.ansible/collections/ansible_collections/amazon/aws' amazon.aws:3.1.1 was installed successfully <==== [root@aap21 ~]# ansible-galaxy collection install community-aws-3.1.0.tar.gz Starting galaxy collection install process Process install dependency map Starting collection install process Installing 'community.aws:3.1.0' to '/root/.ansible/collections/ansible_collections/community/aws' community.aws:3.1.0 was installed successfully 'amazon.aws:3.1.1' is already installed, skipping. <===== ``` ### Actual Results ```console [root@aap21 ~]# ansible-galaxy collection install amazon-aws-3.1.1.tar.gz Starting galaxy collection install process Process install dependency map Starting collection install process Installing 'amazon.aws:3.1.1' to '/root/.ansible/collections/ansible_collections/amazon/aws' amazon.aws:3.1.1 was installed successfully <==== [root@aap21 ~]# ansible-galaxy collection install community-aws-3.1.0.tar.gz -vvvv ansible-galaxy [core 2.12.0] config file = /etc/ansible/ansible.cfg configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/lib/python3.8/site-packages/ansible ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections executable location = /usr/bin/ansible-galaxy python version = 3.8.6 (default, Jan 22 2021, 11:41:28) [GCC 8.4.1 20200928 (Red Hat 8.4.1-1)] jinja version = 2.10.3 libyaml = True Using /etc/ansible/ansible.cfg as config file Starting galaxy collection install process Found installed collection amazon.aws:3.1.1 at '/root/.ansible/collections/ansible_collections/amazon/aws' Process install dependency map Initial connection to galaxy_server: https://galaxy.ansible.com Found API version 'v1, v2' with Galaxy server default (https://galaxy.ansible.com/api/) Opened /root/.ansible/galaxy_token Calling Galaxy at https://galaxy.ansible.com/api/v2/collections/amazon/aws/ [WARNING]: Skipping Galaxy server https://galaxy.ansible.com/api/. Got an unexpected error when getting available versions of collection amazon.aws: Unknown error when attempting to call Galaxy at 'https://galaxy.ansible.com/api/v2/collections/amazon/aws/': <urlopen error [Errno -2] Name or service not known> ERROR! Unknown error when attempting to call Galaxy at 'https://galaxy.ansible.com/api/v2/collections/amazon/aws/': <urlopen error [Errno -2] Name or service not known> ``` ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/77443
https://github.com/ansible/ansible/pull/78678
813c25eed1e4832a8ae363455a2f40bb3de33c7f
a02e22e902a69aeb465f16bf03f7f5a91b2cb828
2022-04-01T05:52:33Z
python
2022-09-19T18:10:36Z
closed
ansible/ansible
https://github.com/ansible/ansible
77,437
["test/integration/targets/pyyaml/aliases", "test/integration/targets/pyyaml/runme.sh"]
Add yaml integration test to verify missing cyaml works
### Summary As a follow on to https://github.com/ansible/ansible/pull/77434 we should create an integration test that installs pyyaml in a venv without using the wheel to verify that everything works as expected without the libyaml C extension. ### Issue Type Bug Report ### Component Name lib/ansible/module_utils/common/yaml.py ### Ansible Version ```console $ ansible --version ``` ### Configuration ```console $ ansible-config dump --only-changed ``` ### OS / Environment N/A ### Steps to Reproduce <!--- Paste example playbooks or commands between quotes below --> ```yaml (paste below) ``` ### Expected Results N/A ### Actual Results ```console N/A ``` ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/77437
https://github.com/ansible/ansible/pull/77446
ac56647f4a96ae3b8e18d59763d5b68a142d00e2
2797dc644aa8c809444ccac64cad63e0d9a3f9fe
2022-03-31T19:20:39Z
python
2022-04-01T20:53:19Z
closed
ansible/ansible
https://github.com/ansible/ansible
77,433
["docs/docsite/rst/user_guide/complex_data_manipulation.rst"]
Remove advanced example which does not work.
### Summary Please just remove: ```yaml vars: myvarnames: "{{ q('varnames', '^my') }}" mydict: "{{ dict(myvarnames | zip(q('vars', *myvarnames))) }}" ``` https://docs.ansible.com/ansible/latest/user_guide/complex_data_manipulation.html#id15 No tests exist for this and a simple copy paste is producing some sort of DoS-crash. There is no additional reference where this was ever used or tested. Original: https://github.com/ansible/ansible/pull/46979/files#diff-0b3f5962e2d097f45656021c9579639763d56e82a67bd97d37694027e2f686d9R205-R213 ### Issue Type Documentation Report ### Component Name docs/docsite/rst/user_guide/complex_data_manipulation.rst ### Ansible Version ```console ansible [core 2.12.2] config file = /etc/ansible/ansible.cfg configured module search path = ['/home/robert.rettig/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/lib/python3.8/site-packages/ansible ansible collection location = /home/robert.rettig/.ansible/collections:/usr/share/ansible/collections executable location = /bin/ansible python version = 3.8.12 (default, Sep 21 2021, 00:10:52) [GCC 8.5.0 20210514 (Red Hat 8.5.0-3)] jinja version = 2.10.3 libyaml = True ``` ### Configuration ```console $ ansible-config dump --only-changed ``` ### OS / Environment CentOS Stream 8 ### Additional Information `ansible-playbook debug.yml` with _debug.yml_: ```yaml - become: no connection: local gather_facts: no hosts: localhost tasks: - debug: var: mydict vars: myvarnames: "{{ q('varnames', '^my') }}" mydict: "{{ dict(myvarnames | zip(q('vars', *myvarnames))) }}" ``` error: ```txt ... original message: recursive loop detected in template string: {{ dict(myvarnames | zip(q('vars', *myvarnames))) }}"} ``` ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/77433
https://github.com/ansible/ansible/pull/77436
a85261342acf2e9a0d7e9dc792ef1edadf32e4b2
d7d2afd2031618bc3614b48c4d4be5aa409e0155
2022-03-31T17:19:30Z
python
2022-04-07T17:44:05Z
closed
ansible/ansible
https://github.com/ansible/ansible
77,416
["changelogs/fragments/77424-fix-False-ansible-galaxy-server-config-options.yaml", "lib/ansible/cli/galaxy.py", "test/units/galaxy/test_collection.py"]
galaxy validate_certs remains a stringt type instead of typecast to bool
### Summary ansible.cfg's validate_certs option for galaxy is never typecast to bool and a "False" is actually truthy. ### Issue Type Bug Report ### Component Name galaxy ### Ansible Version ```console $ ansible --version ansible [core 2.14.0.dev0] (devel 6d260ad967) last updated 2022/03/30 10:48:12 (GMT -400) config file = /home/jtanner/workspace/github/jctanner.redhat/ansible-hub-ui.tags/deleteme/ansible.cfg configured module search path = ['/home/jtanner/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /home/jtanner/workspace/github/ansible/ansible/lib/ansible ansible collection location = /home/jtanner/.ansible/collections:/usr/share/ansible/collections executable location = /home/jtanner/venvs/galaxydev/bin/ansible python version = 3.10.3 (main, Mar 18 2022, 00:00:00) [GCC 11.2.1 20220127 (Red Hat 11.2.1-9)] jinja version = 3.0.3 libyaml = True ``` ### Configuration ```console $ ansible-config dump --only-changed GALAXY_SERVER_LIST(/home/jtanner/workspace/github/jctanner.redhat/ansible-hub-ui.tags/deleteme/ansible.cfg) = ['hub'] ``` ### OS / Environment Fedora25 ### Steps to Reproduce ``` $ cat ansible.cfg | fgrep -v token= [galaxy] server_list = hub #validate_certs=false [galaxy_server.hub] validate_certs=False username=jdoe password=redhat auth_url=https://keycloak-ephemeral-yhd7ju.apps.c-rh-c-eph.8p0c.p1.openshiftapps.com/auth/realms/redhat-external/protocol/openid-connect/token url=https://front-end-aggregator-ephemeral-yhd7ju.apps.c-rh-c-eph.8p0c.p1.openshiftapps.com/api/automation-hub/ ``` ``` ansible-galaxy -vvvv collection publish foo23/test/foo23-test-1.0.0.tar.gz ``` ### Expected Results Certs should be ignored. ### Actual Results ```console ERROR! Unknown error when attempting to call Galaxy at 'https://front-end-aggregator-ephemeral-yhd7ju.apps.c-rh-c-eph.8p0c.p1.openshiftapps.com/api/automation-hub/api': <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Hostname mismatch, certificate is not valid for 'front-end-aggregator-ephemeral-yhd7ju.apps.c-rh-c-eph.8p0c.p1.openshiftapps.com'. (_ssl.c:997)> ``` ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/77416
https://github.com/ansible/ansible/pull/77424
bf8e186c68dc97f7410fab78635d4b15e79ce800
87a8fedd945fbec8b7b13664dd3522c4f526bfde
2022-03-30T15:51:02Z
python
2022-03-31T19:09:10Z
closed
ansible/ansible
https://github.com/ansible/ansible
77,399
["changelogs/fragments/77396-remove-display_skipped_hosts.yml", "lib/ansible/config/base.yml", "lib/ansible/plugins/doc_fragments/default_callback.py"]
Remove deprecated options.display_skipped_hosts.env.0
### Summary The config option `options.display_skipped_hosts.env.0` should be removed from `lib/ansible/plugins/callback/default.py`. It was scheduled for removal in 2.12. ### Issue Type Bug Report ### Component Name `lib/ansible/plugins/callback/default.py` ### Ansible Version 2.14 ### Configuration N/A ### OS / Environment N/A ### Steps to Reproduce N/A ### Expected Results N/A ### Actual Results N/A
https://github.com/ansible/ansible/issues/77399
https://github.com/ansible/ansible/pull/77427
ff8a854e571e8f6a22e34d2f285fbc4e86d5ec9c
f2387537b6ab8fca0d82a7aca41541dcdbc97894
2022-03-29T21:34:12Z
python
2022-03-31T19:11:31Z
closed
ansible/ansible
https://github.com/ansible/ansible
77,398
["changelogs/fragments/77398-remove-plugin_filters_cfg-default.yml", "lib/ansible/config/base.yml", "test/integration/targets/plugin_filtering/filter_lookup.ini", "test/integration/targets/plugin_filtering/filter_modules.ini", "test/integration/targets/plugin_filtering/filter_ping.ini", "test/integration/targets/plugin_filtering/filter_stat.ini", "test/integration/targets/plugin_filtering/no_filters.ini"]
Remove deprecated PLUGIN_FILTERS_CFG.ini.0
### Summary The config option `PLUGIN_FILTERS_CFG.ini.0` should be removed from `lib/ansible/config/base.yml`. It was scheduled for removal in 2.12. ### Issue Type Bug Report ### Component Name `lib/ansible/config/base.yml` ### Ansible Version 2.14 ### Configuration N/A ### OS / Environment N/A ### Steps to Reproduce N/A ### Expected Results N/A ### Actual Results N/A
https://github.com/ansible/ansible/issues/77398
https://github.com/ansible/ansible/pull/77429
a421a38e1068924478535f4aa3b27fd566dc452e
d4dd4a82c0c091f24808c57443a4551acc95ad7f
2022-03-29T21:34:11Z
python
2022-03-31T19:11:56Z
closed
ansible/ansible
https://github.com/ansible/ansible
77,397
["changelogs/fragments/77397-remove-network_group_modules.yml", "lib/ansible/config/base.yml"]
Remove deprecated NETWORK_GROUP_MODULES.env.0
### Summary The config option `NETWORK_GROUP_MODULES.env.0` should be removed from `lib/ansible/config/base.yml`. It was scheduled for removal in 2.12. ### Issue Type Bug Report ### Component Name `lib/ansible/config/base.yml` ### Ansible Version 2.14 ### Configuration N/A ### OS / Environment N/A ### Steps to Reproduce N/A ### Expected Results N/A ### Actual Results N/A
https://github.com/ansible/ansible/issues/77397
https://github.com/ansible/ansible/pull/77428
f2387537b6ab8fca0d82a7aca41541dcdbc97894
a421a38e1068924478535f4aa3b27fd566dc452e
2022-03-29T21:34:09Z
python
2022-03-31T19:11:42Z
closed
ansible/ansible
https://github.com/ansible/ansible
77,396
["changelogs/fragments/77396-remove-display_skipped_hosts.yml", "lib/ansible/config/base.yml", "lib/ansible/plugins/doc_fragments/default_callback.py"]
Remove deprecated DISPLAY_SKIPPED_HOSTS.env.0
### Summary The config option `DISPLAY_SKIPPED_HOSTS.env.0` should be removed from `lib/ansible/config/base.yml`. It was scheduled for removal in 2.12. ### Issue Type Bug Report ### Component Name `lib/ansible/config/base.yml` ### Ansible Version 2.14 ### Configuration N/A ### OS / Environment N/A ### Steps to Reproduce N/A ### Expected Results N/A ### Actual Results N/A
https://github.com/ansible/ansible/issues/77396
https://github.com/ansible/ansible/pull/77427
ff8a854e571e8f6a22e34d2f285fbc4e86d5ec9c
f2387537b6ab8fca0d82a7aca41541dcdbc97894
2022-03-29T21:34:08Z
python
2022-03-31T19:11:31Z
closed
ansible/ansible
https://github.com/ansible/ansible
77,395
["changelogs/fragments/77395-remove-libvirt_lxc_noseclabel.yml", "lib/ansible/config/base.yml"]
Remove deprecated DEFAULT_LIBVIRT_LXC_NOSECLABEL.env.0
### Summary The config option `DEFAULT_LIBVIRT_LXC_NOSECLABEL.env.0` should be removed from `lib/ansible/config/base.yml`. It was scheduled for removal in 2.12. ### Issue Type Bug Report ### Component Name `lib/ansible/config/base.yml` ### Ansible Version 2.14 ### Configuration N/A ### OS / Environment N/A ### Steps to Reproduce N/A ### Expected Results N/A ### Actual Results N/A
https://github.com/ansible/ansible/issues/77395
https://github.com/ansible/ansible/pull/77426
e918cfa588ff7b6c98c90fef2798250a26c94e01
ff8a854e571e8f6a22e34d2f285fbc4e86d5ec9c
2022-03-29T21:34:06Z
python
2022-03-31T19:11:20Z
closed
ansible/ansible
https://github.com/ansible/ansible
77,393
["changelogs/fragments/77393-remove-allow_world_readable_tmpfiles.yml", "lib/ansible/config/base.yml", "lib/ansible/plugins/action/__init__.py", "test/units/plugins/action/test_action.py"]
Remove deprecated ALLOW_WORLD_READABLE_TMPFILES
### Summary The config option `ALLOW_WORLD_READABLE_TMPFILES` should be removed from `lib/ansible/config/base.yml`. It was scheduled for removal in 2.14. ### Issue Type Bug Report ### Component Name `lib/ansible/config/base.yml` ### Ansible Version 2.14 ### Configuration N/A ### OS / Environment N/A ### Steps to Reproduce N/A ### Expected Results N/A ### Actual Results N/A
https://github.com/ansible/ansible/issues/77393
https://github.com/ansible/ansible/pull/77410
60b4200bc6fee69384da990bb7884f58577fc724
e080bae766fdf98a659cc96a0160ca17f6b4c2cd
2022-03-29T21:34:01Z
python
2022-03-30T13:46:57Z
closed
ansible/ansible
https://github.com/ansible/ansible
77,390
["changelogs/fragments/winrm-kinit-path.yml", "lib/ansible/plugins/connection/__init__.py", "lib/ansible/plugins/connection/winrm.py", "test/units/plugins/connection/test_winrm.py"]
Executing kinit for Kerberos not including PATH environment variable
### Summary When running winrm with Kerberos for authentication the kinit ends up not being found because the subprocess doesn't take the executing playbook's $PATH into consideration. https://github.com/ansible/ansible/blob/4d984613f5e16e205434cdf7290572e62b40bf62/lib/ansible/plugins/connection/winrm.py#L323-L329 https://github.com/ansible/ansible/blob/4d984613f5e16e205434cdf7290572e62b40bf62/lib/ansible/plugins/connection/winrm.py#L386-L389 Basically I run a conda environment with kinit installed there and not on the system. So the path to kinit is something like `/home/<user>/.miniconda/env/<env_name>/bin/kinit`. There's no way of knowing which user is going to be executing this playbook so its hard to specify an absolute path to the kinit command. ### Issue Type Bug Report ### Component Name winrm ### Ansible Version ```console $ ansible --version ansible 2.9.5 config file = /path/to/local.ansible.cfg configured module search path = ['/home/<user>/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /home/<user>/miniconda3/envs/ansible/lib/python3.6/site-packages/ansible executable location = /home/<user>/miniconda3/envs/ansible/bin/ansible python version = 3.6.10 |Anaconda, Inc.| (default, Jan 7 2020, 21:14:29) [GCC 7.3.0] ``` ### Configuration ```console $ ansible-config dump --only-changed DEFAULT_ASK_PASS(/playbook DEFAULT_HASH_BEHAVIOUR(/playbook DEFAULT_SCP_IF_SSH(/playbook HOST_KEY_CHECKING(/playbook ``` ### OS / Environment Running on WSL Ubuntu 18.04 Connecting to Windows Server 2019 ### Steps to Reproduce <!--- Paste example playbooks or commands between quotes below --> ```yaml (paste below) - hosts: all gather_facts: yes ``` ansible.cfg ```ini [defaults] host_key_checking = False ask_pass = True hash_behaviour = merge [ssh_connection] scp_if_ssh=True ``` hosts.ini ``` [all:vars] ansible_become_method=runas ansible_connection=winrm ansible_winrm_transport=kerberos ansible_winrm_server_cert_validation=ignore ansible_winrm_kerberos_delegation=true ``` ### Expected Results Kerberos authentication to happen when executing tasks ### Actual Results ```console $> ansible-playbook -i inventories/servers/windows.ini test.yaml --user [email protected] -vvvvv ansible-playbook 2.9.5 config file = /path_to_playbook/local.ansible.cfg configured module search path = ['/home/<user>/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /home/<user>/miniconda3/envs/ansible/lib/python3.6/site-packages/ansible executable location = /home/<user>/miniconda3/envs/ansible/bin/ansible-playbook python version = 3.6.10 |Anaconda, Inc.| (default, Jan 7 2020, 21:14:29) [GCC 7.3.0] Using /path_to_playbook/local.ansible.cfg as config file SSH password: setting up inventory plugins host_list declined parsing /path_to_playbook/inventories/servers/windows.ini as it did not pass its verify_file() method script declined parsing /path_to_playbook/inventories/servers/windows.ini as it did not pass its verify_file() method auto declined parsing /path_to_playbook/inventories/servers/windows.ini as it did not pass its verify_file() method yaml declined parsing /path_to_playbook/inventories/servers/windows.ini as it did not pass its verify_file() method Parsed /path_to_playbook/inventories/servers/windows.ini inventory source with ini plugin Loading callback plugin default of type stdout, v2.0 from /home/<user>/miniconda3/envs/ansible/lib/python3.6/site-packages/ansible/plugins/callback/default.py PLAYBOOK: test.yaml ****************************************************************************************************************** Positional arguments: test.yaml verbosity: 5 ask_pass: True remote_user: [email protected] connection: smart timeout: 10 become_method: sudo tags: ('all',) inventory: ('/path_to_playbook/inventories/servers/windows.ini',) forks: 5 1 plays in test.yaml PLAY [all] *************************************************************************************************************************** TASK [Gathering Facts] *************************************************************************************************************** task path: /path_to_playbook/test.yaml:1 Using module file /home/<user>/miniconda3/envs/ansible/lib/python3.6/site-packages/ansible/modules/windows/setup.ps1 Pipelining is enabled. <<myhost>> ESTABLISH WINRM CONNECTION FOR USER: [email protected] on PORT 5986 TO <myhost> creating Kerberos CC at /tmp/tmpeardraxc calling kinit with subprocess for principal [email protected] fatal: [<myhost>]: UNREACHABLE! => { "changed": false, "msg": "Kerberos auth failure when calling kinit cmd 'kinit': [Errno 2] No such file or directory: 'kinit': 'kinit'", "unreachable": true } PLAY RECAP *************************************************************************************************************************** <myhost> : ok=0 changed=0 unreachable=1 failed=0 skipped=0 rescued=0 ignored=0 ``` ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/77390
https://github.com/ansible/ansible/pull/77401
353511a900f6216a25a25d8a36528f636428b57b
60b4200bc6fee69384da990bb7884f58577fc724
2022-03-29T19:47:48Z
python
2022-03-30T00:36:56Z
closed
ansible/ansible
https://github.com/ansible/ansible
77,368
["changelogs/fragments/77368-rhel-os-family-compat.yaml", "lib/ansible/module_utils/facts/system/distribution.py", "test/integration/targets/interpreter_discovery_python/tasks/main.yml"]
Wrong python interpreter discovered in ansible core 2.13.0dev
### Summary ansible [core 2.13.0.dev0] is giving wrong `discovered_interpreter_python`. Here is a comparison from same host for 2.12.1 and 2.13 ``` [root@perfscale-jenkins-max-control-11-exec-controlplane-1-vsi ansible-tower-setup]# ansible --version [WARNING]: You are running the development version of Ansible. You should only run Ansible from "devel" if you are modifying the Ansible engine, or trying out features under development. This is a rapidly changing source of code and can become unstable at any point. ansible [core 2.13.0.dev0] config file = /root/ansible-tower-setup/ansible.cfg configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/lib/python3.9/site-packages/ansible ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections executable location = /usr/bin/ansible python version = 3.9.2 (default, Mar 5 2021, 01:49:45) [GCC 8.4.1 20200928 (Red Hat 8.4.1-1)] jinja version = 3.0.3 libyaml = True [root@perfscale-jenkins-max-control-11-exec-controlplane-1-vsi ansible-tower-setup]# ansible -i inventory.cluster automationcontroller -m setup | grep -i discovered_interpreter_python [WARNING]: You are running the development version of Ansible. You should only run Ansible from "devel" if you are modifying the Ansible engine, or trying out features under development. This is a rapidly changing source of code and can become unstable at any point. [WARNING]: Platform linux on host xx.xx.xx.xx is using the discovered Python interpreter at /usr/bin/python3.9, but future installation of another Python interpreter could change the meaning of that path. See https://docs.ansible.com/ansible- core/devel/reference_appendices/interpreter_discovery.html for more information. "discovered_interpreter_python": "/usr/bin/python3.9", ``` In 2.12.1 ``` [root@perfscale-jenkins-max-control-11-exec-controlplane-1-vsi ansible-tower-setup]# ansible --version ansible [core 2.12.1] config file = /root/ansible-tower-setup/ansible.cfg configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/lib/python3.8/site-packages/ansible ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections executable location = /usr/bin/ansible python version = 3.8.6 (default, Jan 22 2021, 11:41:28) [GCC 8.4.1 20200928 (Red Hat 8.4.1-1)] jinja version = 2.10.3 libyaml = True [root@perfscale-jenkins-max-control-11-exec-controlplane-1-vsi ansible-tower-setup]# ansible -i inventory.cluster automationcontroller -m setup | grep -i discovered_interpreter_python "discovered_interpreter_python": "/usr/libexec/platform-python", ``` ### Issue Type Bug Report ### Component Name setup ### Ansible Version ```console $ ansible --version ansible [core 2.13.0.dev0] config file = /root/ansible-tower-setup/ansible.cfg configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/lib/python3.9/site-packages/ansible ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections executable location = /usr/bin/ansible python version = 3.9.2 (default, Mar 5 2021, 01:49:45) [GCC 8.4.1 20200928 (Red Hat 8.4.1-1)] jinja version = 3.0.3 libyaml = True ``` ### Configuration ```console $ ansible-config dump --only-changed ``` ### OS / Environment RHEL 8.4 ### Steps to Reproduce <!--- Paste example playbooks or commands between quotes below --> ``` Try to run the setup module and look for `discovered_interpreter_python` ``` ### Expected Results ```console "discovered_interpreter_python": "/usr/libexec/platform-python" ``` ### Actual Results ```console "discovered_interpreter_python": "/usr/bin/python3.9" ``` ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/77368
https://github.com/ansible/ansible/pull/77371
f03624e2957783e6b1ff6a005a978d945de59443
4723eb9caa12e1b99c4c411199bd4d4ab272534d
2022-03-28T13:36:36Z
python
2022-03-28T16:47:09Z
closed
ansible/ansible
https://github.com/ansible/ansible
77,349
["lib/ansible/cli/galaxy.py", "lib/ansible/galaxy/dependency_resolution/dataclasses.py", "test/integration/targets/ansible-galaxy-collection/tasks/install.yml"]
`ansible-galaxy role install` fails if signatures are defined for collections
### Summary If a galaxy requirements file contains collections that have signatures defined, then `ansible-galaxy role install` with that requirements file fails because a keyring is not supplied. ### Issue Type Bug Report ### Component Name ansible-galaxy ### Ansible Version ```console $ ansible --version ansible [core 2.13.0.dev0] (devel ff184b0815) last updated 2022/03/24 16:21:31 (GMT -400) config file = /home/shrews/.ansible.cfg configured module search path = ['/home/shrews/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /home/shrews/Devel/github/Shrews/ansible/lib/ansible ansible collection location = /home/shrews/.ansible/collections:/usr/share/ansible/collections executable location = /home/shrews/Devel/github/Shrews/ansible/bin/ansible python version = 3.9.7 (default, Sep 10 2021, 14:59:43) [GCC 11.2.0] jinja version = 3.1.0 libyaml = True ``` ### Configuration ```console $ ansible-config dump --only-changed DEFAULT_HOST_LIST(/home/shrews/.ansible.cfg) = ['/home/shrews/Devel/ansible/hosts.yaml'] ``` ### OS / Environment Ubuntu 21.10 ### Steps to Reproduce <!--- Paste example playbooks or commands between quotes below --> ```yaml (paste below) $ cat req.yml collections: - name: community.mysql signatures: - file:///home/shrews/test.asc $ ansible-galaxy role install -r req.yml ERROR! Signatures were provided to verify community.mysql but no keyring was configured. ``` ### Expected Results `role install` should ignore collection signatures ### Actual Results ```console $ ansible-galaxy role install -r req.yml -vvvv ansible-galaxy [core 2.13.0.dev0] (devel ff184b0815) last updated 2022/03/24 16:21:31 (GMT -400) config file = /home/shrews/.ansible.cfg configured module search path = ['/home/shrews/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /home/shrews/Devel/github/Shrews/ansible/lib/ansible ansible collection location = /home/shrews/.ansible/collections:/usr/share/ansible/collections executable location = /home/shrews/Devel/github/Shrews/ansible/bin/ansible-galaxy python version = 3.9.7 (default, Sep 10 2021, 14:59:43) [GCC 11.2.0] jinja version = 3.1.0 libyaml = True Using /home/shrews/.ansible.cfg as config file Reading requirement file at '/home/shrews/req.yml' ERROR! Signatures were provided to verify community.mysql but no keyring was configured. ``` ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/77349
https://github.com/ansible/ansible/pull/77355
50d4cf931c0e329576599ab0fb1474d36a24c1d6
87d52e0ce02bfa5b7db8e98cfcdda4cd494b8791
2022-03-24T20:39:56Z
python
2022-03-29T15:03:43Z
closed
ansible/ansible
https://github.com/ansible/ansible
77,316
["changelogs/fragments/ModuleUtils.SID-long-username.yml", "lib/ansible/module_utils/powershell/Ansible.ModuleUtils.SID.psm1"]
Ansible.ModuleUtils.SID.psm1: Function Convert-ToSID fails if principal has more than 20 chars
### Summary The function Convert-ToSID from Ansible.ModuleUtils.SID.psm1 states, that it can handle UPN as input. This is true as long as the principal matches the SAMAccountName. If a princial is longer than 20 chars the SAMAccountName is truncated to 20 chars in AD. Translate([System.Security.Principal.SecurityIdentifier]) then fails. Workaround: If one uses the SAMAccountName instead of the principal, the function works correctly. ### Issue Type Bug Report ### Component Name Ansible.ModuleUtils.SID.psm1 ### Ansible Version ```console $ ansible --version ansible [core 2.11.7] config file = None configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/local/lib/python3.8/site-packages/ansible ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections executable location = /usr/local/bin/ansible python version = 3.8.12 (default, Jan 29 2022, 05:15:52) [GCC 10.2.1 20210110] jinja version = 3.0.3 libyaml = True Affected code is the latest repo version of https://github.com/ansible/ansible/blob/devel/lib/ansible/module_utils/powershell/Ansible.ModuleUtils.SID.psm1 ``` ### Configuration ```console $ ansible-config dump --only-changed ``` ### OS / Environment Targets are Windows Systems on 2016 and 2019. The bug is in the powershell code. ### Steps to Reproduce <!--- Paste example playbooks or commands between quotes below --> ```powershell # Import Ansible.ModuleUtils.SID.psm1 PS C:\Users\test> Convert-ToSID -account_name [email protected] Convert-ToSID : account_name [email protected] is not a valid account, cannot get SID: Exception calling "Translate" with "1" argument(s): "Some or all identity references could not be translated." At line:1 char:1 + Convert-ToSID -account_name [email protected] + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Convert-ToSID or just $account = New-Object System.Security.Principal.NTAccount($domain, $username) $account.Translate([System.Security.Principal.SecurityIdentifier]) with proper inputs for $domain and $username ``` Account details: ```powershell PS C:\Users\test> Get-ADUser -Filter {Name -like "*thisisalongname12345678*"} DistinguishedName : CN=thisisalongname12345678,OU=Service Accounts,DC=domain,DC=com Enabled : True GivenName : Name : thisisalongname12345678 ObjectClass : user ObjectGUID : bca42554-2785-4e07-a4bc-b255bfa63f2f SamAccountName : thisisalongname12345 SID : S-1-5-21-776561741-1229272821-682004430-105809 Surname : UserPrincipalName : [email protected] ``` ### Expected Results ``` BinaryLength AccountDomainSid Value ------------ ---------------- ----- 28 S-1-5-21-776561741-1229272821-682004430 S-1-5-21-776561741-1229272821-682004430-105809 ``` This can be achieved by using the SAMAccountName in UPN format as a workaround: ```Convert-ToSID -account_name [email protected]``` ### Actual Results ```console Convert-ToSID : account_name [email protected] is not a valid account, cannot get SID: Exception calling "Translate" with "1" argument(s): "Some or all identity references could not be translated." At line:1 char:1 + Convert-ToSID -account_name [email protected] + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Convert-ToSID ``` ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/77316
https://github.com/ansible/ansible/pull/77334
27aa2612d9d9a378ca2e1a20ec7787e2b93f90b5
ff184b0815cdbf7dc222fd9d7b0cfaa93d5fe03c
2022-03-18T08:52:31Z
python
2022-03-24T19:01:45Z
closed
ansible/ansible
https://github.com/ansible/ansible
77,315
["changelogs/fragments/77315-fix-meta-vv-header.yml", "lib/ansible/plugins/strategy/__init__.py", "test/integration/targets/meta_tasks/runme.sh"]
Empty "META: " lines printed
### Summary My complex `site.yml` causes "empty" `META: ` lines being printed often together with other `META: ` lines such as `ran handlers`, `role_complete`. The line is: ``` META: ``` There is a space after the `META:` but after that there isn't any reason such as `ran handlers` or `role_complete`. Normal/valid `META: ` lines with a "reason" often but not always have these "empty" `META: ` lines near them. I cannot duplicate this issue with a simple playbook or a simple playbook + role. My `site.yml` uses multiple layers of `include_role` and so on so it is difficult to try to simplify it into test case. But perhaps it could be possible to look at how that "empty" `META: ` line could be possible. ### Issue Type Bug Report ### Component Name ansible ### Ansible Version ```console $ ansible --version ansible [core 2.11.9] config file = /etc/ansible/ansible.cfg configured module search path = ['/x/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /y/lib64/python3.6/site-packages/ansible ansible collection location = /x/.ansible/collections:/usr/share/ansible/collections executable location = /y/bin/ansible python version = 3.6.8 (default, Nov 16 2020, 16:55:22) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] jinja version = 3.0.2 libyaml = True ``` ### Configuration ```console $ ansible-config dump --only-changed CACHE_PLUGIN(/etc/ansible/ansible.cfg) = community.general.yaml CACHE_PLUGIN_CONNECTION(/etc/ansible/ansible.cfg) = /tmp/.ansible-fact.$USER CACHE_PLUGIN_TIMEOUT(/etc/ansible/ansible.cfg) = 5184000 CALLBACKS_ENABLED(/etc/ansible/ansible.cfg) = ['ansible.posix.timer'] CONTROLLER_PYTHON_WARNING(/etc/ansible/ansible.cfg) = False DEFAULT_FORKS(/etc/ansible/ansible.cfg) = 10 DEFAULT_LOCAL_TMP(/etc/ansible/ansible.cfg) = /tmp/.ansible.x/ansible-local-20276c69v2u7m DEFAULT_LOG_PATH(/etc/ansible/ansible.cfg) = /var/log/ansible.log DEFAULT_STDOUT_CALLBACK(/etc/ansible/ansible.cfg) = community.general.yaml DEFAULT_STRATEGY(/etc/ansible/ansible.cfg) = ansible.builtin.free DEFAULT_TIMEOUT(/etc/ansible/ansible.cfg) = 50 DEFAULT_VAULT_IDENTITY_LIST(env: ANSIBLE_VAULT_IDENTITY_LIST) = ['a@v1', 'b@v2'] DEFAULT_VAULT_ID_MATCH(/etc/ansible/ansible.cfg) = True INJECT_FACTS_AS_VARS(/etc/ansible/ansible.cfg) = False RETRY_FILES_SAVE_PATH(/etc/ansible/ansible.cfg) = /tmp/.ansible-retry.x ``` ### OS / Environment EL7 ### Steps to Reproduce <!--- Paste example playbooks or commands between quotes below --> ```yaml (paste below) could not reproduce with a naive test case, it is visible in my site.yml that contains total ~500 .yml files across dozens of roles ``` ### Expected Results There should be no spurious `META: ` lines with no further information on what it is about. ### Actual Results ```console example 1: 2022-03-17 09:34:47,350 p=13119 u=user n=ansible | META: ran handlers 2022-03-17 09:34:47,359 p=13119 u=user n=ansible | META: ran handlers 2022-03-17 09:34:47,368 p=13119 u=user n=ansible | META: ran handlers 2022-03-17 09:34:47,377 p=13119 u=user n=ansible | META: ran handlers 2022-03-17 09:34:47,386 p=13119 u=user n=ansible | META: ran handlers 2022-03-17 09:34:47,396 p=13119 u=user n=ansible | META: ran handlers 2022-03-17 09:34:47,405 p=13119 u=user n=ansible | META: ran handlers 2022-03-17 09:34:47,415 p=13119 u=user n=ansible | META: ran handlers 2022-03-17 09:34:47,425 p=13119 u=user n=ansible | META: ran handlers 2022-03-17 09:34:47,435 p=13119 u=user n=ansible | META: ran handlers 2022-03-17 09:34:47,443 p=13119 u=user n=ansible | META: ran handlers 2022-03-17 09:34:47,452 p=13119 u=user n=ansible | META: ran handlers 2022-03-17 09:34:47,461 p=13119 u=user n=ansible | META: ran handlers 2022-03-17 09:34:47,470 p=13119 u=user n=ansible | META: ran handlers 2022-03-17 09:34:47,479 p=13119 u=user n=ansible | META: ran handlers 2022-03-17 09:34:47,597 p=13119 u=user n=ansible | ok: [host.example.com] 2022-03-17 09:34:47,612 p=13119 u=user n=ansible | META: 2022-03-17 09:34:47,621 p=13119 u=user n=ansible | META: 2022-03-17 09:34:47,631 p=13119 u=user n=ansible | META: 2022-03-17 09:34:47,640 p=13119 u=user n=ansible | META: 2022-03-17 09:34:47,649 p=13119 u=user n=ansible | META: 2022-03-17 09:34:47,659 p=13119 u=user n=ansible | META: 2022-03-17 09:34:47,669 p=13119 u=user n=ansible | META: 2022-03-17 09:34:47,679 p=13119 u=user n=ansible | META: 2022-03-17 09:34:47,689 p=13119 u=user n=ansible | META: 2022-03-17 09:34:47,698 p=13119 u=user n=ansible | META: 2022-03-17 09:34:47,706 p=13119 u=user n=ansible | META: 2022-03-17 09:34:47,715 p=13119 u=user n=ansible | META: 2022-03-17 09:34:47,724 p=13119 u=user n=ansible | META: 2022-03-17 09:34:47,733 p=13119 u=user n=ansible | META: 2022-03-17 09:34:47,741 p=13119 u=user n=ansible | META: 2022-03-17 09:34:47,751 p=13119 u=user n=ansible | META: ran handlers 2022-03-17 09:34:48,056 p=13119 u=user n=ansible | META: ``` ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/77315
https://github.com/ansible/ansible/pull/78681
a26c325bd8f6e2822d9d7e62f77a424c1db4fbf6
a6d4c3ff7cf43c24be6622102cee834fc5096496
2022-03-18T07:29:16Z
python
2022-09-13T07:50:10Z
closed
ansible/ansible
https://github.com/ansible/ansible
77,286
["changelogs/fragments/77275-add-support-for-deepin-distro-info-detection.yaml", "lib/ansible/module_utils/facts/system/distribution.py", "lib/ansible/modules/hostname.py", "test/units/module_utils/facts/system/distribution/fixtures/deepin_20.4.json", "test/units/module_utils/facts/system/distribution/fixtures/uos_20.json"]
Failed to detect deepin/Uos Linux distro info correctly
### Summary Deepin Linux is a debian based distro. Ansiable is unable to detect deepin/Uos Linux distro info correctly. ### Issue Type Bug Report ### Component Name lib/ansible/module_utils/facts/system/distribution.py ### Ansible Version ```console $ ansible --version ansible 2.7.7 config file = /etc/ansible/ansible.cfg configured module search path = ['/home/chanth/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/lib/python3/dist-packages/ansible executable location = /usr/bin/ansible python version = 3.7.3 (default, Apr 2 2021, 05:20:44) [GCC 8.3.0] ``` ### Configuration ```console $ ansible-config dump --only-changed ``` ### OS / Environment Deepin 20.4 (apricot) ### Steps to Reproduce <!--- Paste example playbooks or commands between quotes below --> ```bash ansible all -m setup -i"`hostname`," --connection=local -a"filter=ansible_distribution*" ``` ### Expected Results ```console chanth-PC | SUCCESS => { "ansible_facts": { "ansible_distribution": "Deepin", "ansible_distribution_file_parsed": true, "ansible_distribution_file_path": "/etc/os-release", "ansible_distribution_file_variety": "Debian", "ansible_distribution_major_version": "20", "ansible_distribution_release": "apricot", "ansible_distribution_version": "20.4" }, "changed": false } ``` ### Actual Results ```console chanth-PC | SUCCESS => { "ansible_facts": { "ansible_distribution": "Deepin 20.4", "ansible_distribution_file_parsed": true, "ansible_distribution_file_path": "/usr/lib/os-release", "ansible_distribution_file_variety": "ClearLinux", "ansible_distribution_major_version": "\"20.4\"", "ansible_distribution_release": "\"20.4\"", "ansible_distribution_version": "\"20.4\"" }, "changed": false } ``` ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/77286
https://github.com/ansible/ansible/pull/77275
4d984613f5e16e205434cdf7290572e62b40bf62
34e60c0a7ab67d5d7dbf133de728aeb68398dd02
2022-03-15T15:10:55Z
python
2022-03-17T19:22:23Z
closed
ansible/ansible
https://github.com/ansible/ansible
77,285
["docs/docsite/rst/dev_guide/developing_collections_structure.rst"]
Bundling Playbooks within a Collection
### Summary I want to distribute a playbook in one of my collections. The docs are stating that this is possible: * [Developing collections #playboos-directory](https://docs.ansible.com/ansible/latest/dev_guide/developing_collections_structure.html#playbooks-directory) However I do not find an example of how this could be done: * Above mentioned docs only show the directory sturcture, not where the playbook-file needs to be placed nor any examples. * When using `ansible-galaxy collection init ...` a skeleton is created but it does not contain a `playbooks` directory where I could check how this is done by default. * I found the right command to call in [this Pull Request](https://github.com/ansible/ansible/pull/67435), but there is no further info about the structure needed in the collection. In the end I tried just putting a `test.yml` file containing a simple playbook into `namespace/collection/playbooks/` but when using that collection Ansible states that `ERROR! the playbook: namespace.collection.test could not be found`. ### Issue Type Documentation Report ### Component Name docs/docsite/rst/dev_guide/developing_collections_structure.rst ### Ansible Version ```console $ ansible --version ansible 2.10.8 config file = /etc/ansible/ansible.cfg configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/local/lib/python3.8/dist-packages/ansible executable location = /usr/local/bin/ansible python version = 3.8.10 (default, Nov 26 2021, 20:14:08) [GCC 9.3.0] ``` ### Configuration ```console $ ansible-config dump --only-changed ANSIBLE_FORCE_COLOR(env: ANSIBLE_FORCE_COLOR) = True ANSIBLE_PIPELINING(/etc/ansible/ansible.cfg) = True ANSIBLE_SSH_ARGS(/etc/ansible/ansible.cfg) = -o ControlMaster=auto -o ControlPersist=3600s DEFAULT_CALLBACK_WHITELIST(/etc/ansible/ansible.cfg) = ['ansible.posix.profile_tasks'] HOST_KEY_CHECKING(/etc/ansible/ansible.cfg) = False INVENTORY_ENABLED(/etc/ansible/ansible.cfg) = ['host_list', 'script', 'auto', 'yaml', 'ini', 'toml', 'community.vmware.vmware_vm_inventory'] ``` ### OS / Environment Ubuntu 20.04 ### Additional Information Having examples available would help to better understand how this feature is meant to work. ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/77285
https://github.com/ansible/ansible/pull/77747
18fe5a88352a460dcc4fbe49a478552c80a0f101
42086c14a36ccf3eb16b10350852ba1ffc2ed6d1
2022-03-15T13:28:46Z
python
2022-05-06T15:30:42Z
closed
ansible/ansible
https://github.com/ansible/ansible
77,280
["changelogs/fragments/nativejinjatext-yaml-representer.yml", "lib/ansible/parsing/yaml/dumper.py"]
to_nice_yaml: cannot represent an object
### Summary With Ansible v2.9 (on Python v3.6.9 provided by Ubuntu 18.04 LTS) and Jinja2 v2.11.3, the playbook (see below) works to cast a number into a string in the YAML output: ```shell $ ansible-playbook convert.yml PLAY [localhost] ****************************************************************************************************************************************************************************** TASK [Gathering Facts] ************************************************************************************************************************************************************************ ok: [localhost] TASK [set_fact] ******************************************************************************************************************************************************************************* ok: [localhost] TASK [debug] ********************************************************************************************************************************************************************************** ok: [localhost] => { "bar": { "x": "my_string", "y": 5, "z": "300" } } TASK [debug] ********************************************************************************************************************************************************************************** ok: [localhost] => { "msg": "x: my_string\ny: 5\nz: '300'\n" } PLAY RECAP ************************************************************************************************************************************************************************************ localhost : ok=4 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 ``` Unfortunately, with an updated stack (ansible-core v2.12.3, Jinja2 v3.0.3, Python v3.8.0) I get a weird error `cannot represent an object`: ```shell $ ansible-playbook convert.yml [WARNING]: Unable to parse /etc/dallmeier/environment as an inventory source [WARNING]: No inventory was parsed, only implicit localhost is available [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all' PLAY [localhost] ****************************************************************************************************************************************************************************** TASK [Gathering Facts] ************************************************************************************************************************************************************************ ok: [localhost] TASK [set_fact] ******************************************************************************************************************************************************************************* ok: [localhost] TASK [debug] ********************************************************************************************************************************************************************************** ok: [localhost] => { "bar": { "x": "my_string", "y": 5, "z": "300" } } TASK [debug] ********************************************************************************************************************************************************************************** fatal: [localhost]: FAILED! => {"msg": "to_nice_yaml - ('cannot represent an object', '300'). ('cannot represent an object', '300')"} PLAY RECAP ************************************************************************************************************************************************************************************ localhost : ok=3 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0 ``` Jinja2 native is enabled in /etc/ansible/ansible.cfg: ```ini [defaults] jinja2_native = True ``` ### Issue Type Bug Report ### Component Name to_nice_yaml ### Ansible Version ```console $ ansible --version ansible [core 2.12.3] config file = /etc/ansible/ansible.cfg configured module search path = ['/home/au/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/local/lib/python3.8/dist-packages/ansible ansible collection location = /home/au/.ansible/collections:/usr/share/ansible/collections executable location = /usr/local/bin/ansible python version = 3.8.0 (default, Dec 9 2021, 17:53:27) [GCC 8.4.0] jinja version = 3.0.3 libyaml = True ``` ### Configuration ```console $ ansible-config dump --only-changed DEFAULT_ASK_VAULT_PASS(/etc/ansible/ansible.cfg) = False DEFAULT_HOST_LIST(/etc/ansible/ansible.cfg) = ['/etc/foobar/environment'] DEFAULT_JINJA2_NATIVE(/etc/ansible/ansible.cfg) = True ``` ### OS / Environment Ubuntu Server 18.04.6 LTS ### Steps to Reproduce <!--- Paste example playbooks or commands between quotes below --> ```yaml (paste below) - hosts: localhost vars: foo: 300 tasks: - set_fact: bar: x: "my_string" y: 5 z: '{{ foo |string }}' - debug: var=bar - debug: msg='{{ bar |to_nice_yaml }}' ``` ### Expected Results `to_nice_yaml` displays the number as string ### Actual Results ```console TASK [set_fact] ******************************************************************************************************************************************************************************* task path: /home/au/src/asa-branches/v0.3/ansible/convert.yml:5 ok: [localhost] => { "ansible_facts": { "bar": { "x": "my_string", "y": 5, "z": "300" } }, "changed": false } TASK [debug] ********************************************************************************************************************************************************************************** task path: /home/au/src/asa-branches/v0.3/ansible/convert.yml:10 ok: [localhost] => { "bar": { "x": "my_string", "y": 5, "z": "300" } } TASK [debug] ********************************************************************************************************************************************************************************** task path: /home/au/src/asa-branches/v0.3/ansible/convert.yml:11 fatal: [localhost]: FAILED! => { "msg": "to_nice_yaml - ('cannot represent an object', '300'). ('cannot represent an object', '300')" } ``` ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/77280
https://github.com/ansible/ansible/pull/77282
d8687bd0158c23e63b13c8c05f83d1a8628e1264
c9db73f04e7a5fae7bbbdff8efbd585d15971d31
2022-03-14T17:27:04Z
python
2022-03-16T10:24:21Z
closed
ansible/ansible
https://github.com/ansible/ansible
77,267
["changelogs/fragments/77271-unarchive.yml", "lib/ansible/modules/unarchive.py", "test/sanity/ignore.txt", "test/units/modules/test_unarchive.py"]
unarchive: io_buffer_size does not work
### Summary The option `io_buffer_size` added in ansible-core 2.12 (#74094) does not appear in the argument spec and thus does not work. (As opposed to the other two documented options that are not in the argument spec, this one is not handled by the accomodating action plugin.) ### Issue Type Bug Report ### Component Name unarchive ### Ansible Version ```console 2.12+ ``` ### Configuration ```console - ``` ### OS / Environment - ### Steps to Reproduce - ### Expected Results - ### Actual Results ```console Argument spec validation will reject this option. ``` ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/77267
https://github.com/ansible/ansible/pull/77271
c555ce1bd90e95cca0d26259de27399d9bf18da4
e3c72230cda45798b4d9bd98c7f296d2895c4027
2022-03-11T21:08:12Z
python
2022-03-17T19:15:13Z
closed
ansible/ansible
https://github.com/ansible/ansible
77,241
["lib/ansible/modules/get_url.py"]
get_url documentation formats "not" incorrectly
### Summary The `get_url` module documentation has extraneous formatting in the "not" word in: ``` NTLM authentication is C(not) supported even if the GSSAPI mech for NTLM has been installed. ``` As it is a part of a sentence, I suspect the "not" here should not have any specific formatting. ### Issue Type Documentation Report ### Component Name get_url ### Ansible Version ```console $ ansible --version irrelevant ``` ### Configuration ```console $ ansible-config dump --only-changed irrelevant ``` ### OS / Environment irrelevant ### Additional Information irrelevant ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/77241
https://github.com/ansible/ansible/pull/77247
3c72aa32d6bd6c3b592d8b47c68ab9de922f170a
496f51ceacdebb76a91bda2973ae35f5afae90de
2022-03-09T05:49:24Z
python
2022-03-10T21:23:31Z
closed
ansible/ansible
https://github.com/ansible/ansible
77,221
["docs/docsite/rst/user_guide/playbooks_filters_ipaddr.rst"]
Wrong collection listed for ipaddr filter
### Summary https://docs.ansible.com/ansible/latest/user_guide/playbooks_filters_ipaddr.html https://github.com/ansible/ansible/blob/devel/docs/docsite/rst/user_guide/playbooks_filters_ipaddr.rst ipaddr is migrated to ansible.utils from ansible.netcommon ``` [DEPRECATION WARNING]: Use 'ansible.utils.ipaddr' module instead. This feature will be removed from ansible.netcommon in a release after 2024-01-01. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg. ``` ### Issue Type Documentation Report ### Component Name docs/docsite/rst/user_guide/playbooks_filters_ipaddr.rst ### Ansible Version ```console $ ansible --version ``` ### Configuration ```console $ ansible-config dump --only-changed ``` ### OS / Environment . ### Additional Information . ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/77221
https://github.com/ansible/ansible/pull/77281
6546c484f4ece685b339423034c0cd6e18cdcba6
dfda04894f25a9f491b5bde7ae051da01d12d654
2022-03-07T16:33:08Z
python
2022-03-14T20:27:06Z
closed
ansible/ansible
https://github.com/ansible/ansible
77,213
["changelogs/fragments/81931-locale-related-parsing-error-git.yml", "lib/ansible/modules/git.py"]
System language dependent parsing error within git module
### Summary I just updated to ansible core `2.12.3` via pip from ansible `2.11.9` and was confronted with weird issues during one of my plays, which tries to ensure a proper local git branch. It complained about a parsing error while navigating a git submodule path. After looking and poking around a little I found [this line of code](https://github.com/ansible/ansible/blob/0c4c18bc04c562755a368df67fce943ca15418ee/lib/ansible/modules/git.py#L546) beeing responsible for the parsing issue, as my machine uses de_DE as locale. This changes the git output from the expected `Entering <path>` to `Betrete <path>` and makes the parser fail. I did not perform a system update along to the ansible upgrade, I am sure it was working with the older ansible version (as I successfully rolled back) and the update caused the break. I see two issues here. First the parser expects english output, which might not be always provided. I tried to think about a solution, but the response of the actually invoked command `git submodule foreach` leaves no room for alternative methods of recognition. Secondly ansible seems to have used some sort of private environment where the locale must have been set to english somehow. Otherwise my play should never have worked at all. Regarding the latter case I really wonder what broke in the recent update. ### Issue Type Bug Report ### Component Name git ### Ansible Version ```console $ ansible --version ansible [core 2.12.3] NOTE: More informations no longer available as I downgraded already to get back to a working state again. ``` ### Configuration ```console no output ``` ### OS / Environment Ubuntu 20.04.4 LTS ### Steps to Reproduce <!--- Paste example playbooks or commands between quotes below --> ```yaml (paste below) - hosts: all gather_facts: false any_errors_fatal: true run_once: true # Required as this runs locally tasks: - name: Perform pre-run checks connection: local block: # Check if local repository is on most recent commit - name: Checkout devops branch '{{ git_config.branch }}', force restart (abort play) if branch had to be changed ansible.builtin.git: clone: false # Do never clone, this should be run from within collection dest: "{{ git_config.path }}" repo: "{{ git_config.repo }}" version: "{{ git_config.branch }}" register: git_status failed_when: git_status.failed or git_status.changed # Module failure (e.g. dirty) or branch was changed/pulled ``` As long as an actual repository containing at least one submodule is given, the error will be triggered if the machine is set to a language different than english. ### Expected Results I expected the module to ensure I am on the proper branch. ### Actual Results ```console The module outputs the following error (abbreviated to prevent cluttering): Unable to parse submodule hash line: Betrete 'provisioning/roles/ansible-redis' ``` ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/77213
https://github.com/ansible/ansible/pull/81931
fe94a99aa291d129aa6432e5d50e7117d9c6aae3
b4920c83adf959c5bd1b6b9157ce67a858c9d4db
2022-03-05T16:47:49Z
python
2023-10-25T13:47:55Z
closed
ansible/ansible
https://github.com/ansible/ansible
77,192
["changelogs/fragments/77210-fix-collection-filter-test-redirects.yml", "lib/ansible/template/__init__.py", "test/integration/targets/collections/collection_root_user/ansible_collections/testns/testredirect/meta/runtime.yml", "test/integration/targets/collections/runme.sh", "test/integration/targets/collections/test_collection_meta.yml"]
moving ipaddr from netcommon to utils breaks the non-namespaced usage of nthhost (without the collection)
### Summary https://github.com/ansible-collections/ansible.netcommon/pull/359 This change breaks the non-namespaced usage of ipaddr filter (without the collection). example ipwrap ### Issue Type Bug Report ### Component Name ansible ### Ansible Version ```console $ ansible --version code and can become unstable at any point. ansible [core 2.13.0.dev0] (bugfix_redirection de11a1ce78) last updated 2022/03/03 13:38:18 (GMT +550) config file = /Users/amhatre/ansible-collections/playbooks/ansible.cfg configured module search path = ['/Users/amhatre/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /Users/amhatre/dev-workspace/ansible/lib/ansible ansible collection location = /Users/amhatre/ansible-collections/collections executable location = /Users/amhatre/dev-workspace/ansible/bin/ansible python version = 3.8.5 (default, Jan 7 2021, 17:04:44) [Clang 12.0.0 (clang-1200.0.32.28)] jinja version = 3.0.3 libyaml = True ``` ### Configuration ```console $ (ansible_from_source1) amhatre@ashwinis-MacBook-Pro playbooks % ansible-config dump --only-changed [WARNING]: You are running the development version of Ansible. You should only run Ansible from "devel" if you are modifying the Ansible engine, or trying out features under development. This is a rapidly changing source of code and can become unstable at any point. COLLECTIONS_PATHS(/Users/amhatre/ansible-collections/playbooks/ansible.cfg) = ['/Users/amhatre/ansible-collection DEFAULT_HOST_LIST(/Users/amhatre/ansible-collections/playbooks/ansible.cfg) = ['/Users/amhatre/ansible-collection HOST_KEY_CHECKING(/Users/amhatre/ansible-collections/playbooks/ansible.cfg) = False INTERPRETER_PYTHON(/Users/amhatre/ansible-collections/playbooks/ansible.cfg) = /Users/amhatre/ansible_venvs/py3.8 PARAMIKO_LOOK_FOR_KEYS(/Users/amhatre/ansible-collections/playbooks/ansible.cfg) = False PERSISTENT_COMMAND_TIMEOUT(/Users/amhatre/ansible-collections/playbooks/ansible.cfg) = 100 PERSISTENT_CONNECT_RETRY_TIMEOUT(/Users/amhatre/ansible-collections/playbooks/ansible.cfg) = 100 PERSISTENT_CONNECT_TIMEOUT(/Users/amhatre/ansible-collections/playbooks/ansible.cfg) = 100 (END) ``` ### OS / Environment mac os ### Steps to Reproduce <!--- Paste example playbooks or commands between quotes below --> ```yaml (paste below) - name: Some configuration files require IPv6 addresses to be “wrapped” in square brackets ([ ]) This filter is used to wrap ipv6 address. hosts: localhost connection: ansible.netcommon.network_cli gather_facts: no tasks: - name: Input for IPVwrap plugin ansible.builtin.set_fact: value: - 192.24.2.1 - host.fqdn - ::1 - '' - 192.168.32.0/24 - fe80::100/10 - 42540766412265424405338506004571095040/64 - True - debug: msg: "{{ value|ipwrap }}" ``` ### Expected Results (py3.6.10) amhatre@ashwinis-MacBook-Pro playbooks % ansible-playbook test_ipwrap.yaml PLAY [Some configuration files require IPv6 addresses to be “wrapped” in square brackets ([ ]) This filter is used to wrap ipv6 address.] *** TASK [Input for IPVwrap plugin] ********************************************************************************* ok: [localhost] TASK [debug] **************************************************************************************************** [WARNING]: The value '' is not a valid IP address or network, passing this value to ipaddr filter might result in breaking change in future. [WARNING]: The value 'True' is not a valid IP address or network, passing this value to ipaddr filter might result in breaking change in future. ok: [localhost] => { "msg": [ "192.24.2.1", "host.fqdn", "[::1]", "", "192.168.32.0/24", "[fe80::100]/10", "[2001:db8:32c:faad::]/64", true ] } PLAY RECAP ****************************************************************************************************** localhost : ok=2 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 (py3.6.10) amhatre@ashwinis-MacBook-Pro playbooks % ### Actual Results ```console (py3.6.10) amhatre@ashwinis-MacBook-Pro playbooks % ansible-playbook test_ipwrap.yaml PLAY [Some configuration files require IPv6 addresses to be “wrapped” in square brackets ([ ]) This filter is used to wrap ipv6 address.] ************************ TASK [Input for IPVwrap plugin] ********************************************************************************************************************************** ok: [localhost] TASK [debug] ***************************************************************************************************************************************************** fatal: [localhost]: FAILED! => {"msg": "template error while templating string: No filter named 'ipwrap'.. String: {{ value|ipwrap }}"} PLAY RECAP ******************************************************************************************************************************************************* localhost : ok=1 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0 (py3.6.10) amhatre@ashwinis-MacBook-Pro playbooks % ``` ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/77192
https://github.com/ansible/ansible/pull/77210
50d28de9ba0d7271b966b3888916195cb9d28965
8063643b4cec51a72377da5f3fa354d3ff9e737a
2022-03-03T08:10:08Z
python
2022-03-07T20:39:56Z
closed
ansible/ansible
https://github.com/ansible/ansible
77,149
["lib/ansible/plugins/connection/ssh.py"]
ansible_ssh_retries parameter does not work for delegated connection (ansible ver 2.9.23)
### Summary When I try to configure ssh retry parameter through vars in a delegated task, it does not behave correctly. Default retry parameter is 3 which works as expected when not configured, but when I add ansible_ssh_retries with any number value, no chance happens. ### Issue Type Documention Report ### Component Name ssh ### Ansible Version ```console $ ansible --version ansible 2.9.23 config file = /examples/ansible.cfg configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /opt/venv/lib/python3.6/site-packages/ansible executable location = /opt/venv/bin/ansible python version = 3.6.8 (default, Sep 9 2021, 07:49:02) [GCC 8.5.0 20210514 (Red Hat 8.5.0-3)] ``` ### Configuration ```console $ ansible-config dump --only-changed ANSIBLE_SSH_RETRIES(/examples/ansible.cfg) = 10 ``` ### OS / Environment $ cat /etc/redhat-release Red Hat Enterprise Linux release 8.4 (Ootpa) ### Steps to Reproduce ansible.cfg: ``` [ssh_connection] retries = 10 ``` retry_test.yml: ``` - name: "Create a file" hosts: localhost gather_facts: no any_errors_fatal: true tasks: - name: "Create a file if not present" delegate_to: <host_ip> vars: ansible_user: <user> ansible_ssh_pass: <pw> ansible_become_method: su ansible_become: yes ansible_become_password: <pw> ansible_ssh_retries: 10 ansible_ssh_extra_args: '-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null' file: path: "/home/<user>/randomfile.txt" state: touch ``` Run following cmd while delegated host ssh connection limit defined by /etc/security/limits.conf is exceeded: `ansible-playbook -i hosts.yml retry_test.yml -vvv` ### Expected Results When ansible_ssh_retries added to vars with a number value X, ssh should try up to X attempts to connect for delegated_hosts. ### Actual Results ```console [root@d94f53b2a6bb:]$ ansible-playbook -i hosts.yml retry_test.yml -vvv ansible-playbook 2.9.23 config file = /examples/ansible.cfg configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /opt/venv/lib/python3.6/site-packages/ansible executable location = /opt/venv/bin/ansible-playbook python version = 3.6.8 (default, Sep 9 2021, 07:49:02) [GCC 8.5.0 20210514 (Red Hat 8.5.0-3)] Using /examples/ansible.cfg as config file host_list declined parsing /examples/hosts.yml as it did not pass its verify_file() method script declined parsing /examples/hosts.yml as it did not pass its verify_file() method Parsed /examples/hosts.yml inventory source with yaml plugin Skipping callback 'actionable', as we already have a stdout callback. Skipping callback 'counter_enabled', as we already have a stdout callback. Skipping callback 'debug', as we already have a stdout callback. Skipping callback 'dense', as we already have a stdout callback. Skipping callback 'dense', as we already have a stdout callback. Skipping callback 'full_skip', as we already have a stdout callback. Skipping callback 'json', as we already have a stdout callback. Skipping callback 'minimal', as we already have a stdout callback. Skipping callback 'null', as we already have a stdout callback. Skipping callback 'oneline', as we already have a stdout callback. Skipping callback 'selective', as we already have a stdout callback. Skipping callback 'skippy', as we already have a stdout callback. Skipping callback 'stderr', as we already have a stdout callback. Skipping callback 'unixy', as we already have a stdout callback. Skipping callback 'yaml', as we already have a stdout callback. PLAYBOOK: retry_test.yml **************************************************************************************************************************************************************** 1 plays in retry_test.yml PLAY [Create a file] ******************************************************************************************************************************************************************** META: ran handlers TASK [Create a file if not present] ***************************************************************************************************************************************************** task path: /examples/retry_test.yml:6 <<host_ip>> ESTABLISH SSH CONNECTION FOR USER: <host_user> <<host_ip>> SSH: EXEC sshpass -d10 ssh -C -o ControlMaster=auto -o ControlPersist=60s -o 'User="<host_user>"' -o ConnectTimeout=10 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ControlPath=/root/.ansible/cp/fbfe67135b <host_ip> '/bin/sh -c '"'"'echo ~<host_user> && sleep 0'"'"'' <<host_ip>> (254, b"\nAuthorized users only. All activity may be monitored and reported.\n\nToo many logins for '<host_user>'.\n", b"Warning: Permanently added '<host_ip>' (ECDSA) to the list of known hosts.\r\n\nAuthorized users only. All activity may be monitored and reported.\n\n") <<host_ip>> Failed to connect to the host via ssh: Warning: Permanently added '<host_ip>' (ECDSA) to the list of known hosts. Authorized users only. All activity may be monitored and reported. <<host_ip>> ESTABLISH SSH CONNECTION FOR USER: <host_user> <<host_ip>> SSH: EXEC sshpass -d10 ssh -C -o ControlMaster=auto -o ControlPersist=60s -o 'User="<host_user>"' -o ConnectTimeout=10 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ControlPath=/root/.ansible/cp/fbfe67135b <host_ip> '/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo Too many logins for '"'"'"'"'"'"'"'"'<host_user>'"'"'"'"'"'"'"'"'./.ansible/tmp `"&& mkdir "` echo Too many logins for '"'"'"'"'"'"'"'"'<host_user>'"'"'"'"'"'"'"'"'./.ansible/tmp/ansible-tmp-1646032840.9470909-227-194794013968900 `" && echo ansible-tmp-1646032840.9470909-227-194794013968900="` echo Too many logins for '"'"'"'"'"'"'"'"'<host_user>'"'"'"'"'"'"'"'"'./.ansible/tmp/ansible-tmp-1646032840.9470909-227-194794013968900 `" ) && sleep 0'"'"'' <<host_ip>> (254, b'', b'') <<host_ip>> Failed to connect to the host via ssh: fatal: [localhost]: UNREACHABLE! => { "changed": false, "msg": "Failed to create temporary directory.In some cases, you may have been able to authenticate and did not have permissions on the target directory. Consider changing the remote tmp path in ansible.cfg to a path rooted in \"/tmp\", for more error information use -vvv. Failed command was: ( umask 77 && mkdir -p \"` echo Too many logins for '<host_user>'./.ansible/tmp `\"&& mkdir \"` echo Too many logins for '<host_user>'./.ansible/tmp/ansible-tmp-1646032840.9470909-227-194794013968900 `\" && echo ansible-tmp-1646032840.9470909-227-194794013968900=\"` echo Too many logins for '<host_user>'./.ansible/tmp/ansible-tmp-1646032840.9470909-227-194794013968900 `\" ), exited with result 254", "unreachable": true } NO MORE HOSTS LEFT ********************************************************************************************************************************************************************** PLAY RECAP ****************************************************************************************************************************************************************************** localhost : ok=0 changed=0 unreachable=1 failed=0 skipped=0 rescued=0 ignored=0 ``` ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/77149
https://github.com/ansible/ansible/pull/77930
f270b4e224174557963120e75bfc81acf1cdde61
15750aec5265866ae46319cbfbb318e9eec0e083
2022-02-28T07:36:03Z
python
2022-06-02T16:21:40Z
closed
ansible/ansible
https://github.com/ansible/ansible
77,136
["changelogs/fragments/77136-first_found-spaces-in-names.yml", "lib/ansible/plugins/lookup/first_found.py", "test/integration/targets/lookup_first_found/files/vars file spaces.yml", "test/integration/targets/lookup_first_found/tasks/main.yml"]
with_first_found: spaces in filenames cause different behaviour
### Summary When I try to import a vars file that contains spaces with `with_first_found` then it behaves differently if the files are passed via `_term` or via `files`. If the list is passed to `files` then the file will not be found and the task fails. ### Issue Type Bug Report ### Component Name first_found ### Ansible Version ```console $ ansible --version ansible [core 2.12.2] config file = /home/user/.ansible.cfg configured module search path = ['/home/user/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/lib/python3.9/site-packages/ansible ansible collection location = /home/user/.ansible/collections:/usr/share/ansible/collections executable location = /usr/local/bin/ansible python version = 3.9.10 (main, Jan 17 2022, 00:00:00) [GCC 11.2.1 20211203 (Red Hat 11.2.1-7)] jinja version = 2.11.3 libyaml = True ``` ### Configuration ```console $ ansible-config dump --only-changed DEFAULT_LOG_PATH(/home/user/.ansible.cfg) = /home/user/ansible.log DEFAULT_STDOUT_CALLBACK(/home/user/.ansible.cfg) = yaml RETRY_FILES_ENABLED(/home/sjakobs/.ansible.cfg) = False ``` ### OS / Environment Fedora 35 ### Steps to Reproduce The following playbook will fail: <!--- Paste example playbooks or commands between quotes below --> ```yaml (paste below) --- - name: Converge hosts: localhost tasks: - name: load var with space include_vars: "{{ item }}" with_first_found: files: - "vars_with space.yml" - name: show var debug: var: foo ``` But commenting the `files` parameter will cause the playbook to succeed. So the following playbook will succeed: ``` --- - name: Converge hosts: localhost tasks: - name: load var with space include_vars: "{{ item }}" with_first_found: # files: - "vars_with space.yml" - name: show var debug: var: foo ``` ### Expected Results ``` PLAY [Converge] ************************************************************************************************* TASK [Gathering Facts] ***************************************************************************************** ok: [localhost] TASK [load var with space] ************************************************************************************* ok: [localhost] => (item=/home/user/molecule/default/vars_with space.yml) TASK [show var] ************************************************************************************************* ok: [localhost] => foo: bar PLAY RECAP ***************************************************************************************************** localhost : ok=3 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored= ``` ### Actual Results ```console PLAY [Converge] ********************************************************************************************* TASK [Gathering Facts] ********************************************************************************************* ok: [localhost] TASK [load var with space] ********************************************************************************************* fatal: [localhost]: FAILED! => msg: No file was found when using first_found. PLAY RECAP ********************************************************************************************* localhost : ok=1 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0 ``` ``` ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/77136
https://github.com/ansible/ansible/pull/77141
12865139472f0a2fa95b94983dcedb4d57e93b10
74a204e6f144f3eabd6384bbb665b6afd69117c3
2022-02-24T11:03:04Z
python
2022-03-02T21:16:47Z
closed
ansible/ansible
https://github.com/ansible/ansible
77,108
["changelogs/fragments/77108_params_blank.yml", "lib/ansible/module_utils/common/parameters.py", "test/units/module_utils/common/arg_spec/test_validate_invalid.py"]
Empty strings are accepted when not listed in 'choices'.
### Summary When creating a new plugin, if an argument uses a list of pre-defined `choices`, even if an empty string ('') is not defined in the selection, it is accepted as a valid value in the playbook. The problem is that `diff_list` is evaluated to "", and thus, the test that should raise an error evaluates to false (`lib/ansible/module_utils/common/parametres.py`): https://github.com/ansible/ansible/blob/36121aeee7812e7f37dd49a64c0dbf9cf741878f/lib/ansible/module_utils/common/parameters.py#L653..L660 ### Issue Type Bug Report ### Component Name Any plugin that uses `choices` in one of its parameters. ### Ansible Version ```console $ ansible --version ansible [core 2.12.2] config file = /etc/ansible/ansible.cfg configured module search path = ['/home/rjeffman/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/lib/python3.10/site-packages/ansible ansible collection location = /home/rjeffman/.ansible/collections:/usr/share/ansible/collections executable location = /usr/bin/ansible python version = 3.10.2 (main, Jan 17 2022, 00:00:00) [GCC 11.2.1 20211203 (Red Hat 11.2.1-7)] jinja version = 3.0.1 libyaml = True ``` ### Configuration ```console $ ansible-config dump --only-changed $ ``` ### OS / Environment Any. ### Steps to Reproduce If you have a plugin (e.g: `myplugin`) where `argument_spec` list a parameter defined like: ``` ch_param=dict(type="list", choices=["A", "B", "C"]), ``` Then the following task would not raise an error: ```yaml (paste below) - myplugin: ch_param: "" ``` ### Expected Results If a value provide by a parameter with a list of valid choices, it is expected that any value outside of this list would raise an error. ### Actual Results ```console No error is reported by Ansible. ``` ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/77108
https://github.com/ansible/ansible/pull/77119
d60efd97687803fd184ac53aa691bd4e0ec43170
4f48f375a0203b0d09c55522a86300a52da5b24a
2022-02-22T19:09:47Z
python
2022-02-24T19:08:33Z
closed
ansible/ansible
https://github.com/ansible/ansible
77,085
["changelogs/fragments/77086-correct-pylint-symbols.yml", "test/lib/ansible_test/_util/controller/sanity/pylint/plugins/deprecated.py"]
`deprecated` pylint plugin bug
### Summary ``` 00:55 File "/root/.ansible/test/venv/sanity.pylint/3.10/1d079f27/lib/python3.10/site-packages/pylint/utils/ast_walker.py", line 74, in walk 00:55 callback(astroid) 00:55 File "/root/ansible/test/lib/ansible_test/_util/controller/sanity/pylint/plugins/deprecated.py", line 252, in visit_call 00:55 self._check_version(node, version, collection_name) 00:55 File "/root/ansible/test/lib/ansible_test/_util/controller/sanity/pylint/plugins/deprecated.py", line 175, in _check_version 00:55 self.add_message('invalid-version', node=node, args=(version,)) 00:55 File "/root/.ansible/test/venv/sanity.pylint/3.10/1d079f27/lib/python3.10/site-packages/pylint/checkers/base_checker.py", line 111, in add_message 00:55 self.linter.add_message(msgid, line, node, args, confidence, col_offset) 00:55 File "/root/.ansible/test/venv/sanity.pylint/3.10/1d079f27/lib/python3.10/site-packages/pylint/message/message_handler_mix_in.py", line 222, in add_message 00:55 message_definitions = self.msgs_store.get_message_definitions(msgid) 00:55 File "/root/.ansible/test/venv/sanity.pylint/3.10/1d079f27/lib/python3.10/site-packages/pylint/message/message_definition_store.py", line 50, in get_message_definitions 00:55 for m in self.message_id_store.get_active_msgids(msgid_or_symbol) 00:55 File "/root/.ansible/test/venv/sanity.pylint/3.10/1d079f27/lib/python3.10/site-packages/pylint/message/message_id_store.py", line 116, in get_active_msgids 00:55 raise UnknownMessageError(error_msg) 00:55 pylint.exceptions.UnknownMessageError: No such message id or symbol 'invalid-version'. ``` `invalid-version` is not defined in that plugin. Additionally, we probably need to handle the issue where the `version` is a reference to a variable that cannot be resolved via astroid: ``` display.deprecated(msg, version=deprecation[1]['version']) ``` ### Issue Type Bug Report ### Component Name test/lib/ansible_test/_util/controller/sanity/pylint/plugins/deprecated.py ### Ansible Version ```console $ ansible --version ``` ### Configuration ```console $ ansible-config dump --only-changed ``` ### OS / Environment N/A ### Steps to Reproduce <!--- Paste example playbooks or commands between quotes below --> ```yaml (paste below) ``` ### Expected Results N/A ### Actual Results ```console N/A ``` ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/77085
https://github.com/ansible/ansible/pull/77086
143904f49b806322b1ae95b5b53057f644bf9665
bdf37336c867ef97dffe32fb5e23a82adb37b899
2022-02-21T18:28:29Z
python
2022-02-23T20:42:45Z
closed
ansible/ansible
https://github.com/ansible/ansible
77,079
["test/units/module_utils/basic/test_deprecate_warn.py", "test/units/module_utils/common/validation/test_check_required_if.py", "test/units/module_utils/facts/test_collectors.py", "test/units/parsing/test_mod_args.py"]
Some tests are skipped due to duplicate names
**SUMMARY** Test names must be unique per scope otherwise the second test overrides the first one with the same name. **ISSUE TYPE** - Bugfix Pull Request **COMPONENT NAME** ansible/test/units/parsing/test_mod_args.py ansible/test/units/module_utils/facts/test_collectors.py ansible/test/units/module_utils/common/validation/test_check_required_if.py ansible/test/units/module_utils/basic/test_deprecate_warn.py **ADDITIONAL INFORMATION** For example if you had a test file that does: ``` def test_a(): pass def test_a(): pass ``` Then only the second `test_a` will be ran. More details [here](https://codereview.doctor/features/python/best-practice/avoid-duplicate-unit-test-names). These are the tests that are overriding previously defined tests due to this problem: https://github.com/ansible/ansible/blob/de9a3bda2cfaace7e3d25b0c4774eefdd9514687/test/units/parsing/test_mod_args.py#L121 https://github.com/ansible/ansible/blob/de9a3bda2cfaace7e3d25b0c4774eefdd9514687/test/units/module_utils/facts/test_collectors.py#L397 https://github.com/ansible/ansible/blob/de9a3bda2cfaace7e3d25b0c4774eefdd9514687/test/units/module_utils/facts/test_collectors.py#L413 https://github.com/ansible/ansible/blob/de9a3bda2cfaace7e3d25b0c4774eefdd9514687/test/units/module_utils/common/validation/test_check_required_if.py#L56 https://github.com/ansible/ansible/blob/de9a3bda2cfaace7e3d25b0c4774eefdd9514687/test/units/module_utils/basic/test_deprecate_warn.py#L74 I found this issue automatically, see other issues [here](https://codereview.doctor/ansible/ansible)
https://github.com/ansible/ansible/issues/77079
https://github.com/ansible/ansible/pull/77115
0bd8106d15ed35ba3f1869010721ba958c01158f
2cd6cdc6a74beb2413383837ffc25cdd902264e8
2022-02-21T09:32:00Z
python
2022-02-23T00:41:57Z
closed
ansible/ansible
https://github.com/ansible/ansible
77,077
["changelogs/fragments/77077_iptables.yml", "lib/ansible/modules/iptables.py"]
Iptables --set-dscp unknown option for iptables version v1.8.7 (nf_tables)
### Summary When i try to use set_dscp_mark in ansible.builtin.iptables got this error ``` FAILED! => {"changed": false, "cmd": "/usr/sbin/iptables -t mangle -A POSTROUTING -p udp --destination-port 7777 --set-dscp 399962", "msg": "iptables v1.8.7 (nf_tables): unknown option \"--set-dscp\"\nTry `iptables -h' or 'iptables --help' for more information.", "rc": 2, "stderr": "iptables v1.8.7 (nf_tables): unknown option \"--set-dscp\"\nTry `iptables -h' or 'iptables --help' for more information.\n", "stderr_lines": ["iptables v1.8.7 (nf_tables): unknown option \"--set-dscp\"", "Try `iptables -h' or 'iptables --help' for more information."], "stdout": "", "stdout_lines": []} ``` ### Issue Type Bug Report ### Component Name ansible.builtin.iptables ### Ansible Version ```console $ ansible --version ansible [core 2.12.2] config file = /etc/ansible/ansible.cfg configured module search path = ['~/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/lib/python3.10/site-packages/ansible ansible collection location = ~/.ansible/collections:/usr/share/ansible/collections executable location = /usr/bin/ansible python version = 3.10.2 (main, Jan 15 2022, 19:56:27) [GCC 11.1.0] jinja version = 3.0.3 libyaml = True ``` ### Configuration ```console $ ansible-config dump --only-changed nothing ``` ### OS / Environment Host Linux XXX 5.15.21-1-MANJARO #1 SMP PREEMPT Sun Feb 6 12:21:42 UTC 2022 x86_64 GNU/Linux Guest Linux debian 5.10.0-11-amd64 #1 SMP Debian 5.10.92-1 (2022-01-18) x86_64 GNU/Linux ### Steps to Reproduce ``` - name: Modify mangle table to mark packet for queue discipline on port 7777 ansible.builtin.iptables: table: mangle chain: POSTROUTING protocol: udp destination_port: 7777 set_dscp_mark: 6666:2 ``` ### Expected Results I expect that the iptables rule was installed on the system ### Actual Results ```console fatal: [tcvm]: FAILED! => {"changed": false, "cmd": "/usr/sbin/iptables -t mangle -A POSTROUTING -p udp --destination-port 7777 --set-dscp 399962", "msg": "iptables v1.8.7 (nf_tables): unknown option \"--set-dscp\"\nTry `iptables -h' or 'iptables --help' for more information.", "rc": 2, "stderr": "iptables v1.8.7 (nf_tables): unknown option \"--set-dscp\"\nTry `iptables -h' or 'iptables --help' for more information.\n", "stderr_lines": ["iptables v1.8.7 (nf_tables): unknown option \"--set-dscp\"", "Try `iptables -h' or 'iptables --help' for more information."], "stdout": "", "stdout_lines": []} ``` ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/77077
https://github.com/ansible/ansible/pull/82145
567c78f9a1c7d6a5326dcd63a2a69ba9db6c3a6d
40baf5eace3848cd99b43a7c6732048c6072da60
2022-02-20T18:08:31Z
python
2023-11-07T15:19:25Z
closed
ansible/ansible
https://github.com/ansible/ansible
77,049
["changelogs/fragments/group_warning.yml", "lib/ansible/modules/group.py"]
Group module emits false warning when local: yes
### Summary When attempting to create a new local group using the group module a warning is written to the log and the group is created anyway. ### Issue Type Bug Report ### Component Name group ### Ansible Version ```console $ ansible --version TFDM==>ansible --version ansible [core 2.11.5] config file = /opt/repo/team/n26984/WIP_working/playbooks/ansible.cfg configured module search path = ['/opt/repo/team/n26984/WIP_working/playbooks/collections/ansible_collections/tfdm/utils/plugins/modules', '/usr/share/ansible/collections/ansible_collections/tfdm/utils/plugins/modules', '/home/tfdmseed/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/local/lib/python3.8/site-packages/ansible ansible collection location = /home/tfdmseed/.ansible/collections:/usr/share/ansible/collections executable location = /usr/local/bin/ansible python version = 3.8.6 (default, Jan 22 2021, 11:41:28) [GCC 8.4.1 20200928 (Red Hat 8.4.1-1)] jinja version = 3.0.2 libyaml = True ``` ### Configuration ```console $ ansible-config dump --only-changed TFDM==>ansible-config dump --only-changed ANSIBLE_PIPELINING(/opt/repo/team/n26984/WIP_working/playbooks/ansible.cfg) = True BECOME_ALLOW_SAME_USER(/opt/repo/team/n26984/WIP_working/playbooks/ansible.cfg) = True BECOME_PLUGIN_PATH(/opt/repo/team/n26984/WIP_working/playbooks/ansible.cfg) = ['/opt/repo/team/n26984/WIP_working/playbooks/collections/ansible_collections/tfd> CALLBACKS_ENABLED(/opt/repo/team/n26984/WIP_working/playbooks/ansible.cfg) = ['tfdm.utils.tfdm_log', 'tfdm.utils.profile_tasks_custom'] DEFAULT_ACTION_PLUGIN_PATH(/opt/repo/team/n26984/WIP_working/playbooks/ansible.cfg) = ['/opt/repo/team/n26984/WIP_working/playbooks/collections/ansible_collect> DEFAULT_FILTER_PLUGIN_PATH(/opt/repo/team/n26984/WIP_working/playbooks/ansible.cfg) = ['/opt/repo/team/n26984/WIP_working/playbooks/collections/ansible_collect> DEFAULT_FORKS(/opt/repo/team/n26984/WIP_working/playbooks/ansible.cfg) = 100 DEFAULT_HOST_LIST(/opt/repo/team/n26984/WIP_working/playbooks/ansible.cfg) = ['/opt/repo/team/n26984/WIP_working/playbooks/inventory.yml'] DEFAULT_LOAD_CALLBACK_PLUGINS(/opt/repo/team/n26984/WIP_working/playbooks/ansible.cfg) = True DEFAULT_LOCAL_TMP(/opt/repo/team/n26984/WIP_working/playbooks/ansible.cfg) = /tmp/.ansible_tfdmseed/ansible-local-181801rco8rkt DEFAULT_MODULE_PATH(/opt/repo/team/n26984/WIP_working/playbooks/ansible.cfg) = ['/opt/repo/team/n26984/WIP_working/playbooks/collections/ansible_collections/tf> DEFAULT_ROLES_PATH(/opt/repo/team/n26984/WIP_working/playbooks/ansible.cfg) = ['/opt/repo/team/n26984/WIP_working/playbooks/roles', '/usr/share/ansible/tfdm_ro> DEFAULT_STDOUT_CALLBACK(/opt/repo/team/n26984/WIP_working/playbooks/ansible.cfg) = tfdm.utils.yaml_custom DEFAULT_STRATEGY(/opt/repo/team/n26984/WIP_working/playbooks/ansible.cfg) = free DEFAULT_TEST_PLUGIN_PATH(/opt/repo/team/n26984/WIP_working/playbooks/ansible.cfg) = ['/opt/repo/team/n26984/WIP_working/playbooks/collections/ansible_collectio> DEFAULT_TIMEOUT(/opt/repo/team/n26984/WIP_working/playbooks/ansible.cfg) = 60 DEFAULT_VAULT_PASSWORD_FILE(/opt/repo/team/n26984/WIP_working/playbooks/ansible.cfg) = /opt/repo/team/n26984/WIP_working/playbooks/tfdm_key DIFF_ALWAYS(/opt/repo/team/n26984/WIP_working/playbooks/ansible.cfg) = True DIFF_CONTEXT(/opt/repo/team/n26984/WIP_working/playbooks/ansible.cfg) = 0 DISPLAY_SKIPPED_HOSTS(/opt/repo/team/n26984/WIP_working/playbooks/ansible.cfg) = False DUPLICATE_YAML_DICT_KEY(/opt/repo/team/n26984/WIP_working/playbooks/ansible.cfg) = ignore HOST_KEY_CHECKING(/opt/repo/team/n26984/WIP_working/playbooks/ansible.cfg) = False INTERPRETER_PYTHON(/opt/repo/team/n26984/WIP_working/playbooks/ansible.cfg) = auto_silent INVENTORY_CACHE_ENABLED(/opt/repo/team/n26984/WIP_working/playbooks/ansible.cfg) = True INVENTORY_ENABLED(/opt/repo/team/n26984/WIP_working/playbooks/ansible.cfg) = ['tfdm.utils.tfdm_inventory', 'host_list', 'script', 'auto', 'yaml', 'ini'] LOCALHOST_WARNING(/opt/repo/team/n26984/WIP_working/playbooks/ansible.cfg) = False MAX_FILE_SIZE_FOR_DIFF(/opt/repo/team/n26984/WIP_working/playbooks/ansible.cfg) = 10485760 VARIABLE_PLUGINS_ENABLED(/opt/repo/team/n26984/WIP_working/playbooks/ansible.cfg) = ['host_group_vars', 'tfdm.utils.tfdm_site_vars', 'tfdm.utils.nested_vars'] ``` ### OS / Environment TFDM==>cat /etc/redhat-release Red Hat Enterprise Linux release 8.4 (Ootpa) ### Steps to Reproduce <!--- Paste example playbooks or commands between quotes below --> ```yaml (paste below) --- - name: Create Local Group hosts: "{{ target_host | get_target_hosts(groups) }}" tasks: - name: create a local group group: name: jke_grp gid: 4242 local: yes ``` prompt>ansible-playbook test_group.yml -e target_host=sup01 ### Expected Results The local group is created on the specified host with no warnings ### Actual Results ```console TFDM==>ansible-playbook test_group.yml -e target_host=sup01 2022-02-17 14:25:51.932801 tfdmseed /opt/repo/team/n26984/WIP_working/playbooks /usr/local/bin/ansible-playbook test_group.yml -e target_host=sup01 /var/log/ansible/tfdmseed/test_group.2022-02-17T14-25-51.log.gz (/backups/ansible/vnat/tfdmseed/test_group.2022-02-17T14-25-51.log.gz) PLAY [Create Local Group] ************************************************************************************************************************************** Thursday 17 February 2022 14:25:52 +0000 (0:00:00.178) 0:00:00.178 ***** TASK [Gathering Facts] ***************************************************************************************************************************************** ok: [sup01] Thursday 17 February 2022 14:25:54 +0000 (0:00:02.058) 0:00:02.237 ***** TASK [create a local group] ************************************************************************************************************************************ [WARNING]: 'local: true' specified and group was not found in /etc/group. The local group may already exist if the local group database exists somewhere other than /etc/group. changed: [sup01] PLAY RECAP ***************************************************************************************************************************************************** sup01 : ok=2 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 LOG: /var/log/ansible/tfdmseed/test_group.2022-02-17T14-25-51.log.gz (/backups/ansible/vnat/tfdmseed/test_group.2022-02-17T14-25-51.log.gz) [WARNING]: There were 1 previous warnings in this run. Please review the log. ``` ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/77049
https://github.com/ansible/ansible/pull/81557
4a96b3d5b41fe9f0d12d899234b22e676d82e804
aa8a29a9d4cad82cbaad74be10cd8f1c1dc4e3c0
2022-02-17T14:27:44Z
python
2023-08-22T15:23:10Z
closed
ansible/ansible
https://github.com/ansible/ansible
77,047
["docs/docsite/rst/reference_appendices/faq.rst", "docs/docsite/rst/user_guide/playbooks_error_handling.rst"]
please add/elaborate when variables need to be wrapped in jinja delimiters
### Summary I'm studying Red Hat's RH294 and ansible in general. One thing that often confuses me is when to warp variables in jinja delimiters `{{ }}` and when not. [playbooks_variables.rst ](https://docs.ansible.com/ansible/2.9/user_guide/playbooks_variables.html#using-variables-with-jinja2) says: > Once you’ve defined variables, you can use them in your playbooks using the Jinja2 templating system. Here’s a simple Jinja2 template: > > `My amp goes to {{ max_amp_value }}` But many modules/conditionals have implicit jinja wrapping and fail when a variable is wrapped in `{{ }}`. The [builtin `debug` module's `var` parameter](https://docs.ansible.com/ansible/latest/collections/ansible/builtin/debug_module.html#parameter-var) is one of the few places so far where I found this to be documented explicitly. The [`when` clause](https://docs.ansible.com/ansible/latest/user_guide/playbooks_conditionals.html) is another example where it is documented that it is a jinja expression and does not require wrapping. However: `failed_when`, `changed_when` also require variables to used as-is but that is not documented at [conditionals](https://docs.ansible.com/ansible/latest/user_guide/playbooks_error_handling.html) AFAICT. ### Issue Type Documentation Report ### Component Name playbooks_variables.rst ### Ansible Version ```console n/a ``` ### Configuration ```console n/a ``` ### OS / Environment n/a ### Additional Information Adding an explanation that some modules/variables/statements run in a jinja context and others don't and how this affects the need to wrap variables would help newcomers create correct playbooks quicker. Adding a similar note about the jinja context to playbooks_error_handling.rst as seen on playbooks_conditionals.rst would be helpful as well. ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/77047
https://github.com/ansible/ansible/pull/77051
e620b96f49c6b343963a01f1ff6c5419869df2df
84b85a5b5a53a56c460bf4b68b5126fd2ccdc03a
2022-02-17T09:49:40Z
python
2022-02-17T15:28:12Z
closed
ansible/ansible
https://github.com/ansible/ansible
77,025
["changelogs/fragments/77074-hostname-fix-typeerror-in-filestrategy.yml", "lib/ansible/modules/hostname.py"]
hostname module crashes with TypeError when FileStrategy is used
### Summary The `hostname` module crashes with a `TypeError` exception when the file-based strategy is used (e.g. when handling a Devuan host). ### Issue Type Bug Report ### Component Name hostname ### Ansible Version ```console $ ansible --version ansible [core 2.12.2] config file = /home/tseeker/ansible/main/ansible.cfg configured module search path = ['/home/tseeker/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /home/tseeker/.virtualenvs/ansible/lib/python3.9/site-packages/ansible ansible collection location = /home/tseeker/.ansible/collections:/usr/share/ansible/collections executable location = /home/tseeker/.virtualenvs/ansible/bin/ansible python version = 3.9.2 (default, Feb 28 2021, 17:03:44) [GCC 10.2.1 20210110] jinja version = 3.0.3 libyaml = True ``` ### Configuration ```console $ ansible-config dump --only-changed DEFAULT_ASK_VAULT_PASS(/home/tseeker/ansible/main/ansible.cfg) = True DEFAULT_HOST_LIST(/home/tseeker/ansible/main/ansible.cfg) = ['/home/tseeker/ansible/main/inventory'] DEFAULT_JINJA2_EXTENSIONS(/home/tseeker/ansible/main/ansible.cfg) = jinja2.ext.do HOST_KEY_CHECKING(/home/tseeker/ansible/main/ansible.cfg) = False USE_PERSISTENT_CONNECTIONS(/home/tseeker/ansible/main/ansible.cfg) = True ``` ### OS / Environment Devuan Chimaera on both the host running Ansible and the target. ### Steps to Reproduce Tested with : ```bash ansible -m ansible.builtin.hostname -a 'name=target' target ``` Various values for `use` were attempted. ### Expected Results I expected the `hostname` to do exactly nothing as it was already configured on the machine in question. ### Actual Results ```console The plugin crashes with the following traceback : Traceback (most recent call last): File "/home/administrator/.ansible/tmp/ansible-tmp-1644935764.4447377-23987-132310327618278/AnsiballZ_hostname.py", line 259, in <module> _ansiballz_main() File "/home/administrator/.ansible/tmp/ansible-tmp-1644935764.4447377-23987-132310327618278/AnsiballZ_hostname.py", line 246, in _ansiballz_main exitcode = debug(sys.argv[1], zipped_mod, ANSIBALLZ_PARAMS) File "/home/administrator/.ansible/tmp/ansible-tmp-1644935764.4447377-23987-132310327618278/AnsiballZ_hostname.py", line 213, in debug runpy.run_module(mod_name='ansible.modules.hostname', init_globals=None, run_name='__main__', alter_sys=True) File "/usr/lib/python3.9/runpy.py", line 210, in run_module return _run_module_code(code, init_globals, run_name, mod_spec) File "/usr/lib/python3.9/runpy.py", line 97, in _run_module_code _run_code(code, mod_globals, init_globals, File "/usr/lib/python3.9/runpy.py", line 87, in _run_code exec(code, run_globals) File "/home/administrator/.ansible/tmp/ansible-tmp-1644935764.4447377-23987-132310327618278/debug_dir/ansible/modules/hostname.py", line 891, in <module> main() File "/home/administrator/.ansible/tmp/ansible-tmp-1644935764.4447377-23987-132310327618278/debug_dir/ansible/modules/hostname.py", line 885, in main 'before': 'hostname = ' + name_before + '\n'} TypeError: can only concatenate str (not "list") to str ``` This is caused by line 260 of `hostname.py`, which returns the array containing all the lines in whatever file `FileStrategy` is currently reading rather than just one line. ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/77025
https://github.com/ansible/ansible/pull/77074
6a7009a84f550c5a9573c1aa1337c0f3960a2415
d60efd97687803fd184ac53aa691bd4e0ec43170
2022-02-15T15:00:59Z
python
2022-02-24T19:05:52Z
closed
ansible/ansible
https://github.com/ansible/ansible
77,010
["changelogs/fragments/77010-dnf-ensure-releasever-string.yml", "lib/ansible/modules/dnf.py"]
dnf module fails on Fedora Rawhide
### Summary An error occurs using this Ansible code: ```yaml - name: install docker ansible.builtin.package: name: moby-engine state: present ``` The [error](https://gitlab.com/robertdebock/ansible-role-docker/-/jobs/2078222255#L279): ```text An exception occurred during task execution. To see the full traceback, use -vvv. The error was: TypeError: in method 'ConfigParser_setSubstitutions', argument 2 of type 'std::map< std::string,std::string,std::less< std::string >,std::allocator< std::pair< std::string const,std::string > > > const &' ``` The full error: ```text fatal: [docker-fedora-rawhide]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n File \"/root/.ansible/tmp/ansible-tmp-1644500487.7706077-1096-217210945615717/AnsiballZ_dnf.py\", line 107, in <module>\n _ansiballz_main()\n File \"/root/.ansible/tmp/ansible-tmp-1644500487.7706077-1096-217210945615717/AnsiballZ_dnf.py\", line 99, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File \"/root/.ansible/tmp/ansible-tmp-1644500487.7706077-1096-217210945615717/AnsiballZ_dnf.py\", line 47, in invoke_module\n runpy.run_module(mod_name='ansible.modules.dnf', init_globals=dict(_module_fqn='ansible.modules.dnf', _modlib_path=modlib_path),\n File \"/usr/lib64/python3.10/runpy.py\", line 209, in run_module\n return _run_module_code(code, init_globals, run_name, mod_spec)\n File \"/usr/lib64/python3.10/runpy.py\", line 96, in _run_module_code\n _run_code(code, mod_globals, init_globals,\n File \"/usr/lib64/python3.10/runpy.py\", line 86, in _run_code\n exec(code, run_globals)\n File \"/tmp/ansible_ansible.legacy.dnf_payload_vdrv7w8l/ansible_ansible.legacy.dnf_payload.zip/ansible/modules/dnf.py\", line 1427, in <module>\n File \"/tmp/ansible_ansible.legacy.dnf_payload_vdrv7w8l/ansible_ansible.legacy.dnf_payload.zip/ansible/modules/dnf.py\", line 1416, in main\n File \"/tmp/ansible_ansible.legacy.dnf_payload_vdrv7w8l/ansible_ansible.legacy.dnf_payload.zip/ansible/modules/dnf.py\", line 1382, in run\n File \"/tmp/ansible_ansible.legacy.dnf_payload_vdrv7w8l/ansible_ansible.legacy.dnf_payload.zip/ansible/modules/dnf.py\", line 704, in _base\n File \"/tmp/ansible_ansible.legacy.dnf_payload_vdrv7w8l/ansible_ansible.legacy.dnf_payload.zip/ansible/modules/dnf.py\", line 674, in _specify_repositories\n File \"/usr/lib/python3.10/site-packages/dnf/base.py\", line 545, in read_all_repos\n for repo in reader:\n File \"/usr/lib/python3.10/site-packages/dnf/conf/read.py\", line 42, in __iter__\n for r in self._get_repos(self.conf.config_file_path):\n File \"/usr/lib/python3.10/site-packages/dnf/conf/read.py\", line 109, in _get_repos\n parser.setSubstitutions(substs)\n File \"/usr/lib64/python3.10/site-packages/libdnf/conf.py\", line 1670, in setSubstitutions\n return _conf.ConfigParser_setSubstitutions(self, substitutions)\nTypeError: in method 'ConfigParser_setSubstitutions', argument 2 of type 'std::map< std::string,std::string,std::less< std::string >,std::allocator< std::pair< std::string const,std::string > > > const &'\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1} ``` It happens on Fedora Rawhide only, not Fedora 35. ### Issue Type Bug Report ### Component Name package ### Ansible Version ```console $ ansible --version ansible [core 2.12.2] config file = /Users/robertdb/Documents/git.adfinis.com/juniper/ansible-playbook-g itlab/ansible.cfg configured module search path = ['/Users/robertdb/.ansible/plugins/modules', '/usr /share/ansible/plugins/modules'] ansible python module location = /opt/homebrew/lib/python3.9/site-packages/ansible ansible collection location = /Users/robertdb/Documents/git.adfinis.com/juniper/an sible-playbook-gitlab/collections executable location = /opt/homebrew/bin/ansible python version = 3.9.2 (default, Mar 26 2021, 15:28:17) [Clang 12.0.0 (clang-1200. 0.32.29)] jinja version = 3.0.3 libyaml = True ``` ### Configuration ```console $ ansible-config dump --only-changed # (no output) ``` ### OS / Environment Ansible Controller: Mac OS X Ansible managed node: Fedora Rawhide (currently "36") ### Steps to Reproduce ```yaml - name: install docker ansible.builtin.package: name: moby-engine state: present ``` ### Expected Results I was hoping the package to be installed. ### Actual Results ```console An exception occurred during task execution. To see the full traceback, use -vvv. The error was: TypeError: in method 'ConfigParser_setSubstitutions', argument 2 of type 'std::map< std::string,std::string,std::less< std::string >,std::allocator< std::pair< std::string const,std::string > > > const &' ``` ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/77010
https://github.com/ansible/ansible/pull/77024
af7c9deb4ed4c6b9a526a40f976bb52c570fced1
18251f368511d1eaa161380517c29f6d7839d229
2022-02-11T11:59:02Z
python
2022-02-15T15:12:47Z
closed
ansible/ansible
https://github.com/ansible/ansible
77,004
["changelogs/fragments/77004-restore-missing-default.yml", "lib/ansible/plugins/lookup/template.py", "test/integration/targets/lookup_template/tasks/main.yml", "test/integration/targets/lookup_template/templates/dict.j2"]
to_json filter sometimes turns values into strings when templating
### Summary It seems like the to_json filter behaves differently depending on: * Whether it's passed the result of a template call directly, or whether the result of the template call is placed into a fact first * Whether the template call actually does any substitutions or not * Whether I'm using ansible community <=v4.10.0 or >=5.0.1 When I run the playbook using Ansible 4.10.0, to_json turns the value into a JSON string, if and only if it's passed the result of a template call which does no substitutions. If the template has a variable in it, or if the result of the template call is stored in a fact before being sent to to_json, the JSON looks how I'd expect. When using Ansible 5.0.1, the value is turned into a string whenever to_json is passed the result of a template call, regardless of whether the template has a variable in it or not. There's a lot of permutations here, and I'm not sure which, if any, of these behaviors are unexpected. I've found https://github.com/ansible/ansible/issues/76443, which seems closely related, but: * I'm already using `template` and not `copy` as recommended [here](https://github.com/ansible/ansible/issues/76443#issuecomment-984889291) * If it's the case that `to_json and to_nice_json ALWAYS are supposed to return a string (of serialized JSON)` as mentioned [here](https://github.com/ansible/ansible/issues/76443#issuecomment-984879201), it seems that there are edge cases where it doesn't ### Issue Type Bug Report ### Component Name to_json ### Ansible Version ```console $ ansible --version ansible [core 2.12.1] config file = None configured module search path = ['/Users/riendeau/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /Users/riendeau/venvs/ansible5x/lib/python3.9/site-packages/ansible ansible collection location = /Users/riendeau/.ansible/collections:/usr/share/ansible/collections executable location = /Users/riendeau/venvs/ansible5x/bin/ansible python version = 3.9.10 (v3.9.10:f2f3f53782, Jan 13 2022, 17:02:14) [Clang 6.0 (clang-600.0.57)] jinja version = 3.0.3 libyaml = True ``` ### Configuration ```console $ ansible-config dump --only-changed COLOR_DEBUG(env: ANSIBLE_COLOR_DEBUG) = bright gray ``` ### OS / Environment Mac OS Monterey 12.1 ### Steps to Reproduce <!--- Paste example playbooks or commands between quotes below --> ```yaml (paste below) --- - name: Test with trivial template hosts: localhost tasks: - copy: dest: "trivial.json.j2" content: '{ "hello": "world" }' - set_fact: template_result: "{{ lookup('template', 'trivial.json.j2') }}" - set_fact: json_from_fact_trivial_template: "{{ template_result | to_json }}" json_from_template_trivial_template: "{{ lookup('template', 'trivial.json.j2') | to_json }}" - debug: var: json_from_fact_trivial_template - debug: var: json_from_template_trivial_template - name: Test with template including variable hosts: localhost tasks: - copy: dest: "withvar.json.j2" content: '{% raw %}{ "{{ greeting }}": "world" }{% endraw %}' - set_fact: greeting: 'howdy' - set_fact: template_result: "{{ lookup('template', 'withvar.json.j2') }}" - set_fact: json_from_fact_template_withvar: "{{ template_result | to_json }}" json_from_template_withvar: "{{ lookup('template', 'withvar.json.j2') | to_json }}" - debug: var: json_from_fact_template_withvar - debug: var: json_from_template_withvar ``` ### Expected Results I expected: * Consistent behavior between Ansible 4.10.0 and Ansible 5.0.1, or documentation of a behavior change * Consistent behavior within Ansible 5.0.1 ### Actual Results ```console (Output with Ansible 4.10.0:) TASK [debug] **************************************************************************************************************************************************************** ok: [localhost] => { "json_from_fact_trivial_template": { "hello": "world" } } TASK [debug] **************************************************************************************************************************************************************** ok: [localhost] => { "json_from_template_trivial_template": "\"{ \\\"hello\\\": \\\"world\\\" }\"" } TASK [debug] **************************************************************************************************************************************************************** ok: [localhost] => { "json_from_fact_template_withvar": { "howdy": "world" } } TASK [debug] **************************************************************************************************************************************************************** ok: [localhost] => { "json_from_template_withvar": { "howdy": "world" } } ------ (Output with Ansible 5.0.1:) TASK [debug] **************************************************************************************************************************************************************** ok: [localhost] => { "json_from_fact_trivial_template": { "hello": "world" } } TASK [debug] **************************************************************************************************************************************************************** ok: [localhost] => { "json_from_template_trivial_template": "\"{ \\\"hello\\\": \\\"world\\\" }\"" } TASK [debug] **************************************************************************************************************************************************************** ok: [localhost] => { "json_from_fact_template_withvar": { "howdy": "world" } } TASK [debug] **************************************************************************************************************************************************************** ok: [localhost] => { "json_from_template_withvar": "\"{\\\"howdy\\\": \\\"world\\\"}\"" } ``` ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/77004
https://github.com/ansible/ansible/pull/77016
c9d3518d2f3812787e1627806b5fa93f8fae48a6
3779c1f278685c5a8d7f78942ce649f6805a5775
2022-02-10T17:48:08Z
python
2022-02-14T14:21:17Z
closed
ansible/ansible
https://github.com/ansible/ansible
77,001
["changelogs/fragments/handle_connection_cornercase.yml", "lib/ansible/playbook/play_context.py"]
Error: No such container: inventory_hostname
### Summary Our CI is breaking when gathering facts: ``` TASK [Gathering Facts] ********************************************************* fatal: [debian-11]: FAILED! => { "ansible_facts": {}, "changed": false, "failed_modules": { "ansible.legacy.setup": { "failed": true, "module_stderr": "Error: No such container: inventory_hostname\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1 } } } MSG: The following modules failed to execute: ansible.legacy.setup ``` https://github.com/pulp/pulp_installer/runs/5134587244?check_suite_focus=true#step:7:147 it believe it started with this commit: https://github.com/ansible/ansible/commit/6d2d476113b3a26e46c9917e213f09494fbc0a13 ### Issue Type Bug Report ### Component Name ansible.legacy.setup ### Ansible Version ```console $ ansible --version ansible [core 2.13.0.dev0] config file = /home/runner/work/pulp_installer/pulp_installer/ansible.cfg configured module search path = ['/home/runner/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/site-packages/ansible ansible collection location = /home/runner/.ansible/collections:/usr/share/ansible/collections executable location = /opt/hostedtoolcache/Python/3.9.10/x64/bin/ansible python version = 3.9.10 (main, Feb 3 2022, 07:33:39) [GCC 9.3.0] jinja version = 3.0.3 libyaml = True ``` ### Configuration ```console $ ansible-config dump --only-changed ``` ### OS / Environment Debian 11, CentOS 8 stream, fedora 35, CentOS 7 ### Steps to Reproduce Run molecule test with docker images on ansible core 2.13.0.dev0 ### Expected Results Successfully gather facts ### Actual Results ```console TASK [Gathering Facts] ********************************************************* fatal: [debian-11]: FAILED! => { "ansible_facts": {}, "changed": false, "failed_modules": { "ansible.legacy.setup": { "failed": true, "module_stderr": "Error: No such container: inventory_hostname\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1 } } } MSG: The following modules failed to execute: ansible.legacy.setup ``` ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/77001
https://github.com/ansible/ansible/pull/77005
32f7490a2c841c3162e90712aa5faf4fdbeabda8
56edbd2bbb372a61dae2017923f1d8e33d1922d9
2022-02-10T16:55:06Z
python
2022-02-11T21:26:02Z
closed
ansible/ansible
https://github.com/ansible/ansible
76,960
["changelogs/fragments/ansible-test-validate-modules-collection-loader.yml", "test/integration/targets/ansible-test/ansible_collections/ns/ps_only/meta/runtime.yml", "test/integration/targets/ansible-test/ansible_collections/ns/ps_only/plugins/module_utils/validate.psm1", "test/integration/targets/ansible-test/ansible_collections/ns/ps_only/plugins/modules/validate.ps1", "test/integration/targets/ansible-test/ansible_collections/ns/ps_only/plugins/modules/validate.py", "test/integration/targets/ansible-test/collection-tests/validate-modules-collection-loader.sh", "test/lib/ansible_test/_util/controller/sanity/validate-modules/validate_modules/main.py"]
`ansible-test sanity` fails on `validate-modules` in a collection that contains no python modules and uses `meta/runtime.yml` in Ansible 2.12+
### Summary I am working with @lowlydba on an [MSSQL-focused collection](https://github.com/LowlyDBA/lowlydba.sqlserver), and we're getting the basics set up. We have hit the following error in the sanity tests for Ansible 2.12 and higher: ``` Running sanity test "validate-modules" ERROR: Command "/root/.ansible/test/venv/sanity.validate-modules/3.9/2e4ce301/bin/python /root/ansible/test/lib/ansible_test/_util/controller/sanity/validate-modules/validate-modules --format json --arg-spec plugins/modules/memory.ps1 plugins/modules/memory.py --collection ansible_collections/lowlydba/sqlserver --collection-version 0.0.0" returned exit status 0. >>> Standard Error [WARNING]: packaging Python module unavailable; unable to validate collection Ansible version requirements >>> Standard Output {} ``` This looks a lot like https://github.com/ansible/ansible/pull/76513 and https://github.com/ansible/ansible/issues/76504 , but is still happening in `devel` and `milestone` too. We have been troubleshooting it in https://github.com/LowlyDBA/lowlydba.sqlserver/issues/6 and have found the following: - Error goes away if there are no PowerShell modules present (the collection will be entirely PowerShell modules at this time) - Error goes away if `requires_ansible` is not present in `meta/runtime.yml` - Error goes away if a python module is included in the collection (a python plugin was not sufficient, tested with a filter plugin) ### Issue Type Bug Report ### Component Name ansible-test ### Ansible Version Affects `stable-2.12`, `milestone`, and `devel` branches. ### Configuration ```console $ ansible-config dump --only-changed n/a ``` ### OS / Environment WSL2 / Ubuntu 18.04 ### Steps to Reproduce <!--- Paste example playbooks or commands between quotes below --> With [the collection](https://github.com/LowlyDBA/lowlydba.sqlserver) checked out in the right directory structure: ```yaml (paste below) ansible-test sanity --docker default ``` ### Expected Results Clean run ### Actual Results ```console Running sanity test "validate-modules" ERROR: Command "/root/.ansible/test/venv/sanity.validate-modules/3.9/2e4ce301/bin/python /root/ansible/test/lib/ansible_test/_util/controller/sanity/validate-modules/validate-modules --format json --arg-spec plugins/modules/memory.ps1 plugins/modules/memory.py --collection ansible_collections/lowlydba/sqlserver --collection-version 0.0.0" returned exit status 0. >>> Standard Error [WARNING]: packaging Python module unavailable; unable to validate collection Ansible version requirements >>> Standard Output {} ERROR: Command "docker exec -it ansible-test-controller-EL88bWob /usr/bin/env ANSIBLE_TEST_CONTENT_ROOT=/root/ansible_collections/lowlydba/sqlserver LC_ALL=en_US.UTF-8 /usr/bin/python3.9 /root/ansible/bin/ansible-test sanity --containers '{"control": {"__pypi_proxy__": {"pypi-test-container-EL88bWob": {"host_ip": "172.17.0.2", "names": ["pypi-test-container-EL88bWob"], "ports": [3141]}}}, "managed": {"__pypi_proxy__": {"pypi-test-container-EL88bWob": {"host_ip": "172.17.0.2", "names": ["pypi-test-container-EL88bWob"], "ports": [3141]}}}}' --metadata tests/output/.tmp/metadata-s3jmdrvh.json --truncate 198 --color yes --host-path tests/output/.tmp/host-zpgh4g5o" returned exit status 1. ``` ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/76960
https://github.com/ansible/ansible/pull/76986
699ecb83082b3b24a1a0a21cfadf19eda8891bff
0d40423f1c1c7ca2e71f30c9eca60ca60af93ff2
2022-02-06T16:59:14Z
python
2022-02-08T19:38:00Z
closed
ansible/ansible
https://github.com/ansible/ansible
76,959
["changelogs/fragments/76971-unarchive-remove-unnecessary-zipinfo-dependency.yml", "lib/ansible/modules/unarchive.py", "test/integration/targets/unarchive/tasks/test_missing_binaries.yml"]
unarchive: Fallback to unzip -Z if zipinfo is not available
### Summary unarchive requires zipinfo: fatal: [_[...]_]: FAILED! => {"changed": false, "msg": "Failed to find handler for \"_[...]_.zip\". Make sure the required command to extract the file is installed. Unable to find required 'zipinfo' binary in the path. Command \"/usr/bin/tar\" detected as tar type None. GNU tar required."} OpenELEC has no zipinfo (see #39029 and #59556) but `unzip -Z` seems to work. Would it not be possible to fall back to `unzip -Z` if zipinfo is not available and fails only if both are not working? See also: - #75361 - #74632 - #36442 This could for example solved like this: ```diff diff --git a/lib/ansible/modules/unarchive.py b/lib/ansible/modules/unarchive.py index d1ccd01066..009e73b466 100644 --- a/lib/ansible/modules/unarchive.py +++ b/lib/ansible/modules/unarchive.py @@ -280,7 +280,7 @@ class ZipArchive(object): self.includes = [] self.include_files = self.module.params['include'] self.cmd_path = None - self.zipinfo_cmd_path = None + self.zipinfo_cmd = None self._files_in_archive = [] self._infodict = dict() @@ -374,7 +374,7 @@ class ZipArchive(object): def is_unarchived(self): # BSD unzip doesn't support zipinfo listings with timestamp. - cmd = [self.zipinfo_cmd_path, '-T', '-s', self.src] + cmd = self.zipinfo_cmd + ['-T', '-s', self.src] if self.excludes: cmd.extend(['-x', ] + self.excludes) @@ -695,19 +695,16 @@ class ZipArchive(object): return dict(cmd=cmd, rc=rc, out=out, err=err) def can_handle_archive(self): - binaries = ( - ('unzip', 'cmd_path'), - ('zipinfo', 'zipinfo_cmd_path'), - ) - missing = [] - for b in binaries: - try: - setattr(self, b[1], get_bin_path(b[0])) - except ValueError: - missing.append(b[0]) + try: + self.cmd_path = get_bin_path('unzip') + except ValueError: + return False, "Unable to find required 'unzip' binary in the path" - if missing: - return False, "Unable to find required '{missing}' binary in the path.".format(missing="' or '".join(missing)) + try: + self.zipinfo_cmd = [get_bin_path('zipinfo_cmd')] + except ValueError: + # fallback to unzip -Z + self.zipinfo_cmd = [self.cmd_path, "-Z"] cmd = [self.cmd_path, '-l', self.src] rc, out, err = self.module.run_command(cmd) ``` ### Issue Type Feature Idea ### Component Name unarchive ### Additional Information ```yaml - name: Unarchive plugin ansible.builtin.unarchive: src: "file.zip" dest: "dir" copy: no ``` ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/76959
https://github.com/ansible/ansible/pull/76971
a43112290a704294df7154d7ddd7dc624b72251f
9d6cc7b576daca138f27b5f57b2914614a6d3685
2022-02-06T16:05:07Z
python
2022-06-07T20:05:07Z
closed
ansible/ansible
https://github.com/ansible/ansible
76,958
["changelogs/fragments/76958-hostname-systemd-nm.yaml", "lib/ansible/modules/hostname.py", "test/integration/targets/hostname/tasks/test_normal.yml"]
NetworkManager set-hostname writes to the log every few seconds
### Summary I have a playbook as follows: ``` - name: Change the hostname hostname: name: example.com ``` I have also tried: ``` - name: Change the hostname hostname: name: example.com use: systemd ``` Changing hostname on CentOS Stream 8 using the above playbook causes the target machine to log the following output in none stop way: ``` Feb 6 03:43:41 172-105-183-143 NetworkManager[772]: <info> [1644119021.3649] policy: set-hostname: current hostname was changed outside NetworkManager: 'example.com' Feb 6 03:43:42 172-105-183-143 NetworkManager[772]: <info> [1644119022.3647] policy: set-hostname: current hostname was changed outside NetworkManager: 'example.com' Feb 6 03:43:42 172-105-183-143 NetworkManager[772]: <info> [1644119022.3651] policy: set-hostname: current hostname was changed outside NetworkManager: 'example.com' Feb 6 03:43:43 172-105-183-143 NetworkManager[772]: <info> [1644119023.3646] policy: set-hostname: current hostname was changed outside NetworkManager: 'example.com' Feb 6 03:43:43 172-105-183-143 NetworkManager[772]: <info> [1644119023.3649] policy: set-hostname: current hostname was changed outside NetworkManager: 'example.com' ``` However, when I log into the target machine and run the following command, it stops producing unnecessary logs. ```hostnamectl set-hostname example.com``` OS details of the target machine: ``` NAME="CentOS Stream" VERSION="8" ID="centos" ID_LIKE="rhel fedora" VERSION_ID="8" PLATFORM_ID="platform:el8" PRETTY_NAME="CentOS Stream 8" ANSI_COLOR="0;31" CPE_NAME="cpe:/o:centos:centos:8" HOME_URL="https://centos.org/" BUG_REPORT_URL="https://bugzilla.redhat.com/" REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux 8" REDHAT_SUPPORT_PRODUCT_VERSION="CentOS Stream" ``` The same issue is also logged here: https://bugzilla.redhat.com/show_bug.cgi?id=1894137 However, I am not getting the issue when I run the command 'hostnamectl' directly in the box but only when I update the hostname using Ansible playbook. Ansible version I am using: ``` ➜ ~ ansible --version ansible [core 2.12.2] config file = None configured module search path = ['/Users/gehendra/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/local/lib/python3.9/site-packages/ansible ansible collection location = /Users/gehendra/.ansible/collections:/usr/share/ansible/collections executable location = /usr/local/bin/ansible python version = 3.9.8 (main, Nov 10 2021, 09:21:22) [Clang 13.0.0 (clang-1300.0.29.3)] jinja version = 3.0.3 libyaml = True ``` Your help would be highly appreciated. Thank you. ### Issue Type Bug Report ### Component Name ansible ### Ansible Version ```console $ ansible --version ansible [core 2.12.2] config file = None configured module search path = ['/Users/gehendra/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/local/lib/python3.9/site-packages/ansible ansible collection location = /Users/gehendra/.ansible/collections:/usr/share/ansible/collections executable location = /usr/local/bin/ansible python version = 3.9.8 (main, Nov 10 2021, 09:21:22) [Clang 13.0.0 (clang-1300.0.29.3)] jinja version = 3.0.3 libyaml = True ``` ### Configuration ```console $ ansible-config dump --only-changed (END) Nothing was produced at all. ``` ### OS / Environment [ga@example ~]$ cat /etc/os-release NAME="CentOS Stream" VERSION="8" ID="centos" ID_LIKE="rhel fedora" VERSION_ID="8" PLATFORM_ID="platform:el8" PRETTY_NAME="CentOS Stream 8" ANSI_COLOR="0;31" CPE_NAME="cpe:/o:centos:centos:8" HOME_URL="https://centos.org/" BUG_REPORT_URL="https://bugzilla.redhat.com/" REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux 8" REDHAT_SUPPORT_PRODUCT_VERSION="CentOS Stream" ### Steps to Reproduce <!--- Paste example playbooks or commands between quotes below --> ```yaml (paste below) - name: Change the hostname hostname: name: example.com or - name: Change the hostname hostname: name: example.com use: systemd ``` ### Expected Results I do not want the garbage/error logs to be written every second. ### Actual Results ```console No errors are displayed when running the playbook on the control machine. ``` ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/76958
https://github.com/ansible/ansible/pull/77243
1100289a45e5b5444bc5af59052fc2d63452eff6
c1a34d5a6337002edf74dbd63d4bc68ce8e085e8
2022-02-06T04:08:14Z
python
2022-03-21T14:32:41Z
closed
ansible/ansible
https://github.com/ansible/ansible
76,867
["changelogs/fragments/service_facts_warnings.yml", "lib/ansible/modules/service_facts.py"]
service_facts module quietly returns incomplete services when privileges are wrong
### Summary If you fail to add `become: true` on an Ubuntu system with systemd, you will quietly receive a list of the `sysv` services without any systemd services. This is due to the service facts module implementing its own separate test for systemd https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/service_facts.py#L224-L234 which quietly ignores a failure. If it were to use the value of the ansible fact `ansible_service_mgr` instead then it would correctly catch this failure and report the warning. ### Issue Type Bug Report ### Component Name service_facts module ### Ansible Version ```console $ ansible --version ansible [core 2.12.1] config file = None configured module search path = ['/Users/jrhett/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /opt/homebrew/Cellar/ansible/5.2.0/libexec/lib/python3.10/site-packages/ansible ansible collection location = /Users/jrhett/.ansible/collections:/usr/share/ansible/collections executable location = /opt/homebrew/bin/ansible python version = 3.10.1 (main, Dec 6 2021, 22:18:13) [Clang 13.0.0 (clang-1300.0.29.3)] jinja version = 3.0.3 libyaml = True ``` ### Configuration ```console $ ansible-config dump --only-changed (empty) ``` ### OS / Environment Target node is Ubuntu 20.04 ### Steps to Reproduce <!--- Paste example playbooks or commands between quotes below --> ```shell $ ansible -m service_facts <node ip> ``` ### Expected Results `WARNING: Could not find status for all services. Sometimes this is due to insufficient privileges.` ### Actual Results ```console A quiet success with only sysv services. 52.14.195.85 | SUCCESS => { "ansible_facts": { "services": { "acpid": { "name": "acpid", "source": "sysv", "state": "stopped" }, "apparmor": { "name": "apparmor", "source": "sysv", "state": "stopped" }, ``` ``` ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/76867
https://github.com/ansible/ansible/pull/76921
47faa6e206ccd697b4050062147a5d3242435597
699ecb83082b3b24a1a0a21cfadf19eda8891bff
2022-01-27T21:51:57Z
python
2022-02-08T18:05:21Z
closed
ansible/ansible
https://github.com/ansible/ansible
76,863
["docs/docsite/rst/user_guide/playbooks_filters.rst"]
password_hash inconsistency
### Summary The filter `password_hash` produces different results depending on whether `passlib` is installed or not. Without `passlib`: ``` {{"hello world"|password_hash("sha256", "mysalt")}} # $5$mysalt$ncw1Kn3P8zDlbcLu/7Tn6W3yyOk1jKaW1/PoMJVooP5 {{"hello world"|password_hash("sha256", "mysalt", rounds=5000)}} # $5$rounds=5000$mysalt$ncw1Kn3P8zDlbcLu/7Tn6W3yyOk1jKaW1/PoMJVooP5 ``` With `passlib`: ``` {{"hello world"|password_hash("sha256", "mysalt")}} # $5$rounds=535000$mysalt$HelubZR3XJZRX9KCUKy7z6RggBuxqLGuAUdYM5u0Fl0 {{"hello world"|password_hash("sha256", "mysalt", rounds=5000)}} # $5$mysalt$ncw1Kn3P8zDlbcLu/7Tn6W3yyOk1jKaW1/PoMJVooP ``` Funny enough, without specifying the amount of rounds, I get different defaults on different machines (535000 on this machine, 656000 on another one). So to get matching hashes we'll have to use `crypt`'s default rounds of 5000. Alas, the generated strings differ by `$rounds=...`. This is a problem for idempotency, for example: ```yaml --- - user: name: myuser pass: '{{"%s"|format(mypassword)|password_hash("sha512", "mysalt")}}' ``` The only way I see to get idempotency is to specify `rounds` to be neither `crypt`'s nor `passlib`'s default: ```yaml --- - user: name: myuser pass: '{{"%s"|format(mypassword)|password_hash("sha512", "mysalt", rounds=5001)}}' ``` This is not a bug. It's just the way different implementations behave. I just think it's worth mentioning in the documentation. ### Issue Type Documentation Report ### Component Name docs/docsite/rst/user_guide/playbooks_filters.rst ### Ansible Version ```console $ ansible --version 2.12.1 ``` ### Configuration ```console $ ansible-config dump --only-changed n/a ``` ### OS / Environment all ### Additional Information n/a ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/76863
https://github.com/ansible/ansible/pull/77963
85329beb90f436ad84daa4aced5f594ff4d84ec1
fa840d4c7c60d6f68d661cb40102fb0d0674fa83
2022-01-27T08:42:17Z
python
2022-06-09T14:53:04Z
closed
ansible/ansible
https://github.com/ansible/ansible
76,837
["docs/docsite/rst/dev_guide/developing_locally.rst", "docs/docsite/rst/dev_guide/migrating_roles.rst"]
update `ansible.legacy` documentation to fix misleading docs
### Summary The existing `ansible.legacy` docs are misleading: https://docs.ansible.com/ansible/latest/dev_guide/migrating_roles.html#using-ansible-legacy-to-access-local-custom-modules-from-collections-based-roles Specific feedback: ansible.legacy will not access plugins in collections, that is only for NON collection roles and plays. Once moved into collecitons, roles CANNOT house any custom plugins, they MUST be migrated to collection itself They CAN use plugins provided by other roles, but that should work w/o adding namespacing Last thing you want to do is set collection: [ansible.legacy] ... that can mess up your resolution big time it might make more sense to rewrite that section from a general task perspective and leave out collection roles. ### Issue Type Documentation Report ### Component Name docs/docsite/rst/dev_guide/migrating_roles.rst ### Ansible Version ```console $ ansible --version 2.10 and later ``` ### Configuration ```console $ ansible-config dump --only-changed none ``` ### OS / Environment none ### Additional Information Need to clarify the documentation to cover this information and also add how `ansible.legacy` can be used for local modules that overwrite `ansible.builtin` modules. For example, if a user can't use the existing `ansible.builtin.copy` module without some modification, they can create their modified 'copy' module and access this as `ansible.legacy.copy`. `ansible.legacy` uses the "original" resolver for plugins and modules, searching for them in playbook-adjacent directories and in roles. This only works for the `ansible.builtin` plugins and not for collections. ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/76837
https://github.com/ansible/ansible/pull/76839
6bca0a5dc28037b3a4e8b0e6f45de6f0eb2f2086
e9af4195bee12dba5cae682fb6f8ec9bffaa0883
2022-01-24T20:56:45Z
python
2022-01-26T17:17:18Z
closed
ansible/ansible
https://github.com/ansible/ansible
76,826
["lib/ansible/module_utils/powershell/Ansible.ModuleUtils.Legacy.psm1"]
ansible_reboot_pending always reports null on Windows Server
### Summary On Windows the setup module sets the variable ansible_reboot_pending using the function Get-PendingRebootStatus in module_utils/powershell/Ansible.ModuleUtils.Legacy.psm1 The $featuredata variable is only populated on Windows Server where the root\microsoft\windows\servermanager CIM class exists if(($featureData -and $featureData.RequiresReboot) -or $regData -or $CBSRebootStatus) is then subsequently evaluated but Being an array $featureData has no "RequiresReboot" property: ``` PS C:\Users\c.mammoli.adm> $featureData.GetType() IsPublic IsSerial Name BaseType -------- -------- ---- -------- True True Object[] System.Array PS C:\Users\c.mammoli.adm> $featureData.RequiresReboot The property 'RequiresReboot' cannot be found on this object. Verify that the property exists. At line:1 char:1 + $featureData.RequiresReboot + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [], PropertyNotFoundException + FullyQualifiedErrorId : PropertyNotFoundStrict ``` Being run with "Set-StrictMode -Version 2.0" the function errors out and the setup module returns $null ### Issue Type Bug Report ### Component Name lib/ansible/module_utils/powershell/Ansible.ModuleUtils.Legacy.psm1 lib/ansible/modules/setup.py ### Ansible Version ```console ansible 2.9.27 config file = /home/c.mammoli/.ansible.cfg configured module search path = ['/home/c.mammoli/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /home/c.mammoli/.local/lib/python3.9/site-packages/ansible executable location = /home/c.mammoli/.local/bin/ansible python version = 3.9.2 (default, Feb 28 2021, 17:03:44) [GCC 10.2.1 20210110] ``` ### Configuration ```console ANSIBLE_PIPELINING(/home/c.mammoli/.ansible.cfg) = True ANSIBLE_SSH_CONTROL_PATH_DIR(/home/c.mammoli/.ansible.cfg) = /dev/shm/ansible_control_path CACHE_PLUGIN(/home/c.mammoli/.ansible.cfg) = jsonfile CACHE_PLUGIN_CONNECTION(/home/c.mammoli/.ansible.cfg) = ~/.ansible_fact_cache.json DEFAULT_GATHERING(/home/c.mammoli/.ansible.cfg) = implicit DEFAULT_HOST_LIST(/home/c.mammoli/.ansible.cfg) = ['/home/c.mammoli/devel/ansible/inventory_netbox.yml'] DEFAULT_LOAD_CALLBACK_PLUGINS(/home/c.mammoli/.ansible.cfg) = True DEFAULT_LOOKUP_PLUGIN_PATH(/home/c.mammoli/.ansible.cfg) = ['/home/c.mammoli/devel/ansible/lookup_plugins'] DEFAULT_ROLES_PATH(/home/c.mammoli/.ansible.cfg) = ['/home/c.mammoli/devel/ansible/roles'] DEFAULT_STDOUT_CALLBACK(/home/c.mammoli/.ansible.cfg) = yaml HOST_KEY_CHECKING(/home/c.mammoli/.ansible.cfg) = False INVENTORY_ENABLED(/home/c.mammoli/.ansible.cfg) = ['yaml', 'ini', 'tower', 'netbox.netbox.nb_inventory', 'script'] RETRY_FILES_ENABLED(/home/c.mammoli/.ansible.cfg) = True RETRY_FILES_SAVE_PATH(/home/c.mammoli/.ansible.cfg) = /home/c.mammoli/.ansible-retry c.mammoli ~/devel/ansible $ ``` ### OS / Environment Rocky 8 ### Steps to Reproduce ```--- - hosts: windows_server_host gather_facts: true tasks: - name: run the Function Get-PendingRebootStatus function from module_utils/powershell/Ansible.ModuleUtils.Legacy.psm1 without StrictMode win_shell: | Function Get-PendingRebootStatus { <# .SYNOPSIS Check if reboot is required, if so notify CA. Function returns true if computer has a pending reboot #> $featureData = Invoke-CimMethod -EA Ignore -Name GetServerFeature -Namespace root\microsoft\windows\servermanager -Class MSFT_ServerManagerTasks $regData = Get-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager" "PendingFileRenameOperations" -EA Ignore $CBSRebootStatus = Get-ChildItem "HKLM:\\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing" -ErrorAction SilentlyContinue| Where-Object {$_.PSChildName -eq "RebootPending"} if(($featureData -and $featureData.RequiresReboot) -or $regData -or $CBSRebootStatus) { return $True } else { return $False } } Get-PendingRebootStatus register: PendingRebootStatus - name: reboot pending according to the function debug: var: PendingRebootStatus.stdout - name: reboot pending according to the setup module debug: var: ansible_reboot_pending ``` ### Expected Results ansible_reboot_pending is set to either true or false ### Actual Results ```console ansible_reboot_pending is set to null ``` ### Code of Conduct - [x] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/76826
https://github.com/ansible/ansible/pull/82076
fb8ede22e1641c0df37a31cba569841fdcc529c3
f5d7dc1a97642e26dcc5873388642d84340b642e
2022-01-24T11:06:24Z
python
2023-10-26T19:16:05Z
closed
ansible/ansible
https://github.com/ansible/ansible
76,823
["lib/ansible/modules/blockinfile.py"]
[blockinfile]: multiple blocks get generated, if you add "\n" to marker
### Summary we config the domain info with the `/etc/hosts` file, we monitor our service and change the domain with bash script like this: ``` ansible 127.0.0.1 -m blockinfile -a "block='192.168.1.1 test.company.com' marker='# {mark} : test block' path=/etc/hosts" ``` BUT , occasionally the file `/etc/hosts` contains multiple block. I expected that there should be only one block. I have read the source code `lib/ansible/modules/files/blockinfile.py` and find nothing suspicious. ### Issue Type ~Bug Report~ - Docs Report ### Component Name blockinfile ### Ansible Version ```console $ ansible --version ansible 2.7.5.post0 config file = /etc/ansible/ansible.cfg configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules'] ansible python module location = /usr/lib/python2.7/site-packages/ansible executable location = /usr/bin/ansible python version = 2.7.5 (default, Aug 7 2019, 00:51:29) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] ``` ### Configuration ```console $ ansible-config dump --only-changed COMMAND_WARNINGS(/etc/ansible/ansible.cfg) = False HOST_KEY_CHECKING(/etc/ansible/ansible.cfg) = False ``` ### OS / Environment CentOS-7.6 ### Steps to Reproduce <!--- Paste example playbooks or commands between quotes below --> ```yaml (paste below) ansible 127.0.0.1 -m blockinfile -a "block='192.168.1.1 test.company.com' marker='# {mark} : test block' path=/etc/hosts" ``` ### Expected Results ```console # BEGIN : test block 192.168.1.1 test.company.com # END : test block ``` ### Actual Results ```console # BEGIN : test block 192.168.1.1 test.company.com # END : test block # BEGIN : test block 192.168.1.2 test.company.com # END : test block ``` ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/76823
https://github.com/ansible/ansible/pull/79292
a12a9b409f964a911c7348e85035475fd6eab0b4
f700047e69a03917194d1ec9f6d73577013362ce
2022-01-24T06:36:57Z
python
2022-11-03T19:10:45Z
closed
ansible/ansible
https://github.com/ansible/ansible
76,799
["docs/docsite/.templates/banner.html", "docs/docsite/rst/reference_appendices/release_and_maintenance.rst"]
clear documentation of versioning of stable versions
### Summary Needing a new ansible feature I wanted to see if a newer ansible Debian package is available somewhere. I went and checked [available Debian packages](https://packages.debian.org/search?keywords=ansible). Ouuugh, there is v4.6.0 available in Debian experimental? Where the hell is that version number from? To find out I checked [packages in Ubuntu](https://packages.ubuntu.com/search?keywords=ansible). No such thing as v4.6 there. So I googled ["download ansible"](https://duckduckgo.com/?t=ffab&q=download+ansible&ia=web). First two hits on duckduck go are Redhat corporate crap web pages, but the third is the [Installing Ansible](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html) docu. So I went to the "Installing Ansible" docu, clicked on "Installing Ansible in Debian" read the text about the PPAs, scrolled back up to "Installing Ansible on Ubuntu" saw the [PPA link](https://launchpad.net/~ansible/+archive/ubuntu/ansible) and went there. Now the PPA has a whole truck load full of versions among which figures a v5.2.0. Now how would I know which version is a stable release (as opposed to a dev build)? No word on the PPA page about stable/dev. Back to the [Installing Ansible](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html) docu and scanning for relevant information there. The chapter [Finding tarballs of tagged releases](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html#finding-tarballs-of-tagged-releases) says "You can download the latest stable release from [PyPI’s ansible package page](https://pypi.org/project/ansible/). OK, lets follow that rabbit hole then. The latter page comes up with "ansible 5.2.0" on top. All right so is 5.2.0 the curstable release? That page says: xxxxx Branch Info - The devel branch corresponds to the release actively under development. - The stable-2.X branches correspond to stable releases. - Create a branch based on devel and set up a dev environment if you want to open a PR. - See the [Ansible release and maintenance page](https://docs.ansible.com/ansible/latest/reference_appendices/release_and_maintenance.html) for information about active branches. xxxxx So in that case 5.2.0 is not a stable release, but only 2.X branches are? Maybe check out the [Ansible release and maintenance page](https://docs.ansible.com/ansible/latest/reference_appendices/release_and_maintenance.html) as that paragraph above suggest? So let's follow that link which shows a page saying "See the the [devel release and maintenance page](https://docs.ansible.com/ansible/devel/reference_appendices/release_and_maintenance.html) for up to date information.". So on through a yet another link and page to that page now. Top of that page reads "You are reading the devel version of the Ansible documentation - this version is not guaranteed stable. Use the version selection to the left if you want the latest stable released version.". Oh. OK. However no link to the "stable" version there, however the drop down to select the version of the docu allows to select versions "devel", "2.9" and "latest*. What would the latest stable version be now? "2.9"? "latest"? But maybe that dev page will tell me anyway what the latest stable version is? Well there is a **LOT** of text to read there to find out what the secret(?!?)/obfuscated(?why?)/mysterious(?!) latest stable version is. Let's see... parsing that looong and complicated document seems to imply that it is the "Ansible community package" that I want... And it *seems* that versions v4.x and v5.x are currently maintained. But then I know that the feature I want was tagged with 2.11. Now that can't be the "Ansible community package" version ... or **could it**? Who knows, my head is allready full with info I had to read only to find out and I still don't know what to download. So let's follow one more link, namely to the [5.x Changelog](https://github.com/ansible-community/ansible-build-data/blob/main/5/CHANGELOG-v5.rst), read through that and lo and behold there it is, somewhere a few pages of scrolling down it says "Ansible 5.2.0 contains Ansible-core version 2.12.1". Halleluya! Maybe you are think to yourself right now "boy that sucks reading tickets by noobs", but let me tell you, having to spend one hour of reading to find out what the latest stable ansible version is sucks too. IMHO finding out what the latest stable release is should be as simple as the "simple" in the "simple automation system". Is it possible to clear this jungle up and make it approachable by humans that don't want to spend an hour only to find out what the latest stable release is? I'd certainly suggest a patch if I could, but I'm lost at this point. There are too many pages, with too much info and it's much, much, much too complicated. Help!? Thanks a lot for ansible! PS: Even through all of this I *still* haven't found out where the "Ansible community package" versions are coming from (are they tags? Where?) ### Issue Type Documentation Report ### Component Name docs/docsite/rst/reference_appendices/release_and_maintenance.rst ### Ansible Version ```console $ ansible --version ansible 2.10.8 config file = /home/USER/.ansible.cfg configured module search path = [EDITED, '/usr/share/ansible'] ansible python module location = /usr/lib/python3/dist-packages/ansible executable location = /usr/bin/ansible python version = 3.9.2 (default, Feb 28 2021, 17:03:44) [GCC 10.2.1 20210110] ``` ### Configuration ```console $ ansible-config dump --only-changed doesn't apply ``` ### OS / Environment doesn't apply ### Additional Information doesn't apply ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/76799
https://github.com/ansible/ansible/pull/77577
f7c2b1986c5b6afce1d8fe83ce6bf26b535aa617
f633b62cbc995befe47d98c735d57baacb9cda2e
2022-01-19T17:56:57Z
python
2022-04-28T13:12:49Z
closed
ansible/ansible
https://github.com/ansible/ansible
76,792
["changelogs/fragments/76792-hostname-all-systemd.yml", "lib/ansible/modules/hostname.py"]
Hostname module should support for CBL Mariner Linux
### Summary Attempting to use the `hostname` module on a host running [CBL-Mariner](https://github.com/microsoft/CBL-Mariner) fails with the following error: `hostname module cannot be used on platform Linux (Mariner)` It looks like a method specifically for this OS is needed in modules/system/hostname.py. Similar bugs in the past: #42726 and #58444 A PR to fix similar issues in the past is #56936 ### Issue Type Bug Report ### Component Name hostname ### Ansible Version ```console $ ansible --version ansible 2.9.23 config file = None configured module search path = ['/home/fedora/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/lib/python3.7/site-packages/ansible executable location = /usr/bin/ansible python version = 3.7.10 (default, Sep 28 2021, 20:29:11) [GCC 9.1.0] ``` ### Configuration ```console $ ansible-config dump --only-changed ``` ### OS / Environment OS is [CBL-Mariner](https://github.com/microsoft/CBL-Mariner) /etc/os-release ``` NAME="Common Base Linux Mariner" VERSION="1.0.20211230" ID=mariner VERSION_ID=1.0 PRETTY_NAME="CBL-Mariner/Linux" ANSI_COLOR="1;34" HOME_URL="https://aka.ms/cbl-mariner" BUG_REPORT_URL="https://aka.ms/cbl-mariner" SUPPORT_URL="https://aka.ms/cbl-mariner" ``` /etc/lsb-release ``` DISTRIB_ID="Mariner" DISTRIB_RELEASE="1.0.20211230" DISTRIB_CODENAME=Mariner DISTRIB_DESCRIPTION="CBL-Mariner 1.0.20211230" ``` ``` /etc/mariner-release CBL-Mariner 1.0.20211230 MARINER_BUILD_NUMBER=f33d439 ``` ### Steps to Reproduce <!--- Paste example playbooks or commands between quotes below --> ```yaml (paste below) - name: "ensure hostname is correct" hostname: name={{ inventory_hostname }} ``` ### Expected Results I expected `hostname` to "just work" given CBL-Mariner is derived from Fedora Server 35. ### Actual Results ```console Error received: hostname module cannot be used on platform Linux (Mariner) ``` ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/76792
https://github.com/ansible/ansible/pull/76800
36519ff95eddea72d7c16f9a7c3e8501ee0ab60e
374720fc97f54c34281a2c78e3ecb12eca45c46c
2022-01-18T20:30:39Z
python
2022-01-20T19:25:52Z
closed
ansible/ansible
https://github.com/ansible/ansible
76,789
["changelogs/fragments/forced_local+fix+.yml", "lib/ansible/executor/task_executor.py"]
Setting `ansible_network_os` without `connection: network_cli` causes ansible to look for local interpreter on remote
### Summary Running a play that does not specify `connection: ansible.netcommon.network_cli` against a host with `ansible_network_os` defined causes Ansible to try to use the local Ansible controller's python interpreter on the remote (causing a "file not found error"). It looks like this problem was introduced [here](https://github.com/ansible/ansible/commit/173d0a8de74f6124696282a6e40037f16c49efc2) and flagged for reversal [here](https://github.com/ansible/ansible/pull/74718) (though the reversion was never merged). ### Issue Type Bug Report ### Component Name interpreter discovery ### Ansible Version ```console $ ansible --version ansible [core 2.12.1] config file = ansible.cfg configured module search path = ['.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = .venv/lib/python3.10/site-packages/ansible ansible collection location = .ansible executable location = .venv/bin/ansible python version = 3.10.1 (main, Dec 9 2021, 00:00:00) [GCC 11.2.1 20211203 (Red Hat 11.2.1-7)] jinja version = 2.11.3 libyaml = True ``` ### Configuration ```console $ ansible-config dump --only-changed COLLECTIONS_PATHS(env: ANSIBLE_COLLECTIONS_PATH) = ['.ansible'] HOST_KEY_CHECKING(ansible.cfg) = False INVENTORY_ENABLED(ansible.cfg) = ['ansible.builtin.script', 'ansible.builtin.yaml'] ``` ### OS / Environment Ansible Controller OS: Fedora 35 Python version: 3.10.1 ### Steps to Reproduce <!--- Paste example playbooks or commands between quotes below --> ```yaml # playbook.yml --- - hosts: all gather_facts: true # inventory.yml --- all: hosts: any-host-of-any-type.mydomain.local: {} ``` Run command: ``` # note that "edgeos" is just any arbitrary value supported by the network os setting ansible-playbook playbook.yml -i inventory.yml -e ansible_network_os=edgeos ``` ### Expected Results I expected the `ansible_network_os` setting to be ignored since the play in `playbook.yml` does not specify the `connection: ansible.netcommon.network_cli` setting. ### Actual Results ```console fatal: [any-host-of-any-type.mydomain.local]: FAILED! => { "ansible_facts": {}, "changed": false, "failed_modules": { "ansible.legacy.setup": { "failed": true, "module_stderr": "Shared connection to any-host-of-any-type.mydomain.local closed.\r\n", "module_stdout": "/bin/sh: .venv/bin/python: No such file or directory\r\n", "msg": "The module failed to execute correctly, you probably need to set the interpreter.\nSee stdout/stderr for the exact error", "rc": 127 } }, "msg": "The following modules failed to execute: ansible.legacy.setup\n" } ``` ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/76789
https://github.com/ansible/ansible/pull/81295
010e542a13516eed9bb6b5e997ea255104257a80
6db006a5fa18b710e5ad0bc90e5ea5494a6b68c2
2022-01-18T17:58:42Z
python
2023-07-27T14:59:55Z
closed
ansible/ansible
https://github.com/ansible/ansible
76,786
["docs/docsite/rst/user_guide/connection_details.rst"]
connection_details.rst uses ansible_user and remote_user interchangeably without explaining the differences (if any) between these settings
### Summary The examples in connection_details.rst in the section Setting a remote user use a mix of `remote_user` and `ansible_user`. It does not explain why it uses one or the other. I couldn't find any official reference saying that they are interchangeable or not. Some reports on StackOverlow indicate that there might be subtle differences. E.g. [Ansible remote_user vs ansible_user](https://stackoverflow.com/questions/36668756/ansible-remote-user-vs-ansible-user). I believe a lot of people would like to know which of these to use or when to use one or the other. ### Issue Type Documentation Report ### Component Name ansible/docs/docsite/rst/user_guide/connection_details.rst ### Ansible Version ```console n/a (using 2.9) ``` ### Configuration ```console n/a ``` ### OS / Environment n/a (RHEL 8) ### Additional Information Having official documentation on this will allow all users to make an informed decision. ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/76786
https://github.com/ansible/ansible/pull/77140
dc6b0d48575e0119cdbb0fd7f66c8dd30b414bdb
22ba18d7b0dc76e6f3e567a2f0510f495233dba2
2022-01-18T16:03:26Z
python
2022-02-25T10:59:11Z
closed
ansible/ansible
https://github.com/ansible/ansible
76,782
["changelogs/fragments/76782-fqcn-compare-lockstep-strategies.yml", "lib/ansible/plugins/callback/default.py", "test/integration/targets/callback_default/callback_default.out.fqcn_free.stdout", "test/integration/targets/callback_default/runme.sh"]
Task names on wrong tasks when strategy=free
### Summary In 2.11.7 when using strategy=free, the task names that are printed for each task are often names from different tasks and not the task that is being executed. The task names are mixed up between hosts, between lines within a role, and even between roles (task files). Also TASK lines are printed without any other output, not even name of the host where the supposed task is running. ### Issue Type Bug Report ### Component Name pip ### Ansible Version ```console $ ansible --version ansible [core 2.11.7] config file = /etc/ansible/ansible.cfg configured module search path = ['/home/x/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /opt/venv/lib64/python3.6/site-packages/ansible ansible collection location = /home/x/.ansible/collections:/usr/share/ansible/collections executable location = /opt/venv/bin/ansible python version = 3.6.8 (default, Nov 16 2020, 16:55:22) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] jinja version = 3.0.2 libyaml = True ``` ### Configuration ```console $ ansible-config dump --only-changed CALLBACKS_ENABLED(/etc/ansible/ansible.cfg) = ['ansible.posix.timer'] CONTROLLER_PYTHON_WARNING(/etc/ansible/ansible.cfg) = False DEFAULT_FORKS(/etc/ansible/ansible.cfg) = 10 DEFAULT_STDOUT_CALLBACK(/etc/ansible/ansible.cfg) = community.general.yaml DEFAULT_STRATEGY(/etc/ansible/ansible.cfg) = ansible.builtin.free DEFAULT_TIMEOUT(/etc/ansible/ansible.cfg) = 30 DEFAULT_VAULT_ID_MATCH(/etc/ansible/ansible.cfg) = True INJECT_FACTS_AS_VARS(/etc/ansible/ansible.cfg) = False ``` ### OS / Environment EL7 ### Steps to Reproduce <!--- Paste example playbooks or commands between quotes below --> ```yaml (paste below) ``` ### Expected Results As in 2.9 Ansible should not print useless "TASK" lines and should print the right task name to go with each task output. ### Actual Results ```console Example: TASK [rolename : Install xinetd with yum] ************************************************************************************************************************************* task path: /home/x/roles/rolename/tasks/main.yml:190 TASK [rolename : Install xinetd with yum] ************************************************************************************************************************************* task path: /home/x/roles/rolename/tasks/main.yml:184 ok: [hostb.example.com] => changed=false backup: '' msg: '' TASK [rolename : Install xinetd with yum] ************************************************************************************************************************************* task path: /home/x/roles/rolename/tasks/main.yml:190 TASK [rolename : Install xinetd with yum] ************************************************************************************************************************************* task path: /home/x/roles/rolename/tasks/main.yml:184 ok: [hostc.example.com] => changed=false backup: '' msg: '' TASK [rolename : Install xinetd with yum] ************************************************************************************************************************************* task path: /home/x/roles/rolename/tasks/main.yml:190 ok: [hosta.example.com] => changed=false msg: '' rc: 0 results: - 2:xinetd-2.3.15-14.el7.x86_64 providing xinetd is already installed TASK [rolename : Change line in configuration file] *************************************************************************************************************** task path: /home/x/roles/rolename/tasks/main.yml:196 TASK [rolename : Change line in configuration file] *************************************************************************************************************** task path: /home/x/roles/rolename/tasks/main.yml:190 ok: [hostb.example.com] => changed=false msg: '' rc: 0 results: - 2:xinetd-2.3.15-14.el7.x86_64 providing xinetd is already installed TASK [rolename : Change line in configuration file] *************************************************************************************************************** task path: /home/x/roles/rolename/tasks/main.yml:196 TASK [rolename : Change line in configuration file] *************************************************************************************************************** task path: /home/x/roles/rolename/tasks/main.yml:190 ok: [hostc.example.com] => changed=false msg: '' rc: 0 results: - 2:xinetd-2.3.15-14.el7.x86_64 providing xinetd is already installed TASK [rolename : Change line in configuration file] *************************************************************************************************************** task path: /home/x/roles/rolename/tasks/main.yml:196 ok: [hosta.example.com] => changed=false backup: '' msg: '' TASK [rolename : Change another line in file] ************************************************************************************************************** task path: /home/x/roles/rolename/tasks/main.yml:204 TASK [rolename : Change another line in file] ************************************************************************************************************** task path: /home/x/roles/rolename/tasks/main.yml:196 ok: [hostb.example.com] => changed=false backup: '' msg: '' TASK [rolename : Change another line in file] ************************************************************************************************************** task path: /home/x/roles/rolename/tasks/main.yml:204 TASK [rolename : Change another line in file] ************************************************************************************************************** task path: /home/x/roles/rolename/tasks/main.yml:196 ok: [hostc.example.com] => changed=false backup: '' msg: '' The above log consists of 14 "TASK" lines. Most of those are wrong: 1. Correct task name for line number 190. But no hostname and no output from task, seems this line is useless. 2. Incorrect task name for line number 184, as seen from command output it is a "lineinfile" task, named "Add line in file". It is not a "yum" task. 3. Repeating #1. 4. Same as #2 but different host. 5. Finally a correct task name, this is a "yum" task output. 6. Correct task name for line number 196. But no hostname and no output from task, seems this line is useless. 7. Incorrect task name for line number 190, this time it is indeed a "yum" task but the TASK name printed is for a "lineinfile" task. 8. Correct task name for line number 196. But no hostname and no output from task, seems this line is useless. 9. Same as #7. 10. Finally a correct task name, this is a "lineinfile" task output. 11. Correct task name for line number 204. But no hostname and no output from task, seems this line is useless. 12. Incorrect task name for line number 196. 13. Correct task name for line number 204. But no hostname and no output from task, seems this line is useless. 14. Incorrect task name for line number 196. Out of 14 (!!!) "TASK" lines and all the other lines that go with them, only: - 3 occurrences had right task name for the line number and had some useful information (host name, task output). - 6 lines (and the following role file + line number, empty line) seemed useless. This makes Ansible output hugely long with all the useless 3 line combinations of TASK+file/linenumber+empty line. Not to mention I have to manually decode each file + line number because the task name printed is often wrong. ``` ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/76782
https://github.com/ansible/ansible/pull/76787
6de06377d0671fa9b3f19241dcacf9dbb093fcd8
29bdb8bf1e1ab7ca35721dad1a58efc966d56bd4
2022-01-18T11:18:44Z
python
2022-01-18T19:57:42Z
closed
ansible/ansible
https://github.com/ansible/ansible
76,769
["changelogs/fragments/76769-inventory-constructable-disable-lookups.yml", "lib/ansible/plugins/inventory/__init__.py"]
Parameterize disable_lookups in Constructable
### Summary Currently, `disable_lookups=True` is hard-coded, it would be nice if this could be overridden. ### Issue Type Bug Report ### Component Name inventory ### Ansible Version ```console $ ansible --version ansible [core 2.12.1] config file = /Users/mark/.ansible.cfg configured module search path = ['/Users/mark/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /Users/mark/.ansible/collections/ansible_collections/community/digitalocean/venv/lib/python3.9/site-packages/ansible ansible collection location = /Users/mark/.ansible/collections:/usr/share/ansible/collections executable location = /Users/mark/.ansible/collections/ansible_collections/community/digitalocean/venv/bin/ansible python version = 3.9.9 (main, Dec 9 2021, 19:41:06) [Clang 13.0.0 (clang-1300.0.29.3)] jinja version = 3.0.3 libyaml = True ``` ### Configuration ```console $ ansible-config dump --only-changed DEFAULT_STDOUT_CALLBACK(/Users/mark/.ansible.cfg) = yaml DIFF_ALWAYS(/Users/mark/.ansible.cfg) = True INTERPRETER_PYTHON(/Users/mark/.ansible.cfg) = /Users/mark/.pyenv/shims/python3 ``` ### OS / Environment MacOS 12.0.1 ### Steps to Reproduce There's nothing to reproduce, it's an observation. ### Expected Results N/A ### Actual Results ```console N/A ``` ### Code of Conduct - [X] I agree to follow the Ansible Code of Conduct
https://github.com/ansible/ansible/issues/76769
https://github.com/ansible/ansible/pull/76770
553e75df95767d0eba8d906c6fac034a0fc0ab1c
36519ff95eddea72d7c16f9a7c3e8501ee0ab60e
2022-01-15T16:02:41Z
python
2022-01-19T15:49:50Z