Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
d049d425
Commit
d049d425
authored
Apr 27, 2012
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clarify stderr behavior of modules
parent
aed5414c
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
38 additions
and
18 deletions
+38
-18
YAMLSyntax.html
+1
-1
api.html
+1
-1
examples.html
+1
-1
faq.html
+1
-1
genindex.html
+1
-1
gettingstarted.html
+1
-1
index.html
+1
-1
moduledev.html
+10
-4
modules.html
+1
-1
patterns.html
+5
-1
playbooks.html
+1
-1
rst/moduledev.rst
+13
-3
search.html
+1
-1
searchindex.js
+0
-0
No files found.
YAMLSyntax.html
View file @
d049d425
...
@@ -247,7 +247,7 @@ languages:
...
@@ -247,7 +247,7 @@ languages:
<p
class=
"pull-right"
><a
href=
"#"
>
Back to top
</a></p>
<p
class=
"pull-right"
><a
href=
"#"
>
Back to top
</a></p>
<p>
<p>
©
Copyright 2012 Michael DeHaan.
<br/>
©
Copyright 2012 Michael DeHaan.
<br/>
Last updated on Apr 2
5
, 2012.
<br/>
Last updated on Apr 2
7
, 2012.
<br/>
Created using
<a
href=
"http://sphinx.pocoo.org/"
>
Sphinx
</a>
1.0.8.
<br/>
Created using
<a
href=
"http://sphinx.pocoo.org/"
>
Sphinx
</a>
1.0.8.
<br/>
</p>
</p>
</div>
</div>
...
...
api.html
View file @
d049d425
...
@@ -331,7 +331,7 @@ a conf.d file appropriately or something similar. Who knows.</p>
...
@@ -331,7 +331,7 @@ a conf.d file appropriately or something similar. Who knows.</p>
<p
class=
"pull-right"
><a
href=
"#"
>
Back to top
</a></p>
<p
class=
"pull-right"
><a
href=
"#"
>
Back to top
</a></p>
<p>
<p>
©
Copyright 2012 Michael DeHaan.
<br/>
©
Copyright 2012 Michael DeHaan.
<br/>
Last updated on Apr 2
5
, 2012.
<br/>
Last updated on Apr 2
7
, 2012.
<br/>
Created using
<a
href=
"http://sphinx.pocoo.org/"
>
Sphinx
</a>
1.0.8.
<br/>
Created using
<a
href=
"http://sphinx.pocoo.org/"
>
Sphinx
</a>
1.0.8.
<br/>
</p>
</p>
</div>
</div>
...
...
examples.html
View file @
d049d425
...
@@ -346,7 +346,7 @@ a simplified syntax for this.</p>
...
@@ -346,7 +346,7 @@ a simplified syntax for this.</p>
<p
class=
"pull-right"
><a
href=
"#"
>
Back to top
</a></p>
<p
class=
"pull-right"
><a
href=
"#"
>
Back to top
</a></p>
<p>
<p>
©
Copyright 2012 Michael DeHaan.
<br/>
©
Copyright 2012 Michael DeHaan.
<br/>
Last updated on Apr 2
5
, 2012.
<br/>
Last updated on Apr 2
7
, 2012.
<br/>
Created using
<a
href=
"http://sphinx.pocoo.org/"
>
Sphinx
</a>
1.0.8.
<br/>
Created using
<a
href=
"http://sphinx.pocoo.org/"
>
Sphinx
</a>
1.0.8.
<br/>
</p>
</p>
</div>
</div>
...
...
faq.html
View file @
d049d425
...
@@ -353,7 +353,7 @@ tasks – whether for a QA sytem, build system, or anything you can think of
...
@@ -353,7 +353,7 @@ tasks – whether for a QA sytem, build system, or anything you can think of
<p
class=
"pull-right"
><a
href=
"#"
>
Back to top
</a></p>
<p
class=
"pull-right"
><a
href=
"#"
>
Back to top
</a></p>
<p>
<p>
©
Copyright 2012 Michael DeHaan.
<br/>
©
Copyright 2012 Michael DeHaan.
<br/>
Last updated on Apr 2
5
, 2012.
<br/>
Last updated on Apr 2
7
, 2012.
<br/>
Created using
<a
href=
"http://sphinx.pocoo.org/"
>
Sphinx
</a>
1.0.8.
<br/>
Created using
<a
href=
"http://sphinx.pocoo.org/"
>
Sphinx
</a>
1.0.8.
<br/>
</p>
</p>
</div>
</div>
...
...
genindex.html
View file @
d049d425
...
@@ -162,7 +162,7 @@ s.parentNode.insertBefore(ga, s);
...
@@ -162,7 +162,7 @@ s.parentNode.insertBefore(ga, s);
<p
class=
"pull-right"
><a
href=
"#"
>
Back to top
</a></p>
<p
class=
"pull-right"
><a
href=
"#"
>
Back to top
</a></p>
<p>
<p>
©
Copyright 2012 Michael DeHaan.
<br/>
©
Copyright 2012 Michael DeHaan.
<br/>
Last updated on Apr 2
5
, 2012.
<br/>
Last updated on Apr 2
7
, 2012.
<br/>
Created using
<a
href=
"http://sphinx.pocoo.org/"
>
Sphinx
</a>
1.0.8.
<br/>
Created using
<a
href=
"http://sphinx.pocoo.org/"
>
Sphinx
</a>
1.0.8.
<br/>
</p>
</p>
</div>
</div>
...
...
gettingstarted.html
View file @
d049d425
...
@@ -315,7 +315,7 @@ explore, but you already have a fully working infrastructure!</p>
...
@@ -315,7 +315,7 @@ explore, but you already have a fully working infrastructure!</p>
<p
class=
"pull-right"
><a
href=
"#"
>
Back to top
</a></p>
<p
class=
"pull-right"
><a
href=
"#"
>
Back to top
</a></p>
<p>
<p>
©
Copyright 2012 Michael DeHaan.
<br/>
©
Copyright 2012 Michael DeHaan.
<br/>
Last updated on Apr 2
5
, 2012.
<br/>
Last updated on Apr 2
7
, 2012.
<br/>
Created using
<a
href=
"http://sphinx.pocoo.org/"
>
Sphinx
</a>
1.0.8.
<br/>
Created using
<a
href=
"http://sphinx.pocoo.org/"
>
Sphinx
</a>
1.0.8.
<br/>
</p>
</p>
</div>
</div>
...
...
index.html
View file @
d049d425
...
@@ -401,7 +401,7 @@ Puppet Labs, and rPath. Reach Michael by email <a class="reference external" hr
...
@@ -401,7 +401,7 @@ Puppet Labs, and rPath. Reach Michael by email <a class="reference external" hr
<p
class=
"pull-right"
><a
href=
"#"
>
Back to top
</a></p>
<p
class=
"pull-right"
><a
href=
"#"
>
Back to top
</a></p>
<p>
<p>
©
Copyright 2012 Michael DeHaan.
<br/>
©
Copyright 2012 Michael DeHaan.
<br/>
Last updated on Apr 2
5
, 2012.
<br/>
Last updated on Apr 2
7
, 2012.
<br/>
Created using
<a
href=
"http://sphinx.pocoo.org/"
>
Sphinx
</a>
1.0.8.
<br/>
Created using
<a
href=
"http://sphinx.pocoo.org/"
>
Sphinx
</a>
1.0.8.
<br/>
</p>
</p>
</div>
</div>
...
...
moduledev.html
View file @
d049d425
...
@@ -176,9 +176,9 @@ a module that just outputs the current time.</p>
...
@@ -176,9 +176,9 @@ a module that just outputs the current time.</p>
<p>
We are going to use Python here but any language is possible. Only File I/O and outputing to standard
<p>
We are going to use Python here but any language is possible. Only File I/O and outputing to standard
out are required. So, bash, C++, clojure, Python, Ruby, whatever you want
out are required. So, bash, C++, clojure, Python, Ruby, whatever you want
is fine.
</p>
is fine.
</p>
<p>
It
’
s obvious that y
ou would never really need to build a module to set the system time,
<p>
So, here
’
s an example. Y
ou would never really need to build a module to set the system time,
the
‘
command
’
module could already be used to do this.
However, it makes for a decent example.
the
‘
command
’
module could already be used to do this.
Though we
’
re going to make one.
</p>
Reading the modules that come with ansible (linked above) is a great way to learn how to write
<p>
Reading the modules that come with ansible (linked above) is a great way to learn how to write
modules. Keep in mind, though, that some modules in ansible
’
s source tree are internalisms,
modules. Keep in mind, though, that some modules in ansible
’
s source tree are internalisms,
so look at
<cite>
service
</cite>
or
<cite>
yum
</cite>
, and don
’
t stare too close into things like
<cite>
async_wrapper
</cite>
or
so look at
<cite>
service
</cite>
or
<cite>
yum
</cite>
, and don
’
t stare too close into things like
<cite>
async_wrapper
</cite>
or
you
’
ll turn to stone. Nobody ever executes async_wrapper directly.
</p>
you
’
ll turn to stone. Nobody ever executes async_wrapper directly.
</p>
...
@@ -331,6 +331,12 @@ json isn’t in the Python standard library until 2.5.:</p>
...
@@ -331,6 +331,12 @@ json isn’t in the Python standard library until 2.5.:</p>
</div>
</div>
<p>
Because the output is supposed to be valid JSON. Except that
’
s not quite true,
<p>
Because the output is supposed to be valid JSON. Except that
’
s not quite true,
but we
’
ll get to that later.
</p>
but we
’
ll get to that later.
</p>
<p>
Further, modules must not output anything on stderr, even if the JSON returned
out stdout is valid. This is due to the internals of our SSH library, more or less.
</p>
<p>
If a module returns stderr or otherwise fails to produce valid JSON, the actual output
will still be shown in Ansible, however, but the command will not succeed.
</p>
<p>
Always use the hacking/test-module script when developing modules and it will warn
you about these kind of things.
</p>
</div>
</div>
<div
class=
"section"
id=
"conventions"
>
<div
class=
"section"
id=
"conventions"
>
<h2>
Conventions
<a
class=
"headerlink"
href=
"#conventions"
title=
"Permalink to this headline"
>
¶
</a></h2>
<h2>
Conventions
<a
class=
"headerlink"
href=
"#conventions"
title=
"Permalink to this headline"
>
¶
</a></h2>
...
@@ -396,7 +402,7 @@ Stop by the mailing list to inquire about requirements.</p>
...
@@ -396,7 +402,7 @@ Stop by the mailing list to inquire about requirements.</p>
<p
class=
"pull-right"
><a
href=
"#"
>
Back to top
</a></p>
<p
class=
"pull-right"
><a
href=
"#"
>
Back to top
</a></p>
<p>
<p>
©
Copyright 2012 Michael DeHaan.
<br/>
©
Copyright 2012 Michael DeHaan.
<br/>
Last updated on Apr 2
5
, 2012.
<br/>
Last updated on Apr 2
7
, 2012.
<br/>
Created using
<a
href=
"http://sphinx.pocoo.org/"
>
Sphinx
</a>
1.0.8.
<br/>
Created using
<a
href=
"http://sphinx.pocoo.org/"
>
Sphinx
</a>
1.0.8.
<br/>
</p>
</p>
</div>
</div>
...
...
modules.html
View file @
d049d425
...
@@ -724,7 +724,7 @@ yum pkg=httpd state=installed</pre>
...
@@ -724,7 +724,7 @@ yum pkg=httpd state=installed</pre>
<p
class=
"pull-right"
><a
href=
"#"
>
Back to top
</a></p>
<p
class=
"pull-right"
><a
href=
"#"
>
Back to top
</a></p>
<p>
<p>
©
Copyright 2012 Michael DeHaan.
<br/>
©
Copyright 2012 Michael DeHaan.
<br/>
Last updated on Apr 2
5
, 2012.
<br/>
Last updated on Apr 2
7
, 2012.
<br/>
Created using
<a
href=
"http://sphinx.pocoo.org/"
>
Sphinx
</a>
1.0.8.
<br/>
Created using
<a
href=
"http://sphinx.pocoo.org/"
>
Sphinx
</a>
1.0.8.
<br/>
</p>
</p>
</div>
</div>
...
...
patterns.html
View file @
d049d425
...
@@ -268,6 +268,10 @@ style file with a YAML one.:</p>
...
@@ -268,6 +268,10 @@ style file with a YAML one.:</p>
- asdf: 1234
</pre>
- asdf: 1234
</pre>
</div>
</div>
<p>
Tip: Be sure to start your YAML file with the YAML record designator
“—”
.
</p>
<p>
Tip: Be sure to start your YAML file with the YAML record designator
“—”
.
</p>
<p>
NOTE: variables specified in playbooks will override variables specified
in the host file. Further, if a host is in multiple groups, currently, the
variables set by the last loaded group will win over variables set in other
groups. This behavior may be refined in future releases.
</p>
<div
class=
"admonition-see-also admonition seealso"
>
<div
class=
"admonition-see-also admonition seealso"
>
<p
class=
"first admonition-title"
>
See also
</p>
<p
class=
"first admonition-title"
>
See also
</p>
<dl
class=
"last docutils"
>
<dl
class=
"last docutils"
>
...
@@ -291,7 +295,7 @@ style file with a YAML one.:</p>
...
@@ -291,7 +295,7 @@ style file with a YAML one.:</p>
<p
class=
"pull-right"
><a
href=
"#"
>
Back to top
</a></p>
<p
class=
"pull-right"
><a
href=
"#"
>
Back to top
</a></p>
<p>
<p>
©
Copyright 2012 Michael DeHaan.
<br/>
©
Copyright 2012 Michael DeHaan.
<br/>
Last updated on Apr 2
5
, 2012.
<br/>
Last updated on Apr 2
7
, 2012.
<br/>
Created using
<a
href=
"http://sphinx.pocoo.org/"
>
Sphinx
</a>
1.0.8.
<br/>
Created using
<a
href=
"http://sphinx.pocoo.org/"
>
Sphinx
</a>
1.0.8.
<br/>
</p>
</p>
</div>
</div>
...
...
playbooks.html
View file @
d049d425
...
@@ -684,7 +684,7 @@ Let’s run a playbook using a parallelism level of 10:</p>
...
@@ -684,7 +684,7 @@ Let’s run a playbook using a parallelism level of 10:</p>
<p
class=
"pull-right"
><a
href=
"#"
>
Back to top
</a></p>
<p
class=
"pull-right"
><a
href=
"#"
>
Back to top
</a></p>
<p>
<p>
©
Copyright 2012 Michael DeHaan.
<br/>
©
Copyright 2012 Michael DeHaan.
<br/>
Last updated on Apr 2
5
, 2012.
<br/>
Last updated on Apr 2
7
, 2012.
<br/>
Created using
<a
href=
"http://sphinx.pocoo.org/"
>
Sphinx
</a>
1.0.8.
<br/>
Created using
<a
href=
"http://sphinx.pocoo.org/"
>
Sphinx
</a>
1.0.8.
<br/>
</p>
</p>
</div>
</div>
...
...
rst/moduledev.rst
View file @
d049d425
...
@@ -15,10 +15,11 @@ a module that just outputs the current time.
...
@@ -15,10 +15,11 @@ a module that just outputs the current time.
We are going to use Python here but any language is possible. Only File I/O and outputing to standard
We are going to use Python here but any language is possible. Only File I/O and outputing to standard
out are required. So, bash, C++, clojure, Python, Ruby, whatever you want
out are required. So, bash, C++, clojure, Python, Ruby, whatever you want
is fine.
is fine.
So, here's an example. You would never really need to build a module to set the system time,
the 'command' module could already be used to do this. Though we're going to make one.
It's obvious that you would never really need to build a module to set the system time,
the 'command' module could already be used to do this. However, it makes for a decent example.
Reading the modules that come with ansible (linked above) is a great way to learn how to write
Reading the modules that come with ansible (linked above) is a great way to learn how to write
modules. Keep in mind, though, that some modules in ansible's source tree are internalisms,
modules. Keep in mind, though, that some modules in ansible's source tree are internalisms,
so look at `service` or `yum`, and don't stare too close into things like `async_wrapper` or
so look at `service` or `yum`, and don't stare too close into things like `async_wrapper` or
...
@@ -187,6 +188,15 @@ You should also never do this in a module::
...
@@ -187,6 +188,15 @@ You should also never do this in a module::
Because the output is supposed to be valid JSON. Except that's not quite true,
Because the output is supposed to be valid JSON. Except that's not quite true,
but we'll get to that later.
but we'll get to that later.
Further, modules must not output anything on stderr, even if the JSON returned
out stdout is valid. This is due to the internals of our SSH library, more or less.
If a module returns stderr or otherwise fails to produce valid JSON, the actual output
will still be shown in Ansible, however, but the command will not succeed.
Always use the hacking/test-module script when developing modules and it will warn
you about these kind of things.
Conventions
Conventions
```````````
```````````
...
...
search.html
View file @
d049d425
...
@@ -179,7 +179,7 @@ s.parentNode.insertBefore(ga, s);
...
@@ -179,7 +179,7 @@ s.parentNode.insertBefore(ga, s);
<p
class=
"pull-right"
><a
href=
"#"
>
Back to top
</a></p>
<p
class=
"pull-right"
><a
href=
"#"
>
Back to top
</a></p>
<p>
<p>
©
Copyright 2012 Michael DeHaan.
<br/>
©
Copyright 2012 Michael DeHaan.
<br/>
Last updated on Apr 2
5
, 2012.
<br/>
Last updated on Apr 2
7
, 2012.
<br/>
Created using
<a
href=
"http://sphinx.pocoo.org/"
>
Sphinx
</a>
1.0.8.
<br/>
Created using
<a
href=
"http://sphinx.pocoo.org/"
>
Sphinx
</a>
1.0.8.
<br/>
</p>
</p>
</div>
</div>
...
...
searchindex.js
View file @
d049d425
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment