Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow to disable user logins and to remove SSH keys
Readded old users because they have not been removed from instances, disable their login and remove their SSH keys. Change-Id: I0406e2d339bf30be66f813936b4be8336fc6cbab
- Loading branch information
Showing
3 changed files
with
47 additions
and
42 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,5 @@ | ||
- name: Create temporary key file | ||
tempfile: | ||
state: file | ||
prefix: infra-setup- | ||
register: keyfile | ||
|
||
- name: generate file with public keys from users | ||
shell: | | ||
echo {{ item.1 }} >> {{ keyfile.path }} | ||
loop: "{{ users|subelements('keys') }}" | ||
changed_when: true | ||
|
||
- name: Create Keypair from generated public key | ||
os_keypair: | ||
state: present | ||
name: "{{ default_keypair_name }}" | ||
public_key_file: "{{ keyfile.path }}" | ||
public_key: "{{ users|map(attribute='keys', default='')|join('\n') }}" |
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