Aller au contenu

OPSDirectory

Les opérations sont stockées dans un répertoire (dépôt d’opérations) nommé “OPSDirectory”.

“OPSDirectory” est composé de deux répertoires :

  • “operationBooks” : rassemble les “operationBooks”
  • “operations” : rassemble les “operations”

et d’un ou plusieurs fichiers d’inventaires “inventoryFiles” Tous les détails d’un “inventoryFile”.

Pour assurer le suivi et la sauvegarde de ces scripts, je vous conseille de les intégrer dans un dépôt Git.

Initialisation d’un dépôt d’opérations

La commande “setupops” permet de créer un “OPSDirectory”.

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

Exemple : automation-cli setupops "firstOPSDirectory"

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

Vous pouvez créer plusieurs “OPSDirectory” dans un répertoire “racine”. L’exemple suivant présente un dépôt “racine” comportant deux “OPSDirectory”.

Cette organisation est complètement arbitraire, ceci doit permettre de répartir et de bien définir chaque tâche à exécuter (opération).

/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

Exemple de création d’un dépôt racine avec 2 “OPSDirectory”

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

Votre dépôt contient deux “OPSDirectory” et a été sauvegardé dans un dépôt Git.