Resources attached to the Road To DevOps tutorial
https://blog.noobtoroot.xyz/road-to-devops/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
112 lines
3.1 KiB
112 lines
3.1 KiB
2 years ago
|
## TP Ansible Galaxy
|
||
|
|
||
|
Créer et partager ses propres roles.
|
||
|
|
||
|
|
||
|
## Télécharger des roles
|
||
|
|
||
|
|
||
|
* Aller sur Galaxy https://galaxy.ansible.com et rechercher le role Apache de Geerlingguy.
|
||
|
|
||
|
* Récupérer la CLI d'installation.
|
||
|
|
||
|
![](images/ansible-galaxy-search-role.png)
|
||
|
|
||
|
|
||
|
* Il est également possible de faire une recherche avec la commande `search`
|
||
|
|
||
|
<!-- .slide: data-state="small-code" -->
|
||
|
```none
|
||
|
$ ansible-galaxy search --author geerlingguy apache
|
||
|
|
||
|
Found 14 roles matching your search:
|
||
|
|
||
|
Name Description
|
||
|
---- -----------
|
||
|
geerlingguy.adminer Installs Adminer for Database management.
|
||
|
geerlingguy.apache Apache 2.x for Linux.
|
||
|
geerlingguy.apache-php-fpm Apache 2.4+ PHP-FPM support for Linux.
|
||
|
geerlingguy.certbot Installs and configures Certbot (for Let's Encrypt).
|
||
|
geerlingguy.drupal Deploy or install Drupal on your servers.
|
||
|
geerlingguy.htpasswd htpasswd installation and helper role for Linux serv...
|
||
|
geerlingguy.munin Munin monitoring server for RedHat/CentOS or Debian/...
|
||
|
geerlingguy.php PHP for RedHat/CentOS/Fedora/Debian/Ubuntu.
|
||
|
geerlingguy.pimpmylog Pimp my Log installation for Linux
|
||
|
geerlingguy.solr Apache Solr for Linux.
|
||
|
geerlingguy.supervisor Supervisor (process state manager) for Linux.
|
||
|
geerlingguy.svn SVN web server for Linux
|
||
|
geerlingguy.tomcat6 Tomcat 6 for RHEL/CentOS and Debian/Ubuntu.
|
||
|
geerlingguy.varnish Varnish for Linux.
|
||
|
```
|
||
|
|
||
|
|
||
|
* Installer le role apache récupéré.
|
||
|
|
||
|
<!-- .slide: data-state="small-code" -->
|
||
|
```none
|
||
|
$ ansible-galaxy install geerlingguy.apache
|
||
|
|
||
|
- downloading role 'apache', owned by geerlingguy
|
||
|
- downloading role from https://github.com/geerlingguy/ansible-role-apache/archive/3.0.3.tar.gz
|
||
|
- extracting geerlingguy.apache to /home/formationback/.ansible/roles/geerlingguy.apache
|
||
|
- geerlingguy.apache (3.0.3) was installed successfully
|
||
|
```
|
||
|
|
||
|
|
||
|
* Parcourons ensemble la structure des dossiers et notamment le dossier meta.
|
||
|
|
||
|
<!-- .slide: data-state="small-code" -->
|
||
|
```none
|
||
|
$ cat /home/ansible/.ansible/roles/geerlingguy.apache/meta/main.yml
|
||
|
```
|
||
|
```yaml
|
||
|
dependencies: []
|
||
|
|
||
|
galaxy_info:
|
||
|
author: geerlingguy
|
||
|
description: Apache 2.x for Linux.
|
||
|
company: "Midwestern Mac, LLC"
|
||
|
license: "license (BSD, MIT)"
|
||
|
min_ansible_version: 2.4
|
||
|
platforms:
|
||
|
- name: EL
|
||
|
versions:
|
||
|
- all
|
||
|
- name: Fedora
|
||
|
versions:
|
||
|
- all
|
||
|
- name: Amazon
|
||
|
versions:
|
||
|
- all
|
||
|
- name: Debian
|
||
|
versions:
|
||
|
- all
|
||
|
- name: Ubuntu
|
||
|
versions:
|
||
|
- trusty
|
||
|
- xenial
|
||
|
- bionic
|
||
|
- name: Solaris
|
||
|
versions:
|
||
|
- 11.3
|
||
|
galaxy_tags:
|
||
|
- web
|
||
|
- apache
|
||
|
- webserver
|
||
|
- html
|
||
|
- httpd
|
||
|
|
||
|
allow_duplicates: true
|
||
|
```
|
||
|
|
||
|
|
||
|
## Gérer les roles comme des dépendances externes
|
||
|
|
||
|
|
||
|
* Pour ce TP, nous allons réutiliser les roles que vous venez de créer. Pour plus de facilité, les versions finales sont déjà présentes sur le GitLab `https://gitlab.com/a-berthout`.
|
||
|
|
||
|
* Grâce à Ansible Galaxy, dans votre projet actuel, récupérer les roles suivants :
|
||
|
* Apache sur la branche master
|
||
|
* MariaDB sur la branche develop
|
||
|
* Wordpress sur le tag V1.0.0
|