Linuxfabrik / lfops

LFOps is an Ansible Collection of generic Roles, Playbooks and Plugins for managing Linux-based Cloud Infrastructures.
https://linuxfabrik.ch
The Unlicense
53 stars 13 forks source link

Feature/role influxdb enable https #141

Closed paasi6666 closed 8 months ago

paasi6666 commented 9 months ago

Feature added to enable HTTPS (optional).

NavidSassan commented 9 months ago

Hi, thanks for the PR! I simplified the variables a bit, as we don't need to set multiple certificates, just one :) I also separated validate_certs into its own variable as it is not part of the config and only changes the behaviour of the role. Please check if these changes still work for your use case.

paasi6666 commented 9 months ago

Hi, thanks for the PR! I simplified the variables a bit, as we don't need to set multiple certificates, just one :) I also separated validate_certs into its own variable as it is not part of the config and only changes the behaviour of the role. Please check if these changes still work for your use case.

Thanks for the simplifications. Almost worked for our use case (minor changes, already commited).

NavidSassan commented 9 months ago

Did you get a bug without your changes? If so, can you send me the error and your ansible version? In general, the > 1 comparison should not be needed, any number other than 0 is "truthy" in python.

paasi6666 commented 9 months ago

Did you get a bug without your changes? If so, can you send me the error and your ansible version? In general, the > 1 comparison should not be needed, any number other than 0 is "truthy" in python.

Ansible Version is core 2.15.8.

In the influxdb.yml it will just puts a 2 instead of true:

  # Determines whether HTTPS is enabled.
  https-enabled = 2

And in the task, it tells me the following: TASK [linuxfabrik.lfops.influxdb : create new admin user "influxdb-admin"] ***** fatal: [p-vm-graf-002.stadtluzern.ch]: FAILED! => {"changed": false, "msg": "400: Client sent an HTTP request to an HTTPS server.\n"}

Verbose output:

fatal: [server@domain.com]: FAILED! => {
    "changed": false,
    "invocation": {
        "module_args": {
            "admin": true,
            "grants": null,
            "hostname": "localhost",
            "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "path": "",
            "port": 8086,
            "proxies": {},
            "retries": 3,
            "ssl": false,
            "state": "present",
            "timeout": null,
            "udp_port": 4444,
            "use_udp": false,
            "user_name": "influxdb-admin",
            "user_password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "username": "influxdb-admin",
            "validate_certs": false
        }
    },
    "msg": "400: Client sent an HTTP request to an HTTPS server.\n"
NavidSassan commented 8 months ago

thanks a lot for your contribution!