---
title: "ANSIBLE: Comment encrypter/decrypter un fichier ?"
canonical: "https://blog.kaptus.net/space/BKAP/blog/162857093/ANSIBLE%3A%20Comment%20encrypter%2Fdecrypter%20un%20fichier%20%3F"
format: markdown
---
## Problème

Comment encrypter/décrypter un fichier avec ansible-vault ?

## Solution

Pour encrypter une fichier :

##### **Encrypt file**

```shell
ansible-vault encrypt file.yml
```

Pour décrypter un fichier :

##### **Decrypt file**

```shell
ansible-vault decrypt file.yml
```

Pour modifier la clé de cryptage :

##### **Change key file**

```shell
ansible-vault rekey file.yml
```

Pour éditer un fichier crypté :

##### **Edit crypted file**

```shell
ansible-vault edit file.yml
```

Pour voir le contenu d'un fichier crypté :

##### **View crypted file**

```shell
ansible-vault view file.yml
```

## Articles connexes



> Macro (contentbylabel)