DS ansible
This commit is contained in:
parent
8dde9a9e9f
commit
b922c7b009
4
sio2/ct-ansible/hosts
Normal file
4
sio2/ct-ansible/hosts
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
[user]
|
||||||
|
srv
|
||||||
|
|
||||||
|
|
36
sio2/ct-ansible/utilisateur.yml
Normal file
36
sio2/ct-ansible/utilisateur.yml
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
---
|
||||||
|
- hosts: srv
|
||||||
|
vars:
|
||||||
|
password: Azerty1+
|
||||||
|
tasks:
|
||||||
|
|
||||||
|
- name: creation de l'utilisateur sioadm
|
||||||
|
user:
|
||||||
|
name: sioadm
|
||||||
|
state: present
|
||||||
|
generate_ssh_key: yes
|
||||||
|
uid: 1200
|
||||||
|
groups: sudo
|
||||||
|
append: yes
|
||||||
|
password: "{{ 'Azerty1+' | password_hash('sha512') }}"
|
||||||
|
|
||||||
|
- name: desinstallation du paquet wpasupplicant
|
||||||
|
apt:
|
||||||
|
name: wpasupplicant
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
- name: desinstallation du paquet rpcbind
|
||||||
|
apt:
|
||||||
|
name: rpcbind
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
- name: copie du fichier /etc/resolv.conf
|
||||||
|
copy:
|
||||||
|
src: resolv.conf
|
||||||
|
dest: /etc/resolv.conf
|
||||||
|
|
||||||
|
- name: ajout de la ligne PermitRootLogin prohibit-password dans /etc/ssh/sshd_config
|
||||||
|
lineinfile:
|
||||||
|
path: /etc/ssh/sshd_config
|
||||||
|
line: 'PermitRootLogin prohibit-password'
|
||||||
|
create: yes
|
Loading…
x
Reference in New Issue
Block a user