added readme

This commit is contained in:
2021-02-05 10:46:20 +01:00
parent 02e6dfecf9
commit f4d2dbc724
+52
View File
@@ -0,0 +1,52 @@
# Initial Server Setup on Debian based systems
This role will execute a initial server setup for debian based systems. A number of containers will be created with the options specified in the `vars/defaults.yml` variable file.
## Settings
- `create_user`: the name of the remote sudo user to create.
- `copy_local_key`: path to a local SSH public key that will be copied as authorized key for the new user. By default, it copies the key from the current system user running Ansible.
- `sys_packages`: array with list of packages that should be installed.
## Running this Role
Quick Steps:
### 1. Create a playbook
```shell
nano /etc/ansible/playbooks/setup-playbook.yml
```
Drop the following in that playbook file:
```yml
#playbooks/setup-playbook.yml
---
- hosts: all
become: true
roles:
- cael.init
```
### 2. Customize Options
```shell
nano vars/default.yml
```
```yml
#vars/default.yml
---
create_user: sammy
copy_local_key: "{{ lookup('file', lookup('env','HOME') + '/.ssh/id_rsa.pub') }}"
sys_packages: [ 'curl', 'vim', 'git', 'ufw']
```
### 3. IMPORTANT STEP - ssh-copy-id
```commmand
ssh-copy-id user@targethost
```
### 4. Run the Playbook
```command
ansible-playbook -l [target] -i [inventory file] -u [remote user] playbook.yml
```