- Node - a physical or virtual machine that hosts services
- Nodes also referred to as members.
- Examples
- Your computer
- An AWS EC2 instance
- A bare metal machine in your private data center
- Service - executing software that provides utility via an interface
- Typically long-lived process listening on a port(s)
- Examples
- A web server (nginx, apache, iis)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#connecting to server provisoned for adding python | |
connection { | |
host = self.ipv4_address #will use the ip address of the droplet created | |
user = "root" | |
type = "ssh" | |
private_key = file("~/.ssh/id_rsa") #will use the private key of the hosts allowed to connect to droplet created | |
timeout = "2m" | |
} | |
#we need python for ansible to run | |
provisioner "remote-exec" { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# use the existing the ssh-key, these are added to digital ocean console | |
# check the security section, use the same name added there | |
data "digitalocean_ssh_key" "default" { | |
name = "<change-it>" | |
} | |
#Generate it from digitalocean console, make sure to pass it safely | |
provider "digitalocean" { | |
token = "<change-it>" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Usage: slackpost <token> <channel> <message> | |
# Enter the name of your slack host here - the thing that appears in your URL: | |
# https://slackhost.slack.com/ | |
slackhost=PUT_YOUR_HOST_HERE | |
token=$1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The problem occurs when trying to run docker containers using the ansible docker module as below: | |
######## | |
playbook: | |
######## | |
- name: Start docker container (using docker-compose) | |
docker_service: | |
project_src: /home/ubuntu | |
become_user: ubuntu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3.4" | |
services: | |
web: | |
image: nginx:latest | |
ports: | |
- "9080:80" | |
volumes: | |
- ./code:/code | |
- ./site.conf:/etc/nginx/conf.d/default.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class testing extends MX_Controller{ | |
function index(){ | |
echo "hellow testing HMVC"; | |
} | |
} |