From a7798332abdeb8314a8af830ea9b448b20b99f22 Mon Sep 17 00:00:00 2001 From: Thomas Constans Date: Fri, 23 Nov 2018 15:50:49 +0100 Subject: [PATCH] mise au point exercices --- 17.3_variable/host_vars/cible1 | 18 ++++++++++++++++++ 17.3_variable/myapache3/vars/centos.yml | 3 +++ 17.3_variable/myapache3/vars/debian.yml | 3 +++ 6_adhoc.txt | 6 +++--- 4 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 17.3_variable/host_vars/cible1 create mode 100644 17.3_variable/myapache3/vars/centos.yml create mode 100644 17.3_variable/myapache3/vars/debian.yml diff --git a/17.3_variable/host_vars/cible1 b/17.3_variable/host_vars/cible1 new file mode 100644 index 0000000..b1f06c9 --- /dev/null +++ b/17.3_variable/host_vars/cible1 @@ -0,0 +1,18 @@ + +apache_vhosts: +- servername: orsys.fr + serveralias: + - www.orsys.fr + - www.orsys.com + - orsys.com + documentroot: /var/www/html/orsys.fr + accesslog: /var/log/httpd/access_orsys.fr_log + errorlog: /var/log/httpd/error_orsys.fr_log +- servername: thomas.fr + serveralias: + - www.thomas.fr + - thomas.org + - www.thomas.org + documentroot: /var/www/html/thomas.fr + accesslog: /var/log/httpd/access_thomas.fr_log + errorlog: /var/log/httpd/error_thomas.fr_log \ No newline at end of file diff --git a/17.3_variable/myapache3/vars/centos.yml b/17.3_variable/myapache3/vars/centos.yml new file mode 100644 index 0000000..b59da74 --- /dev/null +++ b/17.3_variable/myapache3/vars/centos.yml @@ -0,0 +1,3 @@ +apache_package_name: httpd +apache_service_name: httpd +apache_conf_dir: /etc/httpd/conf.d diff --git a/17.3_variable/myapache3/vars/debian.yml b/17.3_variable/myapache3/vars/debian.yml new file mode 100644 index 0000000..72dd9de --- /dev/null +++ b/17.3_variable/myapache3/vars/debian.yml @@ -0,0 +1,3 @@ +apache_package_name: apache2 +apache_service_name: apache2 +apache_conf_dir: /etc/apache2/sites-enabled/ diff --git a/6_adhoc.txt b/6_adhoc.txt index 5565025..0095f5b 100644 --- a/6_adhoc.txt +++ b/6_adhoc.txt @@ -1,6 +1,6 @@ -ansible centos2 -u root -k -m user -a "user=ansible password={{ 'ansible'|password_hash('sha512') }} create_home=yes home=/home/ansible" +ansible all -u root -k -m user -a "user=ansible password={{ 'ansible'|password_hash('sha512') }} create_home=yes home=/home/ansible" -ansible centos2 -u root -k -m lineinfile -a "path=/etc/sudoers.d/ansible state=present create=yes line='ansible ALL=(ALL) NOPASSWD: ALL'" +ansible all -u root -k -m lineinfile -a "path=/etc/sudoers.d/ansible state=present create=yes line='ansible ALL=(ALL) NOPASSWD: ALL' validate='/usr/sbin/visudo -cf %s'" -ansible centos2 -u root -k -m authorized_key -a "key={{ lookup( 'file', '/root/.ssh/id_rsa.pub') }} user=ansible" +ansible all -u root -k -m authorized_key -a "key={{ lookup( 'file', '/root/.ssh/id_rsa.pub') }} user=ansible"