A test-kitchen plugin that adds the support for ansible in push mode
This kitchen plugin adds ansible as a provisioner in push mode. Ansible will run from your host rather than run from guest machines.
gem install kitchen-ansiblepush
git clone [email protected]:ahelal/kitchen-ansiblepush.git
cd kitchen-ansiblepush
gem build kitchen-ansiblepush.gemspec
gem install kitchen-ansiblepush-<version>.gem
provisioner :
## required options
name : ansible_push
playbook : "../../plays/web.yml" # Path to Play yaml
##
## Optional argument
ansible_config : "/path/to/ansible/ansible.cfg" # path to ansible config file
verbose : "vvvv" # verbose level v, vv, vvv, vvvv
diff : true # print file diff
mygroup : "web" # ansible group, or list of groups
raw_arguments : "--timeout=200"
extra_vars : "@vars.yml"
tags : [ "that", "this" ]
skip_tags : [ "notme", "orme" ]
start_at_task : [ "five" ]
# Hash of other groups
groups :
db :
- db01
sudo : true
sudo_user : root
remote_user : ubuntu
private_key : "/path..../id_rsa"
ask_vault_pass : true
vault_password_file : "/..../file"
host_key_checking : false
generate_inv : true
use_instance_name : false # use short (platform) instead of instance name by default
idempotency_test : False
If you want to check your code is idempotent you can use the idempotency_test. Essentially, this will run Ansible twice and check nothing changed in the next run. If something changed it will list the tasks. Note: If your using Ansible callback in your config this might conflict.
idempotency_test: True
fail_non_idempotent: True
If your running ansible V2 you need to white list the callback callback_whitelist = changes
in ansible.cfg
You can also choose to not to fail if idempotency test fails.
By default chef is installed and serverspec stuff. if you dont want to install
chef_bootstrap_url: nil
- Enable envirionment var ANSIBLE_CALLBACK_WHITELIST="changes" before call
- Tests (PRs for tests is highligh appreciated)