From 72ff4864baa89e570860550f0888c57c7a94aa99 Mon Sep 17 00:00:00 2001 From: Thomas Constans Date: Tue, 22 Sep 2020 22:49:24 +0200 Subject: [PATCH] initial commit --- Readme.md | 22 +++++++++++++++++++ group_vars/cibles.yml | 1 + group_vars/machines | 1 + ...mue-sib-centos-01.formation.actilis.fr.yml | 1 + host_vars/m4 | 1 + inventaire | 12 ++++++++++ 6 files changed, 38 insertions(+) create mode 100644 Readme.md create mode 100644 group_vars/cibles.yml create mode 100644 group_vars/machines create mode 100644 host_vars/amue-sib-centos-01.formation.actilis.fr.yml create mode 100644 host_vars/m4 create mode 100644 inventaire diff --git a/Readme.md b/Readme.md new file mode 100644 index 0000000..43a7fd7 --- /dev/null +++ b/Readme.md @@ -0,0 +1,22 @@ +INVENTAIRE +---------- + +*Tâche*: Mettre au point un fichier d'inventaire simple + +*Condition*: pour utiliser ansible + +*Norme*: vim, /etc/ansible/hosts + +*Pratique:* + +Créer un fichier d'inventaire contenant: + + 1. les machines cibles précédemment mises en place + 2. un groupe "centos" ne contenant que la machine virtuelle centos1. + 2. un groupe "debian" ne contenant que la machine virtuelle debian1. + 3. un groupe "cibles" contenant les machines des groupes debian et centos + +*Performance*: +```bash +ansible-inventory -i inventaire --graph +``` \ No newline at end of file diff --git a/group_vars/cibles.yml b/group_vars/cibles.yml new file mode 100644 index 0000000..fc66475 --- /dev/null +++ b/group_vars/cibles.yml @@ -0,0 +1 @@ +myvar: "variable de groupe" \ No newline at end of file diff --git a/group_vars/machines b/group_vars/machines new file mode 100644 index 0000000..c73d74e --- /dev/null +++ b/group_vars/machines @@ -0,0 +1 @@ +var_machine: foo \ No newline at end of file diff --git a/host_vars/amue-sib-centos-01.formation.actilis.fr.yml b/host_vars/amue-sib-centos-01.formation.actilis.fr.yml new file mode 100644 index 0000000..377de68 --- /dev/null +++ b/host_vars/amue-sib-centos-01.formation.actilis.fr.yml @@ -0,0 +1 @@ +myvar: "valeur specifique à amue-sib-centos-01.formation.actilis.fr" \ No newline at end of file diff --git a/host_vars/m4 b/host_vars/m4 new file mode 100644 index 0000000..20e9ff3 --- /dev/null +++ b/host_vars/m4 @@ -0,0 +1 @@ +foo: bar diff --git a/inventaire b/inventaire new file mode 100644 index 0000000..5ff1a7d --- /dev/null +++ b/inventaire @@ -0,0 +1,12 @@ +# /etc/ansible/hosts +[debian] +amue-sib-debian-01.formation.actilis.fr + + +[centos] +amue-sib-centos-01.formation.actilis.fr + + +[cibles:children] +debian +centos \ No newline at end of file