Code Monkey home page Code Monkey logo

ansible-collection-nginx's People

Contributors

alessfg avatar vandud avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ansible-collection-nginx's Issues

Getting error when using collection anybody else seen this?

I have installed the collection then used a playbook to run this
ansible version is 2.10.6
Playbook is

  • hosts: all
    collections:
    • nginxinc.nginx_core
      roles:
    • role: nginx

Using debian buster get a message debian supported
"msg": "Your OS, Debian is supported by NGINX Open Source"

then an error and then stops not sure why it is checking for apline when it has alredy checked that it is debian?

TASK [nginxinc.nginx_core.nginx : Install dependencies] ********************************************************************************************************
fatal: [abc]: FAILED! => {"reason": "couldn't resolve module/action 'apk'. This often indicates a misspelling, missing collection, or incorrect module path.\n\nThe error appears to be in '/home/abc/ansibleplaybooks/ansible_collections/nginxinc/nginx_core/roles/nginx/tasks/prerequisites/install-dependencies.yml': line 2, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n---\n- name: (Alpine Linux) Install dependencies\n ^ here\n"}.

iS it possible to point ngninx-config role to the latest version?

Is your feature request related to a problem? Please describe

Some bug fixing are existing on the latest version of the role ansible-role-nginx-config
but not available to the people who installed it via the collection

Describe the solution you'd like

Point the role ansible-role-nginx-config to the latest version

Describe alternatives you've considered

Installing the two roles inside the collection independently and not using the collection anymore
IT would work without problems, some refactoring needed but it defeats a bit the purpose of having a collection

ansible-playbook deploy-nginx-web-server.yml -e "inventory=192.168.2.14"

Describe the bug

A clear and concise description of what the bug is.

To reproduce

Steps to reproduce the behavior:

  1. Deploy NGINX collection using playbook.yml
  2. View output/logs/configuration on '...'
  3. See error

Expected behavior

A clear and concise description of what you expected to happen.

Your environment

  • Version of the NGINX collection or specific commit
  • Version of Ansible
  • Version of Jinja2 (if you are using any templating capability)
  • Target deployment platform

Additional context

Add any other context about the problem here.
failed: [192.168.2.14] (item={u'config': {u'servers': [{u'core': {u'server_name': u'localhost', u'listen': [{u'port': 80}]}, u'sub_filter': {u'sub_filters': [{u'string': u'server_hostname', u'replacement': u'$hostname'}, {u'string': u'server_address', u'replacement': u'$server_addr:$server_port'}, {u'string': u'server_url', u'replacement': u'$request_uri'}, {u'string': u'remote_addr', u'replacement': u'$remote_addr:$remote_port'}, {u'string': u'server_date', u'replacement': u'$time_local'}, {u'string': u'client_browser', u'replacement': u'$http_user_agent'}, {u'string': u'request_id', u'replacement': u'$request_id'}, {u'string': u'nginx_version', u'replacement': u'$nginx_version'}, {u'string': u'document_root', u'replacement': u'$document_root'}, {u'string': u'proxied_for_ip', u'replacement': u'$http_x_forwarded_for'}], u'once': False}, u'log': {u'access': [{u'path': u'/var/log/nginx/access.log', u'format': u'main'}]}, u'locations': [{u'core': {u'index': u'index.html', u'root': u'/usr/share/nginx/html'}, u'location': u'/'}]}]}, u'template_file': u'http/default.conf.j2', u'deployment_location': u'/etc/nginx/conf.d/default.conf'}) => {"ansible_loop_var": "item", "changed": false, "item": {"config": {"servers": [{"core": {"listen": [{"port": 80}], "server_name": "localhost"}, "locations": [{"core": {"index": "index.html", "root": "/usr/share/nginx/html"}, "location": "/"}], "log": {"access": [{"format": "main", "path": "/var/log/nginx/access.log"}]}, "sub_filter": {"once": false, "sub_filters": [{"replacement": "$hostname", "string": "server_hostname"}, {"replacement": "$server_addr:$server_port", "string": "server_address"}, {"replacement": "$request_uri", "string": "server_url"}, {"replacement": "$remote_addr:$remote_port", "string": "remote_addr"}, {"replacement": "$time_local", "string": "server_date"}, {"replacement": "$http_user_agent", "string": "client_browser"}, {"replacement": "$request_id", "string": "request_id"}, {"replacement": "$nginx_version", "string": "nginx_version"}, {"replacement": "$document_root", "string": "document_root"}, {"replacement": "$http_x_forwarded_for", "string": "proxied_for_ip"}]}}]}, "deployment_location": "/etc/nginx/conf.d/default.conf", "template_file": "http/default.conf.j2"}, "msg": "TemplateAssertionError: no test named 'boolean'"}

