Skip to content

Commit

Permalink
Improve intro
Browse files Browse the repository at this point in the history
  • Loading branch information
raphink committed Jun 3, 2012
1 parent 2918fbd commit 9b106b2
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 17 deletions.
6 changes: 6 additions & 0 deletions en/augeas.sty
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
\usepackage[table]{xcolor} % loads also »colortbl«, colored
%\usepackage[table,gray]{xcolor} % loads also »colortbl«, grayscale


%\rowcolors{2}{gray!25}{white}
\usepackage{multirow}

Expand Down Expand Up @@ -83,3 +84,8 @@
% Number listings within chapters
\numberwithin{listing}{chapter}

% Use footnote package when footnotes (or NdT)
% are called from within \dvquote
% Warning:Load footnote after xcolor
\usepackage{footnote}

59 changes: 51 additions & 8 deletions en/chapters/exploring_augtool.tex
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,50 @@ \section{Parsing your System Configuration Files}

\consolecode/$ augtool/
This will give you an interactive shell which passes commands to Augeas. Augeas transforms your configuration files into a tree, which has two nodes at its root: \nolinkurl{/augeas} and \nolinkurl{/files}. The \nolinkurl{/augeas} node contains metadata, which we will be looking at in chapter~\ref{chap:metadata}, while \nolinkurl{/files} contains the representation of the files Augeas was able to parse. You can see these two nodes by typing \verb!ls /!:
This will give you an interactive shell which passes commands to Augeas.
To see which commands your version of \texttt{augtool} supports, simply type \texttt{help}:
\begin{augtoolsh}[]
augtool> help
Commands:
quit - exit the program
clear - clear the value of a node
defnode - set a variable, possibly creating a new node
defvar - set a variable
get - get the value of a node
ins - insert new node
insert - insert new node (alias of 'ins')
load - (re)load files under /files
ls - list children of a node
match - print matches for a path expression
mv - move a subtree
move - move a subtree (alias of 'mv')
print - print a subtree
dump-xml - print a subtree as XML
rm - delete nodes and subtrees
save - save all pending changes
set - set the value of a node
\end{augtoolsh}
\begin{augtoolsh}[]
setm - set the value of multiple nodes
clearm - clear the value of multiple nodes
span - print position in input file corresponding to tree
store - parse text into tree
retrieve - transform tree into text
touch - create a new node
help - print help
Type 'help <command>' for more information on a command
\end{augtoolsh}
Augeas transforms your configuration files into a tree,
which has two nodes at its root: \texttt{/augeas} and \texttt{/files}.
The \texttt{/augeas} node contains metadata, which we will be looking at in chapter~\ref{chap:metadata},
while \texttt{/files} contains the representation of the files Augeas was able to parse.
You can see these two nodes by typing \verb!ls /!:
\index{Commands!ls}
Expand All @@ -34,7 +77,7 @@ \section{Parsing your System Configuration Files}
\verb!ls! is an \verb!augtool! command which lists the children of the given node and gives their value (if any).
You can see which files (or directories containing files) were successfully parsed by Augeas in \nolinkurl{/etc} by typing \verb!ls /files/etc!:
You can see which files (or directories containing files) were successfully parsed by Augeas in \texttt{/etc} by typing \verb!ls /files/etc!:
\begin{augtoolsh}[]
augtool> ls /files/etc
Expand All @@ -53,7 +96,7 @@ \section{Parsing your System Configuration Files}
\index{Commands!print}
Let's inspect the contents of the first line of \nolinkurl{/etc/fstab} in the Augeas tree. We can use the \verb!print! command to inspect nodes and their values recursively:
Let's inspect the contents of the first line of \texttt{/etc/fstab} in the Augeas tree. We can use the \verb!print! command to inspect nodes and their values recursively:
\begin{augtoolsh}[]
augtool> print /files/etc/fstab/1
Expand All @@ -68,7 +111,7 @@ \section{Parsing your System Configuration Files}
/files/etc/fstab/1/passno = "0"
\end{augtoolsh}
Each of the child nodes beneath the \verb!1! node refers to a part of a single line in the \nolinkurl{/etc/fstab} file. The filesystem options are further split into separate nodes under the \verb!opt! node so they can be managed individually.
Each of the child nodes beneath the \verb!1! node refers to a part of a single line in the \texttt{/etc/fstab} file. The filesystem options are further split into separate nodes under the \verb!opt! node so they can be managed individually.
What if we only wanted to find the \verb!opt! nodes of this first line? The \verb!match! command lets us find the nodes matching an expression:
Expand Down Expand Up @@ -97,7 +140,7 @@ \section{Parsing your System Configuration Files}
\section{Using a Fakeroot}
It is often useful to play with \verb!augtool! when you want to understand the Augeas tree or try XPath expressions. However, you likely don't want to play with the files in your \nolinkurl{/etc} directory and take the risk of ruining your system. Augeas lets you set a fakeroot so that the files parsed and modified by Augeas are taken from this root instead of the \nolinkurl{/} directory of your system.
It is often useful to play with \verb!augtool! when you want to understand the Augeas tree or try XPath expressions. However, you likely don't want to play with the files in your \texttt{/etc} directory and take the risk of ruining your system. Augeas lets you set a fakeroot so that the files parsed and modified by Augeas are taken from this root instead of the \texttt{/} directory of your system.
\index{augtool!options!--root} \index{Environment variables!\textsc{augeas\_root}}
Expand Down Expand Up @@ -136,7 +179,7 @@ \section{Modifying Files}
\end{listing}
In listing \refandpage{lst:rm_fstab_opt} we change the filesystem options specified on the first line of \nolinkurl{/etc/fstab} by removing the third \verb!opt! node. The \verb!rm! command on line 2 removes only the \verb!opt! node we specified. Line 3 tells us that the \verb!rm! command removed only one node, the \nolinkurl{/files/etc/fstab/1/opt[3]} node. Lines 4 through 11 show us the \nolinkurl{/files/etc/fstab/1} tree without the removed node.
In listing \refandpage{lst:rm_fstab_opt} we change the filesystem options specified on the first line of \texttt{/etc/fstab} by removing the third \verb!opt! node. The \verb!rm! command on line 2 removes only the \verb!opt! node we specified. Line 3 tells us that the \verb!rm! command removed only one node, the \texttt{/files/etc/fstab/1/opt[3]} node. Lines 4 through 11 show us the \texttt{/files/etc/fstab/1} tree without the removed node.
On line 12, we call the \verb!save! command. This command tells Augeas to save the tree back to the configuration files. Augeas inspects the files and tries to apply the new tree to them. In our case, the \verb!save! command was successful as line 13 tells us, and one file was modified, which is what we expected. We can then quit the \verb!augtool! session by typing \verb!quit! on line 14. We can then quit the \verb!augtool! session by typing \verb!quit! on line 14.
Expand All @@ -154,15 +197,15 @@ \section{Preserving existing files}
\item
\verb!--new! will save the modified file with a .augnew extension and leave the original file untouched.
\end{itemize}
These options actually modify the value of the \nolinkurl{/augeas/save} node in the Augeas tree\footnoteref{sec:save_node}.
These options actually modify the value of the \texttt{/augeas/save} node in the Augeas tree\footnoteref{sec:save_node}.
\section{Locating nodes in files}
\label{sec:locating_nodes} \index{augtool!options!--span} \index{Flags!\textsc{aug\_enable\_span}}
The span metadata were added in Augeas 0.8.0. For performance reasons, they are not activated by default. This functionality can be activated by the \verb!AUG_ENABLE_SPAN! flag or the \verb!--span! flag in \verb!augtool!.
You can see if the \verb!span! functionality is activated in the current session by looking at the \nolinkurl{/augeas/span} node\footnoteref{sec:span_node}:
You can see if the \verb!span! functionality is activated in the current session by looking at the \texttt{/augeas/span} node\footnoteref{sec:span_node}:
\index{Metadata!\slash{}augeas\slash{}span}
Expand Down
18 changes: 9 additions & 9 deletions en/chapters/introduction.tex
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ \subsection{No remote management support}

