-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from mapuri/multimaster
Vendor in recent changes to contiv build for multiple master instance support
- Loading branch information
Showing
14 changed files
with
184 additions
and
64 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
--- | ||
# Variables here are applicable to all host groups | ||
|
||
# define an empty environment that can be overridden from command line | ||
env: | ||
|
||
node_name: "{{ ansible_hostname }}" | ||
node_addr: "{{ hostvars[ansible_hostname]['ansible_' + monitor_interface]['ipv4']['address'] }}" | ||
online_master_addr: "192.168.24.10" | ||
|
||
# following variables are used in one or more roles, but have no good default value to pick from. | ||
# Leaving them as commented so that playbooks can fail early due to variable not defined error. | ||
|
||
# env: | ||
# service_vip: | ||
# monitor_interface: |
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
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
6 changes: 1 addition & 5 deletions
6
vendor/configuration/ansible/roles/contiv_storage/templates/volplugin.j2
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1 @@ | ||
{% if online_master_addr == node_addr or online_master_addr == "" %} | ||
VOLPLUGIN_ARGS='--debug' | ||
{% else %} | ||
VOLPLUGIN_ARGS='--debug --master {{ online_master_addr }}:9005' | ||
{% endif %} | ||
VOLPLUGIN_ARGS='--debug --master {{ service_vip }}:9005' |
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[Unit] | ||
Description=Ucarp (Virtual IP service) | ||
After=auditd.service systemd-user-sessions.service time-sync.target | ||
|
||
[Service] | ||
ExecStart=/usr/bin/ucarp.sh start | ||
KillMode=control-group |
13 changes: 13 additions & 0 deletions
13
vendor/configuration/ansible/roles/ucarp/files/ucarp/vip_down.sh
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
|
||
usage="$0 <ifname> <vip>" | ||
if [ $# -ne 2 ]; then | ||
echo USAGE: $usage | ||
exit 1 | ||
fi | ||
|
||
set -x -e | ||
|
||
intf=$1 | ||
|
||
/sbin/ip link del dev ${intf}_0 |
19 changes: 19 additions & 0 deletions
19
vendor/configuration/ansible/roles/ucarp/files/ucarp/vip_up.sh
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
|
||
usage="$0 <ifname> <vip>" | ||
if [ $# -ne 2 ]; then | ||
echo USAGE: $usage | ||
exit 1 | ||
fi | ||
|
||
set -x -e | ||
|
||
intf=$1 | ||
vip=$2 | ||
|
||
/sbin/ip link add name ${intf}_0 type dummy | ||
|
||
# XXX: the subnet needs to be derived from underlying parent interface | ||
/sbin/ip addr add ${vip}/24 dev ${intf}_0 | ||
|
||
/sbin/ip link set dev ${intf}_0 up |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
# This role contains tasks for configuring and starting ucarp service | ||
|
||
- name: download and install ucarp service (Redhat) | ||
yum: name=ucarp state=present | ||
when: ansible_os_family == "RedHat" | ||
|
||
- name: download and install ucarp service (Ubuntu) | ||
apt: name=ucarp state=present | ||
when: ansible_os_family == "Debian" | ||
|
||
- name: copy the ucarp start/stop script | ||
template: src=ucarp.sh.j2 dest=/usr/bin/ucarp.sh mode=u=rwx,g=rx,o=rx | ||
|
||
- name: copy the vip up and down scripts used by ucarp | ||
copy: src=ucarp/ dest=/usr/bin/ucarp/ mode=u=rwx,g=rx,o=rx | ||
|
||
- name: copy systemd units for ucarp | ||
copy: src=ucarp.service dest=/etc/systemd/system/ucarp.service | ||
|
||
- name: start ucarp | ||
service: name=ucarp state=started |
22 changes: 22 additions & 0 deletions
22
vendor/configuration/ansible/roles/ucarp/templates/ucarp.sh.j2
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
|
||
usage="$0 <start>" | ||
if [ $# -ne 1 ]; then | ||
echo USAGE: $usage | ||
exit 1 | ||
fi | ||
|
||
set -x -e | ||
|
||
case $1 in | ||
start) | ||
/sbin/ucarp --shutdown --interface={{ monitor_interface }} \ | ||
--srcip={{ hostvars[ansible_hostname]['ansible_' + monitor_interface]['ipv4']['address'] }} \ | ||
--vhid=1 --pass=cluster_secret --addr={{ service_vip }} \ | ||
--upscript="/usr/bin/ucarp/vip_up.sh" --downscript="/usr/bin/ucarp/vip_down.sh" | ||
;; | ||
|
||
*) | ||
echo USAGE: $usage | ||
exit 1 | ||
esac |
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