diff --git a/6_adhoc.txt b/6_adhoc.txt new file mode 100644 index 0000000..5565025 --- /dev/null +++ b/6_adhoc.txt @@ -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" +