Giter Site home page Giter Site logo

gildesmarais / ansible-5-minutes-server Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 66 KB

πŸš€ Setup an Ubuntu server with common security configurations in less than 5 minutes.

License: MIT License

Jinja 100.00%
ansible blueprint configuration server ubuntu vagrant

ansible-5-minutes-server's Introduction

β–ˆβ–ˆ   β–ˆβ–ˆ β–ˆβ–ˆ        β–ˆβ–ˆ β–ˆβ–ˆβ–ˆ    β–ˆβ–ˆβ–ˆ      β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  β–ˆβ–ˆ β–ˆβ–ˆ      β–ˆβ–ˆ
β–ˆβ–ˆ   β–ˆβ–ˆ β–ˆβ–ˆ        β–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆ  β–ˆβ–ˆβ–ˆβ–ˆ     β–ˆβ–ˆ       β–ˆβ–ˆ β–ˆβ–ˆ      β–ˆβ–ˆ
β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆ        β–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆ     β–ˆβ–ˆ   β–ˆβ–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆ      β–ˆβ–ˆ
β–ˆβ–ˆ   β–ˆβ–ˆ β–ˆβ–ˆ        β–ˆβ–ˆ β–ˆβ–ˆ  β–ˆβ–ˆ  β–ˆβ–ˆ     β–ˆβ–ˆ    β–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆ
β–ˆβ–ˆ   β–ˆβ–ˆ β–ˆβ–ˆ β–„β–ˆ     β–ˆβ–ˆ β–ˆβ–ˆ      β–ˆβ–ˆ      β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  β–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆ

In addition to the repositories highlighted below, I also recommend you:

  1. visit my personal website,
  2. check my .dotfiles and
  3. follow me on mastodon: @[email protected].

ansible-5-minutes-server's People

Contributors

gildesmarais avatar

Stargazers

 avatar

Watchers

 avatar  avatar

ansible-5-minutes-server's Issues

Setup /swapfile and add as memory

This comes in handy on small servers with not so much memory available.

  • setup /swapfile of 1GB
  • automount with fstab entry
  • set sysctl to low swappiness
fallocate -l 1G /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
swapon --show

echo "/swapfile none swap sw 0 0" >> /etc/fstab

# set swappiness
echo 'vm.swappiness = 15' >> /etc/sysctl.conf
sudo sysctl -p

Create a deploy user

  • create home dir
  • add ssh-key to authorized_keys
  • allow configuration of groups

Sample snippet

sudo useradd -m deploy

# add to more groups afterwards
sudo usermod -a -G rvm deploy
sudo usermod -a -G docker deploy

support multiple admins

Currently there's one ADMIN user.

This could encourage to share this admin user across organisations which is bad (e.g. can't audit who really logged in).

  • secrets: remove ADMIN_*
  • check if there's an existing playbook for user and key management - prefer to use that, if popular
  • make ADMINS an array takingΒ a hash like this (pseudo/draft code):
    ADMINS:
      - username: foo
        email: [email protected]
        public_key: a/path/to/id_rsa.pub
  • implement the creation and ssh key uploading in the role. (proper key management - needs to remove keys, when removed from ADMINS config)
  • research if a go-to rolebook for that case exists in the ansible universe

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.