Created
April 22, 2020 16:05
-
-
Save andy722/3e29906e10300b1660906fd870170f00 to your computer and use it in GitHub Desktop.
ansible / delete user
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ansible swarm_dtln -b -m user -a "name=USERNAME state=absent remove=yes force=true" | |
ansible swarm_dtln -b -m replace -a 'backup=yes dest=/etc/ssh/sshd_config regexp=^(AllowUsers.*)\\b(USERNAME)\\b(.*)$ replace=\\1\\3' | |
ansible swarm_dtln -b -m replace -a 'backup=yes dest=/etc/ssh/sshd_config regexp=^(Match.*)\\b(USERNAME\,)\\b(.*)$ replace=\\1\\3' | |
ansible swarm_dtln -b -m service -a "name=sshd state=restarted" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment