GithubHelp home page GithubHelp logo

initial_server_setup's Introduction

Initial_Server_Setup

This Ansible role performs the usual steps to prepare a server for hosting apps that are exposed to the public.

Also find it on ansible galaxy.

Requirements

  • You must be able to log in via ssh as a user that has sudo privileges.
  • Ansible facts must have been gathered.
  • You need to "become" for the role to work

Role Variables

Use the "extra_packages" variable to install additional packages.

Example usage:

extra_packages:
  - package_name

The variable "firewall" (defaults to true) allows you to decide if you want a firewall to be set up or not.

Example usage:

firewall: false

To allow ports/protocols through firewall, use the variable "services". "trusted" has to be a list (can also only be one item), but is optional; if undefined, all IPs are allowed. "name" is just for semantical purposes. SSH is allowed by default. All outgoing connections are allowed. See the firehol config for details.

If you want a firewall, but all ports but ssh should be closed, leave services undefined (just dont add it to playbook).

Example usage:

services:  
  - name: service_name
    port: port_number
    protocols
      - udp
      - tcp
      - icmp
    trusted:
      - IP
      - IP

Example Playbook

- hosts: all
  gather_facts: yes
  become: no
  tasks:
    - block:
      - name: Initial server setup (security etc.)
        include_role:
          name: jstet.initial_server_setup
        vars:
          extra_packages:
            - htop
            - net-tools
          services:
            - name: http
              port: 80
              protocols:
                - tcp
                - udp
              trusted:
                - 216.58.190.0
                - 174.23.123.1
            - name: https
              port: 443
              protocols:
                - tcp
                - udp
      become: yes

Installation

ansible-galaxy install jstet.initial_server_setup

Another option would be to include the role in requirements.yml like this:

roles:
- jstet.initial_server_setup

Afterwards run:

ansible-galaxy install -r requirements.yml

initial_server_setup's People

Contributors

jstet avatar

Watchers

 avatar

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.