From 224c9fbbe9a8d2f0e12dbc3686130b2f67f6cc5f Mon Sep 17 00:00:00 2001 From: mathis Date: Thu, 24 Nov 2022 10:01:03 +0100 Subject: [PATCH] Ajout --- sio2/sisr2/control/Ansible/config | 3 ++ sio2/sisr2/control/Ansible/hosts | Bin 0 -> 1075 bytes sio2/sisr2/control/Ansible/local.yml | 43 ++++++++++++++++++++++++++ sio2/sisr2/control/Ansible/resolv.txt | 4 +++ 4 files changed, 50 insertions(+) create mode 100644 sio2/sisr2/control/Ansible/config create mode 100644 sio2/sisr2/control/Ansible/hosts create mode 100644 sio2/sisr2/control/Ansible/local.yml create mode 100644 sio2/sisr2/control/Ansible/resolv.txt diff --git a/sio2/sisr2/control/Ansible/config b/sio2/sisr2/control/Ansible/config new file mode 100644 index 0000000..1533947 --- /dev/null +++ b/sio2/sisr2/control/Ansible/config @@ -0,0 +1,3 @@ +host srv + user root + hostname 192.168.0.23 diff --git a/sio2/sisr2/control/Ansible/hosts b/sio2/sisr2/control/Ansible/hosts new file mode 100644 index 0000000000000000000000000000000000000000..25423bdc5b7c330d8c1f47f53a7aca4a282f12a4 GIT binary patch literal 1075 zcmV-31kC#%iwFP!000001MQVtZ{j!}tbb;Im6ltXmw=h#~p->19J8}{y zG33_R2_e6J9F}&VQ|(BzJ1ec^PeO^0&pAFg=Muy=4C==)xcPMm3{_E1PsZD))Dl`Z zq9V&JRTfl<$wg5S3z_CN8s~Oz6yR|Kj6GB z%O82j!Cja-+n#-B&sIoEKJ_$;4Qe-pRj8+frK1keB#8Q2b1iQy#m)4mwzWd8+6{Br zndVbJLj`po2kZ5NZq8lPl=|ypl$&}fKZ>T|v~-hpyTg?QXObFzUJvhDeL+zUpL7Xz z*QV9-%YEW)7F+R?q2s59-pD-Z^HY0(CmUIb56k_y2+Go$pd_CSlzZj=4r@hkYaG|c z{cIWdW3L=Ny9;Tc8e_X~lV`D;x5+qfX=F8T&4%;6*_*3wHi(v6ay&e_+vB~u+wOE9 zHT{wP*cd6M?PXeK#~jOK#8G&x`THVz4Nm>0vo-YDgaGiq)0wdV-dR zD+Sqp5H4Jz4A(Q`{y1DTh1hobUSHRY{$MPGo5`X%7&oA)B-4>JUiR)rdux>$>l~G< zp#wLCjt_epJ}NHlmqKdUzk{lc{Bcgd%Vg~%f+Grp08-4#@W3h}OOgQFFrolakR~?E zap&FQN}#=m9=fitD-XY2*}o<-v`%?^5ym8Tu**zNL9jHBgZ$ki?KpWY6y`3qJD}e9 zOTSJF`nuyFLRontmUHJ_JC59|Dzz!jQF^)<5X2si0Av*w``E&?_R<(m4g(w^9Jx3^ z-;TaIf>mMlbG}rEVDCaHMII_x>-hNR9Hk+q3wGMLI_%?xQsut`KD^QRK9~;|Ht)2A zD5ltby`5ThjcmlwQ}e0XDvX=}rKEFl370A-uPDv2{pO2S|Lpqvoz0MQ`_ujZ+c*0c zhsqm%F#oG@|91YXQj5?3{{n(wYWvlgs|PT;b>a}Rlz&-PiC5(!t4~p=i;`HE+x6D_ t;`YxcA&0}^a5x+ehr{7;I2;a#!{Kl^91e%W;c)&jUjcqG4I}_40082q3^@P* literal 0 HcmV?d00001 diff --git a/sio2/sisr2/control/Ansible/local.yml b/sio2/sisr2/control/Ansible/local.yml new file mode 100644 index 0000000..0e07635 --- /dev/null +++ b/sio2/sisr2/control/Ansible/local.yml @@ -0,0 +1,43 @@ +--- +- name: mon playbook + hosts: srv + tasks: + + - name: Ajout utilisateur sioadm + ansible.builtin.user: + name: sioadm + password: sioadm + uid: 1040 + group: sudo + shell: /bin/bash + + - name: Ajout key publique ssh + ansible.posix.authorized_key: + user: sioadm + state: present + key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCczAluP96RmQK4/0L2XtjZ6XOWd4cFUxTcHLLOWYvQ3+nmjyguK/5wN6bR5hvFuYis1zk0xzZSOzxiodtNUOajfjWc1H3ryi6faM8NUe5YQ7hHgediBardZCcw8OUe2pICAtiQtc/0UmGrETd6EeMlnDA5W3Xb4fuGV8bUef6Bmv3dNvNhuextfSEWWKGYPfYY2DWxHvYGz3S1YQd7GYtBBFUbaO26mJWF+7D044wIG2eBWYb7hzkpgXRZ1IQGiV/G/ug2JV8EiMX34owTkLxlzzbMepvOE4949+iAxCZQyWQ9OTlhLgzHqfR2E6QLcxfpq1Bv8sLv7AsUP7OFPkYCP6fuEnTZsywVfZy96jZjGhe5hHGS/H4YcgApH8aCcQSxPlQ8+FQ1b38P8qRLKRERzqtwTN5Ae3HG4bB2+C0AvmU4echlmRfs4FWOQ9yFR50ocdDgDGAQDEL0mXMR5EL/aY4pNH2LTC+HkbUuQWvezUFdaXxGiwktmS4ftDz0rbc= root@ansible + + - name: Desintallation wpasupplicant et rpcbind + ansible.builtin.package: + name: wpasupplicant, rpcbind + state: absent + + - name: Modification resolv + ansible.builtin.copy: + src: ./resolv.txt + dest: /etc/resolv.conf + + - name: Activer root login a prohibit-password + lineinfile: + dest: /etc/ssh/sshd_config + regexp: '^PermitRootLogin' + line: "PermitRootLogin prohibit-password" + state: present + notify: + - restart ssh + + handlers: + - name: restart ssh + service: + name: sshd + state: restarted diff --git a/sio2/sisr2/control/Ansible/resolv.txt b/sio2/sisr2/control/Ansible/resolv.txt new file mode 100644 index 0000000..352c7b7 --- /dev/null +++ b/sio2/sisr2/control/Ansible/resolv.txt @@ -0,0 +1,4 @@ +search sio.lan +domain sio.lan +nameserver 10.121.38.7 +nameserver 10.121.38.8