Forum Discussion
BigD_300005
Feb 09, 2018Cirrostratus
Ansible Dynamic node tasks
Is there a way in Ansible to get the node task to spin off multiple times without having to manually create 3 node tasks? I'd like to just have one playbook instead of multiple depending on how many ...
amintej
Sep 11, 2018Cirrus
My playbook for this case is:
tasks:
- name: ADD NODES
bigip_node:
state: present
partition: "{{ f5_partition }}"
server: "{{ f5_server }}"
user: "{{ f5_user }}"
password: "{{ f5_pass }}"
name: "{{ item.f5_node_name }}"
host: "{{ item.f5_node_host }}"
validate_certs: no
delegate_to: localhost
with_items: "{{ f5_nodes_list }}"
Example for node list:
f5_server: f5host.local
f5_partition: partition1
f5_user: user1
f5_pass: vault
f5_nodes_list:
- f5_node_name: node-1
f5_node_host: 1.1.1.3
- f5_node_name: node-2
f5_node_host: 1.1.1.4
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects