Forum Discussion

lp_213985's avatar
lp_213985
Icon for Nimbostratus rankNimbostratus
Oct 19, 2017

config-sync inside the iApp

Hi Devcentral,

i'm tryng to do the config sync from inside the iApp (from active to group)

i wrote an iapp with just one command

tmsh::run /cm config-sync to-group name_device.group

and works. good!

than i wrote the same command at the beginning of the iApp for a service deployment. what i've seen is that the command for the config sync start at the beginning, but also starts the deployment. the result is that te sync ends at the end of the deployment.

what i need is

first sync
than (when the sync is complete, starts the deployment).

below my tentative:

1) very simplified iapp

implementation section        

    do the sync
    create ltm pool 

it doesn't work.

2) i've tried using proc

it doesn't work

3) i've tried with an if statement

do the sync
if device group is "in sync",
    start the deployment

not works

4) i've tried with the command after

do the sync
after n,
starts the deployment

not works

the result is always the same: starts the sync, also starts the deployment, and complete the sync at the end of the deployment

what i need instead is

first sync
then (when the sync is complete), starts the deployment.

any idea?

thank in advance

1 Reply

  • I also tried with a while cicle

     

    while { not ($::field_value equals "In Sync") }{ tmsh::run /cm config-sync to-group nome_device.group wait check_sync }

     

    wait is a procedure that include the after 5000 command check_sync is a procedure that do the tmsh::get_status / cm sync-status

     

    than i inizialize the variable $::field_value with the config sync status (Changes Pending, In Sync, etc)

     

    the result is that the process rest in the cycle to infinite.