Skip to content

Instantly share code, notes, and snippets.

@darkone23
Created October 17, 2013 00:28
Show Gist options
  • Select an option

  • Save darkone23/7017340 to your computer and use it in GitHub Desktop.

Select an option

Save darkone23/7017340 to your computer and use it in GitHub Desktop.
Ansible searches for files in different places depending on which part of ansible you are using. The `getcwd` role just looks up your current working directory and provides it as the variable 'basedir'. This way, you can do things like this:
- hosts: webservers
vars_files:
- vars/web-archival-config.yaml
roles:
- getcwd
- role: cron-job
frequency: hourly
template: '{{ basedir + "templates/archive.sh" }}'
dest: ~/bin/archive.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment