Skip to content

Instantly share code, notes, and snippets.

View AkashRajvanshi's full-sized avatar
😎
DevOps

Akash Rajvanshi AkashRajvanshi

😎
DevOps
View GitHub Profile
---
container_name: portainer
container_image: portainer/portainer-ce
container_ports: 9000:9000
container_config_volume: /var/run/docker.sock:/var/run/docker.sock
container_data_volume: /home/vagrant/portainer:/data
- name: Installing Portainer With Ansible
hosts: cluster
become: True
vars_files:
- vars/default.yml
tasks:
- name: Installing Docker Module for Python
pip:
name: docker
- name: Pulling portainer docker image
- name: Install Docker with Ansible
hosts: cluster
become: True
tasks:
- name: Updating the system
apt: update_cache=yes force_apt_get=yes cache_valid_time=3600
- name: Upgrading the system
apt: upgrade=dist force_apt_get=yes
- name: Installing aptitude using apt
apt: name=aptitude state=latest update_cache=yes force_apt_get=yes
[defaults]
inventory = hosts
remote_user = vagrant
private_key_file = /home/${USER}/.vagrant.d/insecure_private_key
host_key_checking = False
@AkashRajvanshi
AkashRajvanshi / hosts
Last active September 22, 2020 14:54
[cluster]
master ansible_host=127.0.0.1 ansible_port=2222
worker ansible_host=127.0.0.1 ansible_port=2200
Vagrant.configure("2") do |config|
config.ssh.insert_key = false
config.vm.define "master" do |master|
master.vm.box = "ubuntu/bionic64"
end
config.vm.define "worker" do |worker|
worker.vm.box = "ubuntu/bionic64"
end
config.vm.network "public_network"
config.vm.provider "virtualbox" do |vb|
# Install Vagrant
# Download the latest version of vagrant from : https://www.vagrantup.com/downloads.html
# If you using debian ( Download x.deb ), Otherwise download Binary file an place in executable path in system.
# Installation ( Debian )
$ sudo dpkg -i ./vagrant-x.deb
# Install VM ( Ubuntu 18.04 )
$ vagrant init
# Install Some Dependencies
$ sudo apt-get -y install gcc make linux-headers-$(uname -r) dkms
# Install Virtual Box
$ sudo apt install ./virtualbox-5.2_5.2.44-139111~Ubuntu~bionic_amd64.deb
# To Check
$ VBoxManage -v
5.2.44r139111
## Installing code-server with persistent storage, because this gives us the freedom to access code files from desired directories
--------------------------------------------------------------------------------------
# We already create PersistentVolume, but we need a another claim for code-server
# YAML for Persistent Volume Claim ( code-server-pvc.yml )
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
# I m installing linkding with persistent storage ( To know about What persistent storage is, check out my Kubernetes 101 post )
# YAML for Persistent Volume ( pv.yml )
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: data
spec:
accessModes: