Commit a95e2e29 authored by nimrod's avatar nimrod
Browse files

- Spelling corrections (yeah hunspell).

parent 27e03f7a
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -15,12 +15,12 @@ Sharing with git submodule

I'd like to start by saying that git submodule is the poor man's package
manager and it's lack of popularity is (somewhat) justified. However, this is a
nice demostration of a case where there is no package manager available and of
nice demonstration of a case where there is no package manager available and of
using git submodule instead. Also, I've only been able to use this technique for
modules written in Python, which is nice considering the lack of boiler-plate
that Ansible provides and that Python is my personal preference.

The whole stroy is really quite simple, create a seperate git repository with
The whole story is really quite simple, create a separate git repository with
the modules in it. You can put them in subdirectories and as a far as I know,
there's no restriction on the hierarchy depth. In your playbook directory create
a :code:`library` directory (the Ansible default, so you can change this in
+3 −3
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@ to get it to work with registering variables as well. What I had left was
programaticaly generating a playbook, but investigating further I found that
Ansible can be imported as a Python module.

Incorperating Ansible in Python
Incorporating Ansible in Python
-------------------------------

To retrieve all of the ip addresses I'd ran the setup module to gather the
@@ -37,7 +37,7 @@ information
    struct = Runner (module_name='setup', pattern='all_hosts').run()

Now we have a complex data structure that is the output of Ansible's fact
gathering module. Running it in the interpeter and examining the structure is
gathering module. Running it in the interpreter and examining the structure is
not hard at all and that is how I managed to write the following code to extract
a list of all of our server's ip addresses.

@@ -53,7 +53,7 @@ Putting that information to good use
            
Now that we have a list of the ip addresses, we can start running Ansible
commands right from with Python (just like we did) or build a playbook by
outputing a YAML file. I chose the latter.
outputting a YAML file. I chose the latter.

.. code:: python

+1 −1
Original line number Diff line number Diff line
@@ -50,7 +50,7 @@ A third option is using a project management tool like `Cargo
<http://doc.crates.io/>`_ for Rust or `Leiningen <http://leiningen.org/>`_
for Clojure. But not all aspects or languages have such tools.

The fourth option I'm thinking of is using a scaffloding tool, mainly `Yeoman
The fourth option I'm thinking of is using a scaffolding tool, mainly `Yeoman
<http://yeoman.io/>`_ as it seems to the most popular one but its focus is on
JS and webapps.

+2 −2
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@ What is Pelican?
----------------

`Pelican <http://blog.getpelican.com/>`_ is a static site generator.
It's written in Python, focusing on blogs, using reStructedText, Jinja2 and Fabric (but you can use Markdown and makefiles and has provisions for normal web pages as well).
It's written in Python, focusing on blogs, using reStructuredText, Jinja2 and Fabric (but you can use Markdown and makefiles and has provisions for normal web pages as well).
It's a pythonic tool that's easy to use and was a breeze to setup.

Installing Pelican
@@ -101,7 +101,7 @@ I've also edited :code:`base.html` and :code:`article.html` inside of :code:`pel
Adding an entry
---------------

Create a ReStructedText file inside of contents. The filename is for personal use and not critical. The heading is the article name and you can add the following for Pelican to use: ::
Create a ReStructuredText file inside of contents. The filename is for personal use and not critical. The heading is the article name and you can add the following for Pelican to use: ::

    :date: 2014-04-19
    :slug:  this-will-the-filename
+2 −2
Original line number Diff line number Diff line
@@ -7,9 +7,9 @@ I've recently written a shell script that contained several functions and I
wanted to support 2 usage methods. The first is quite regular, marking it as an
executable and running it. The second is to source the script and gain the
functions declared. The problem is not actually performing any tasks (or
outputing anything) if the script is being sourced. It took a bit of fiddling
outputting anything) if the script is being sourced. It took a bit of fiddling
but I found a short one-liner to add at the top of the script that solves this
in a POSIX-comliant way (at least on my test machines, Debian with Bash and Dash
in a POSIX-compliant way (at least on my test machines, Debian with Bash and Dash
and KSH on OpenBSD). Here is an example usage:

.. code:: shell
Loading