You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
853 B
Markdown
38 lines
853 B
Markdown
|
3 months ago
|
# Projet Ansible - Installation Nginx sur VPS
|
||
|
|
|
||
|
|
## Configuration
|
||
|
|
|
||
|
|
1. **Modifier l'inventory** : Éditez `inventory.yml` et remplacez `YOUR_VPS_IP_ADDRESS` par l'adresse IP de votre VPS
|
||
|
|
|
||
|
|
2. **Configurer l'accès SSH** :
|
||
|
|
- Assurez-vous d'avoir accès SSH à votre VPS
|
||
|
|
- Si vous utilisez une clé SSH, décommentez et configurez `ansible_ssh_private_key_file`
|
||
|
|
|
||
|
|
## Utilisation
|
||
|
|
|
||
|
|
### Tester la connexion
|
||
|
|
```bash
|
||
|
|
ansible all -m ping
|
||
|
|
```
|
||
|
|
|
||
|
|
### Exécuter le playbook
|
||
|
|
```bash
|
||
|
|
ansible-playbook playbook.yml
|
||
|
|
```
|
||
|
|
|
||
|
|
### Exécuter en mode vérification (dry-run)
|
||
|
|
```bash
|
||
|
|
ansible-playbook playbook.yml --check
|
||
|
|
```
|
||
|
|
|
||
|
|
### Exécuter avec verbosité
|
||
|
|
```bash
|
||
|
|
ansible-playbook playbook.yml -v
|
||
|
|
```
|
||
|
|
|
||
|
|
## Structure du projet
|
||
|
|
|
||
|
|
- `ansible.cfg` : Configuration Ansible
|
||
|
|
- `inventory.yml` : Inventaire des serveurs au format YAML
|
||
|
|
- `playbook.yml` : Playbook d'installation de Nginx
|