Skip to content

OPSDirectory

Operations are stored in a directory (operations repository) called “OPSDirectory”.

“OPSDirectory” is made up of two directories:

  • “operationBooks”: gathers “operationBooks”.
  • operations”: contains the operations

and one or more “inventoryFiles” Full details of an “inventoryFile”.

To keep track of these scripts, I recommend that you integrate them into a Git repository.

Initializing an operations repository

The “setupops” command is used to create an “OPSDirectory”.

Fenêtre de terminal
automation-cli setupops "[OPSDirectory name]"

Example: automation-cli setupops "firstOPSDirectory"

firstOPSDirectory/
├── inventory.yaml
├── operationBooks
└── operations

You can create several “OPSDirectories” in a “root” directory. The following example shows a “root” repository with two “OPSDirectories”.

This organization is completely arbitrary, and is intended to allow you to distribute and clearly define each task to be carried out (operation).

/depot racine
├── filer (OPSDirectory)
│ ├──operationBooks
│ │ └──setup.yaml
│ └──operations
│ └── nfs
│ └── ./run.sh
│ └── ./manifest.yaml
├── clusterKubernetes (OPSDirectory)
│ ├──operationBooks
│ │ └──setupCluser.yaml
│ └──operations
│ └── k8s
│ ├── K8sEnvironment
│ │ ├── ./run.sh
│ │ └── ./manifest.yaml
│ ├── addContainerRegistry
│ │ ├── ./run.sh
│ │ └── ./manifest.yaml
│ ├── master
│ │ ├── CNI-Calico
│ │ │ ├── ./run.sh
│ │ │ └── ./manifest.yaml
│ │ ├── Control-Plane
│ │ │ ├── ./run.sh
│ │ │ └── ./manifest.yaml
│ │ ├── WatingForNodeReady
│ │ │ ├── ./run.sh
│ │ │ └── ./manifest.yaml
│ │ ├── createJoinToken
│ │ │ ├── ./manifest.yaml
│ │ │ └── ./run.sh
│ │ ├── getJoinTokensList
│ │ │ └── ./manifest.yaml
│ │ ├── k8sTools
│ │ │ ├── ./run.sh
│ │ │ └── ./manifest.yaml
│ │ └── updateCertificates
│ │ ├── ./run.sh
│ │ └── ./manifest.yaml
│ ├── networkSetup
│ │ ├── ./run.sh
│ │ └── ./manifest.yaml
│ ├── setInternalContainerRegistry
│ │ ├── ./run.sh
│ │ └── ./manifest.yaml
│ ├── swapDesactivation
│ │ ├── ./run.sh
│ │ └── ./manifest.yaml
│ └── worker
│ └── joinCluster
│ ├── ./manifest.yaml
│ └── ./run.sh

Example of creating a root repository with 2 “OPSDirectories

Fenêtre de terminal
# Creating root devops
mkdir devops
cd devop
# Creating 2 OPS directories
automation-cli setupops "filer" # Datacenter shared storage
automation-cli setupops "clusterKubernetes" # Datacenter Kubernetes cluster
# Add README.md file
touch README.md
# Init Git repository
git init
git checkout -b main
git add .
git commit -m "first commit"
git remote add origin https://git.domain/Owner/devops.git
git push -u origin main

Your repository contains two “OPSDirectories” and has been saved in a Git repository.