How will you deal with this problem? [extra-variable problem]

14 views
Skip to first unread message

강동인

unread,
Dec 13, 2017, 3:26:19 AM12/13/17
to Ansible Project

Currently I am using citirx's L4 switch. I need to create 1 to 10 servers for each L4 switch. To do this I need extra_variables.

( The extra variable below was used to create only two servers. )

When I have to make 10 servers, I have too many to define in extra_variable

The problem is that it is difficult to read as well as hard to write

I'm using Ansible Tower(3.2.1), Ansible(2.4.2)

If so, how will you solve this problem?



---

##############################################################################################################
# add server                                                                                                 #
# add service                                                                                                #
##############################################################################################################
extra_var_server:
  - name: "aaa01em"
    ip: "172.30.1.1"
    port: "80"
    servicetype: "HTTP"
  - name: "aaa02em"
    ip: "172.30.1.2"
    port: "80"
    servicetype: "HTTP"


##############################################################################################################
# bind service (including bind lb monitor)                                                                   #
##############################################################################################################
extra_var_monitorname:
  - tcp
  - http_serveralive_aspx


##############################################################################################################
# add lb vserver                                                                                             #
##############################################################################################################
extra_var_lb_vserver:
  - name: "testvsr"
    ip: "172.30.10.10"
    port: "80"
    servicetype: "HTTP"
    lbmethod: ""                        # choice = [ ROUNDROBIN, LEASTCONNECTION, LEASTRESPONSETIME, ... ]
    m: ""                               # choice = [ IP, MAC, IPTUNNEL, TOS ]
    sessionless: ""                     # choice = [ enabled, disabled ]
Reply all
Reply to author
Forward
0 new messages