Skip to content

Announcing Enhanced VCS Integration ๐ŸŽ‰ ๐ŸŽ‰

Read more here โ†’

Spacelift Policies with Ansibleยป

Plan Policy with Ansibleยป

Using our native Plan Policy you could implement advanced handling of different situations that can happen while running playbooks on multiple hosts.

One good example is if you'd like to manually review situations when some of the hosts were unreachable, but still be able to apply the change regardless.

You could test it using the following Plan Policy:

1
2
3
4
5
6
7
package spacelift

warn["Some hosts were unreachable"] {
  input.ansible.dark != {}
}

sample { true }

Once you attach the above Plan Policy to an Ansible stack that is configured in a way not to fail when finding unreachable hosts, you could automatically detect unreachable hosts using a Plan Policy and require approval using the Approval Policy.

Please find an example policy evaluation below: Ansible example policy evaluation

Linking Terraform and Ansible workflowsยป

You can use our Trigger Policy to link multiple stacks together. This applies also to stacks from different vendors.

One of the use cases is to link Terraform and Ansible workflows so that you could use Ansible to configure EC2 instances you've just created using Terraform.

We provide an extensive example of one way to set something like this up in our Terraform-Ansible workflow demo repository.