39 lines
900 B
YAML
39 lines
900 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: "{{ password }}"
|
|
|
|
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
|
|
|