Skip to content
Snippets Groups Projects
Commit 47d3ad8c authored by Vincent Mazenod's avatar Vincent Mazenod
Browse files

attaque ansible

parent fb20a72b
No related branches found
No related tags found
No related merge requests found
Pipeline #3243 passed
content/slides/cri/images/ansible_mgmt.png

46.8 KiB

...@@ -3,6 +3,59 @@ ...@@ -3,6 +3,59 @@
![ansible](images/ansible.png "ansible")<!-- .element width="30%" --> ![ansible](images/ansible.png "ansible")<!-- .element width="30%" -->
## ansible
* outil de
* provisioning
* gestion de config
* déploiemenet d'application
* racheté par RedHat en octobre 2015
* outils équivalents
* puppet, chief, salt ...
## ansible
* écrit en python
* python 2 par défaut
* marche bien en python 3
* virtualenv
## ansible
* prérequis
* sur la machine pilote (mgmt node)
* ansible
* sur le(s) noeud(s)
* une connextion ssh ou PowerShell
* python
## ansible
[![gestion ansible](images/ansible_mgmt.png "gestion ansible")](https://medium.com/formcept/configuration-management-and-continuous-deployment-cd0892dce998)
## terminologie
* **mgmt node** - Ansible management node is the machine where the Ansible is installed & which is responsible for configuration of all server machines.
Inventory:- Inventory is a file which consists of IP Address of all servers on which configuration is to be done.
Playbook: Playbook is used to manage configuration which can be deployed on the remote machines. Playbook is designed in simple human-readable format, so that it becomes easy to understand the code.
Task:- Task is the file where a user defines the steps that he needs to perform on the Playbook.
Module:- Ansible has in-built modules that can be executed directly on remote hosts or through Playbooks. Users can also write their own modules. These modules can control system resources, like services, packages, or files or handle execution of system commands.
Role: Role is used for organizing Playbooks and other files in order to facilitate sharing and reusing portions of a provisioning.
Play: A provisioning executed from start to finish is called a Play.
Facts:Used to get the system information while running the playbook, like network interfaces or operating system.
Handlers: Handlers which are similar to a task, can be used to restart or to stop a service.
ansible all --inventory-file=inventory.ini --module-name ping -u root
* modules
* task * task
* register * register
* debug * debug
...@@ -16,11 +69,13 @@ ...@@ -16,11 +69,13 @@
* --check --diff * --check --diff
* verbosité * verbosité
* tags * tags
* variable (see debug task) * variable (see debug task)
* hierarchie * hierarchie
* from env ou Vault * from env ou Vault
* acces dynamique * acces dynamique
* ansible-vault : utiliser vault * ansible-vault : utiliser vault
* https://docs.ansible.com/ansible/latest/user_guide/playbooks_prompts.html
* plugin * plugin
* callback * callback
* filter * filter
...@@ -29,6 +84,7 @@ ...@@ -29,6 +84,7 @@
* pexpect * pexpect
* remote roles * remote roles
* skeleton https://github.com/mrjk/ansible-skel
### Récupérer les roles nécessaires ### Récupérer les roles nécessaires
......
...@@ -97,6 +97,7 @@ $ vagrant box remove "ubuntu/xenial64" ...@@ -97,6 +97,7 @@ $ vagrant box remove "ubuntu/xenial64"
``` ```
$ vagrant init "ubuntu/bionic64" $ vagrant init "ubuntu/bionic64"
$ vagrant up #--provider=virtualbox $ vagrant up #--provider=virtualbox
$ vagrant provision
$ vagrant ssh $ vagrant ssh
$ vagrant halt $ vagrant halt
$ vagrant suspend $ vagrant suspend
...@@ -170,6 +171,8 @@ Vagrant.configure("2") do |config| ...@@ -170,6 +171,8 @@ Vagrant.configure("2") do |config|
end end
end end
``` ```
https://www.vagrantup.com/docs/provisioning/ansible_common.html
### idéal pour tester les playbooks ### idéal pour tester les playbooks
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment