-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #640 from cisagov/improvement/create_cyhy_user_dur…
…ing_ami_build Move `cyhy` user creation to AMI build time
- Loading branch information
Showing
9 changed files
with
28 additions
and
51 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- | ||
# The bastion is the only instance that does not need a cyhy user for | ||
# operational functionality. | ||
- hosts: all:!bastion | ||
name: Create the cyhy user and set up SSH access | ||
become: yes | ||
become_method: sudo | ||
tasks: | ||
- name: Create the cyhy user | ||
ansible.builtin.user: | ||
home: /var/cyhy | ||
name: cyhy | ||
shell: /bin/bash | ||
uid: 2048 | ||
register: user_info | ||
|
||
- name: Modify permissions on the home directory | ||
ansible.builtin.file: | ||
mode: 0750 | ||
path: "{{ user_info.home }}" | ||
|
||
- name: Add the SSH public key as an authorized key | ||
ansible.posix.authorized_key: | ||
key: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOreUDnms12MPI0gh7K+YGaESYgC2TY1zA+kSK/g+n5+ cyhy | ||
user: cyhy |
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
This file was deleted.
Oops, something went wrong.
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
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
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