# Conditional provision template

**URL:** <https://forum.genieacs.com/t/conditional-provision-template/3340>\
**Category:** Uncategorized\
**Created:** [December 22, 2022, 9:29am UTC](https://forum.genieacs.com/t/conditional-provision-template/3340 "2022-12-22T09:29:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bigdestroyer](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/bigdestroyer/32/1123_2.png) [@bigdestroyer](https://forum.genieacs.com/u/bigdestroyer)\
**Post date:** [December 22, 2022, 9:29am UTC](https://forum.genieacs.com/t/conditional-provision-template/3340/1 "2022-12-22T09:29:09Z")

</div>

I would like to find out if there is a way to provision a specific provision script based of a custom parameter/dropdown or so.

Basic idea is to provision a GPON fiber ONT as a bridged or routed mode based of a parameter. What would be the best way to approach this problem?

---

<div class="post-metadata">

**Author:** ![akcoder](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/akcoder/32/11_2.png) [@akcoder](https://forum.genieacs.com/u/akcoder)\
**Post date:** [December 22, 2022, 6:03pm UTC](https://forum.genieacs.com/t/conditional-provision-template/3340/2 "2022-12-22T18:03:06Z")

</div>

A two-step process I’ve found works best. First step is to get the desired configuration of the CPE and then set a tag with the desired state. I use `Routed` and `Bridged`. The second stage is two different provision scripts, one for bridged, one for routed. Use a preset to kick off the routed provision, and for precondition I use: `Tags.Disabled IS NULL AND Tags.Provisioned IS NULL AND Tags.Managed IS NOT NULL AND InternetGatewayDevice.DeviceInfo.SpecVersion >= "1"`. And a variation of that for bridged devices.

> **[Example of a Provisioning Flow · genieacs/genieacs Wiki](https://github.com/genieacs/genieacs/wiki/Example-of-a-Provisioning-Flow)**
>
> A fast and lightweight TR-069 Auto Configuration Server (ACS) - Example of a Provisioning Flow · genieacs/genieacs Wiki

---

<div class="post-metadata">

**Author:** ![bigdestroyer](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/bigdestroyer/32/1123_2.png) [@bigdestroyer](https://forum.genieacs.com/u/bigdestroyer)\
**Post date:** [December 23, 2022, 11:37am UTC](https://forum.genieacs.com/t/conditional-provision-template/3340/3 "2022-12-23T11:37:38Z")

</div>

Thank you for the response, that makes sense. Quick question, what do you try and accomplish with the precondition with the tags?

---

<div class="post-metadata">

**Author:** ![akcoder](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/akcoder/32/11_2.png) [@akcoder](https://forum.genieacs.com/u/akcoder)\
**Post date:** [January 3, 2023, 6:30pm UTC](https://forum.genieacs.com/t/conditional-provision-template/3340/4 "2023-01-03T18:30:11Z")

</div>

I use tags to know what state the CPE should be in. GenieACS doesn’t have a concept of metadata about a device, so the best way store this information is in tags.
