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”.
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”
# 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
Votre dépôt contient deux “OPSDirectory” et a été sauvegardé dans un dépôt Git.