Skip to content

Instantly share code, notes, and snippets.

@hnakamur
Created August 19, 2013 05:21
Show Gist options
  • Save hnakamur/6265936 to your computer and use it in GitHub Desktop.
Save hnakamur/6265936 to your computer and use it in GitHub Desktop.
First add localhost to your inventory file (ex. /etc/ansible/hosts or ~/.ansible/hosts) and then run ansible-playbook ansible-directories.yml
- hosts: localhost
connection: local
vars:
role: common
tasks:
- name: create directories for ansible files.
file: path={{ item }} state=directory
with_items:
- group_vars
- host_vars
- roles/{{ role }}/tasks
- roles/{{ role }}/handlers
- roles/{{ role }}/templates
- roles/{{ role }}/files
- roles/{{ role }}/vars
@hnakamur
Copy link
Author

ありがとうございます。私の実行例もrole→rolesに編集しました。

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