Skip to main content

Raymii.org Logo (IEC resistor symbol)logo

Quis custodiet ipsos custodes?
Home | About | All pages | RSS Feed | Gopher

Ansible - create playbooks and role file and folder structure

Published: 08-09-2016 | Author: Remy van Elst | Text only version of this article


Table of Contents


Because I always forget which folders and files go into a playbook folder. Basedon the best practices page

ansible

If you like this article, consider sponsoring me by trying out a Digital OceanVPS. With this link you'll get $100 credit for 60 days). (referral link)

To create a new Ansile project:

mkdir -p new_projectcd new_project# inventory and master playbooktouch production staging site.yml # foldersmkdir -p group_vars host_vars library filter_plugins

To create a role with all the folders (role is named common):

mkdir -p roles/common/{tasks,handlers,templates,files,vars,defaults,meta}touch roles/common/{tasks,handlers,templates,files,vars,defaults,meta}/main.yml
Tags: ansible, python, snippets