- hosts: all
name: "====== COMMON CONFIGURATIONS ======"
roles:
- local_backup
- common
tags:
- common-only
at the first task which uses file (not even copy):
- name: "XXXXXXXXX"
file:
path: "/etc/FILE"
state: touch
owner: root
group: root
mode: 0644
# preserving times makes the command idempotent (see ansible documentation)
modification_time: preserve
access_time: preserve
I get the error:
TASK [common : XXXXXXXXX] ****************************************************************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ImportError: No module named backup
fatal: [HOST]: FAILED! => {"msg": "Unexpected failure during module execution.", "stdout": ""}
The message using -vvv is
TASK [common : XXXXXXXXX] ****************************************************************************************************************************
task path: /data/homes/ansible/ansible-config/ft/ansible-deploy/roles/common/tasks/auth-config.CentOS.yml:29
The full traceback is:
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/ansible/executor/task_executor.py", line 147, in run
res = self._execute()
File "/usr/lib/python2.7/site-packages/ansible/executor/task_executor.py", line 630, in _execute
self._handler = self._get_action_handler(connection=self._connection, templar=templar)
File "/usr/lib/python2.7/site-packages/ansible/executor/task_executor.py", line 1082, in _get_action_handler
collection_list=collections
File "/usr/lib/python2.7/site-packages/ansible/plugins/loader.py", line 552, in get
self._module_cache[path] = self._load_module_source(name, path)
File "/usr/lib/python2.7/site-packages/ansible/plugins/loader.py", line 530, in _load_module_source
module = imp.load_source(to_native(full_name), to_native(path), module_file)
File "/data/homes/ansible/ansible-config/ft/ansible-deploy/roles/local_backup/action_plugins/normal.py", line 8, in <module>
from ansible.module_utils.backup import local_backup
ImportError: No module named backup
fatal: [HOST]: FAILED! => {
"msg": "Unexpected failure during module execution.",
"stdout": ""
}
When I comment out the copy task, the module fails with the same error message at a task using lineinfile which comes after the copy block, for which I wanted to use the local backup
We are using Ansible 2.9.17 on CentOS 7.9. There is no problem when we don't import local_backup.
Is this a usage problem or some problem with local_backup?
Hi, when using this module like
at the first task which uses
file
(not evencopy
):I get the error:
The message using
-vvv
isWhen I comment out the
copy
task, the module fails with the same error message at a task usinglineinfile
which comes after thecopy
block, for which I wanted to use the local backupWe are using Ansible 2.9.17 on CentOS 7.9. There is no problem when we don't import
local_backup
.Is this a usage problem or some problem with
local_backup
?