Skip to content

Instantly share code, notes, and snippets.

@angstwad
Created March 31, 2014 14:24
Show Gist options
  • Save angstwad/9893480 to your computer and use it in GitHub Desktop.
Save angstwad/9893480 to your computer and use it in GitHub Desktop.
Splitting in Jinja2/Ansible
---
- name: Test split
hosts: localhost
gather_facts: false
vars:
- facter_blockdevices: "sda,sdb,sdc,sdd,sde,sdf"
tasks:
- name: Let's split
debug: var=item
with_items: "facter_blockdevices.split(',')"
@thisisjagan
Copy link

I get the following output when i try this. Please help.

TASK [Let's split] ************************************************************************************************************************************************************
ok: [localhost] => (item=None) => {}
ok: [localhost] => (item=None) => {}
ok: [localhost] => (item=None) => {}
ok: [localhost] => (item=None) => {}
ok: [localhost] => (item=None) => {}
ok: [localhost] => (item=None) => {}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment