Run ansible base playbook for puppet tests

As we start to do things in the base playbook instead of in puppet, we
need for those things to happen before we run puppet, and before we test
final system state.

Install ansible into a virtualenv, then run the base playbook.

Change-Id: I88808dec9dd4ebdd3fb9081881d2ab69f9eed95e
This commit is contained in:
Monty Taylor 2018-08-02 11:06:14 -05:00
parent c6c2435101
commit 2fa5458994
No known key found for this signature in database
GPG Key ID: 7BAE94BC7141A594
1 changed files with 10 additions and 1 deletions

View File

@ -2,8 +2,15 @@ require 'beaker-rspec'
SYSTEM_CONFIG='git.openstack.org/openstack-infra/system-config'
def run_ansible(host)
base_playbook = "#{ENV['HOME']}/src/#{SYSTEM_CONFIG}/playbooks/base.yaml"
on host, "echo 'localhost ansible_connection=local' > hosts"
on host, "virtualenv .ansiblevenv"
on host, ".ansiblevenv/bin/pip install ansible"
on host, ".ansiblevenv/bin/ansible-playbook -i hosts #{base_playbook}"
end
def install_infra_puppet(host)
install_system_config(host)
on host, "bash -x #{ENV['HOME']}/src/#{SYSTEM_CONFIG}/install_puppet.sh", :environment => ENV.to_hash
end
@ -66,6 +73,8 @@ end
# Set up hosts, before running any tests
hosts.each do |host|
setup_host(host)
install_system_config(host)
run_ansible(host)
install_infra_puppet(host)
install_infra_modules(host, proj_root)
end