From b5dde2437431af85d234b4bbe59b2e12ecefdc93 Mon Sep 17 00:00:00 2001 From: Thomas Constans Date: Mon, 14 Nov 2022 16:37:30 +0100 Subject: [PATCH] instructions abr --- Readme | 24 ------------- Readme.md | 29 ++++++++++++++++ apache.yml | 7 ---- myapache4/README.md | 45 ------------------------ myapache4/defaults/main.yml | 4 --- myapache4/files/index.html | 1 - myapache4/files/info.php | 2 -- myapache4/handlers/main.yml | 11 ------ myapache4/meta/main.yml | 57 ------------------------------ myapache4/tasks/main.yml | 58 ------------------------------- myapache4/tasks/php.yml | 20 ----------- myapache4/templates/vhost.conf.jj | 24 ------------- myapache4/tests/inventory | 2 -- myapache4/tests/test.yml | 5 --- myapache4/vars/centos.yml | 1 - myapache4/vars/debian.yml | 7 ---- myapache4/vars/main.yml | 15 -------- myapache4/vars/redhat.yml | 7 ---- 18 files changed, 29 insertions(+), 290 deletions(-) delete mode 100644 Readme create mode 100644 Readme.md delete mode 100644 apache.yml delete mode 100644 myapache4/README.md delete mode 100644 myapache4/defaults/main.yml delete mode 100644 myapache4/files/index.html delete mode 100644 myapache4/files/info.php delete mode 100644 myapache4/handlers/main.yml delete mode 100644 myapache4/meta/main.yml delete mode 100644 myapache4/tasks/main.yml delete mode 100644 myapache4/tasks/php.yml delete mode 100644 myapache4/templates/vhost.conf.jj delete mode 100644 myapache4/tests/inventory delete mode 100644 myapache4/tests/test.yml delete mode 120000 myapache4/vars/centos.yml delete mode 100644 myapache4/vars/debian.yml delete mode 100644 myapache4/vars/main.yml delete mode 100644 myapache4/vars/redhat.yml diff --git a/Readme b/Readme deleted file mode 100644 index 4806bc9..0000000 --- a/Readme +++ /dev/null @@ -1,24 +0,0 @@ - -Tâche: Utiliser des conditions -Condition: très souvent ;) -Norme: éditeur de texte, modules template - -Objectif: Ajouter le support de php à la demande - -Rajouter une variable booleenne apache_use_php. - -Positionnée à "true", cette variable entraîne: - - l'installation du paquet php-fpm - - le lancement et l'activation du service php-fpm - - l'ajout dans la configuration apache des directives suivantes: - - - SetHandler proxy:fcgi://localhost:9000 - - - -Prérequis: - * On peut se baser sur l'exercice précédent. - -Validation: le playbook s'exécute correctement sur nos cibles. -Chaque cible héberge plusieurs sites différents. \ No newline at end of file diff --git a/Readme.md b/Readme.md new file mode 100644 index 0000000..6a5605e --- /dev/null +++ b/Readme.md @@ -0,0 +1,29 @@ +# Conditions + +## Prérequis: + +Récupérer la solution de l'atelier apache_handlers : https://infra.opendoor.fr/git/tom/sib_12_handlers + +```bash +cd +git clone -b solution https://infra.opendoor.fr/git/tom/sib_12_handlers sib_conditions +cd sib_conditions +``` +## Atelier 1: Ajouter le support de php à la demande + +Rajouter une variable booleenne apache_use_php. + +Positionnée à "true", cette variable entraîne: + - l'installation du paquet php-fpm + - le lancement et l'activation du service php-fpm + - l'ajout dans la configuration apache des directives suivantes: + + + SetHandler proxy:fcgi://localhost:9000 + + + +Prérequis: + * On peut se baser sur l'exercice précédent. + +Validation: le playbook s'exécute correctement sur nos cibles. Suivant la valeur de apache_use_php, le service php-fpm est actif sur la cible \ No newline at end of file diff --git a/apache.yml b/apache.yml deleted file mode 100644 index f82b6b0..0000000 --- a/apache.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- -- name: install apache via ansible playbook - hosts: test - user: ansible - become: true - roles: - - myapache4 diff --git a/myapache4/README.md b/myapache4/README.md deleted file mode 100644 index f41bd0d..0000000 --- a/myapache4/README.md +++ /dev/null @@ -1,45 +0,0 @@ -Role Name -========= - -Rôle de deploiement apache sur une centos. - -1 seul vhost - -Requirements ------------- - -None - -Role Variables --------------- -apache_user_php - default False -http_port: 80 -servername: orsys.fr -serveralias: "www.{{ servername }}" -documentroot: /var/www/html/orsys.fr -accesslog: /var/log/httpd/access_orsys.fr_log -errorlog: /var/log/httpd/error_orsys.fr_log - -Dependencies ------------- - -None - -Example Playbook ----------------- - -Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: - - - hosts: servers - roles: - - { myapache } - -License -------- - -BSD - -Author Information ------------------- - -Thomas Constans diff --git a/myapache4/defaults/main.yml b/myapache4/defaults/main.yml deleted file mode 100644 index 465f508..0000000 --- a/myapache4/defaults/main.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -# defaults file for myapache -http_port: 80 -use_php: false \ No newline at end of file diff --git a/myapache4/files/index.html b/myapache4/files/index.html deleted file mode 100644 index 416474e..0000000 --- a/myapache4/files/index.html +++ /dev/null @@ -1 +0,0 @@ -

