Advertisement
sandervanvugt

Untitled

Aug 25th, 2020
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. [ansible@control webservers]$ cat newhost.sh
  2. #!/bin/bash
  3. ansible ansible3.example.com -m raw -a "yum install python3 -y" -u root --ask-pass
  4. ansible ansible3.example.com -m user -a "name=ansible state=present" -u root --ask-pass
  5. ansible ansible3.example.com -m raw -a "echo password | passwd --stdin ansible" -u root --ask-pass
  6. ssh-copy-id ansible3.example.com
  7. ansible ansible3.example.com -m copy -a "content='ansible ALL=(ALL) NOPASSWD: ALL' dest=/etc/sudoers.d/ansible" -u root --ask-pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement