Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ansible_version ignored if Ansible already in docker container #171

Open
alex-harvey-z3q opened this issue May 30, 2016 · 4 comments
Open

Comments

@alex-harvey-z3q
Copy link
Contributor

It appears that if the provisioned Docker container already contains Ansible, the ansible_version flag is ignored:

My .kitchen.yml:

---
driver:
  name: docker

platforms:
  - name: centos-7.2
    driver_config:
      image: ansible/centos7-ansible:stable
      platform: centos
      provision_command:
        - yum -y install iproute
        - yum -y install net-tools
      forward:
        - 8082:8082

provisioner:
  name: ansible_playbook
  hosts: test-kitchen
  ansible_verbose: false
  ansible_verbosity: 2
  require_ansible_repo: false
  require_ansible_omnibus: true
  ansible_version: 1.9.6
  require_chef_for_busser: false
  requirements_path: requirements.yml
  extra_vars:
    java_packages: ['java-1.8.0-openjdk']

verifier:
  name: serverspec

suites:
  - name: default
    verifier:
      patterns:
        - roles/ansible-nexus/test/integration/default/serverspec/default_spec.rb
      bundler_path: '/usr/local/bin'
      rspec_path: '/usr/local/bin'
@neillturner
Copy link
Owner

what should we do?
add extra code in the script that if which ansible is true then do an ansible -v and then check the version matches if not error message an exit?
versioning ansible is not that useful when installing apt-get or yum as you basically have to take the version they have. More useful when building from source.

@alex-harvey-z3q
Copy link
Contributor Author

Perhaps it would be valid then to just error out with some advice to the user on what should do if they need to test their code against a matrix of ansible versions?

@steenzout
Copy link
Contributor

how about using virtualenvs and always guarantee you are using a clean environment using the Ansible version you requested?

I can provide a patch for this if this is something you would be interested.

@neillturner
Copy link
Owner

i will also take in PR requests and try and make the code as flexible as possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants