File: loop-100-copies.yml

package info (click to toggle)
python-mitogen 0.3.37-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,728 kB
  • sloc: python: 24,644; sh: 198; makefile: 74; perl: 19; ansic: 18
file content (32 lines) | stat: -rw-r--r-- 771 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
- name: bench/loop-100-copies.yml
  hosts: all
  tasks:

  - name: Create file tree
    connection: local
    vars:
      ansible_python_interpreter: "{{ ansible_playbook_python }}"
    shell: >
      mkdir -p /tmp/filetree.in;
      for i in `seq -f /tmp/filetree.in/%g 1 100`; do echo $RANDOM > $i; done;

  - name: Delete remote file tree
    file: path=/tmp/filetree.out state=absent
    when: 0

  - file:
      state: directory
      path: /tmp/filetree.out

  - name: Trigger nasty process pileup
    copy:
      src: "{{item.src}}"
      dest: "/tmp/filetree.out/{{item.path}}"
      mode: 0644
    with_filetree: /tmp/filetree.in
    when: item.state == 'file'
    loop_control:
      label: "/tmp/filetree.out/{{ item.path }}"

  tags:
    - resource_intensive