2021-11-24 09:49:30 +01:00

39 lines
928 B
YAML

---
- 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') }}"
register: mavar
- name: debug
debug:
msg: "{{ mavar }}"
- name: desinstaller le paquet wpasupplicant
apt:
name: wpasupplicant
state: absent
- name: desinstaller le paquet rpcbind
apt:
name: rpcbind
state: absent
- name: copier le fichier /etc/resolv.conf
copy:
src: resolv.conf
dest: /etc/resolv.conf
- name: rajouter PermitRootLogin prohibit-password dans /etc/ssh/sshd_config
lineinfile:
path: /etc/ssh/sshd_config
line: 'PermitRootLogin prohibit-password'
create: yes