From 0e67b142b4cb069c8986ac025ece78b8acb162ef Mon Sep 17 00:00:00 2001 From: Thomas Wiest Date: Wed, 8 Jul 2015 09:35:15 -0400 Subject: documented ansible arch team decisions --- docs/style_guide.adoc | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'docs/style_guide.adoc') diff --git a/docs/style_guide.adoc b/docs/style_guide.adoc index 2f89a5fae..110e7153f 100644 --- a/docs/style_guide.adoc +++ b/docs/style_guide.adoc @@ -57,18 +57,34 @@ Ansible tooling (like `ansible-galaxy init`) create files with a .yml extension. Example: `tasks.yml` -=== Ansible Global Variables -Ansible global variables are defined as any variables outside of ansible roles. Examples include playbook variables, variables passed in on the cli, etc. +=== Ansible CLI Variables +''' +[cols="2v,v"] +|=== +| **Rule** +| Variables meant to be passed in from the ansible CLI MUST have a prefix of cli_ +|=== + +Ansible allows variables to be passed in on the command line using the `-e` option. These variables MUST have a prefix of cli_ so that it's clear where they came from, and how dangerous they are (can be exploited). + +.Example: +[source] +---- +ansible-playbook -e cli_foo=bar someplays.yml +---- + +=== Ansible Global Variables ''' [cols="2v,v"] |=== | **Rule** | Global variables MUST have a prefix of g_ |=== +Ansible global variables are defined as any variables outside of ansible roles. Examples include playbook variables, variables passed in on the cli, etc. -Example: +.Example: [source] ---- g_environment: someval -- cgit v1.2.1