81 lines
2.3 KiB
Markdown
81 lines
2.3 KiB
Markdown
---
|
||
categories: web orchestration ansible
|
||
toc: yes
|
||
title: How to AWX
|
||
...
|
||
|
||
# How to AWX
|
||
|
||
* Documentation: [docs.ansible.com/ansible-tower/latest/html/userguide/overview.html](https://docs.ansible.com/ansible-tower/latest/html/userguide/overview.html)
|
||
* Repository: [github.com/ansible/awx](https://github.com/ansible/awx)
|
||
|
||
[AWX](https://www.ansible.com/community/awx-project) est une interface web et REST pour l'outil d'automatisation [ansible](Howtoansible).
|
||
|
||
## Installation
|
||
|
||
À partir de 18.0 il est recommandé de l'installer à travers [AWX Operator](https://github.com/ansible/awx-operator) qui dépend de kubernetes. Il est aussi possible d'utiliser une image docker.
|
||
|
||
### Docker
|
||
|
||
Copier le dépôt sur le serveur a partir d'une version stable: https://github.com/ansible/awx/releases/tag
|
||
|
||
Il faudra installer les paquets suivants:
|
||
|
||
- `python3`
|
||
- `python3-venv`
|
||
- `python3-setuptools-scm`
|
||
- `python3-psycopg2`
|
||
- `ansible`
|
||
- `docker-compose`
|
||
|
||
Le dépôt devra appartenir a l'usager exécutant, il faut s'assurer que les programmes dans le dossier tools ont bien un droit d’exécution. (Faire attention a noexec qui peut remonter jusqu'au conteneur dans certains cas)
|
||
|
||
Une fois les prérequis installée et les permissions bien appliquée, on peut continuer avec l'installation:
|
||
|
||
La documentation complète se situe sur [Github](https://github.com/ansible/awx/blob/devel/tools/docker-compose/README.md)
|
||
|
||
``
|
||
$ make docker-compose-build
|
||
$ make docker-compose
|
||
``
|
||
|
||
Suite a la complétion, on peut lancer dans un autre terminal:
|
||
|
||
``
|
||
$ docker exec tools_awx_1 make clean-ui ui-devel
|
||
``
|
||
|
||
On peut ensuite accéder a l'interface sur `https://localhost:8043/#/home`
|
||
|
||
|
||
### CLI
|
||
|
||
Une interface de ligne de commande peut aussi être installé directement sur l'hôte
|
||
|
||
```
|
||
$ pip3 install awxkit
|
||
```
|
||
|
||
### Doc
|
||
|
||
La documentation peut être installé en local
|
||
|
||
```
|
||
$ pip3 install sphinx sphinxcontrib-autoprogram
|
||
$ cd awxkit/awxkit/cli/docs
|
||
$ TOWER_HOST=https://awx.example.org TOWER_USERNAME=example TOWER_PASSWORD=secret make clean html
|
||
$ cd build/html/ && python -m http.server
|
||
Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ..
|
||
```
|
||
|
||
## Configuration
|
||
|
||
### Créer un nouvel admin
|
||
|
||
```
|
||
$ docker exec -ti tools_awx_1 awx-manage createsuperuser
|
||
```
|
||
|
||
### Utiliser un postgres externe
|
||
|
||
Il faut aller indiquer le postgres désiré dans les variables de `tools/docker-compose/inventory` |