I have done that but I'm getting an issue.

I have: 
roles/local_backup/
├── action_plugins
│   ├── __pycache__
│   │   └── normal.cpython-310.pyc
│   ├── copy.py
│   └── normal.py
└── module_utils
    ├── __init__.py
    └── backup.py

and in my playbook:
name: Config Environment to host IRIS
  hosts: "{{ var_host | default('all !disabled') }}" 

  environment:
    ANSIBLE_LOCAL_BACKUP: "{{ app_root }}/ansible/backups"
    ANSIBLE_REMOTE_BACKUP_CLEANUP: true
  
  roles:
    - local_backup

  tasks:
    - name: Create/Update instance environment
      include_role:
        name: env_config

and when I run it, I get the following error:
   Unexpected failure during module execution: No module named 
'ansible.module_utils.backup'
with trace of:
  File 
"/home/ubuntu/git/aws-efs/ansible/roles/local_backup/action_plugins/normal.py", 
line 8, in <module>
    from ansible.module_utils.backup import local_backup

>From my reading here item 3 
(https://docs.ansible.com/ansible/latest/dev_guide/overview_architecture.html#the-ansible-search-path)
 
the search path should include the module_utils of my role, which does 
include backup.py which in turns defines local_backup.

Why is it complaining that it can't find the module

Thanks
Alain
On Tuesday, February 21, 2023 at 1:23:03 PM UTC-5 Alain wrote:

> Great, thanks again.
>
> On Tue, Feb 21, 2023 at 1:13 PM Brian Coca <[email protected]> wrote:
>
>> On Tue, Feb 21, 2023 at 1:06 PM Alain <[email protected]> wrote:
>> > should just get the whole thing and treat it as a private role in order 
>> to use it.
>>
>> yes
>>
>> -- 
>> ----------
>> Brian Coca
>>
>> -- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "Ansible Project" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/ansible-project/JWeOuzjRvvk/unsubscribe
>> .
>> To unsubscribe from this group and all its topics, send an email to 
>> [email protected].
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/CACVha7e3r47Fc6Z%2B5s-ShrDSZcEEZDBFUhCcFGKFDzfur6%2BhGQ%40mail.gmail.com
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/e4071f7e-1932-4a2e-9b73-5bd1fd371af6n%40googlegroups.com.

Reply via email to