Browse Source

Makefile addition

dev
root 5 years ago
parent
commit
8d20ef59df
  1. 5
      Makefile
  2. 16
      roles/lxc_swarm/tasks/deploy.yml
  3. 4
      roles/lxc_swarm/tasks/lxc_nodes.yml

5
Makefile

@ -1,4 +1,4 @@
all: preautomation provision swarm_deploy all: preautomation provision swarm_deploy fix
preautomation: preautomation:
/bin/bash ./ansible_install.sh /bin/bash ./ansible_install.sh
@ -9,5 +9,8 @@ provision:
swarm_deploy: swarm_deploy:
/bin/bash ./ansible_swarm_config.sh /bin/bash ./ansible_swarm_config.sh
fix:
/bin/bash ./environment_bnode_script.sh
clean: clean:
/bin/bash ./clean.sh /bin/bash ./clean.sh

16
roles/lxc_swarm/tasks/deploy.yml

@ -13,16 +13,16 @@
#- pause: #- pause:
# seconds: 30 # seconds: 30
- name: Update swarm stack service "bnode" with proper environmental variables #- name: Update swarm stack service "bnode" with proper environmental variables
shell: | # shell: |
sleep 60; mcontainer_addr=`ssh root@10.0.3.100 "docker ps|xargs -n1|grep -i NAMES -A 1|tail -1"` # sleep 60; mcontainer_addr=`ssh root@10.0.3.100 "docker ps|xargs -n1|grep -i NAMES -A 1|tail -1"`
MASTER_ADDR=`ssh -t root@10.0.3.100 "docker exec -it $mcontainer_addr ip a s|grep -i 10.0|head -1 2>/dev/null" 2>&1 |grep inet|awk '{print $2}'|cut -d "/" -f 1|tr -d ' '` # MASTER_ADDR=`ssh -t root@10.0.3.100 "docker exec -it $mcontainer_addr ip a s|grep -i 10.0|head -1 2>/dev/null" 2>&1 |grep inet|awk '{print $2}'|cut -d "/" -f 1|tr -d ' '`
[ -z $MASTER_ADDR ] && echo "Node 1 hasn't yet been initialized" # [ -z $MASTER_ADDR ] && echo "Node 1 hasn't yet been initialized"
env MASTER_ADDR="${MASTER_ADDR}" docker stack deploy -c stack.yaml stack # env MASTER_ADDR="${MASTER_ADDR}" docker stack deploy -c stack.yaml stack
# env MASTER_ADDR="${MASTER_ADDR}" docker service scale stack_bnode=1 # env MASTER_ADDR="${MASTER_ADDR}" docker service scale stack_bnode=1
# sleep 30 # sleep 30
args: # args:
executable: /bin/bash # executable: /bin/bash
#- name: Wait for nodes[0] container to start #- name: Wait for nodes[0] container to start
# pause: # pause:

4
roles/lxc_swarm/tasks/lxc_nodes.yml

@ -54,3 +54,7 @@
direction: in direction: in
from_ip: "10.0.3.0/24" from_ip: "10.0.3.0/24"
when: inventory_hostname in groups['manager'] when: inventory_hostname in groups['manager']
- name: Enable LXC inter-container communication
shell: ifconfig eth0 hw ether 00:00:03:12:22:11
when: inventory_hostname in groups['workers'][1]

Loading…
Cancel
Save