First looks like you have an issue gathering facts, worth setting this to
False
.
Then I would setup and use a variable as the
provider
make it much easier to read your tasks without the same repeated elements all the time.
I have not testing the following
ansible playbook
file but I think it should do want you need.
---
- name: Add Route Domain ID 1234
hosts: bigip
connection: local
gather_facts: False
vars:
f5Provider:
server: "{{inventory_hostname}}"
server_port: 443
user: "brettcarr"
password: "my password"
validate_certs: no
transport: rest
tasks:
- name: Create a route domain
bigip_routedomain:
provider: "{{f5Provider}}"
id: "1234"
state: "present"
delegate_to: localhost
Make sure you have ansible version 2.2 or above and the python F5 SDK (
f5-sdk
) installed.