Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Latest examples available on main don't work on the latest Ansible Galaxy release (0.3.3) #93

Closed
rolandjitsu opened this issue Mar 20, 2021 · 17 comments
Assignees
Labels
documentation Improvements or additions to documentation question How do I do X / how does X work?
Milestone

Comments

@rolandjitsu
Copy link
Contributor

Describe the bug

I'm trying to setup a simple HTTP server on a Debian machine with the following config:

# my_role/meta/main.yml
---
allow_duplicates: no
dependencies:
  - role: nginxinc.nginx
    become: yes
  - role: nginxinc.nginx_config
    become: yes
    vars:
      nginx_config_debug_output: true
      nginx_config_debug_tasks: true
      nginx_config_cleanup: true
      nginx_config_cleanup_files:
        - /etc/nginx/conf.d/default.conf
      nginx_config_main_template_enable: true
      nginx_config_main_template:
        user: pi
        http_enable: true
        http_settings:
          gzip:
            enable: true
          access_log_format:
            - name: main
              format: |-
                '$remote_addr - $remote_user [$time_local] "$request" '
                '$status $body_bytes_sent "$http_referer" '
                '"$http_user_agent" "$http_x_forwarded_for"'
          access_log_location:
            - name: main
              location: /var/log/nginx/access.log
          keepalive_timeout: 65
      nginx_config_http_template_enable: true
      nginx_config_http_template:
        # - template_file: http/default.conf.j2
        # conf_file_name: default.v1.conf
        # conf_file_location: /etc/nginx/conf.d/
        - servers:
            - server_name: localhost
              listen:
                - ip: localhost
                  port: 80
              gzip:
                enable: true
              root: "{{ ui_pkg_dst }}"
              index: index.html
              try_files: $uri $uri/index.html $uri.html =404
              locations:
                - location: /
                  root: "{{ ui_pkg_dst }}"
                  index: index.html
                  try_files: $uri $uri/index.html $uri.html =404

But it seems like the config file on the remote host is always empty or contains just the comment:

TASK [Gathering Facts] *******************************************************************************************************************************************************************************************
ok: [dum-e]

TASK [nginxinc.nginx : Check whether you are using a supported NGINX distribution] *******************************************************************************************************************************
ok: [dum-e] => {
    "changed": false,
    "msg": "Your OS, Debian is supported by NGINX Open Source"
}

TASK [nginxinc.nginx : Set up prerequisites] *********************************************************************************************************************************************************************
included: /Users/rolandgroza/.ansible/roles/nginxinc.nginx/tasks/prerequisites/prerequisites.yml for dum-e

TASK [nginxinc.nginx : Install dependencies] *********************************************************************************************************************************************************************
included: /Users/rolandgroza/.ansible/roles/nginxinc.nginx/tasks/prerequisites/install-dependencies.yml for dum-e

TASK [nginxinc.nginx : (Alpine Linux) Install dependencies] ******************************************************************************************************************************************************
skipping: [dum-e]

TASK [nginxinc.nginx : (Debian/Ubuntu) Install dependencies] *****************************************************************************************************************************************************
ok: [dum-e]

TASK [nginxinc.nginx : (Amazon Linux/CentOS/Oracle Linux/RHEL) Install dependencies] *****************************************************************************************************************************
skipping: [dum-e]

TASK [nginxinc.nginx : (SLES) Install dependencies] **************************************************************************************************************************************************************
skipping: [dum-e]

TASK [nginxinc.nginx : (FreeBSD) Install dependencies using package(s)] ******************************************************************************************************************************************
skipping: [dum-e]

TASK [nginxinc.nginx : (FreeBSD) Install dependencies using port(s)] *********************************************************************************************************************************************
skipping: [dum-e] => (item=security/ca_root_nss) 

TASK [nginxinc.nginx : Check if SELinux is enabled] **************************************************************************************************************************************************************
skipping: [dum-e]

TASK [nginxinc.nginx : Configure SELinux] ************************************************************************************************************************************************************************
skipping: [dum-e]

TASK [nginxinc.nginx : Set up signing keys] **********************************************************************************************************************************************************************
included: /Users/rolandgroza/.ansible/roles/nginxinc.nginx/tasks/keys/setup-keys.yml for dum-e