Remote access to the Augeas API are meant to be added on top of it, not in it.

Puppet\footnote{\url{http://www.puppetlabs.com}} is an example of configuration management tool which supports Augeas as a native type and provides remote management functionality.
Puppet\footnote{\url{http://www.puppetlabs.com}} is an example of configuration management tool which supports Augeas as a native type and provides remote management functionality\footnote{\seeref{chap:puppet}.}. Mcollective with the \texttt{augeasquery} agent also provides a remote access to Augeas.

\subsection{Very little modelling}

Expand Down Expand Up @@ -154,18 +154,18 @@ \subsection{Installing from source}

\url{http://augeas.net/download/}

Next, install the necessary dependencies to build Augeas. The minimal dependencies you will need are the readline headers. You can use one of these commands to install them:
Next, install the necessary dependencies to build Augeas. The minimal dependencies you will need are the readline and libxml headers. You can use one of these commands to install them:

\begin{console}[]
$ sudo yum install readline-devel
$ sudo apt-get install libreadline-dev
$ sudo yum install readline-devel libxml2-devel
$ sudo apt-get install libreadline-dev libxml2-dev
\end{console}

Then, extract, compile and install:

\begin{console}[]
$ tar xvzf augeas-0.8.0.tar.gz
$ cd augeas-0.8.0
$ tar xvzf augeas-1.0.tar.gz
$ cd augeas-1.0
$ ./configure
$ make && sudo make install
\end{console}
Expand Down Expand Up @@ -214,7 +214,7 @@ \subsection{Building documentation}
If you want to build this documentation, begin with the instructions in section \Nameref{sec:installing_from_source} to retrieve the source code.
On Ubuntu, you can find this documentation already built in the `augeas-doc` package\footnoteref{sec:installing_from_packages}.
On Ubuntu and Debian, you can find this documentation already built in the \verb!augeas-doc! package\footnoteref{sec:installing_from_packages}.
\subsubsection{Building the PDF documentation}
Expand All @@ -229,7 +229,7 @@ \subsubsection{Building the PDF documentation}
\consolecode|$ ./configure --with-pdfdocs|
\consolecode|$ make|
This will generate PDF files in the \verb!doc! directory, which contain mostly theorical information on lenses and their implementation in Augeas\seeref{chap:bx}.
This will generate PDF files in the \verb!doc! directory, which contain mostly theorical information on lenses and their implementation in Augeas\footnote{\seeref{chap:bx}.}.
\subsubsection{Building the NaturalDocs documentation}
Expand All @@ -256,7 +256,7 @@ \subsection{Conventions}
This book uses the following conventions:
\begin{itemize}
\item
Filesystem paths, Augeas calls and Unix commands are written in a monospace font;
Filesystem paths, Augeas calls and Unix commands are typeset in a monospace font;
\item
When lines are too long in an output, an antislash (\verb!\!) is added and the rest of the line is reported to the next line with an indentation.
\end{itemize}
Expand Down
3 changes: 3 additions & 0 deletions en/chapters/puppet.tex
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
\chapter{Using Augeas in Puppet}

\label{chap:puppet}
\index{Puppet}

\chquote{Let it be observed, that slovenliness is no part of religion; \\
that neither this nor any text of Scripture,\\
condemns neatness of apparel.\\
Expand Down
2 changes: 2 additions & 0 deletions en/macros.tex
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
\newcommand{\info}[1]{\begin{infoenv}#1\end{infoenv}}




% Quotes

\renewcommand{\epigraphsize}{\footnotesize}
Expand Down

0 comments on commit 9b106b2

Please sign in to comment.