Chef cookbook to setup and run a Terraform Cloud agent using docker.
Follow the steps to Create a new Agent Token to obtain an agent token, add this recipe to your run list and set the token as the ['tfc_agent']['token']
attribute.
The tfc_agent
resource is responsible for fetching and running a Terraform Cloud Agent docker image.
default_action :run
:create
- Pulls the container image.:start
- Starts running the container.:run
- The default action. Does both:create
and:start
in a single in action.:stop
- Stops the running container.:remove
- Removes the cached image.
The name property is used to set the
image
- The container image to use. Defaults tohashicorp/tfc-agent
.tag
- The image tag to use. Defaults tolatest
.token
- The agent token to use.
Minimal usage:
tfc_agent "MyOrgAgent" do
token 123123123...
end
Complete example:
tfc_agent "MyCustomAgent" do
image 'myorg/tfc-agent'
tag '2.0'
token 123123123...
end
This cookbook uses Semantic Versioning 2.0.0.
Given a version number MAJOR.MINOR.PATCH, increment the:
- MAJOR version when you make functional cookbook changes,
- MINOR version when you add functionality in a backwards-compatible manner,
- PATCH version when you make backwards-compatible bug fixes.
We welcome contributed improvements and bug fixes via the usual work flow:
- Fork this repository
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new pull request
Authors and contributors:
- Stephen Hoekstra [email protected]
Copyright 2020 Stephen Hoekstra <[email protected]>
Copyright 2020 Schuberg Philis
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.