It seems like our `value_cmd` is getting refreshed & reset every time we upgrade. How do we make it only set the value once and then lock in forever?


#1
- name: gen_admin_password
  cmd: random
  args:
  - "16"

...

  - name: admin_password
    title: "Generated User Password"
    type: label
    value_cmd:
      name: gen_admin_password
      value_at: 0

#2

Labels will get regenerated each time the app is upgraded as they do not store data. Try the following to both make the password stick and display it to the user:

- name: gen_admin_password
  cmd: random
  args:
  - "16"

...

  - type: text
    name: admin_password
    hidden: true
    value_cmd:
      name: gen_admin_password
      value_at: 0
  - type: label
    name: admin_password_view
    title: "Generated User Password"
    value: '{{repl ConfigOption "admin_password"}}'