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

Add a required version plugin #148

Closed
wants to merge 4 commits into from

Conversation

whikloj
Copy link
Member

@whikloj whikloj commented Jan 7, 2020

GitHub Issue: Islandora/documentation#1343

What does this Pull Request do?

Adds a plugin that enforces a minimum and maximum ansible version. The versions are loaded from a file ansible-version.yml in the root directory of the playbook.

How should this be tested?

I adjusted the ansible-version.yml to have either a minimum version greater than or a maximum version less than my current version and tried to run either

  • vagrant up
  • ansible-playbook -i inventory/vagrant -uvagrant -e'islandora_distro=ubuntu/bionic64' playbook.yml

If you run the vagrant up and the machine has already been built it will not fail and just start the machine, if the machine is not built then it will build the box and then fail.

For example, with ansible version 2.8.1

> ansible --version
ansible 2.8.1
  config file = /sw/var/www/DAM2/claw-playbook/ansible.cfg
  configured module search path = ['/Users/whikloj/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/Cellar/ansible/2.8.1/libexec/lib/python3.7/site-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 3.7.5 (default, Nov  1 2019, 02:16:32) [Clang 11.0.0 (clang-1100.0.33.8)]

I changed ansible-version.yml to

---
  # Minimum version of ansible this playbook works with.
  islandora_ansible_version_min: 2.8.2
  # Maximum version of ansible this playbook works with.
  islandora_ansible_version_max: 2.8.7

Then

> ansible-playbook -i inventory/vagrant -uvagrant -e'islandora_distro=centos/7' playbook.yml
Islandora-Playbook restriction: only an Ansible version between 2.8.2 and 2.8.7 is supported.

or

> vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'ubuntu/bionic64'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'ubuntu/bionic64' version '20190225.0.0' is up to date...
==> default: Setting the name of the VM: Islandora CLAW Ansible
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 8000 (guest) => 8000 (host) (adapter 1)
    default: 8080 (guest) => 8080 (host) (adapter 1)
    default: 3306 (guest) => 3306 (host) (adapter 1)

...

- Islandora-Devops.fits (1.0.0) is already installed, skipping.
- Islandora-Devops.grok (2.0.0) is already installed, skipping.
- Islandora-Devops.karaf (1.0.0) is already installed, skipping.
- Islandora-Devops.keymaster (1.0.0) is already installed, skipping.
- Islandora-Devops.matomo (1.0.0) is already installed, skipping.
    default: Running ansible-playbook...
Islandora-Playbook restriction: only an Ansible version between 2.8.2 and 2.8.7 is supported.
Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.

Interested parties

@Islandora-Devops/committers @g7morris

@whikloj
Copy link
Member Author

whikloj commented Jan 8, 2020

Also @ruebot could test this.

@ruebot
Copy link
Contributor

ruebot commented Jan 10, 2020

vagrant up worked fine on my end with this branch:

=============================================================================== 
geerlingguy.drupal : Install configured modules with drush. ----------- 274.71s
geerlingguy.drupal : Install dependencies with composer require (this may take a while). - 216.22s
Islandora-Devops.crayfish : Install requisite packages ----------------- 65.48s
Islandora-Devops.grok : Make grok -------------------------------------- 63.43s
geerlingguy.drupal : Generate Drupal project with composer package in /tmp/composer-project (this may take a while). -- 57.36s
geerlingguy.drupal : Install Drupal with drush. ------------------------ 48.84s
geerlingguy.java : Ensure Java is installed. --------------------------- 44.36s
Islandora-Devops.alpaca : Install Alpaca via Gradle -------------------- 42.74s
geerlingguy.php : Ensure PHP packages are installed. ------------------- 38.82s
Islandora-Devops.alpaca : Add Alpaca Features -------------------------- 27.09s
Islandora-Devops.crayfish : Build crayfish code including dependencies -- 22.82s
install extra packages ubuntu ------------------------------------------ 22.13s
geerlingguy.mysql : Ensure MySQL packages are installed. --------------- 21.70s
Islandora-Devops.crayfish : Add ImageMagick repo (apt) ----------------- 16.70s
Import features -------------------------------------------------------- 16.02s
geerlingguy.php-versions : Add repository for PHP versions (Ubuntu). --- 15.91s
Islandora-Devops.drupal-openseadragon : Install Openseadragon with composer -- 14.35s
webserver-app : Import features ---------------------------------------- 13.61s
Clear cache ------------------------------------------------------------ 12.80s
Islandora-Devops.tomcat8 : install tomcat8 ----------------------------- 12.27s

@bseeger
Copy link
Member

bseeger commented Jan 13, 2020

This is great. I'd also be interested in the version information for Ansible being on the README.md page as well, so users coming in can start by grabbing the right version and not finding out that they have the wrong one when they "vagrant up".

@whikloj
Copy link
Member Author

whikloj commented Feb 20, 2020

Based on the statement in the latest listserv post.

Ansible 2.5.1 installed (the Vagrant image fails when using the current version of Ansible (2.9.5), but sticking to 2.5.x seems to work).

https://groups.google.com/forum/#!msg/islandora/BlWgiu68zX8/SPVas7qFAAAJ

Maybe we can merge?

@bseeger
Copy link
Member

bseeger commented Feb 20, 2020

fwiw, I've used Ansible 2.8.7 (on a mac) successfully a number of times. Just a data point, not any sort of comment on whether or not to merge.

@bryjbrown
Copy link

bryjbrown commented Apr 4, 2020

So after sinking a nontrivial amount of time to get islandora-playbook to spin up with Vagrant, I can confirm that ansible v2.5.1 (the default version that you get with apt install ansible on Ubuntu 18.04) and v2.9.6 (the version that you get when you install ansible after adding the ppa:ansible/ansible repository) don't work, but ansible v2.8.10 does (requiring one to remove the ppa:ansible/ansible repo and then add the ppa:ansible/ansible-2.8 repo).

Having Vagrant error out due to my having the wrong version of ansible early on in the process and tell me what version of ansible to install would have saved me a lot of time by leading me down the proper path, so I'm adding my $0.02 that including this plugin to specify a minimum/maximum version is 100% A Good Thing For Users.

@whikloj whikloj closed this Apr 7, 2020
@whikloj whikloj deleted the issue-1343 branch September 24, 2021 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants