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”.
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
# Creating root devopsmkdir devopscd devop# Creating 2 OPS directoriesautomation-cli setupops "filer" # Datacenter shared storageautomation-cli setupops "clusterKubernetes" # Datacenter Kubernetes cluster# Add README.md filetouch README.md# Init Git repositorygit initgit checkout -b maingit add .git commit -m "first commit"git remote add origin https://git.domain/Owner/devops.gitgit push -u origin main
Your repository contains two “OPSDirectories” and has been saved in a Git repository.