TASK [nginxinc.nginx : (Alpine Linux) Set up NGINX signing key URL] **********************************************************************************************************************************************
skipping: [dum-e]

TASK [nginxinc.nginx : (Alpine Linux) Download NGINX signing key] ************************************************************************************************************************************************
skipping: [dum-e]

TASK [nginxinc.nginx : (Debian/Red Hat/SLES OSs) Set up NGINX signing key URL] ***********************************************************************************************************************************
ok: [dum-e]

TASK [nginxinc.nginx : (Debian/Ubuntu) Add NGINX signing key] ****************************************************************************************************************************************************
ok: [dum-e]

TASK [nginxinc.nginx : (Amazon Linux/CentOS/Oracle Linux/RHEL/SLES) Add NGINX signing key] ***********************************************************************************************************************
skipping: [dum-e]

TASK [nginxinc.nginx : Install NGINX Open Source] ****************************************************************************************************************************************************************
included: /Users/rolandgroza/.ansible/roles/nginxinc.nginx/tasks/opensource/install-oss.yml for dum-e

TASK [nginxinc.nginx : Install NGINX from repository] ************************************************************************************************************************************************************
included: /Users/rolandgroza/.ansible/roles/nginxinc.nginx/tasks/opensource/install-debian.yml for dum-e

