Comments (4)
Vagrantfile:
require 'yaml'
settings = YAML.load_file 'vagrant.yml'
Vagrant.configure("2") do |config|
config.vm.define :kmaster do |machine|
machine.vm.box = "giovanni/xenial64-libvirt"
machine.vm.hostname = "kmaster"
machine.vm.network "private_network", ip: settings['kmaster_ip_address']
machine.vm.provider :libvirt do |domain|
domain.memory = 1024
domain.cpus = 2
domain.storage :file, :size => settings['docker_disk_size'], :device => settings['docker_disk']
end
end
config.vm.define :node1 do |machine|
machine.vm.box = "giovanni/xenial64-libvirt"
machine.vm.hostname = "node1"
machine.vm.network "private_network", ip: settings['node1_ip_address']
machine.vm.provider :libvirt do |domain|
domain.memory = 1024
domain.cpus = 2
domain.storage :file, :size => settings['docker_disk_size'], :device => settings['docker_disk']
end
end
config.vm.define :node2 do |machine|
machine.vm.box = "giovanni/xenial64-libvirt"
machine.vm.hostname = "node2"
machine.vm.network "private_network", ip: settings['node2_ip_address']
machine.vm.provider :libvirt do |domain|
domain.memory = 1024
domain.cpus = 2
domain.storage :file, :size => settings['docker_disk_size'], :device => settings['docker_disk']
end
end
config.vm.define :node3 do |machine|
machine.vm.box = "giovanni/xenial64-libvirt"
machine.vm.hostname = "node2"
machine.vm.network "private_network", ip: settings['node3_ip_address']
machine.vm.provider :libvirt do |domain|
domain.memory = 1024
domain.cpus = 2
domain.storage :file, :size => settings['docker_disk_size'], :device => settings['docker_disk']
end
end
config.vm.provision "ansible" do |ansible|
ansible.sudo = true
ansible.groups = {
"docker" => ["kmaster", "node1", "node2", "node3"],
"cluster_nodes" => ["node1", "node2", "node3"],
"cluster_servers" => ["node1", "node2"]
}
ansible.host_vars = {
"kmaster" => {"private_ip_address" => settings['kmaster_ip_address']},
"node1" => {"consul_node_role" => "bootstrap", "private_ip_address" => settings['node1_ip_address']},
"node2" => {"consul_node_role" => "server", "private_ip_address" => settings['node2_ip_address']},
"node3" => {"consul_node_role" => "server", "private_ip_address" => settings['node3_ip_address']}
}
ansible.playbook = "devsite.yml"
end
config.vm.synced_folder ".", "/mnt", disabled: true
end
Ansible provision:
---
- hosts: docker
roles:
- docker
- hosts: cluster_nodes
become: yes
become_user: root
roles:
- name: brianshumate.consul
consul_iface: "{{ private_interface | mandatory}}"
consul_install_remotely: true
Vagrant inventory
# Generated by Vagrant
kmaster ansible_ssh_host=192.168.121.61 ansible_ssh_port=22 ansible_ssh_user='vagrant' ansible_ssh_private_key_file='/home/giovanni/Projects/atende/infra-barebones/.vagrant/machines/kmaster/libvirt/private_key' private_ip_address=192.168.50.2
node1 ansible_ssh_host=192.168.121.235 ansible_ssh_port=22 ansible_ssh_user='vagrant' ansible_ssh_private_key_file='/home/giovanni/Projects/atende/infra-barebones/.vagrant/machines/node1/libvirt/private_key' consul_node_role=bootstrap private_ip_address=192.168.50.3
node2 ansible_ssh_host=192.168.121.216 ansible_ssh_port=22 ansible_ssh_user='vagrant' ansible_ssh_private_key_file='/home/giovanni/Projects/atende/infra-barebones/.vagrant/machines/node2/libvirt/private_key' consul_node_role=server private_ip_address=192.168.50.4
node3 ansible_ssh_host=192.168.121.183 ansible_ssh_port=22 ansible_ssh_user='vagrant' ansible_ssh_private_key_file='/home/giovanni/Projects/atende/infra-barebones/.vagrant/machines/node3/libvirt/private_key' consul_node_role=server private_ip_address=192.168.50.5
[docker]
kmaster
node1
node2
node3
[cluster_nodes]
node1
node2
node3
[cluster_servers]
node1
node2
from ansible-consul.
Don't know why, but using just:
consul_node_role: server
consul_bootstrap_expect: true
Works. Now I going to try join the nodes, I will do feedback soon.
Thank you all for the work on this role, makes life easy for everyone ;-)
from ansible-consul.
Working good, but I have to define consul_raw_key
to some value, destroy and recreate the cluster
from ansible-consul.
Problem is Vagrant no provisioning in parallel, have to set ansible.limit = "all"
in vagrant file
from ansible-consul.
Related Issues (20)
- No filter named 'ipaddr' found HOT 1
- Minimum supported Consul version HOT 2
- consul_client_address is ignored HOT 1
- Task "Write gossip encryption key locally for use with new servers" is flakey
- What is the purpose of the consul_iface variable
- Role fails to install on Rocky 8.6 HOT 1
- Molecule outdated HOT 1
- Add RHSM Install Option
- Is enabling TLS for windows supported with this role?
- Support for consul validate HOT 1
- Create Dnsmasq configuration fails with `...({{ item.when }}): 'item' is undefined`
- Maintainers wanted HOT 2
- Fix and re-enable suppressed ansible-lint warnings
- Add grpc_tls address and port for consul >= 1.14.0
- Update to Molecule 5.x
- [BUG] Cannot fetch "gossip encryption key" HOT 1
- Debian Installation HOT 1
- Configuration files are not in json format HOT 3
- Check mode missing in one task HOT 1
- ACL Master Token not generated automatically
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ansible-consul.