Code Monkey home page Code Monkey logo

Comments (4)

berndfinger avatar berndfinger commented on July 28, 2024

We could just skip all the *extracted* directories when setting file permissions and ownership. At the time when the file and directory permissions are set by the role, permissions and ownership only of files which are not already extracted will have to be modified.

from community.sap_install.

marcelmamula avatar marcelmamula commented on July 28, 2024

@berndfinger I would suggest different approach. It is easier to create batches of 100 files and run them in loop.

This is short example I made for test, which splits into batches of 3:

  vars:
    file_input: "fileA fileB fileC fileD fileE fileF fileG fileX"
  tasks:
    - name: Assign file_input into file_list
      ansible.builtin.set_fact:
        file_list: "{{ file_input.split(' ') }}"

    - name: Show file_list in loop per batch
      ansible.builtin.debug:
        msg: "{{ item | join(' ') }}"
      loop: "{{ file_list | batch(3) }}"
      loop_control:
        label: "Batch {{ (file_list.index(item[0]) // 3) + 1 }}"
TASK [Show file_list in loop per batch] *********************************************************************************************************************
ok: [localhost] => (item=Batch 1) => {
    "msg": "fileA fileB fileC"
}
ok: [localhost] => (item=Batch 2) => {
    "msg": "fileD fileE fileF"
}
ok: [localhost] => (item=Batch 3) => {
    "msg": "fileG fileX"
}

from community.sap_install.

berndfinger avatar berndfinger commented on July 28, 2024

@marcelmamula Nice idea, thanks! I tested with a batch size of 100, a directory name of length 100, and several 1000 files with a 22 character file name. I would still skip the extracted directories, as there should never be any need to change owners and permissions of extracted files.

from community.sap_install.

berndfinger avatar berndfinger commented on July 28, 2024

Solved in #735.

from community.sap_install.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.