diff --git a/sio2/sisr2/40-Ansible/hosts b/sio2/sisr2/40-Ansible/hosts new file mode 100644 index 0000000..28c495b --- /dev/null +++ b/sio2/sisr2/40-Ansible/hosts @@ -0,0 +1,6 @@ +[adm] +infra + +[web] +web1 +web2 diff --git a/sio2/sisr2/40-Ansible/index.html b/sio2/sisr2/40-Ansible/index.html new file mode 100644 index 0000000..ac28f91 --- /dev/null +++ b/sio2/sisr2/40-Ansible/index.html @@ -0,0 +1 @@ +Coucou diff --git a/sio2/sisr2/40-Ansible/syslog-cli.yml b/sio2/sisr2/40-Ansible/syslog-cli.yml new file mode 100644 index 0000000..07138f8 --- /dev/null +++ b/sio2/sisr2/40-Ansible/syslog-cli.yml @@ -0,0 +1,22 @@ +--- +- hosts: web + tasks: + - name: decommente l'option ForwardToSyslog + replace: + path: /etc/systemd/journald.conf + regexp: '^#ForwardToSyslog=yes' + replace: 'ForwardToSyslog=yes' + backup: true + notify: Restart systemd-journald.service + + handlers: + - name: Restart systemd-journald.service + service: + name: systemd-journald.service + state: restarted + + - name: Ajoute l'indication de serveur syslog distant si elle n'est pas presente + lineinfile: + path: /etc/rsyslog.conf + line: '*.* @192.168.0.42:514' + create: yes diff --git a/sio2/sisr2/40-Ansible/syslog.yml b/sio2/sisr2/40-Ansible/syslog.yml new file mode 100644 index 0000000..81c5f2c --- /dev/null +++ b/sio2/sisr2/40-Ansible/syslog.yml @@ -0,0 +1,25 @@ +--- +- hosts: infra + tasks: + - name: decommente le chargement du module imudp dans rsyslog.conf + replace: + path: /etc/rsyslog.conf + regexp: '^#module\(load="imudp"\)' + replace: 'module(load="imudp")' + backup: true + notify: Restart Rsyslog + + - name: decommente le chargement du module imudp dans rsyslog.conf + replace: + path: /etc/rsyslog.conf + regexp: '^#input\(type="imudp" port="514"\)' + replace: 'input(type="imudp" port="514")' + backup: true + notify: Restart Rsyslog + + handlers: + - name: Restart Rsyslog + service: + name: rsyslog + state: restarted + diff --git a/sio2/sisr2/40-Ansible/web.yml b/sio2/sisr2/40-Ansible/web.yml new file mode 100644 index 0000000..9daa8e3 --- /dev/null +++ b/sio2/sisr2/40-Ansible/web.yml @@ -0,0 +1,24 @@ +--- +- name: mon playbook + hosts: web + tasks: + + - name: installation apache2 + apt : + name: apache2 + state: present + + - name: installation php-mbstring + apt : + name: php + state: present + + - name: installation php-mbstring + apt : + name: php-mbstring + state: present + + - name: Copie index.html + copy: + src: index.html + dest: /var/www/html/