2
0

rajout exercice "commandes adhoc"

This commit is contained in:
2018-06-27 15:26:33 +02:00
parent d1b1a95d47
commit b49ef55224

6
6_adhoc.txt Normal file
View File

@@ -0,0 +1,6 @@
ansible centos2 -u root -k -m user -a "user=ansible password={{ 'ansible'|password_hash('sha512') }} create_home=yes home=/home/ansible"
ansible centos2 -u root -k -m lineinfile -a "path=/etc/sudoers.d/ansible state=present create=yes line='ansible ALL=(ALL) NOPASSWD: ALL'"
ansible centos2 -u root -k -m authorized_key -a "key={{ lookup( 'file', '/root/.ssh/id_rsa.pub') }} user=ansible"