I am unable to get the users defined in the vars to be added to the database. I have been trying to debug it myself but I'm at a loss.
I have modified the task to remove potential issues with the vars:
- name: test import icingaweb into database
become: true
icingaweb_database_user:
state: 'present'
username: 'hard'
password: 'coded'
force: true
database_login_host: "{{ icingaweb_auth_backend.database.host }}"
database_name: "{{ icingaweb_auth_backend.database.dbname }}"
database_config_file: /etc/icingaweb2/.my.cnf
# no_log: true
register: import_icingaweb2_users
when:
- icingaweb_auth_backend is defined
- icingaweb_auth_backend.database is defined
- icingaweb_auth_backend.database.host is defined
- icingaweb_auth_backend.database.dbname is defined
TASK [icingaweb : test import icingaweb into database] *********************************************************************************************************************************************************
task path: /Users/david/Repos/ansible-icinga2-aio-deploy/roles/icingaweb/tasks/configure.yml:134
Wednesday 16 June 2021 10:14:38 +0200 (0:00:10.265) 0:01:10.861 ********
<10.0.0.99> ESTABLISH SSH CONNECTION FOR USER: ansible
<10.0.0.99> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o 'IdentityFile="/Users/david/.ssh/icinga-ansible"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="ansible"' -o ConnectTimeout=10 -o ControlPath=/Users/david/.ansible/cp/da87df5b65 10.0.0.99 '/bin/sh -c '"'"'echo ~ansible && sleep 0'"'"''
<10.0.0.99> (0, b'/home/ansible\n', b'OpenSSH_8.1p1, LibreSSL 2.7.3\r\ndebug1: Reading configuration data /Users/david/.ssh/config\r\ndebug1: /Users/david/.ssh/config line 1: Applying options for 10.59.*\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 47: Applying options for *\r\ndebug2: resolve_canonicalize: hostname 10.0.0.99 is address\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 25787\r\ndebug3: mux_client_request_session: session request sent\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\n')
<10.0.0.99> ESTABLISH SSH CONNECTION FOR USER: ansible
<10.0.0.99> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o 'IdentityFile="/Users/david/.ssh/icinga-ansible"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="ansible"' -o ConnectTimeout=10 -o ControlPath=/Users/david/.ansible/cp/da87df5b65 10.0.0.99 '/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo /home/ansible/.ansible/tmp `"&& mkdir "` echo /home/ansible/.ansible/tmp/ansible-tmp-1623831279.150812-26120-146535079938049 `" && echo ansible-tmp-1623831279.150812-26120-146535079938049="` echo /home/ansible/.ansible/tmp/ansible-tmp-1623831279.150812-26120-146535079938049 `" ) && sleep 0'"'"''
<10.0.0.99> (0, b'ansible-tmp-1623831279.150812-26120-146535079938049=/home/ansible/.ansible/tmp/ansible-tmp-1623831279.150812-26120-146535079938049\n', b'OpenSSH_8.1p1, LibreSSL 2.7.3\r\ndebug1: Reading configuration data /Users/david/.ssh/config\r\ndebug1: /Users/david/.ssh/config line 1: Applying options for 10.59.*\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 47: Applying options for *\r\ndebug2: resolve_canonicalize: hostname 10.0.0.99 is address\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 25787\r\ndebug3: mux_client_request_session: session request sent\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\n')
Using module file /Users/david/Repos/ansible-icinga2-aio-deploy/roles/icingaweb/library/icingaweb_database_user.py
<10.0.0.99> PUT /Users/david/.ansible/tmp/ansible-local-25779hj3i6udd/tmpxrgsniqh TO /home/ansible/.ansible/tmp/ansible-tmp-1623831279.150812-26120-146535079938049/AnsiballZ_icingaweb_database_user.py
<10.0.0.99> SSH: EXEC sftp -b - -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o 'IdentityFile="/Users/david/.ssh/icinga-ansible"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="ansible"' -o ConnectTimeout=10 -o ControlPath=/Users/david/.ansible/cp/da87df5b65 '[10.0.0.99]'
<10.0.0.99> (0, b'sftp> put /Users/david/.ansible/tmp/ansible-local-25779hj3i6udd/tmpxrgsniqh /home/ansible/.ansible/tmp/ansible-tmp-1623831279.150812-26120-146535079938049/AnsiballZ_icingaweb_database_user.py\n', b'OpenSSH_8.1p1, LibreSSL 2.7.3\r\ndebug1: Reading configuration data /Users/david/.ssh/config\r\ndebug1: /Users/david/.ssh/config line 1: Applying options for 10.59.*\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 47: Applying options for *\r\ndebug2: resolve_canonicalize: hostname 10.0.0.99 is address\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 25787\r\ndebug3: mux_client_request_session: session request sent\r\ndebug2: Remote version: 3\r\ndebug2: Server supports extension "[email protected]" revision 1\r\ndebug2: Server supports extension "[email protected]" revision 2\r\ndebug2: Server supports extension "[email protected]" revision 2\r\ndebug2: Server supports extension "[email protected]" revision 1\r\ndebug2: Server supports extension "[email protected]" revision 1\r\ndebug3: Sent message fd 3 T:16 I:1\r\ndebug3: SSH_FXP_REALPATH . -> /home/ansible size 0\r\ndebug3: Looking up /Users/david/.ansible/tmp/ansible-local-25779hj3i6udd/tmpxrgsniqh\r\ndebug3: Sent message fd 3 T:17 I:2\r\ndebug3: Received stat reply T:101 I:2\r\ndebug1: Couldn\'t stat remote file: No such file or directory\r\ndebug3: Sent message SSH2_FXP_OPEN I:3 P:/home/ansible/.ansible/tmp/ansible-tmp-1623831279.150812-26120-146535079938049/AnsiballZ_icingaweb_database_user.py\r\ndebug3: Sent message SSH2_FXP_WRITE I:4 O:0 S:32768\r\ndebug3: SSH2_FXP_STATUS 0\r\ndebug3: In write loop, ack for 4 32768 bytes at 0\r\ndebug3: Sent message SSH2_FXP_WRITE I:5 O:32768 S:32768\r\ndebug3: Sent message SSH2_FXP_WRITE I:6 O:65536 S:32768\r\ndebug3: Sent message SSH2_FXP_WRITE I:7 O:98304 S:26770\r\ndebug3: SSH2_FXP_STATUS 0\r\ndebug3: In write loop, ack for 5 32768 bytes at 32768\r\ndebug3: SSH2_FXP_STATUS 0\r\ndebug3: In write loop, ack for 6 32768 bytes at 65536\r\ndebug3: SSH2_FXP_STATUS 0\r\ndebug3: In write loop, ack for 7 26770 bytes at 98304\r\ndebug3: Sent message SSH2_FXP_CLOSE I:4\r\ndebug3: SSH2_FXP_STATUS 0\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\n')
<10.0.0.99> ESTABLISH SSH CONNECTION FOR USER: ansible
<10.0.0.99> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o 'IdentityFile="/Users/david/.ssh/icinga-ansible"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="ansible"' -o ConnectTimeout=10 -o ControlPath=/Users/david/.ansible/cp/da87df5b65 10.0.0.99 '/bin/sh -c '"'"'chmod u+x /home/ansible/.ansible/tmp/ansible-tmp-1623831279.150812-26120-146535079938049/ /home/ansible/.ansible/tmp/ansible-tmp-1623831279.150812-26120-146535079938049/AnsiballZ_icingaweb_database_user.py && sleep 0'"'"''
<10.0.0.99> (0, b'', b'OpenSSH_8.1p1, LibreSSL 2.7.3\r\ndebug1: Reading configuration data /Users/david/.ssh/config\r\ndebug1: /Users/david/.ssh/config line 1: Applying options for 10.59.*\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 47: Applying options for *\r\ndebug2: resolve_canonicalize: hostname 10.0.0.99 is address\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 25787\r\ndebug3: mux_client_request_session: session request sent\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\n')
<10.0.0.99> ESTABLISH SSH CONNECTION FOR USER: ansible
<10.0.0.99> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o 'IdentityFile="/Users/david/.ssh/icinga-ansible"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="ansible"' -o ConnectTimeout=10 -o ControlPath=/Users/david/.ansible/cp/da87df5b65 -tt 10.0.0.99 '/bin/sh -c '"'"'sudo -H -S -p "[sudo via ansible, key=zqmjdndqmlossqqmvjppocmxscvlibul] password:" -u root /bin/sh -c '"'"'"'"'"'"'"'"'echo BECOME-SUCCESS-zqmjdndqmlossqqmvjppocmxscvlibul ; /usr/bin/python3 /home/ansible/.ansible/tmp/ansible-tmp-1623831279.150812-26120-146535079938049/AnsiballZ_icingaweb_database_user.py'"'"'"'"'"'"'"'"' && sleep 0'"'"''
Escalation succeeded
<10.0.0.99> (0, b'\r\n{"changed": true, "failed": false, "ansible_module_results": "none", "invocation": {"module_args": {"state": "present", "username": "hard", "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER", "force": true, "database_login_host": "10.0.0.96", "database_name": "icingaweb_config", "database_config_file": "/etc/icingaweb2/.my.cnf", "database_login_port": 3306, "preferences": null, "database_login_user": null, "database_login_password": null, "database_login_unix_socket": null}}}\r\n', b'OpenSSH_8.1p1, LibreSSL 2.7.3\r\ndebug1: Reading configuration data /Users/david/.ssh/config\r\ndebug1: /Users/david/.ssh/config line 1: Applying options for 10.59.*\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 47: Applying options for *\r\ndebug2: resolve_canonicalize: hostname 10.0.0.99 is address\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 25787\r\ndebug3: mux_client_request_session: session request sent\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\nShared connection to 10.0.0.99 closed.\r\n')
changed: [david-icinga.internal] => changed=true
ansible_module_results: none
invocation:
module_args:
database_config_file: /etc/icingaweb2/.my.cnf
database_login_host: 10.0.0.96
database_login_password: null
database_login_port: 3306
database_login_unix_socket: null
database_login_user: null
database_name: icingaweb_config
force: true
password: VALUE_SPECIFIED_IN_NO_LOG_PARAMETER
preferences: null
state: present
username: hard
[client]
user = icingaweb_config
password = icingaweb_config
host = 10.0.0.96
The mysql database is unfortunately unchanged.
Users created in the web ui are present in the db and work as intended.
Is this working for you?
Let me know if I can provide any more info.