Giter Site home page Giter Site logo

automate's Introduction

automate

1.) Prepare virtual machine

For this installation it was used latest debian bullseye. Do install as root.
Install latest debian image and run on all nodes:

apt-get update
apt-get install -y wget bash-completion git python3

1.1) Setup Master and Slave node
On Master node generate ssh-key ( ssh-keygen ). Put .pub key of master to authorized_keys on slave nodes.
check if ssh from master to slaves work.
With your favorite editor edit /etc/hosts, add all hosts ( IP hostname )

example:

127.0.0.1       localhost
::1             localhost ip6-localhost ip6-loopback
ff02::1         ip6-allnodes
ff02::2         ip6-allrouters

192.168.253.180 portainer1
192.168.253.181 portainer2
192.168.253.182 portainer3

2.) Install portainer

On Master node :

in root folder clone repo

git clone https://github.com/brucar18/automate.git

Move into automate dir and edit hosts.yaml to match your configuration

Edit host name and ip addresses to match yours in /etc/hosts

Move to automate folder and run installBase.sh script

./installBase.sh 

To have access to ansible links run this command:

export PATH=$HOME/.local/bin:$PATH

In automate folder run:

This will prepare master and slave hosts
All playbooks are run from master as root

ansible-playbook -i hosts.yaml main.yaml

Setup portainer master and init swarm:

ansible-playbook -i hosts.yaml server.yaml

Setup swarm agents

First generate swarm agent task and then deploy it to slaves.

./gen_swarm.sh
ansible-playbook -i hosts.yaml swarm.yaml

Then login to portainer master node and create admin account
https://masternodeip:9443

3.) Prepare dockers

Run playbook for dockers it will build image on all 3 nodes.

ansible-playbook -i hosts.yaml buildImages.yaml

after this task is completed go to Portainer web and create new stack

1.) Choose local, then select stack and Add stack
image

Copy content of docker-compose.yaml into web editor. Disable access control and deploy stack.
image

Voila your webserver is up and running. image

automate's People

Contributors

brucar18 avatar

Watchers

 avatar

automate's Issues

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.