TASK [nginxinc.nginx : (Debian/Ubuntu) Configure NGINX repository] ***********************************************************************************************************************************************
ok: [dum-e] => (item=deb [arch=amd64] https://nginx.org/packages/mainline/debian/ buster nginx)
ok: [dum-e] => (item=deb-src https://nginx.org/packages/mainline/debian/ buster nginx)

TASK [nginxinc.nginx : (Debian/Ubuntu) Install NGINX] ************************************************************************************************************************************************************
ok: [dum-e]

TASK [nginxinc.nginx : Install NGINX from source] ****************************************************************************************************************************************************************
skipping: [dum-e]

TASK [nginxinc.nginx : Install NGINX from package] ***************************************************************************************************************************************************************
skipping: [dum-e]

TASK [nginxinc.nginx : Install NGINX in Unix systems] ************************************************************************************************************************************************************
skipping: [dum-e]

TASK [nginxinc.nginx : Set up NGINX Plus license] ****************************************************************************************************************************************************************
skipping: [dum-e]

TASK [nginxinc.nginx : Install NGINX Plus] ***********************************************************************************************************************************************************************
skipping: [dum-e]

TASK [nginxinc.nginx : Install NGINX modules] ********************************************************************************************************************************************************************
skipping: [dum-e]

TASK [nginxinc.nginx : Remove NGINX Plus license] ****************************************************************************************************************************************************************
skipping: [dum-e]

TASK [nginxinc.nginx : Modify systemd parameters] ****************************************************************************************************************************************************************
skipping: [dum-e]
[WARNING]: flush_handlers task does not support when conditional

TASK [nginxinc.nginx : Debug NGINX output] ***********************************************************************************************************************************************************************
skipping: [dum-e]

TASK [nginxinc.nginx : Configure logrotate for NGINX] ************************************************************************************************************************************************************
skipping: [dum-e]

TASK [nginxinc.nginx : Install NGINX Amplify] ********************************************************************************************************************************************************************
skipping: [dum-e]

TASK [nginxinc.nginx_config : Set up SELinux] ********************************************************************************************************************************************************************
skipping: [dum-e]

TASK [nginxinc.nginx_config : Cleanup NGINX config] **************************************************************************************************************************************************************
included: /Users/rolandgroza/.ansible/roles/nginxinc.nginx_config/tasks/config/cleanup-config.yml for dum-e

TASK [nginxinc.nginx_config : Find NGINX config files] ***********************************************************************************************************************************************************
skipping: [dum-e]

TASK [nginxinc.nginx_config : Remove NGINX config files] *********************************************************************************************************************************************************
changed: [dum-e] => (item=/etc/nginx/conf.d/default.conf)

TASK [nginxinc.nginx_config : Upload NGINX config] ***************************************************************************************************************************************************************
skipping: [dum-e]

TASK [nginxinc.nginx_config : Create NGINX config] ***************************************************************************************************************************************************************
included: /Users/rolandgroza/.ansible/roles/nginxinc.nginx_config/tasks/config/template-config.yml for dum-e

TASK [nginxinc.nginx_config : Ensure HTML directory exists] ******************************************************************************************************************************************************
skipping: [dum-e] => (item={'key': 'default', 'value': {'template_file': 'www/index.html.j2', 'html_file_name': 'index.html', 'html_file_location': '/usr/share/nginx/html', 'web_server_name': 'Default'}}) 

TASK [nginxinc.nginx_config : Dynamically generate HTML files] ***************************************************************************************************************************************************
skipping: [dum-e] => (item={'key': 'default', 'value': {'template_file': 'www/index.html.j2', 'html_file_name': 'index.html', 'html_file_location': '/usr/share/nginx/html', 'web_server_name': 'Default'}}) 

TASK [nginxinc.nginx_config : Configure NGINX modules] ***********************************************************************************************************************************************************
skipping: [dum-e]

TASK [nginxinc.nginx_config : Ensure NGINX main directory exists] ************************************************************************************************************************************************
ok: [dum-e]

TASK [nginxinc.nginx_config : Dynamically generate NGINX main configuration file] ********************************************************************************************************************************
ok: [dum-e]

TASK [nginxinc.nginx_config : Ensure NGINX HTTP directory exists] ************************************************************************************************************************************************
ok: [dum-e] => (item={'key': 'servers', 'value': [{'server_name': 'localhost', 'listen': [{'ip': 'localhost', 'port': 80}], 'gzip': {'enable': True}, 'root': '/home/pi/ui', 'index': 'index.html', 'try_files': '$uri $uri/index.html $uri.html =404', 'locations': [{'location': '/', 'root': '/home/pi/ui', 'index': 'index.html', 'try_files': '$uri $uri/index.html $uri.html =404'}]}]})

TASK [nginxinc.nginx_config : Ensure NGINX proxy cache directories exist] ****************************************************************************************************************************************

TASK [nginxinc.nginx_config : Dynamically generate NGINX HTTP config files] **************************************************************************************************************************************
changed: [dum-e] => (item={'key': 'servers', 'value': [{'server_name': 'localhost', 'listen': [{'ip': 'localhost', 'port': 80}], 'gzip': {'enable': True}, 'root': '/home/pi/ui', 'index': 'index.html', 'try_files': '$uri $uri/index.html $uri.html =404', 'locations': [{'location': '/', 'root': '/home/pi/ui', 'index': 'index.html', 'try_files': '$uri $uri/index.html $uri.html =404'}]}]})

TASK [nginxinc.nginx_config : Dynamically generate NGINX stub status config file] ********************************************************************************************************************************
skipping: [dum-e]

TASK [nginxinc.nginx_config : Dynamically generate NGINX API config file] ****************************************************************************************************************************************
skipping: [dum-e]

TASK [nginxinc.nginx_config : Ensure NGINX stream directory exists] **********************************************************************************************************************************************
skipping: [dum-e] => (item={'key': 'default', 'value': {'template_file': 'stream/default.conf.j2', 'conf_file_name': 'default.conf', 'conf_file_location': '/etc/nginx/conf.d/stream/', 'network_streams': {'default': {'listen': {'listen_localhost': {'ip': '0.0.0.0', 'port': 80, 'ssl': False, 'opts': []}}, 'ssl': {'cert': '/etc/ssl/certs/default.crt', 'key': '/etc/ssl/private/default.key', 'dhparam': '/etc/ssl/private/dh_param.pem', 'protocols': 'TLSv1 TLSv1.1 TLSv1.2', 'ciphers': 'HIGH:!aNULL:!MD5', 'prefer_server_ciphers': True, 'session_cache': 'none', 'session_timeout': '5m', 'disable_session_tickets': False, 'trusted_cert': '/etc/ssl/certs/root_CA_cert_plus_intermediates.crt', 'ecdh_curve': 'auto'}, 'include_files': [], 'proxy_pass': 'backend', 'proxy_timeout': '3s', 'proxy_connect_timeout': '1s', 'proxy_protocol': False, 'proxy_ssl': {'cert': '/etc/ssl/certs/proxy_default.crt', 'key': '/etc/ssl/private/proxy_default.key', 'trusted_cert': '/etc/ssl/certs/proxy_ca.crt', 'protocols': 'TLSv1 TLSv1.1 TLSv1.2', 'ciphers': 'HIGH:!aNULL:!MD5', 'verify': False, 'verify_depth': 1, 'session_reuse': True}, 'health_check_plus': False}}, 'upstreams': {'upstream1': {'name': 'backend', 'lb_method': 'least_conn', 'zone_name': 'backend', 'zone_size': '64k', 'sticky_cookie': False, 'servers': {'server1': {'address': 'localhost', 'port': 8080, 'weight': 1, 'health_check': 'max_fails=1 fail_timeout=10s'}}}}}}) 

TASK [nginxinc.nginx_config : Dynamically generate NGINX stream config files] ************************************************************************************************************************************
skipping: [dum-e] => (item={'key': 'default', 'value': {'template_file': 'stream/default.conf.j2', 'conf_file_name': 'default.conf', 'conf_file_location': '/etc/nginx/conf.d/stream/', 'network_streams': {'default': {'listen': {'listen_localhost': {'ip': '0.0.0.0', 'port': 80, 'ssl': False, 'opts': []}}, 'ssl': {'cert': '/etc/ssl/certs/default.crt', 'key': '/etc/ssl/private/default.key', 'dhparam': '/etc/ssl/private/dh_param.pem', 'protocols': 'TLSv1 TLSv1.1 TLSv1.2', 'ciphers': 'HIGH:!aNULL:!MD5', 'prefer_server_ciphers': True, 'session_cache': 'none', 'session_timeout': '5m', 'disable_session_tickets': False, 'trusted_cert': '/etc/ssl/certs/root_CA_cert_plus_intermediates.crt', 'ecdh_curve': 'auto'}, 'include_files': [], 'proxy_pass': 'backend', 'proxy_timeout': '3s', 'proxy_connect_timeout': '1s', 'proxy_protocol': False, 'proxy_ssl': {'cert': '/etc/ssl/certs/proxy_default.crt', 'key': '/etc/ssl/private/proxy_default.key', 'trusted_cert': '/etc/ssl/certs/proxy_ca.crt', 'protocols': 'TLSv1 TLSv1.1 TLSv1.2', 'ciphers': 'HIGH:!aNULL:!MD5', 'verify': False, 'verify_depth': 1, 'session_reuse': True}, 'health_check_plus': False}}, 'upstreams': {'upstream1': {'name': 'backend', 'lb_method': 'least_conn', 'zone_name': 'backend', 'zone_size': '64k', 'sticky_cookie': False, 'servers': {'server1': {'address': 'localhost', 'port': 8080, 'weight': 1, 'health_check': 'max_fails=1 fail_timeout=10s'}}}}}}) 

RUNNING HANDLER [nginxinc.nginx_config : (Handler - NGINX Config) Check NGINX] ***********************************************************************************************************************************
ok: [dum-e]

RUNNING HANDLER [nginxinc.nginx_config : (Handler - NGINX Config) Print NGINX error if syntax check fails] *******************************************************************************************************
skipping: [dum-e]

RUNNING HANDLER [nginxinc.nginx_config : (Handler - NGINX Config) Start/reload NGINX] ****************************************************************************************************************************
changed: [dum-e]

TASK [nginxinc.nginx_config : Debug output] **********************************************************************************************************************************************************************
included: /Users/rolandgroza/.ansible/roles/nginxinc.nginx_config/tasks/config/debug-output.yml for dum-e

TASK [nginxinc.nginx_config : Register NGINX config] *************************************************************************************************************************************************************
ok: [dum-e]

TASK [nginxinc.nginx_config : Print NGINX config] ****************************************************************************************************************************************************************
ok: [dum-e] => {
    "config_full.stdout_lines": [
        "# configuration file /etc/nginx/nginx.conf:",
        "#",
        "# Ansible managed",
        "#",
        "",
        "",
        "user pi;",
        "",
        "",
        "",
        "events {",
        "}",
        "",
        "http {",
        "    include       /etc/nginx/mime.types;",
        "    default_type  application/octet-stream;",
        "    log_format  main  '$remote_addr - $remote_user [$time_local] \"$request\" '",
        "'$status $body_bytes_sent \"$http_referer\" '",
        "'\"$http_user_agent\" \"$http_x_forwarded_for\"';",
        "    access_log  /var/log/nginx/access.log  main;",
        "    keepalive_timeout  65;",
        "    gzip on;",
        "",
        "    include /etc/nginx/conf.d/*.conf;",
        "}",
        "",
        "",
        "# configuration file /etc/nginx/mime.types:",
        "",
        "types {",
        "    text/html                             html htm shtml;",
        "    text/css                              css;",
        "    text/xml                              xml;",
        "    image/gif                             gif;",
        "    image/jpeg                            jpeg jpg;",
        "    application/javascript                js;",
        "    application/atom+xml                  atom;",
        "    application/rss+xml                   rss;",
        "",
        "    text/mathml                           mml;",
        "    text/plain                            txt;",
        "    text/vnd.sun.j2me.app-descriptor      jad;",
        "    text/vnd.wap.wml                      wml;",
        "    text/x-component                      htc;",
        "",
        "    image/png                             png;",
        "    image/tiff                            tif tiff;",
        "    image/vnd.wap.wbmp                    wbmp;",
        "    image/x-icon                          ico;",
        "    image/x-jng                           jng;",
        "    image/x-ms-bmp                        bmp;",
        "    image/svg+xml                         svg svgz;",
        "    image/webp                            webp;",
        "",
        "    application/font-woff                 woff;",
        "    application/java-archive              jar war ear;",
        "    application/json                      json;",
        "    application/mac-binhex40              hqx;",
        "    application/msword                    doc;",
        "    application/pdf                       pdf;",
        "    application/postscript                ps eps ai;",
        "    application/rtf                       rtf;",
        "    application/vnd.apple.mpegurl         m3u8;",
        "    application/vnd.ms-excel              xls;",
        "    application/vnd.ms-fontobject         eot;",
        "    application/vnd.ms-powerpoint         ppt;",
        "    application/vnd.wap.wmlc              wmlc;",
        "    application/vnd.google-earth.kml+xml  kml;",
        "    application/vnd.google-earth.kmz      kmz;",
        "    application/x-7z-compressed           7z;",
        "    application/x-cocoa                   cco;",
        "    application/x-java-archive-diff       jardiff;",
        "    application/x-java-jnlp-file          jnlp;",
        "    application/x-makeself                run;",
        "    application/x-perl                    pl pm;",
        "    application/x-pilot                   prc pdb;",
        "    application/x-rar-compressed          rar;",
        "    application/x-redhat-package-manager  rpm;",
        "    application/x-sea                     sea;",
        "    application/x-shockwave-flash         swf;",
        "    application/x-stuffit                 sit;",
        "    application/x-tcl                     tcl tk;",
        "    application/x-x509-ca-cert            der pem crt;",
        "    application/x-xpinstall               xpi;",
        "    application/xhtml+xml                 xhtml;",
        "    application/xspf+xml                  xspf;",
        "    application/zip                       zip;",
        "",
        "    application/octet-stream              bin exe dll;",
        "    application/octet-stream              deb;",
        "    application/octet-stream              dmg;",
        "    application/octet-stream              iso img;",
        "    application/octet-stream              msi msp msm;",
        "",
        "    application/vnd.openxmlformats-officedocument.wordprocessingml.document    docx;",
        "    application/vnd.openxmlformats-officedocument.spreadsheetml.sheet          xlsx;",
        "    application/vnd.openxmlformats-officedocument.presentationml.presentation  pptx;",
        "",
        "    audio/midi                            mid midi kar;",
        "    audio/mpeg                            mp3;",
        "    audio/ogg                             ogg;",
        "    audio/x-m4a                           m4a;",
        "    audio/x-realaudio                     ra;",
        "",
        "    video/3gpp                            3gpp 3gp;",
        "    video/mp2t                            ts;",
        "    video/mp4                             mp4;",
        "    video/mpeg                            mpeg mpg;",
        "    video/quicktime                       mov;",
        "    video/webm                            webm;",
        "    video/x-flv                           flv;",
        "    video/x-m4v                           m4v;",
        "    video/x-mng                           mng;",
        "    video/x-ms-asf                        asx asf;",
        "    video/x-ms-wmv                        wmv;",
        "    video/x-msvideo                       avi;",
        "}",
        "",
        "# configuration file /etc/nginx/conf.d/default.conf:",
        "#",
        "# Ansible managed",
        "#"
    ]
}

To reproduce

Steps to reproduce the behavior:

  1. Deploy NGINX Config role using a role that depends on this role and has the above config
  2. Check /etc/nginx/conf.d/default.conf contents

Expected behavior

I'd expect the config file on the remote host to be generated with the config I've setup.

Your environment:

  • Version of the NGINX Config role or specific commit
---
roles:
  # https://github.com/nginxinc/ansible-role-nginx
  - src: nginxinc.nginx
    version: 0.19.1
  # https://github.com/nginxinc/ansible-role-nginx-config
  - src: nginxinc.nginx_config
    version: 0.3.3
  • Version of Ansible
❯ ansible --version                                                                            
ansible 2.10.2
  config file = /Users/rolandgroza/Work/jigs/ansible.cfg
  configured module search path = ['/Users/rolandgroza/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /Users/rolandgroza/.pyenv/versions/3.8.6/envs/python-3.8/lib/python3.8/site-packages/ansible
  executable location = /Users/rolandgroza/.pyenv/versions/python-3.8/bin/ansible
  python version = 3.8.6 (default, Nov  1 2020, 20:18:23) [Clang 11.0.3 (clang-1103.0.32.62)]
  • Target deployment platform: Debian 10

Additional context

Add any other context about the problem here.

@alessfg alessfg self-assigned this Mar 22, 2021
@alessfg
Copy link
Collaborator

alessfg commented Mar 22, 2021

I think the issue is that you are using the configuration syntax that 0.4.0 is going to use when it's released vs the configuration syntax that 0.3.3 uses. Might I suggest pulling the latest commit from main and checking if that works?

@alessfg alessfg added the question How do I do X / how does X work? label Mar 22, 2021
@alessfg alessfg added this to To do in NGINX Configuration via automation Mar 22, 2021
@ghomem
Copy link

ghomem commented Mar 23, 2021

I seem to be seeing the same issue as reported here.

@rolandjitsu
Copy link
Contributor Author

I think the issue is that you are using the configuration syntax that 0.4.0 is going to use when it's released vs the configuration syntax that 0.3.3 uses. Might I suggest pulling the latest commit from main and checking if that works?

Yeah, that seems to be issue. I've pulled the last commit and tested it and the config is generated as expected.

@ghomem
Copy link

ghomem commented Mar 23, 2021

Indeed, seems that pulling the latest from makes it work. Will this fix make it to the ansible-galaxy repository?

@alessfg
Copy link
Collaborator

alessfg commented Mar 23, 2021

It will make it to ansible-galaxy when 0.4.0 is released. That being said, I am holding on releasing 0.4.0 until I finish refactoring the various templates to a more sustainable development model (using macros).

I'll leave this issue open until 0.4.0 is released in case anyone else encounters a similar issue.

@alessfg alessfg added this to the 0.4.0 milestone Mar 23, 2021
@gregorydlogan
Copy link

@alessfg I just burned a couple of hours chasing down why my seemingly valid sytax wasn't working with 0.3.3. Is there an ETA on 0.4.0?

@alessfg
Copy link
Collaborator

alessfg commented May 3, 2021

Sadly, no. Other higher priority tasks have kept me from dedicating as much time as I'd like to the Ansible roles. That being said, what I can do is add a disclaimer to the README for the time being pointing people to the 0.3.3 docs if they are using the latest release (instead of pulling from GitHub).

@alessfg
Copy link
Collaborator

alessfg commented May 4, 2021

Aaand done 030e282 -- I'm also going to change this issue's title and pin it to try to avoid people loosing unnecessary time figuring out why the latest examples are not working.

@alessfg alessfg added the documentation Improvements or additions to documentation label May 4, 2021
@alessfg alessfg changed the title Config in /etc/nginx/conf.d/default.conf is not populated Latest examples available on main don't work on the latest Ansible Galaxy release May 4, 2021
@alessfg alessfg pinned this issue May 4, 2021
@alessfg alessfg changed the title Latest examples available on main don't work on the latest Ansible Galaxy release Latest examples available on main don't work on the latest Ansible Galaxy release (0.3.3) May 4, 2021
gregorydlogan added a commit to opencast/oc-config-management that referenced this issue May 18, 2021
…n branch of nginx_config. Followed up on nginxinc/ansible-role-nginx-config#93 to see when 0.4.0 will be available.
@acelinkio
Copy link

Hey @alessfg, Is there a ticket somewhere with what has been completed and needs to be done for the 0.4.0 release?

I would like to make some simple examples/docs, just not sure what state everything is in.

@alessfg
Copy link
Collaborator

alessfg commented Oct 18, 2021

If everything goes according to plan, 0.4.0 should be live by end of week.

I originally planned to release it about a month ago once I finished my refactoring efforts, but as is tradition, there were some last minute developments regarding upcoming NGINX releases that delayed the release.

@alessfg
Copy link
Collaborator

alessfg commented Oct 19, 2021

I am happy to report that 0.4.0 is finally live! https://github.com/nginxinc/ansible-role-nginx-config/releases/tag/0.4.0

Closing this for the time being since the original issue posted here should hopefully no longer be an issue.

@alessfg alessfg closed this as completed Oct 19, 2021
NGINX Configuration automation moved this from To do to Done Oct 19, 2021
@acelinkio
Copy link

- name: "edgelb"
  hosts: edgeloadbalancer01
  roles:
  - name: nginxinc.nginx
    vars:
      ansible_become: yes
  - name: nginxinc.nginx_config
    vars: 
      ansible_become: yes
      nginx_config_http_template_enable: true
      nginx_config_http_template:
        - template_file: http/default.conf.j2
          deployment_location: /etc/nginx/conf.d/default.conf
          config:
            upstreams:
              - name: localtest
                servers:
                  - address: localhost:9000
            servers:
              - core:
                  listen:
                    - address: 0.0.0.0
                      port: 80
                locations:
                  - location: /
                    proxy:
                      pass: http://localtest/

posting my ansibleplaybook example for basic setup with 0.4.0. @rolandjitsu

@rolandjitsu
Copy link
Contributor Author

- name: "edgelb"
  hosts: edgeloadbalancer01
  roles:
  - name: nginxinc.nginx
    vars:
      ansible_become: yes
  - name: nginxinc.nginx_config
    vars: 
      ansible_become: yes
      nginx_config_http_template_enable: true
      nginx_config_http_template:
        - template_file: http/default.conf.j2
          deployment_location: /etc/nginx/conf.d/default.conf
          config:
            upstreams:
              - name: localtest
                servers:
                  - address: localhost:9000
            servers:
              - core:
                  listen:
                    - address: 0.0.0.0
                      port: 80
                locations:
                  - location: /
                    proxy:
                      pass: http://localtest/

posting my ansibleplaybook example for basic setup with 0.4.0. @rolandjitsu

Has the config spec changed? Because I've tried updating to 0.4.0 yesterday and the generated output wasn't similar to what it was when using fa49aa0.

@alessfg
Copy link
Collaborator

alessfg commented Oct 22, 2021

Yep, it has. Long story short I've been slowly refactoring the whole config spec over the last year to make it more sustainable long term. I've tried my best to go in depth over the changes on the CHANGELOG but to be completely honest given that everything has changed in some shape or another it might be easier to recreate the config altogether instead of trying to port it. Not the best scenario I know, but on better news I do not expect the config spec to undergo any further drastic changes down the line.

@rolandjitsu
Copy link
Contributor Author

Yep, it has. Long story short I've been slowly refactoring the whole config spec over the last year to make it more sustainable long term. I've tried my best to go in depth over the changes on the CHANGELOG but to be completely honest given that everything has changed in some shape or another it might be easier to recreate the config altogether instead of trying to port it. Not the best scenario I know, but on better news I do not expect the config spec to undergo any further drastic changes down the line.

Ok, I understand. I guess I'll just have to spend a bit of time updating to the new spec.

@alessfg
Copy link
Collaborator

alessfg commented Nov 2, 2021

For sure. Feel free to open a new issue if you have any questions!

@alessfg alessfg unpinned this issue Dec 7, 2021
@alessfg
Copy link
Collaborator

alessfg commented Dec 7, 2021

Unpinning this issue as with the latest release the latest examples on main do work with the latest Ansible Galaxy release (0.4.2).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation question How do I do X / how does X work?
Projects
Development

No branches or pull requests

5 participants