puppet: mention the `--environment` flag authored by anarcat's avatar anarcat
Closes: tpo/tpa/puppet-hiera-enc#1
...@@ -141,13 +141,30 @@ affects a lot of machines. ...@@ -141,13 +141,30 @@ affects a lot of machines.
During ordinary maintenance operations, it's appropriate to work directly on the During ordinary maintenance operations, it's appropriate to work directly on the
default `main` branch, which deploys to the `production` environment. default `main` branch, which deploys to the `production` environment.
However, for changesets that are more complex, such as when deploying a new However, for more complex changes, such as when deploying a new
service or adding a module (see below), it's recommended to start by working on service or adding a module (see below), it's recommended to start by
a feature branch which will deploy as a distinct [environment](#environments) working on a feature branch which will deploy as a distinct
on the puppet server. By assigning a node to the test environment via the [environment](#environments) on the Puppet server.
[external node classifier](#external-node-classifier-enc), a single node (or a
small set) can be made to apply test puppet code. Once the feature branch is To quickly test a different environment used, you can switch the
satisfying, it can be then simply merged to `main` and deleted. environment used by the Puppet agent using the `--environment`
flag. For example, this will switch a node from `production` to
`test`:
puppet agent --test --environment test
A node or group of nodes can be switch to a different environment
using the [external node classifier](#external-node-classifier-enc).
Once the feature branch is satisfactory, it can then be merged to
`main` and deleted:
git merge test
git branch -d test
git push -d origin test
Branches are not deleted automatically after merge: make sure you
cleanup after yourself.
Because environments aren't totally isolated from each other and a compromised Because environments aren't totally isolated from each other and a compromised
node could choose to apply an environment other than `production`, care should node could choose to apply an environment other than `production`, care should
... ...
......