Skip to content

Self-training

This self-training module is divided into stages.

The documentation often refers to the symbol : “~”. It indicates the path to your “Home Directory” ($HOME).

You don’t have to install it, but a training “OPSDirectory” is available. Download this file (not available at present), then unzip it to the root of your “Home directory” (all documentation is based on the ~/automation-cli-auto-formation directory). This “OPSDirectory” simply speeds up the self-training process, avoiding the need to create files for each step.

Open a terminal, install automation-cli, then export the “OPS” variable.

WARNING: All operations contained in the training “OPSDirectory” run on localhost and in your home directory. No dangerous operations are performed. These are generally simple commands, such as “ls” or “echo”. Some operations may create files, in which case the operation will always tell you what has been created or deleted. All files created in this way are systematically deleted. Unless an error has been made, the logs will help you determine which files have been created.

Traces of operations: every operation carried out results in the creation of a log file located in: ~/automation-cli.logs. The command: automation-cli clearlogs 0 deletes all these logs.

Prerequisites

To follow this self-training course, you must have :

  • A working “OPSDirectory”.
  • Debian ‘jq & curl’ packages: sudo apt-get -y install jq curl.

You have not installed a training “OPSDirectory

Let’s start by creating your own training “OPSDirectory”: automation-cli cops [basic operations directory]

Example:

Fenêtre de terminal
automation-cli cops ~/automation-cli-auto-formation

Preparing the working environment (OPS environment variable value)

Open a terminal, and export the environment variable “OPS=”[Path OPSDirectory]”.

Fenêtre de terminal
export OPS=~/automation-cli-auto-formation

The “OPS” variable will be available in the environment of your open terminal. If you close this terminal, you’ll have to repeat this operation in the new terminal.

**If you have downloaded the “OPSDirectory” training package and created a custom directory, replace “~/automation-cli-auto-formation” with the value of the custom directory.

You can also choose not to export this variable, so you’ll need to prefix the “automation-cli” command with OPS=“[OPSDirectory]”.