Browse Source

Making pre-allocation floating IP working for the workload

The current workload does not the new servers using the pre-allocated
IPs, in some situation, it will be hard to getting floating IPs.
This patch will allow a runner to pre-allocating some IPs, then assign
IPs to the server they like.

Change-Id: I992edb95d5d641983908f38340bb8ed546fc72aa
Tong Li 2 years ago
parent
commit
f8bc95c532

+ 0
- 1
workloads/ansible/shade/lampstack/roles/cleaner/tasks/apply.yml View File

@@ -6,7 +6,6 @@
6 6
     validate_certs: "{{ app_env.validate_certs }}"
7 7
     state: absent
8 8
     floating_ip_address: "{{ item }}"
9
-    purge: True
10 9
     server: "{{ hostvars[item].inter_name }}"
11 10
   with_flattened:
12 11
     - "{{ groups['webservers'] }}"

+ 2
- 0
workloads/ansible/shade/lampstack/roles/provision/tasks/apply.yml View File

@@ -16,6 +16,8 @@
16 16
     config_drive: "{{ app_env.config_drive | default('no') }}"
17 17
     security_groups: lampstack_sg
18 18
     floating_ip_pools: "{{ app_env.public_net_name | default(omit) }}"
19
+    floating_ips: "{{ app_env.ips[inventory_hostname] }}"
20
+    reuse_ips: False
19 21
     meta:
20 22
       hostname: "{{ inventory_hostname }}"
21 23
   register: osvm

+ 10
- 0
workloads/ansible/shade/lampstack/vars/bluebox.yml View File

@@ -21,6 +21,16 @@ app_env: {
21 21
   stack_size: 4,
22 22
   volume_size: 4,
23 23
   block_device_name: "/dev/vdb",
24
+
25
+  # The following section shows how to pre allocate floating IPs for each
26
+  # server. If you wish not to do that, leave them empty.
27
+  ips: {
28
+    apache-1: [],
29
+    apache-2: [],
30
+    balancer: [],
31
+    database: []
32
+  },
33
+
24 34
   wp_latest: "http://10.0.10.41/lampstack/wordpress-4.6.1.tar.gz",
25 35
   wp_importer: "http://10.0.10.41/lampstack/wordpress-importer.0.6.3.zip"
26 36
 }

+ 10
- 0
workloads/ansible/shade/lampstack/vars/leap.yml View File

@@ -22,6 +22,16 @@ app_env: {
22 22
   stack_size: 4,
23 23
   volume_size: 2,
24 24
   block_device_name: "/dev/vdb",
25
+
26
+  # The following section shows how to pre allocate floating IPs for each
27
+  # server. If you wish not to do that, leave them empty.
28
+  ips: {
29
+    apache-1: ["9.30.217.34"],
30
+    apache-2: ["9.30.217.23"],
31
+    balancer: ["9.30.217.28"],
32
+    database: ["9.30.217.35"]
33
+  },
34
+
25 35
   wp_latest: "http://10.0.10.12/lampstack/wordpress-4.6.1.tar.gz",
26 36
   wp_importer: "http://10.0.10.12/lampstack/wordpress-importer.0.6.3.zip"
27 37
 }

Loading…
Cancel
Save