Code Monkey home page Code Monkey logo

ansible-bootstrap's Introduction

Ansible Bootstrap Collection

This is an Ansible collection that provides a set of roles to apply some basic starting configuration to private servers I manage. It is not meant as a fully fledged, reusable collection with a wide range of use cases, but rather as a starting point for my own infrastructure.

As such it will not be pushed to Ansible Galaxy, but will instead be used internally alongside other playbooks and roles I've written. Sooner or later this repository might be merged with another one into a single collection for internal use. Until then, this one will be referenced as a dependency fetched directly from Git by Ansible.

ansible-bootstrap's People

Contributors

d3adb5 avatar

Stargazers

 avatar

Watchers

 avatar

ansible-bootstrap's Issues

Bootstrap playbook fails at the last task when running for multiple hosts

The last task of the Ansible playbook involves manipulating files. Since Ansible attempts to parallelize execution when there are multiple hosts, that task should be somehow declared as "serialized".

The way to do that is through throttle: 1, or by setting serial: 1 and executing the entire play on a single host at a time.

Bootstrap will fail if the server already contains a swapfile

Since the swapfile is not being "unmounted" (swapoff'd) when detected, the
system refuses to remove it or overwrite it (lucky!).

Thus, the bootstrap playbook, though not exactly required to be so, is no longer
idempotent.

Perhaps a comparison between the actual file size and the file size being
"requested" should be made to avoid having to let go of swap when running the
bootstrap plays on a machine that has undergone the process before.

Add fail2ban setup to either bootstrap or essentials

fail2ban can help prevent (or at least slow down) brute-force attacks on the
active services of each host, listening in on incoming connections and when a
certain number of retries has been reached, graylisting or blacklisting the
origin IP.

It would be interesting to set it up on the bootstrap playbook and/or on the
essentials playbook, to ensure hosts in the Ansible inventory are moderately
secure.

Add firewalld installation and configuration

A firewall can be used to strengthen security policies across a computer network, keeping some ports completely closed while allowing services to listen on specified ports for a certain protocol on a specific firewall zone.

Setting up a firewall like firewalld should probably be part of the bootstrap process of new hosts, and should hence be featured in the bootstrap.yml playbook. There's an Ansible module for it, which can be used later on for playbooks that ensure services can listen on given ports.

Add a playbook to add users following a directory structure

Add a playbook that adds users according to a directory tree with "branches" corresponding to machines and groups on the target machine, and leaves (files) corresponding to users and their public SSH keys.

It is unlikely there will be more users than me on my target machines, but hey, it would at least be interesting to have the option readily available whenever I find friends with whom to collaborate on things.

Create GitHub Actions workflow to run Ansible playbooks

Create a GitHub Actions workflow to (perhaps periodically) run the Ansible playbooks present in this repository. The inventory, while not exactly sensitive information, can be kept as an Actions secret. Similarly, the private SSH key(s) used to authenticate with the user Ansible will be using in the target hosts would be a secret as well.

This way we can automate some server tasks.

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.