在ansible中创建数组的子集

Creating a subset of an array in ansible

我的数据文件看起来像

---
data:
  - item 1
  - item 2
  - item 3
  - item 4

我想为项目 1 添加一个任务簿,为项目 2 - 4 添加一个不同的任务簿。如何创建仅包含 ['item 2'、'item 3'、'item 4' 的数组]

---
- hosts: localhost
tasks:
  - include: taskbooks1.yml param={{data[0]}}

  - include: taskbooks2.yml param={{item}}
    with_indexed_items: "{{ data }}" # I want to pass another list without item 1
- include: taskbooks2.yml param={{item}}
  with_items: "{{data[1:]}}"