Skip to content

Instantly share code, notes, and snippets.

@klashxx
Created May 27, 2016 13:00
Show Gist options
  • Save klashxx/41730743f1723da926075e9bbcf55479 to your computer and use it in GitHub Desktop.
Save klashxx/41730743f1723da926075e9bbcf55479 to your computer and use it in GitHub Desktop.
---
- name: Test split
hosts: localhost
gather_facts: false
vars:
- svnpath: trunk/Configuracion/App_
tasks:
- name: Let's split
debug: var=item
with_items: "{{ svnpath.split('/', 1) }}"
@klashxx
Copy link
Author

klashxx commented May 27, 2016

PLAY [Test split] **************************************************************

TASK [Let's split] *************************************************************
ok: [localhost] => (item=trunk) => {
    "item": "trunk"
}
ok: [localhost] => (item=Configuracion/App_) => {
    "item": "Configuracion/App_"
}

PLAY RECAP *********************************************************************
localhost                  : ok=1    changed=0    unreachable=0    failed=0   

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