forked from mlowcher61/F5-Ansible
-
Notifications
You must be signed in to change notification settings - Fork 0
/
add_pool_members.yml
executable file
·52 lines (48 loc) · 1.31 KB
/
add_pool_members.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/usr/bin/ansible-playbook
---
#
# Copyright (c) 2016 F5 Networks
# All rights reserved.
#
# author: Mark Lowcher F5 Networks
# description: This playbook will add pool members to
# a pool
- name: Add pool members and nodes
hosts: 10.0.0.160
connection: local
tasks:
- name: Create node1
bigip_node:
host: "10.10.10.10"
name: "node-1"
password: "admin"
server: "10.0.0.160"
user: "admin"
validate_certs: "no"
delegate_to: localhost
- name: Create node2
bigip_node:
host: "10.10.10.20"
name: "node-2"
password: "admin"
server: "10.0.0.160"
user: "admin"
validate_certs: "no"
delegate_to: localhost
- name: Add nodes to pool
bigip_pool_member:
description: "webserver-1"
host: "{{ item.host }}"
name: "{{ item.name }}"
password: "admin"
pool: "web_pool"
port: "80"
server: "10.0.0.160"
user: "admin"
validate_certs: "no"
delegate_to: localhost
with_items:
- host: "10.10.10.10"
name: "node-1"
- host: "10.10.10.20"
name: "node-2"