This role creates a user, sets up his SSH key, creates custom directories, adds user to sudo and installs source files.
If you are running this from a Mac, you need to install passlib.
pip install passlib
.
The following variables can be set
recon_user_include_recon_profile
.- By default, it is set to
true
- It will install recon profile.
- Example value
recon_user_include_recon_profile: true
- By default, it is set to
recon_user_authorized_key
.- By default, it is set to
files/id_rsa.pub
. - Points to where the SSH key is.
- Example value
authorized_key: files/id_rsa.pub
- By default, it is set to
recon_user_username
- By default it is set to
recon
. - It controls the preferred username.
- Example value
recon_user_username: recon
.
- By default it is set to
recon_user_preferred_shell
- By default it is set to
/bin/bash
. - It controls the default shell for the user.
- Example value
recon_user_preferred_shell: /bin/bash
- Updating this will require you to update
startup_file
, i.e.
startup_file: Ubuntu: .zsh
- By default it is set to
recon_user_home_dir
- By default it is set to
/home/{{ recon_user_username }}/
- It controls the preferred home for user.
- Example value
recon_user_home_dir: "/home/{{ recon_user_username }}"
- By default it is set to
recon_user_group_membership
- By default, it is set to
sudo
. - It controls the privileged group.
- Example value
recon_user_group_membership: 'sudo'
- By default, it is set to
recon_user_custom_dirs
- By default, it contains only
targets
. - It can contain as many directories as you want.
- Example value
recon_user_custom_dirs: - targets - whatever
- By default, it contains only
recon_source_files
.- By default, it will install recon profile.
- It can contain as many files as you want.
- Example
recon_source_files: recon_tools: path: '.recon_tools' url: 'https://raw.githubusercontent.com/nahamsec/recon_profile/master/bash_profile'
Generally, you don't need to change anything but this is just me.
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
- hosts: servers
roles:
- { role: frite.recon_user }
Installation is as easy as ansible-galaxy install frite.recon_user
Issues are welcome and so are code contributions.
Reg. code contributions, your code needs to pass all tests,
i.e. molecule test
must succeed.
BSD