hello World

\ No newline at end of file diff --git a/myapache4/files/info.php b/myapache4/files/info.php deleted file mode 100644 index 1868a00..0000000 --- a/myapache4/files/info.php +++ /dev/null @@ -1,2 +0,0 @@ - - ServerName {{ vhost.servername|lower }} - ServerAlias {{ vhost.serveralias }} - DocumentRoot {{ vhost.documentroot }} - CustomLog {{ vhost.accesslog }} combined - ErrorLog {{ vhost.errorlog }} - - Options none - Allowoverride none - Require all denied - - {% if use_php %} - - SetHandler proxy:fcgi://localhost:9000 - - {% endif %} - - - Options {{ vhost.documentrootoptions|default( "none" ) }} - Require all granted - - -{% endfor %} \ No newline at end of file diff --git a/myapache4/tests/inventory b/myapache4/tests/inventory deleted file mode 100644 index 878877b..0000000 --- a/myapache4/tests/inventory +++ /dev/null @@ -1,2 +0,0 @@ -localhost - diff --git a/myapache4/tests/test.yml b/myapache4/tests/test.yml deleted file mode 100644 index 797e379..0000000 --- a/myapache4/tests/test.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -- hosts: localhost - remote_user: root - roles: - - myapache \ No newline at end of file diff --git a/myapache4/vars/centos.yml b/myapache4/vars/centos.yml deleted file mode 120000 index ba2f905..0000000 --- a/myapache4/vars/centos.yml +++ /dev/null @@ -1 +0,0 @@ -redhat.yml \ No newline at end of file diff --git a/myapache4/vars/debian.yml b/myapache4/vars/debian.yml deleted file mode 100644 index 03ceb9d..0000000 --- a/myapache4/vars/debian.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- -apache_conf_dir: /etc/apache2/sites-enabled -apache_log_dir: /var/log/apache2 -package_name: apache2 -service_name: apache2 -apache_user: www-data -apache_group: www-data diff --git a/myapache4/vars/main.yml b/myapache4/vars/main.yml deleted file mode 100644 index 1fb822e..0000000 --- a/myapache4/vars/main.yml +++ /dev/null @@ -1,15 +0,0 @@ ---- -# vars file for myapache -http_port: 80 -apache_vhosts: -- servername: ORSYS.Fr - serveralias: www.orsys.fr - documentroot: /var/www/html/orsys.fr - accesslog: "{{ apache_log_dir }}/access_orsys.fr_log" - errorlog: "{{ apache_log_dir }}/error_orsys.fr_log" -- servername: thomas.fr - serveralias: www.thomas.fr - documentroot: /var/www/html/thomas.fr - accesslog: "{{ apache_log_dir }}/access_thomas.fr_log" - errorlog: "{{ apache_log_dir }}/error_thomas.fr_log" - documentrootoptions: indexes \ No newline at end of file diff --git a/myapache4/vars/redhat.yml b/myapache4/vars/redhat.yml deleted file mode 100644 index c77ed08..0000000 --- a/myapache4/vars/redhat.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- -apache_conf_dir: /etc/httpd/conf.d/ -apache_log_dir: /var/log/httpd -package_name: httpd -service_name: httpd -apache_user: apache -apache_group: apache