Skip to content

Latest commit

 

History

History
93 lines (66 loc) · 2.35 KB

README.md

File metadata and controls

93 lines (66 loc) · 2.35 KB

my-infra-ansible

my-infra-ansible manages server infrastructure in my labo.

Overview

Overview

Commands

Command Description
make ubuntu2004 Prepare base configurations for Ubuntu 20.04.
make prometheus-exporter Setup Prometheus exporters on server.
make prometheus-stack Setup Prometheus and Alertmanager on docker.
make grafana-stack Setup Grafana and Cortex on docker.
make drone Setup Drone CI Server and Runners on docker.
make datadog Setup Datadog Agent on server.
make dhcp Setup ISC DHCP Server on server.
make complete Run every commands written above.

Prerequisite

  • Install ansible and relating packages.

    pip3 install -r requirements.txt

Preparation

  • Update sshd_config.

    vi /etc/ssh/sshd_config
  • Put authorized_keys for root.

    vi ~/.ssh/authorized_keys
  • Restart sshd.service.

    systemctl restart sshd.service
  • Update apt repositories and packages.

    apt update && apt upgrade -y
  • Restart.

    shutdown -r now

Appendix: Configure Static IP

  • Edit /etc/netplan/50-cloud-init.yaml as below.

    network:
        ethernets:
            eth0:
                addresses:
                - 192.168.0.XXX/24    # Set static IP address
                dhcp4: false
                gateway4: 192.168.0.1 # Set gateway address
                nameservers:
                    addresses:
                    - 8.8.8.8
                    - 8.8.4.4
                    search: []
        version: 2
  • Apply changes.

    netplan apply

Appendix: Use Raspberry Pi