All Projects → humiaozuzu → ansible-role-server-setup

humiaozuzu / ansible-role-server-setup

Licence: other
No description, website, or topics provided.

Programming Languages

Jinja
831 projects
shell
77523 projects
Vim Script
2826 projects

Black Ansible

playbooks and tasks to do server connection init and basic setup

plays and roles included

process

When you get new servers from your cloud computing provider, your get password or ssh key auth to servers.

# setup connection (auth by username and password)
ansible-playbook -i inventory/prod/hosts plays/init-connection.yml -u your-user -kK -l 'your-node'

# setup connection (auth by ssh key)
ansible-playbook -i inventory/prod/hosts plays/init-connection.yml -u your-user --private-key=~/.ssh/id_rsa -l 'your-node'

# when connection is initialized, you can run custom roles
ansible-playbook -i inventory/prod/hosts plays/setup-server.yml -l 'your-node'

server connection init

  • configure sudoer
  • add system admin users and ssh key pairs
  • configure ssh

server setup related roles

  • configure apt
  • disable ipv6
  • configure dns

  • configure hosts
  • common settings
    • hostname
    • package upgrade
    • package install/remove
    • set default editor
  • configure timezone
  • configure locale
  • configure ntp
  • configure sysctl
  • pin linux kernel
  • manage iptables with ufw
  • manage users and ssh keys (support host-level management)

how to add to your existing ansible project

put it in requirements.yml

- src: https://github.com/humiaozuzu/ansible-role-server-setup
  name: server-setup
  version: master


## testing

All roles tested on ubuntu 14.04 and part are tested on 16.04

TODO

  • add config example
  • seperate reboot role
  • add missing default for roles
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].