Skip to content

Specifying only some modules defaults shall be used for others #48

@sseide

Description

@sseide

forgot the following...

The readme defines some modules i may enable on installation. Specifying not all modules triggers an "dict has no attribute X" error as there is no safeguard to default all values not set.

Sample playbook - false shall be default for all other modules as stated in readme.

- hosts: raspi
  roles:
    - role: nginxinc.nginx
      type: opensource
      install_from: nginx_repository
      modules:
        geoip: true

output:

...
TASK [nginxinc.nginx : (Install: All OSs) Install NGINX Open Source JavaScript Module] ******
fatal: [127.0.0.1]: FAILED! => {"msg": "The conditional check 'modules.njs' failed. The error was: error while evaluating conditional (modules.njs): 'dict object' has no attribute 'njs'\n\nThe error appears to have been in '/home/stefan/workspaces/ws_misc/universe-config/ansible/roles/nginxinc.nginx/tasks/modules/install-njs.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: \"(Install: All OSs) Install NGINX Open Source JavaScript Module\"\n  ^ here\nThis one looks easy to fix.  It seems that there is a value started\nwith a quote, and the YAML parser is expecting to see the line ended\nwith the same kind of quote.  For instance:\n\n    when: \"ok\" in result.stdout\n\nCould be written as:\n\n   when: '\"ok\" in result.stdout'\n\nOr equivalently:\n\n   when: \"'ok' in result.stdout\"\n"}
´´´

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions