include distribution specific vars from files

pull/19/head
exploide 8 years ago
parent da5a6738d5
commit 1ca3e00b46
  1. 8
      tasks/include-vars.yml
  2. 10
      tasks/install-with-package.yml
  3. 2
      tasks/main.yml
  4. 1
      vars/Ubuntu-16.04.yml
  5. 2
      vars/default.yml

@ -0,0 +1,8 @@
---
- name: Load a variable file based on the OS type, or a default if not found.
include_vars: "{{ item }}"
with_first_found:
- "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yml"
- "{{ ansible_distribution }}.yml"
- "{{ ansible_os_family }}.yml"
- "default.yml"

@ -1,14 +1,4 @@
--- ---
- name: Define certbot_package (Ubuntu 16.04).
set_fact:
certbot_package: letsencrypt
when: ansible_distribution == 'Ubuntu' and ansible_distribution_version == '16.04'
- name: Define certbot_package.
set_fact:
certbot_package: certbot
when: certbot_package is undefined
- name: Install Certbot. - name: Install Certbot.
package: "name={{ certbot_package }} state=present" package: "name={{ certbot_package }} state=present"

@ -1,4 +1,6 @@
--- ---
- include: include-vars.yml
- include: install-with-package.yml - include: install-with-package.yml
when: not certbot_install_from_source when: not certbot_install_from_source

@ -0,0 +1 @@
certbot_package: letsencrypt

@ -0,0 +1,2 @@
---
certbot_package: certbot
Loading…
Cancel
Save