fin mon premeier playbook
This commit is contained in:
32
premier_playbook
Normal file
32
premier_playbook
Normal file
@@ -0,0 +1,32 @@
|
||||
- name: premier playbook
|
||||
hosts: master
|
||||
become: true
|
||||
|
||||
tasks:
|
||||
- name: authorisation ssh user ansible
|
||||
lineinfile:
|
||||
dest: /etc/ssh/sshd_config
|
||||
state: present
|
||||
regexp: '^#Match User anoncvs'
|
||||
line: 'Match User ansible'
|
||||
- name: authorisation source ssh user ansible
|
||||
blockinfile:
|
||||
path: /etc/ssh/sshd_config
|
||||
marker: "#<!-- {mark} ANSIBLE MANAGED BLOCK -->"
|
||||
insertafter: '^Match User ansible'
|
||||
block: |
|
||||
AllowUsers ansible@192.168.14.1
|
||||
PasswordAuthentication no
|
||||
- name: redémarrage service sshd
|
||||
service:
|
||||
name: ssh
|
||||
state: restarted
|
||||
- name: installer le service bind
|
||||
apt:
|
||||
update_cache: yes
|
||||
name: bind9
|
||||
state: present
|
||||
- name: verrouillage logon user ansible
|
||||
user:
|
||||
user: ansible
|
||||
password_lock: true
|
||||
Reference in New Issue
Block a user