@@ -37,7 +37,7 @@ Objective
3737
3838Verify puppet will make sensible and expected changes to the cluster when running::
3939
40- $ tarmak cluster puppet -plan
40+ $ tarmak cluster config -plan
4141
4242which complements ``cluster plan `` verifying Terraform changes.
4343
@@ -49,17 +49,18 @@ To implement this, new objects will be added to Wing's API.
4949New API objects
5050---------------
5151
52- ``PuppetManifest ``
53- ******************
52+ ``PuppetTarget ``
53+ ****************
5454
55- A resource representing a set of puppet manifests to apply to an instance.
55+ A resource representing a set of puppet modules and additional information
56+ (hieradata etc) to apply to an instance.
5657
5758This bundles together the source (S3, google Cloud Storage, etc) and
5859verification of the source (a hash, PGP signature, etc).
5960
6061.. code-block :: yaml
6162
62- kind : PuppetManifest
63+ kind : PuppetTarget
6364 metadata :
6465 name : example-manifest
6566 hash : sha256:34242343
@@ -74,7 +75,7 @@ field for each type of source. For example, something like this in ``types.go``:
7475.. code-block :: go
7576
7677 type ManifestSource struct {
77- S3 *S3ManifestSource `json:"s3ManifestSource "`
78+ S3 *S3ManifestSource `json:"s3 "`
7879 }
7980
8081 type S3ManifestSource struct {
@@ -85,47 +86,56 @@ field for each type of source. For example, something like this in ``types.go``:
8586 ``WingJob ``
8687*************
8788
88- A resource representing the application of a ``PuppetManifest `` on an instance:
89+ A resource representing the application of a ``PuppetTarget `` on an instance:
8990
9091.. code-block :: yaml
9192
9293 kind : WingJob
9394 metadata :
9495 name : example-job
9596 spec :
96- puppetManifestRef :
97+ puppetTargetRef :
9798 name : example-manifest
9899 operation : " dry-run"
99100 instanceID : 1234
100101 status :
101102 exitCode : 1
102103 messages : " "
103104
104- This references a pre-existing ``PuppetManifest ``, and performs the specified
105+ This references a pre-existing ``PuppetTarget ``, and performs the specified
105106action on an instance.
106107
107108If, in the future, we support other configuration management tools (ansible,
108109chef, etc), these would be represented by separate fields.
109110
110111Performing updates to puppet manifests will leave ``WingJob `` and
111- ``PuppetManifest `` resources hanging around. To prevent this, wing should only
112+ ``PuppetTarget `` resources hanging around. To prevent this, wing should only
112113keep the last 15 (or some other number) WingJobs for each instance.
113114
114115Changes to existing API objects
115116-------------------------------
116117
117- ``InstanceSpec `` will have a ``puppetManifestRef `` field also linking to a ``PuppetManifest `` resource.
118- This will be the manifest applied to the instance.
118+ ``InstanceSpec `` will have a ``spec.puppetTargetRef `` field also linking to a
119+ ``PuppetTarget `` resource. This will be the manifest applied to the instance.
120+ A corresponding ``status.puppetTargetRef `` will also be added to record the
121+ latest known applied ``PuppetTarget ``.
122+
123+ When the ``spec.puppetTargetRef `` field is updated on an instance, a new
124+ ``WingJob `` is created with ``operation `` set to ``apply ``.
125+
126+ If a ``WingJob `` applies a different ``PuppetTarget ``, the
127+ ``spec.puppetTargetRef `` will not be updated, however
128+ ``status.puppetTargetRef `` will be.
119129
120130Changes to tarmak CLI
121131---------------------
122132
123133The tarmak CLI needs modification to add support for creating
124- ``PuppetManifest `` and ``PuppetJob `` resources.
134+ ``PuppetTarget `` and ``PuppetJob `` resources.
125135
126136The planned workflow is to run::
127137
128- $ tarmak cluster puppet -plan
138+ $ tarmak cluster config -plan
129139
130140which creates ``WingJob `` resources for either a subset of instances of each
131141type in the current cluster, or all instances. This blocks until
0 commit comments