diff --git a/README.md b/README.md index 008d9dd..0371905 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,10 @@ marathon_version: "1.3.6" # Debian: Mesosphere apt repository URL marathon_apt_package: "marathon={{ marathon_version }}-*" marathon_apt_repo: "deb http://repos.mesosphere.com/{{ansible_distribution|lower}} {{ansible_distribution_release|lower}} main" +marathon_apt_key_id: 'E56151BF' +marathon_apt_key_server: 'keyserver.ubuntu.com' +# undefined if using key server; if set, will override adding key from key_server above +marathon_apt_key_url: # Debian apt pin priority for the marathon package. If empty (the default), no pin priority is used. marathon_apt_pin_priority: diff --git a/defaults/main.yml b/defaults/main.yml index 654095c..f7a9ae5 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -8,6 +8,9 @@ marathon_package_version: "1.0.540" marathon_os_distribution: "{{ ansible_distribution | lower }}" marathon_os_version: "{{ ansible_distribution_version.split('.') | join('') }}" marathon_apt_url: "http://{{ marathon_repo_host }}/{{ ansible_distribution | lower }}" +marathon_apt_key_id: 'E56151BF' +marathon_apt_keyserver: 'keyserver.ubuntu.com' +marathon_apt_key_url: marathon_package_full_version: "{{ marathon_version }}-{{ marathon_package_version }}.{{ marathon_os_distribution }}{{ marathon_os_version }}" marathon_apt_package: "marathon={{ marathon_package_full_version }}" diff --git a/tasks/Debian.yml b/tasks/Debian.yml index a639469..14e4442 100644 --- a/tasks/Debian.yml +++ b/tasks/Debian.yml @@ -1,6 +1,21 @@ --- -- name: Add apt-key - apt_key: id=E56151BF keyserver=keyserver.ubuntu.com state=present +- name: Add apt-key (keyserver) + apt_key: + id: "{{ marathon_apt_key_id }}" + keyserver: "{{ marathon_apt_key_server }}" + state: present + when: + - marathon_apt_key_id and marathon_apt_key_server + - marathon_apt_key_url is not defined + +- name: Add apt-key (url) + apt_key: + id: "{{ marathon_apt_key_id }}" + url: "{{ marathon_apt_key_url }}" + state: present + when: + - marathon_apt_key_id and marathon_apt_key_url + - marathon_apt_key_url is defined - name: Add Mesosphere repo apt_repository: repo='deb {{ marathon_apt_url }} {{ ansible_distribution_release | lower }} main' state=present update_cache=yes