unify mongodb installation for both xenial and bionic in integration tests

pull/64131/head
Dusan Matejka 5 years ago committed by Matt Clay
parent 554285acb7
commit 1f2d78b356

@ -1,14 +1,9 @@
mongodb_version: "4.0"
apt_xenial:
keyserver: "keyserver.ubuntu.com"
keyserver_id: "2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5"
repo: "deb [ arch=amd64 ] http://repo.mongodb.org/apt/ubuntu {{ansible_distribution_release}}/mongodb-org/{{mongodb_version}} multiverse"
apt_bionic:
apt:
keyserver: "keyserver.ubuntu.com"
keyserver_id: "9DA31620334BD75D9DCB49F368818C72E52529D4"
repo: "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu {{ansible_distribution_release}}/mongodb-org/{{mongodb_version}} multiverse"
repo: "deb [ arch=amd64 ] http://repo.mongodb.org/apt/ubuntu {{ansible_distribution_release}}/mongodb-org/{{mongodb_version}} multiverse"
mongodb_packages:
mongod: mongodb-org-server

@ -28,42 +28,21 @@
or (ansible_distribution == 'CentOS' and ansible_distribution_version == '7')
# Ubuntu
- name: Import MongoDB public GPG Key xenial
- name: Import MongoDB public GPG Key
apt_key:
keyserver: "{{ apt_xenial.keyserver }}"
id: "{{ apt_xenial.keyserver_id }}"
keyserver: "{{ apt.keyserver }}"
id: "{{ apt.keyserver_id }}"
when:
- ansible_distribution_version == "16.04"
- ansible_distribution == 'Ubuntu'
- name: Add MongoDB repository into sources list xenial
apt_repository:
repo: "{{ apt_xenial.repo }}"
state: present
when:
- ansible_distribution_version == "16.04"
- ansible_distribution == 'Ubuntu'
- name: Import MongoDB public GPG Key bionic
apt_key:
keyserver: "{{ apt_bionic.keyserver }}"
id: "{{ apt_bionic.keyserver_id }}"
when:
- ansible_distribution_version == "18.04"
- ansible_distribution_version in ["16.04", "18.04"]
- ansible_distribution == 'Ubuntu'
- name: Add MongoDB repository into sources list bionic
- name: Add MongoDB repository into sources list
apt_repository:
repo: "{{ apt_bionic.repo }}"
repo: "{{ apt.repo }}"
state: present
update_cache: yes
when:
- ansible_distribution_version == "18.04"
- ansible_distribution == 'Ubuntu'
- name: Update apt keys
shell: apt-key update && apt-get update
when:
- mongodb_version != "4.0"
- ansible_distribution_version in ["16.04", "18.04"]
- ansible_distribution == 'Ubuntu'
# Need to handle various platforms here. Package name will not always be the same

Loading…
Cancel
Save