Skip to content
This repository has been archived by the owner on May 20, 2020. It is now read-only.

Adding support for ubuntu 15.04 and 16.04 #39

Merged
merged 2 commits into from
Aug 3, 2016

Conversation

mskurski
Copy link
Contributor

@mskurski mskurski commented May 18, 2016

There were few breaking changes in Ubuntu 15.04 and 16.04 which made this cookbook incompatible like:

  • different provider (they went back to systemd)
  • mongod service for ubuntu 16.04 needs some additional configuration

I got some problems with running Ubuntu 16.04 on Vagrant machine (private network required by Vagrant doesn't work properly on official vagrant box for Ubuntu 16.04 and network interfaces names were also changed and Vagrant expects eth0/eth1) so just to simplify this process you can use below configuration:

Vagrantfile

# this line should be commented or removed from your Vagrantfile
#config.vm.host_name = 'your host'

config.vm.box = "geerlingguy/ubuntu1604"
config.vm.provision :shell, path: "./bin/ubuntu_vm_fix.sh"

./bin/ubuntu_vm_fix.sh

#!/usr/bin/env bash

# https://github.com/mitchellh/vagrant/issues/7288
if ! grep -q "127.0.0.1 vagrant.local ubuntu-xenial" /etc/hosts;
then
  echo "#### adding hostname for private network to /etc/hosts (required by vagrant)"
  echo "127.0.0.1 vagrant.local ubuntu-xenial" | sudo tee -a /etc/hosts
fi

# fix network ubuntu/xenial
# disable Predictable Network Interface Names
ip a show dev eth1 > /dev/null
    if (($? > 0)); then
    echo "#### eth1 not exists (eth1 and eth2 is expected by vagrant)"
    echo "#### turning off Predictable Network Interface Names"
    grep -q "net.ifnames=0" /etc/default/grub
    if (($? > 0)); then
      echo "GRUB_CMDLINE_LINUX=\"net.ifnames=0"\" | sudo tee -a /etc/default/grub
      sudo update-grub
      echo "#### restart box to disable Predictable Network Interface Names"
    fi
fi

Just let me know if you will have any problems or questions


supports 'ubuntu', '= 12.04'
supports 'ubuntu', '= 16.04'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be supports 'ubuntu', '>= 12.04' or unchanged.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right, I will fix this

@goatherd
Copy link

Works for me on a generic "ubuntu/xenial64" box.

@@ -97,7 +97,11 @@
when 'debian'
apt_repository "mongodb-org-#{pkg_major_version}" do
uri node['mongodb3']['package']['repo']['url']
distribution "#{node['lsb']['codename']}/mongodb-org/#{node['mongodb3']['package']['repo']['apt']['name']}"
if node['platform'] == 'ubuntu' and node['platform_version'].to_f >= 15.04
distribution "trusty/mongodb-org/#{node['mongodb3']['package']['repo']['apt']['name']}"
Copy link

@goatherd goatherd Jun 28, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

http://repo.mongodb.org/apt/ubuntu/dists/xenial/mongodb-org/ exists for 16.04 so this should be = 15.04 instead.

Looks like mongodb does only support LTS-Versions with their repository. Isn't support for 15.04 mostly a hack?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, seems so they support only LTS versions:
Platform Support

MongoDB only provides packages for 64-bit long-term support Ubuntu releases. Currently, this means 12.04 LTS (Precise Pangolin) and 14.04 LTS (Trusty Tahr). While the packages may work with other Ubuntu releases, this is not a supported configuration.

I agree that support of 15.04 might be considered as a hack, but mongodb release for 14.04 works on 15.04 as well. I will fix this condition and force trusty/mongodb-org release only for 15.04

@mskurski
Copy link
Contributor Author

Thank you @goatherd for your comments, I've already applied fixes.

@goatherd
Copy link

@mskurski

Cool, that was fast.

Really helped me a lot!

@aight8
Copy link

aight8 commented Jul 31, 2016

?

@aight8
Copy link

aight8 commented Jul 31, 2016

Why this PR is open since 2 month? Come on guys. Can you decide a new maintainer when you have no time for this project please?

@sunggun-yu
Copy link
Owner

@aight8 sorry for the late. I was away from chef for several month. sorry again. I need some collaborators. lol
I'll update shortly.

@sunggun-yu sunggun-yu merged commit 58c881b into sunggun-yu:master Aug 3, 2016
@mskurski mskurski mentioned this pull request Aug 3, 2016
@sunggun-yu
Copy link
Owner

@mskurski
Thank you for the great feature. and sorry for late.
it's merged and I'll release it once I finish some testing.

and guys, please forgive me :)
@aight8 @goatherd

@mskurski
Copy link
Contributor Author

mskurski commented Aug 3, 2016

@sunggun-yu
no worries mate :)

sunggun-yu added a commit that referenced this pull request Aug 4, 2016
- Update default mongodb version as 3.2.8
- Adding Kitchen testing platforms : ubuntu 15.04 and 16.04
! Some test cases are still failing !
sunggun-yu added a commit that referenced this pull request Aug 5, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants