From a92d424bdb5dc51b143c702754bed761e919a576 Mon Sep 17 00:00:00 2001 From: Alessandro Fael Garcia Date: Wed, 7 Aug 2019 22:16:27 +0200 Subject: [PATCH] Add support for Debian Buster (#163) Closes #151 --- README.md | 5 +++-- meta/main.yml | 6 +++--- molecule/default/molecule.yml | 2 ++ molecule/stable_push/molecule.yml | 2 ++ molecule/template_module/molecule.yml | 2 ++ molecule/unit/molecule.yml | 2 ++ tasks/conf/template-config.yml | 21 +++++++++++---------- tasks/conf/upload-config.yml | 24 ++++++++++++------------ tasks/keys/apt-key.yml | 4 +--- 9 files changed, 38 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index a5d5cd9..d19e23e 100644 --- a/README.md +++ b/README.md @@ -37,9 +37,9 @@ Debian: versions: - jessie - stretch + - buster Ubuntu: versions: - - trusty - xenial - bionic SUSE/SLES: @@ -73,6 +73,7 @@ Debian: versions: - jessie - stretch + - buster FreeBSD: versions: - 11.2+ @@ -92,7 +93,6 @@ SUSE/SLES: - 15 Ubuntu: versions: - - trusty - xenial - bionic ``` @@ -164,6 +164,7 @@ Debian: versions: - jessie - stretch + - buster Ubuntu: versions: - xenial diff --git a/meta/main.yml b/meta/main.yml index 93b8218..c802b6f 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -13,13 +13,14 @@ galaxy_info: - name: Alpine versions: - all - - name: Amazon Linux + - name: Amazon versions: - - candidate + - Candidate - name: Debian versions: - jessie - stretch + - buster - name: EL versions: - 6 @@ -30,7 +31,6 @@ galaxy_info: - 12.0 - name: Ubuntu versions: - - trusty - xenial - bionic - name: SLES diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml index 19423c1..2e6751a 100644 --- a/molecule/default/molecule.yml +++ b/molecule/default/molecule.yml @@ -16,6 +16,8 @@ platforms: image: debian:jessie - name: debian-stretch image: debian:stretch + - name: debian-buster + image: debian:buster - name: ubuntu-xenial image: ubuntu:xenial - name: ubuntu-bionic diff --git a/molecule/stable_push/molecule.yml b/molecule/stable_push/molecule.yml index 1433456..ef5d8d0 100644 --- a/molecule/stable_push/molecule.yml +++ b/molecule/stable_push/molecule.yml @@ -19,6 +19,8 @@ platforms: image: debian:jessie - name: debian-stretch image: debian:stretch + - name: debian-buster + image: debian:buster - name: ubuntu-xenial image: ubuntu:xenial - name: ubuntu-bionic diff --git a/molecule/template_module/molecule.yml b/molecule/template_module/molecule.yml index 1433456..ef5d8d0 100644 --- a/molecule/template_module/molecule.yml +++ b/molecule/template_module/molecule.yml @@ -19,6 +19,8 @@ platforms: image: debian:jessie - name: debian-stretch image: debian:stretch + - name: debian-buster + image: debian:buster - name: ubuntu-xenial image: ubuntu:xenial - name: ubuntu-bionic diff --git a/molecule/unit/molecule.yml b/molecule/unit/molecule.yml index 49a8301..8369595 100644 --- a/molecule/unit/molecule.yml +++ b/molecule/unit/molecule.yml @@ -16,6 +16,8 @@ platforms: image: debian:jessie - name: debian-stretch image: debian:stretch + - name: debian-buster + image: debian:buster - name: ubuntu-xenial image: ubuntu:xenial - name: ubuntu-bionic diff --git a/tasks/conf/template-config.yml b/tasks/conf/template-config.yml index 75112b9..dc22f86 100644 --- a/tasks/conf/template-config.yml +++ b/tasks/conf/template-config.yml @@ -4,7 +4,7 @@ path: "{{ item.value.html_file_location | default('/usr/share/nginx/html') }}" state: directory with_dict: "{{ nginx_html_demo_template }}" - when: nginx_html_demo_template_enable + when: nginx_html_demo_template_enable | bool - name: "(Setup: All NGINX) Dynamically Generate HTML Files" template: @@ -12,20 +12,20 @@ dest: "{{ item.value.html_file_location | default('/usr/share/nginx/html') }}/{{ item.value.html_file_name | default('index.html') }}" backup: yes with_dict: "{{ nginx_html_demo_template }}" - when: nginx_html_demo_template_enable + when: nginx_html_demo_template_enable | bool - name: "(Setup: All NGINX) Ensure NGINX Main Directory Exists" file: path: "{{ nginx_main_template.conf_file_location | default('/etc/nginx') }}" state: directory - when: nginx_main_template_enable + when: nginx_main_template_enable | bool - name: "(Setup: All NGINX) Dynamically Generate NGINX Main Configuration File" template: src: "{{ nginx_main_template.template_file | default('nginx.conf.j2') }}" dest: "{{ nginx_main_template.conf_file_location | default('/etc/nginx') }}/{{ nginx_main_template.conf_file_name | default('nginx.conf') }}" backup: yes - when: nginx_main_template_enable + when: nginx_main_template_enable | bool notify: "(Handler: All OSs) Reload NGINX" - name: "(Setup: All NGINX) Ensure NGINX HTTP Directory Exists" @@ -33,7 +33,7 @@ path: "{{ item.value.conf_file_location | default('/etc/nginx/conf.d/') }}" state: directory with_dict: "{{ nginx_http_template }}" - when: nginx_http_template_enable + when: nginx_http_template_enable | bool - name: "(Setup: All NGINX) Ensure NGINX Proxy Cache Directories Exist" file: @@ -44,7 +44,7 @@ - "{{ nginx_http_template }}" - reverse_proxy.proxy_cache_path - skip_missing: true - when: nginx_http_template_enable + when: nginx_http_template_enable | bool - name: "(Setup: All NGINX) Dynamically Generate NGINX HTTP Configuration Files" template: @@ -52,23 +52,24 @@ dest: "{{ item.value.conf_file_location | default('/etc/nginx/conf.d/') }}/{{ item.value.conf_file_name | default('default.conf') }}" backup: yes with_dict: "{{ nginx_http_template }}" - when: nginx_http_template_enable + when: nginx_http_template_enable | bool notify: "(Handler: All OSs) Reload NGINX" + - name: "(Setup: All NGINX) Dynamically Generate NGINX API Configuration File" template: src: "{{ nginx_rest_api_src | default('http/api.conf.j2') }}" dest: "{{ nginx_rest_api_location | default('/etc/nginx/conf.d/api.conf') }}" backup: yes notify: "(Handler: All OSs) Reload NGINX" - when: nginx_rest_api_enable + when: nginx_rest_api_enable | bool - name: "(Setup: All NGINX) Ensure NGINX Stream Directory Exists" file: path: "{{ item.value.conf_file_location | default('/etc/nginx/conf.d/stream/') }}" state: directory with_dict: "{{ nginx_stream_template }}" - when: nginx_stream_template_enable + when: nginx_stream_template_enable | bool - name: "(Setup: All NGINX) Dynamically Generate NGINX Stream Configuration Files" template: @@ -76,5 +77,5 @@ dest: "{{ item.value.conf_file_location | default('/etc/nginx/conf.d/stream/') }}/{{ item.value.conf_file_name | default('default.conf') }}" backup: yes with_dict: "{{ nginx_stream_template }}" - when: nginx_stream_template_enable notify: "(Handler: All OSs) Reload NGINX" + when: nginx_stream_template_enable | bool diff --git a/tasks/conf/upload-config.yml b/tasks/conf/upload-config.yml index 9add6a9..fb08fb6 100644 --- a/tasks/conf/upload-config.yml +++ b/tasks/conf/upload-config.yml @@ -3,21 +3,21 @@ file: path: "{{ nginx_main_upload_dest | default('/etc/nginx/') }}" state: directory - when: nginx_main_upload_enable + when: nginx_main_upload_enable | bool - name: "(Setup: All NGINX) Upload NGINX Main Configuration File" copy: src: "{{ nginx_main_upload_src | default('conf/nginx.conf') }}" dest: "{{ nginx_main_upload_dest | default('/etc/nginx/') }}" backup: yes + when: nginx_main_upload_enable | bool notify: "(Handler: All OSs) Reload NGINX" - when: nginx_main_upload_enable - name: "(Setup: All NGINX) Ensure NGINX HTTP Directory Exists" file: path: "{{ nginx_http_upload_dest | default('/etc/nginx/conf.d/') }}" state: directory - when: nginx_http_upload_enable + when: nginx_http_upload_enable | bool - name: "(Setup: All NGINX) Upload NGINX HTTP Configuration Files" copy: @@ -25,14 +25,14 @@ dest: "{{ nginx_http_upload_dest | default('/etc/nginx/conf.d/') }}" backup: yes with_fileglob: "{{ nginx_http_upload_src }}" + when: nginx_http_upload_enable | bool notify: "(Handler: All OSs) Reload NGINX" - when: nginx_http_upload_enable - name: "(Setup: All NGINX) Ensure NGINX Stream Directory Exists" file: path: "{{ nginx_stream_upload_dest | default('/etc/nginx/conf.d/') }}" state: directory - when: nginx_stream_upload_enable + when: nginx_stream_upload_enable | bool - name: "(Setup: All NGINX) Upload NGINX Stream Configuration Files" copy: @@ -40,14 +40,14 @@ dest: "{{ nginx_stream_upload_dest | default('/etc/nginx/conf.d/') }}" backup: yes with_fileglob: "{{ nginx_stream_upload_src }}" + when: nginx_stream_upload_enable | bool notify: "(Handler: All OSs) Reload NGINX" - when: nginx_stream_upload_enable - name: "(Setup: All NGINX) Ensure NGINX HTML Directory Exists" file: path: "{{ nginx_html_upload_dest | default('/usr/share/nginx/html') }}" state: directory - when: nginx_html_upload_enable + when: nginx_html_upload_enable | bool - name: "(Setup: All NGINX) Upload NGINX HTML Files" copy: @@ -55,20 +55,20 @@ dest: "{{ nginx_html_upload_dest | default('/usr/share/nginx/html') }}" backup: yes with_fileglob: "{{ nginx_html_upload_src }}" + when: nginx_html_upload_enable | bool notify: "(Handler: All OSs) Reload NGINX" - when: nginx_html_upload_enable - name: "(Setup: All NGINX) Ensure SSL Certificate Directory Exists" file: path: "{{ nginx_ssl_crt_upload_dest | default('/etc/ssl/certs/') }}" state: directory - when: nginx_ssl_upload_enable + when: nginx_ssl_upload_enable | bool - name: "(Setup: All NGINX) Ensure SSL Key Directory Exists" file: path: "{{ nginx_ssl_key_upload_dest | default('/etc/ssl/private/') }}" state: directory - when: nginx_ssl_upload_enable + when: nginx_ssl_upload_enable | bool - name: "(Setup: All NGINX) Upload NGINX SSL Certificates" copy: @@ -78,7 +78,7 @@ decrypt: yes backup: yes with_fileglob: "{{ nginx_ssl_crt_upload_src }}" - when: nginx_ssl_upload_enable + when: nginx_ssl_upload_enable | bool - name: "(Setup: All NGINX) Upload NGINX SSL Keys" copy: @@ -88,4 +88,4 @@ decrypt: yes backup: yes with_fileglob: "{{ nginx_ssl_key_upload_src }}" - when: nginx_ssl_upload_enable + when: nginx_ssl_upload_enable | bool diff --git a/tasks/keys/apt-key.yml b/tasks/keys/apt-key.yml index 7abb01c..ef7f140 100644 --- a/tasks/keys/apt-key.yml +++ b/tasks/keys/apt-key.yml @@ -1,9 +1,7 @@ --- - name: "(Install: APT OSs) Set Default APT NGINX Signing Key URL" set_fact: - default_keysite: >- - {{ (ansible_distribution_release == 'trusty') - | ternary('http://nginx.org/keys/nginx_signing.key', 'https://nginx.org/keys/nginx_signing.key') }} + default_keysite: https://nginx.org/keys/nginx_signing.key - name: "(Install: APT OSs) Set APT NGINX Signing Key URL" set_fact: