# Trying to use local\_backup

**URL:** <https://forum.ansible.com/t/trying-to-use-local-backup/37651>\
**Category:** Ansible Project\
**Tags:** ubuntu, aws, galaxy-ng\
**Created:** [February 11, 2023, 8:06pm UTC](https://forum.ansible.com/t/trying-to-use-local-backup/37651 "2023-02-11T20:06:35Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alain](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@Alain](https://forum.ansible.com/u/Alain)\
**Post date:** [February 11, 2023, 8:06pm UTC](https://forum.ansible.com/t/trying-to-use-local-backup/37651/1 "2023-02-11T20:06:35Z")

</div>

Found the following: [https://github.com/bcoca/local\_backup](https://github.com/bcoca/local_backup) and trying to use it and I’m still quite new at this and probably doing something very obvious wrong.

First tried to use ansible-galaxy install and that failed since it says that it doesn’t have a meta/main.yml file

Then I just created a local role with the content of the git repo and now I’m getting this error:  
File “/home/ubuntu/git/aws-efs/ansible/roles/local\_backup/action\_plugins/normal.py”, line 8, in   
from ansible.module\_utils.backup import local\_backup  
ModuleNotFoundError: No module named ‘ansible.module\_utils.backup’

What am I missing?

Alain

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [February 21, 2023, 4:21pm UTC](https://forum.ansible.com/t/trying-to-use-local-backup/37651/2 "2023-02-21T16:21:56Z")

</div>

I wrote that as an example, which is why i didn't make it a 'full  
role' nor publish it into galaxy.

Backup policies vary a LOT by context, that just shows one way to do  
this and you are free to use it a s a reference, but it was never  
something for production use.

---

<div class="post-metadata">

**Author:** ![Alain](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@Alain](https://forum.ansible.com/u/Alain)\
**Post date:** [February 21, 2023, 6:05pm UTC](https://forum.ansible.com/t/trying-to-use-local-backup/37651/3 "2023-02-21T18:05:49Z")

</div>

Brian,

I understand that it has never graduated to production use, and maybe my issue is that I’m pretty new at Ansible, but if it is not a full role and not published in Galaxy, is there any way to still deploy it or I should just get the whole thing and treat it as a private role in order to use it.

Thanks  
Alain

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [February 21, 2023, 6:11pm UTC](https://forum.ansible.com/t/trying-to-use-local-backup/37651/4 "2023-02-21T18:11:34Z")

</div>

yes

---

<div class="post-metadata">

**Author:** ![Alain](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@Alain](https://forum.ansible.com/u/Alain)\
**Post date:** [February 21, 2023, 6:22pm UTC](https://forum.ansible.com/t/trying-to-use-local-backup/37651/5 "2023-02-21T18:22:33Z")

</div>

Great, thanks again.

---

<div class="post-metadata">

**Author:** ![Alain](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@Alain](https://forum.ansible.com/u/Alain)\
**Post date:** [March 1, 2023, 5:56pm UTC](https://forum.ansible.com/t/trying-to-use-local-backup/37651/6 "2023-03-01T17:56:10Z")

</div>

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   
from ansible.module\_utils.backup import local\_backup

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

Thanks  
Alain

---

<div class="post-metadata">

**Author:** ![Alain](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@Alain](https://forum.ansible.com/u/Alain)\
**Post date:** [March 1, 2023, 9:58pm UTC](https://forum.ansible.com/t/trying-to-use-local-backup/37651/7 "2023-03-01T21:58:40Z")

</div>

I have tested with the provided test play and it worked as expected. So wondering if it is related to path or something. Tried with one almost like the test and no error but no “controller\_backup” in the copy return value.

Alain
