Ansible Archive Module

I get the error when i finished the task Ansible Archive Module. Please help me verify what steps missing or fail



Hello, @chauhuuphat
You can take help of Review section which is recently launched.

yep, already click review, please help

@chauhuuphat, as per question format must be ‘tar.gz’ intead of ‘tar’

Hi, as my configure file format: tar && force_archive: true. After run playbook, i have log-in to stapp01 to verify file and appear file.tar.gz.
I think this display is correct with requirement

@chauhuuphat, if you just named your file tar.gz that doesn’t mean its a compressed tar archive, you need to make sure you set format: gz in your playbook as well so that it can create a gzip compressed tar archive.

thanks for your suggest, the task is succeed

Task failed while result were same as required.

@Inderpreet @Tej-Singh-Rana @rahul456 @chauhuuphat

@bilalshakir41396, can you please share your KKE user details ?

email:

[email protected]

now I completed with this yml.


  • name: Archive Playbook demo
    hosts: stapp01
    become: yes
    tasks:

    • name: Archive the direcotyr in tar.gz format
      archive:
      path: /usr/src/finance/
      dest: /opt/finance/blog.tar.gz
      format: gz
      force_archive: true
      owner: tony
      group: tony
  • name: Archive Playbook demo
    hosts: stapp02
    become: yes
    tasks:

    • name: Archive the direcotyr in tar.gz format
      archive:
      path: /usr/src/finance/
      dest: /opt/finance/blog.tar.gz
      format: gz
      force_archive: true
      owner: steve
      group: steve
  • name: Archive Playbook demo
    hosts: stapp03
    become: yes
    tasks:

    • name: Archive the direcotyr in tar.gz format
      archive:
      path: /usr/src/finance/
      dest: /opt/finance/blog.tar.gz
      format: gz
      force_archive: true
      owner: banner
      group: banner

@bilalshakir41396, there are some issues with your playbook as some tasks failed.