76 lines
1.2 KiB
Markdown
76 lines
1.2 KiB
Markdown
|
# molecule
|
||
|
|
||
|
Molecule est un framework permettant de tester les roles ansible.
|
||
|
|
||
|
Il supporte diferent driver:
|
||
|
|
||
|
- Docker (default)
|
||
|
- Vagrant
|
||
|
- Libvirtd
|
||
|
|
||
|
## Hierarchie
|
||
|
|
||
|
Les fichiers de configuration sont instalé dans le role sous `molecule/default`
|
||
|
|
||
|
Les principaux fichier sont les suivants:
|
||
|
|
||
|
- `molecule.yml` configuration central
|
||
|
- `converge.yml` playbook contenant l'appel du role a tester
|
||
|
- `verify.yml` playbook effectuant les tests
|
||
|
|
||
|
### molecule.yml
|
||
|
|
||
|
ce ficheier de config poséde diferent clés principal:
|
||
|
|
||
|
- `dependency`
|
||
|
- `driver`
|
||
|
- `lint`
|
||
|
- `platform`
|
||
|
- `provisioner`
|
||
|
- `scenario`
|
||
|
- `verifier`
|
||
|
|
||
|
## Scenario
|
||
|
|
||
|
Scenario par defaut:
|
||
|
|
||
|
```YAML
|
||
|
scenario:
|
||
|
create_sequence:
|
||
|
- dependency
|
||
|
- create
|
||
|
- prepare
|
||
|
check_sequence:
|
||
|
- dependency
|
||
|
- cleanup
|
||
|
- destroy
|
||
|
- create
|
||
|
- prepare
|
||
|
- converge
|
||
|
- check
|
||
|
- destroy
|
||
|
converge_sequence:
|
||
|
- dependency
|
||
|
- create
|
||
|
- prepare
|
||
|
- converge
|
||
|
destroy_sequence:
|
||
|
- dependency
|
||
|
- cleanup
|
||
|
- destroy
|
||
|
test_sequence:
|
||
|
- dependency
|
||
|
- lint
|
||
|
- cleanup
|
||
|
- destroy
|
||
|
- syntax
|
||
|
- create
|
||
|
- prepare
|
||
|
- converge
|
||
|
- idempotence
|
||
|
- side_effect
|
||
|
- verify
|
||
|
- cleanup
|
||
|
- destroy
|
||
|
```
|