-
Notifications
You must be signed in to change notification settings - Fork 8
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 #446 from BiBiServ/hotfix-hybrid-cloud
Hotfix hybrid cloud
- Loading branch information
Showing
7 changed files
with
59 additions
and
32 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
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
30 changes: 23 additions & 7 deletions
30
resources/playbook/roles/bibigrid/templates/slurm/worker_userdata.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,10 +1,26 @@ | ||
#cloud-config | ||
{% set cloud_identifier = item.cloud_identifier %} | ||
|
||
bootcmd: | ||
- /usr/bin/ip route add 10.0.0.0/24 via {{ hostvars[item].private_v4 }} dev ens3 | ||
{% for cluster_cidr in cluster_cidrs %} | ||
{% if cluster_cidr.cloud_identifier != hostvars[item].cloud_identifier %} | ||
- /usr/bin/ip route add {{ cluster_cidr.provider_cidrs }} via {{ hostvars[item].private_v4 }} dev ens3 | ||
{% endif %} | ||
{% endfor %} | ||
# Create a shell script to apply routes | ||
write_files: | ||
- content: | | ||
#!/bin/bash | ||
echo Adding IP Routes | ||
/usr/bin/ip route add 10.0.0.0/24 via {{ hostvars[item].private_v4 }} | ||
echo /usr/bin/ip route add 10.0.0.0/24 via {{ hostvars[item].private_v4 }} - $? | ||
{% for cluster_cidr in cluster_cidrs %} | ||
{% if cluster_cidr.cloud_identifier != hostvars[item].cloud_identifier %} | ||
{% for provider_cidr in cluster_cidr.provider_cidrs %} | ||
/usr/bin/ip route add {{ provider_cidr }} via {{ hostvars[item].private_v4 }} | ||
echo /usr/bin/ip route add {{ provider_cidr }} via {{ hostvars[item].private_v4 }} - $? | ||
{% endfor %} | ||
{% endif %} | ||
{% endfor %} | ||
echo "$(/usr/bin/ip route)" | ||
echo "IP Routes Added" | ||
path: /usr/local/bin/apply-routes.sh | ||
permissions: '0755' | ||
|
||
# Execute the shell script | ||
runcmd: | ||
- /usr/local/bin/apply-routes.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
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