winch plan

show the changes that apply would make

Examples

# show the changes of the pipeline site
winch plan site
# use the inventory production
winch plan site --inventory production
# plan with a value for one variable
winch plan site --set vars.nginx_port=8080
# plan two stages on the web hosts without web3
winch plan site --hosts 'web & !web3' --stages nginx,site
# exit with code 2 when apply would change something
winch plan site --exit-code

Usage

winch plan [<pipeline>] [flags]

Plan shows the changes that winch apply would make, and the plan hash. It changes nothing.

Leave out the pipeline name when the steps are at the top of winch.yaml.

A host pattern is a group or a host, with "," for union, "&" for intersection, and "!" for exclusion. Each stage runs on the hosts in both its hosts and --hosts. The stages of --stages run in pipeline order.

A --set value parses as YAML.

With a terminal, ssh can ask questions, and winch connects to the hosts one at a time. Without one, or with --batch, ssh asks nothing, and winch connects to them in parallel.

With --exit-code, plan exits with code 2 when the plan has changes, unknown steps, pending handlers, a pending then, or a pending gate or assert.

Flags

FlagValueDefaultMeaning
--inventory<name>inventory in winch.yamlinventory for the run
--hosts<pattern>allonly these hosts
--stages<names>allonly these stages, such as mail,monit
--user[<host>=]<name>from the inventorySSH login user, for all hosts or one; repeatable
--setvars.<name>=<value>variable value; repeatable
--batchno questions from ssh
--exit-codeexit code 2 for a plan with changes
--jsonJSON events on stdout

See

  • winch doc workflow
  • winch doc pipeline
  • winch doc inventory