Ansible unarchieve module task failure

@KodeKloud @kodekloud-support3 @player001 @mmumshad

Hi All,
Ansible unarchieve module task failed, but root user tony was set as owner and group for the unarchieve folders.
Can you please let me know what was the issue?
Please find the screenshot

Hello, panneerarasu
Have you mentioned “mode” field in along with your unarchive module in your playbook?

Thanks for replying. No, I have unarchieved and used copy function to apply mode, owner and group.


Hi! In the task they might have asked like “The extracted data permissions must be 0744” something like that. In Unarchive module only, we specify
owner: tony
group: tony
mode: ‘0744’

1 Like

Yes agree. Isn’t it mentioned that the unarchived module should have Sudo user permission and mode?
So I have just used 2 modules unarchieve and copy instead of unarchieve with mode and owner.

Still the solution was achieved its purpose.
@Inderpreet @player001

Hi Everyone,

I completed this task however I dont think it was the right approach, I wrote my playbook and add the unarchive task, but I was getting ‘permission denied’ because the directory ‘/opt/devops’ only have root access allowed

So I tried to elevate users(tony - steve - banner) permission to root

I tried this add on playbook.yml

  • name: Playbook to copy file and uncompress
    hosts: stapp
    become: yes
    become_method: enable
    become_user: root

but this didnt work

I also tried
become_exe = ‘sudo su -’

but didnt work

It was until I manually changed folder permissions to allow write to all users that it work


but I dont think that is the right way to do, so Is it anyway to elevate user permissions on Ansible (sudo su) ??