nginx_config not deploying the correct config in nginx.conf file

I am trying to execute the following playbook

---
- name: Basic setup
  hosts: gates
  collections:
    - nginxinc.nginx_core
  tasks:
    - name: Install NGINX
      include_role:
        name: nginx
    - name: Configure NGINX
      include_role:
        name: nginx_config
      vars:
        nginx_config_debug_output: true

        nginx_config_cleanup: true
        nginx_config_cleanup_paths:
          - directory:
              - /etc/nginx/conf.d
            recurse: false
        nginx_config_cleanup_files:
          - /etc/nginx/conf.d/default.conf
        nginx_config_main_template_enable: false
        nginx_config_main_template:
          template_file: nginx.conf.j2
          conf_file_name: nginx.conf
          conf_file_location: /etc/nginx/
          user: nginx
          worker_processes: auto
          worker_rlimit_nofile: 1024
          pid: /var/run/nginx.pid
          error_log:
            location: /var/log/nginx/error.log
            level: warn
          worker_connections: 1024
          http_enable: true
          access_log_format:
            - name: upstream_info
              format: |-
                '$remote_addr - $remote_user [$time_local] "$request" '
                '$status $body_bytes_sent "$http_referer" "$http_user_agent" '
                'rt=$request_time uct="$upstream_connect_time" uht="$upstream_header_time" urt="$upstream_response_time"'
          access_log_location:
            - name: upstream_info
              location: /var/log/nginx/access.log

but the nginx.conf is getting the default values:

user  nginx;
worker_processes  auto;

error_log  /var/log/nginx/error.log notice;
pid        /var/run/nginx.pid;


events {
    worker_connections  1024;
}


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;

    sendfile        on;
    #tcp_nopush     on;

    keepalive_timeout  65;

    #gzip  on;

    include /etc/nginx/conf.d/*.conf;
}

I am running Ansible 4.1 and I have the 0.3.3 nginxinc.nginx_core collection

(cluster) joan@DESKTOP-OM8Q4NE:~/Abzu/cluster$ ansible --version
ansible [core 2.11.1]
  config file = /home/joan/Abzu/cluster/ansible.cfg
  configured module search path = ['/home/joan/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/joan/.local/share/virtualenvs/cluster-DtMsh1G5/lib/python3.8/site-packages/ansible
  ansible collection location = /home/joan/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/joan/.local/share/virtualenvs/cluster-DtMsh1G5/bin/ansible
  python version = 3.8.5 (default, Jan 27 2021, 15:41:15) [GCC 9.3.0]
  jinja version = 3.0.0
  libyaml = True

RHEL - Equivalent distribution for use in ansible project and collection

Is your feature request related to a problem? Please describe

I'm using a lot RHEL and Centos distribution, Now with Centos "stream" moving from v.8 distribution i'm interested in using Rocky Linux.

Describe the solution you'd like

Extend "limitation" in use only whit distribution indicated in vars/main.yml also with Rocky linux distribution

Describe alternatives you've considered

change the following variable available from

nginx_distributions: [
  'Alpine', 'Amazon', 'CentOS', 'Debian', 'FreeBSD', 'RedHat', 'SLES', 'Ubuntu',
  'NetBSD', 'OpenBSD', 'DragonFlyBSD', 'HardenedBSD',
]

--- to ---

nginx_distributions: [
  'Alpine', 'Amazon', 'CentOS', 'Debian', 'FreeBSD', 'RedHat', 'SLES', 'Ubuntu',
  'NetBSD', 'OpenBSD', 'DragonFlyBSD', 'HardenedBSD', 'Rocky',
]

Additional context

The preliminary test can be done correct and installation can be made.

##Add any other context or screenshots about the feature request here.
Tested proficiency with Rocky Linux 8.5 version using the following play:

---
- name: install and starts the Nginx web server on server one 
  hosts: one
  pre_tasks:
  - name: ensure http is not installed
    yum:
      name: httpd
      state: absent

  collections:
    - nginxinc.nginx_core
  roles:
    - role: nginx
...

Fails on amazon linux 2

I get the following errors:

Your OS, Amazon is not supported by NGINX Open Source

fatal: [nginx]: FAILED! => {"changed": false, "msg": "Failure talking to yum: failure: repodata/repomd.xml from nginx: [Errno 256] No more mirrors to try.\nhttps://nginx.org/packages/mainline/rhel/2/x86_64/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found"}

When installing on amazon linux.

Ami is ami-0528a5175983e7f28 (amzn2-ami-hvm-2.0*).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.