底辺エンジニアの備忘録

30過ぎて、記憶力低下が著しい為、メモ代わりにしていく予定。 自身のスキルが低いので、内容の正確さは保障できません・・・OTL

ansible_f5_1

Big-IPの設定をAnsibleで設定

 

Big-IPのMgmtのアドレス:192.168.2.245

 

$ cat f5.ini
[big-ip]
192.168.2.245

[all:vars]
ansible_user = root
ansible_ssh_pass = default

 

 

 

$ cat f5.yml
---
- hosts: big-ip
tasks:
- name: プールを作成
local_action: >
bigip_pool
server=192.168.2.245
user=admin
password=admin
state=present
name=ansible-pool
lb_method=least_connection_member
slow_ramp_time=120

- name: プールメンバーを追加(1つ目)
local_action: >
bigip_pool
server=192.168.2.245
user=admin
password=admin
state=present
name=ansible-pool
host=192.168.150.10
port=80

- name: プールメンバーを追加(2つ目)
local_action: >
bigip_pool
server=192.168.2.245
user=admin
password=admin
state=present
name=ansible-pool
host=192.168.150.20
port=80

- name: プールメンバーを追加(3つ目)
local_action: >
bigip_pool
server=192.168.2.245
user=admin
password=admin
state=present
name=ansible-pool
host=192.168.150.30
port=80

- name: Add virtual server
bigip_virtual_server:
server: 192.168.2.245
user: admin
password: admin
state: present
name: myvirtualserver
destination: 1.1.1.1
port: 443
pool: ansible-pool
description: Test Virtual Server
all_profiles:
- http
- clientssl
delegate_to: localhost