Système de contrôle de versions, open-source, décentralisé, conçu pour être efficace et rapide.
cp main.c main.c.old
Une bonne pratique Evolix.
$ su
# apt install git
# git --version
git version 2.11.0
$ cd /etc
$ su
# git init
# git status
# git add .
# git commit -m "commit initial"
# echo "127.0.0.1 foo" >> /etc/hosts
# git status
# git diff [HEAD]
# git commit --all --message "Ajout de foo dans /etc/hosts"
# git log
# git show
Le livre Pro Git est incontournable,
pour le débutant comme pour l'expert.
Paquets pour de nombreuses distributions
$ su
# apt install ansible
# ansible --version
ansible 2.2.1.0
config file = /etc/ansible/ansible.cfg
configured module search path = Default w/o overrides
$ ansible localhost --module-name ping
$ ansible localhost --module-name ping --one-line
$ ansible localhost --module-name setup
$ ansible localhost --module-name setup --args "filter=ansible_mem*"
$ ansible localhost --module-name lineinfile --args \
"dest=/etc/hosts regexp=example.com line='192.168.0.25 example.com'"
inventory/
├── group_vars
│ ├── all.yml
│ ├── hypervisors.yml
│ └── proxies.yml
├── hosts
├── hosts-dev
└── host_vars
├── stack01-data01.yml
├── stack01-front01-web01.yml
└── stack01-front01.yml
kvm01 ansible_host=192.168.2.1
kvm02 ansible_host=192.168.2.2
stack01-front01 ansible_host=192.168.2.1 ansible_port=22020
stack01-front01-web01 ansible_host=192.168.2.1 ansible_port=22101
stack01-data01 ansible_host=192.168.2.1 ansible_port=22010
[hypervisors]
kvm01
kvm02
[fronts]
stack01-front01
[dbs]
stack01-data01
[web]
stack01-front01-web01
---
- hosts: localhost
tasks:
- name: example.com in /etc/hosts
lineinfile:
dest: /etc/hosts
regexp: example.com
line: '192.168.0.25 example.com'
state: present
$ ansible-playbook playbook.yml