Uploaded image for project: 'CFEngine Community'
  1. CFEngine Community
  2. CFE-3654

Passing data containers (JSON objects) to promise modules

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Done
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.18.0
    • Component/s: None
    • Labels:
      None

      Description

      It should be possible to pass data containers (JSON objects) to promise modules, without encoding them as strings. This workaround should not be necessary:

      https://github.com/cfengine/core/blob/master/docs/custom_promise_types/groups_experimental.cf#L8-L38

      Something like this should work:

      bundle agent main
      {
        systemd:
          "sample"
            name => "sample",
            description => "my sample service",
            unit_requires => "syslog.socket",
            service_execstart => "sample --start",
            service_restart => "on-failure",
            install_alias => "sample.service"
            environment => parsejson('{
              "KEY1": "VALUE1",
              "KEY2": "VALUE2"
            }');
      }
      

      This will only be implemented for JSON based protocol, not line based.

        Attachments

          Activity

            People

            Assignee:
            vpodzime Vratislav Podzimek
            Reporter:
            olehermanse Ole Herman Schumacher Elgesem
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: