Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [ansible@control webservers]$ cat newhost.sh
- #!/bin/bash
- ansible ansible3.example.com -m raw -a "yum install python3 -y" -u root --ask-pass
- ansible ansible3.example.com -m user -a "name=ansible state=present" -u root --ask-pass
- ansible ansible3.example.com -m raw -a "echo password | passwd --stdin ansible" -u root --ask-pass
- ssh-copy-id ansible3.example.com
- 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