Controle Ansible
This commit is contained in:
parent
e2b84b2da0
commit
5a4ae55d1f
2
sio2/sisr/ctrlansible/hosts
Normal file
2
sio2/sisr/ctrlansible/hosts
Normal file
@ -0,0 +1,2 @@
|
||||
[user]
|
||||
srv
|
4
sio2/sisr/ctrlansible/resolv.conf
Normal file
4
sio2/sisr/ctrlansible/resolv.conf
Normal file
@ -0,0 +1,4 @@
|
||||
search sio.lan
|
||||
domain sio.lan
|
||||
nameserver 10.121.38.7
|
||||
nameserver 10.121.38.8
|
38
sio2/sisr/ctrlansible/user.yml
Normal file
38
sio2/sisr/ctrlansible/user.yml
Normal file
@ -0,0 +1,38 @@
|
||||
---
|
||||
- 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
|
||||
|
Loading…
x
Reference in New Issue
Block a user