Git Product home page Git Product logo

home-deploy's Introduction

Home Deploy

ssh-keygen -t ed25519 -C "Main User"

ssh-copy-id -i ~/.ssh/id_ed25519.pub <ip-add>

Ansible Deployment

Server Setup

I recommend using Ubuntu for the Ansible server

Ansible Install

sudo apt update
sudo apt install ansible

Setup Ansible User & Create SSH Key

sudo adduser <ansible-user>
sudo usermod -aG sudo <ansible-user>

Login as the ansible user and create SSH Key.

ssh-keygen -t ed25519 -C "Ansible User"

Download Deploy Repo

 sudo apt install -y git
 git clone https://github.com/marksie1988/home-deploy.git --recursive
 cd ~/home-deploy
 git submodule init
 git submodule update

copy the id_ed25519.pub file to the templates folder and rename it ansible_user.pub

If updates have been added to submodules run:

git submodule foreach git pull origin master

Install One Password

Add acocunt

op signin add

Login

eval $(op signin)

Install WebHook

 sudo apt install webhook

Configure Webhook:

 cp .stubs/webhook/webhook.json /etc/webhook.json
 chmod +x deploy-hook.sh

Update webhook.json with secret from Github

Enable & Start Services:

 systemctl enable webhook
 systemctl start webhook

Open Firewall Port:

 sudo ufw allow 9000/tcp
 sudo ufw reload

Client Deployment

Client Setup

On the Ansible server from the repo directory run the below command:

ansible-playbook authorized_keys.yml --ask-pass --ask-become-pass

To limit to a specific group of hosts:

ansible-playbook authorized_keys.yml --ask-pass --ask-become-pass --limit <host-group>

Deploy playbooks

eval $(op signin my)
ansible-playbook main.yml --ask-become-pass --limit <host-group> -i <inventory-file> --ask-vault-pass

Vault should be used for any files with sensitive data

home-deploy's People

Contributors

craftzdog avatar marksie1988 avatar

Watchers

 avatar  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.