klips/ansible/roles/core/README.md

77 lines
2.1 KiB
Markdown
Raw Normal View History

2019-08-31 06:47:50 +00:00
core
2019-08-29 09:35:19 +00:00
=========
2019-08-31 06:47:50 +00:00
A simple role for configuring a set of packages / settings on a new Ubuntu host using Ansible.
2019-08-31 07:08:24 +00:00
### Packages Added / Configured
Git
- Configure / set user name and email
SSH
- MOTD (Template, replacable, displayed on login.)
- PAM (Template, replacable, authusers file to bypass)
- authusers (Add users to file to bypass PAM settings)
Vim
- Install Vim
- Run https://github.com/shaunrd0/klips/scripts/setup-vim.sh
2019-08-29 09:35:19 +00:00
Requirements
------------
2019-08-31 06:47:50 +00:00
Expects that the host is using apt package manager, and running a Debian / Ubuntu system.
2019-08-29 09:35:19 +00:00
Role Variables
--------------
2019-08-31 06:47:50 +00:00
Found in `.../roles/core/defaults/main.yml`
```
---
packages: [git, vim, ssh]
ssh_port: 22
auth_methods: "publickey,keyboard-interactive"
git_email: "user@domain.com"
git_name: "First Last"
hostname: "localhost"
domain_name: "www.localhost.com"
```
2019-08-29 09:35:19 +00:00
2019-08-31 07:01:59 +00:00
#### Basic package installation variable -
2019-08-29 09:35:19 +00:00
2019-08-31 06:47:50 +00:00
packages - A list of packages to install when running core configuration. Add package to this list and it will be installed on your new host. Further configuration will need to be done manually, unless the role is modified otherwise.
2019-08-29 09:35:19 +00:00
2019-08-31 07:01:59 +00:00
#### SSH Configuration Variables -
2019-08-31 06:47:50 +00:00
ssh_port - The port to configure SSH to listen on
auth_methods - Authentication methods to allow SSH base configuration to use. Otherwise, specify a match within the sshd_config
2019-08-31 07:01:59 +00:00
#### MOTD Configuration Variables -
2019-08-29 09:35:19 +00:00
2019-08-31 06:47:50 +00:00
hostname - The hostname of the box you are using, used in the MOTD for a host-specific greeting, so you know which host you are logged into when glancing between terminals.
2019-08-29 09:35:19 +00:00
2019-08-31 06:47:50 +00:00
domain_name - The domain name, if available, associated with this host.
2019-08-31 07:01:59 +00:00
#### Git Configuration Variables -
2019-08-31 06:47:50 +00:00
git_email - Email address to configure with Git
git_name - Full name to configure with Git (First Last || Shaun Reed)
Example Playbook
----------------
2019-08-29 09:35:19 +00:00
2019-08-31 06:47:50 +00:00
After configuring the appropriate variables in `.../defaults/main.yml`, create the following play.yml and run `ansible-playbook play.yml` after setting the correct hosts in your `/etc/ansible/hosts` file.
2019-08-29 09:35:19 +00:00
2019-08-31 06:47:50 +00:00
```
---
- hosts: core
become: yes
roles:
- core
```
2019-08-29 09:35:19 +00:00
2019-08-31 06:47:50 +00:00
Feel free to rename play.yml, hosts group name, etc. Just be sure it reflects to your settings in the related files.
2019-08-29 09:35:19 +00:00