matrix-docker-ansible-deploy icon indicating copy to clipboard operation
matrix-docker-ansible-deploy copied to clipboard

Failed to import the required Python library (requests)

Open Taubin opened this issue 1 year ago • 7 comments

Playbook Configuration:

My vars.yml file looks like this:

---
# The bare domain name which represents your Matrix identity.
# Matrix user ids for your server will be of the form (`@user:<matrix-domain>`).
#
# Note: this playbook does not touch the server referenced here.
# Installation happens on another server ("matrix.<matrix-domain>").
#
# If you've deployed using the wrong domain, you'll have to run the Uninstalling step,
# because you can't change the Domain after deployment.
#
# Example value: example.com
matrix_domain: [redacted]

# The Matrix homeserver software to install.
# See:
#  - `roles/custom/matrix-base/defaults/main.yml` for valid options
# - the `docs/configuring-playbook-IMPLEMENTATION_NAME.md` documentation page, if one is available for your implementation choice
matrix_homeserver_implementation: synapse

# A secret used as a base, for generating various other secrets.
# You can put any string here, but generating a strong one is preferred (e.g. `pwgen -s 64 1`).
matrix_homeserver_generic_secret_key: '[redacted]'

# This is something which is provided to Let's Encrypt when retrieving SSL certificates for domains.
#
# In case SSL renewal fails at some point, you'll also get an email notification there.
#
# If you decide to use another method for managing SSL certificates (different than the default Let's Encrypt),
# you won't be required to define this variable (see `docs/configuring-playbook-ssl-certificates.md`).
#
# Example value: [email protected]
matrix_ssl_lets_encrypt_support_email: 'redacted]'

# A Postgres password to use for the superuser Postgres user (called `matrix` by default).
#
# The playbook creates additional Postgres users and databases (one for each enabled service)
# using this superuser account.
devture_postgres_connection_password: '[redacted]'

Matrix Server:

  • OS: Ubuntu 18.04.6
  • Architecture amd64

Ansible: If your problem appears to be with Ansible, tell us:

  • where you run Ansible -- e.g. on the Matrix server itself; on another computer (which OS? distro? standard installation or containerized Ansible?)

Ansible is being run on the server itself

  • what version of Ansible you're running (see ansible --version)
ansible [core 2.14.0]
  config file = /home/taubin/matrix-docker-ansible-deploy/ansible.cfg
  configured module search path = ['/home/taubin/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/taubin/.local/lib/python3.10/site-packages/ansible
  ansible collection location = /home/taubin/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/taubin/.local/bin/ansible
  python version = 3.10.8 (main, Oct 12 2022, 19:14:09) [GCC 7.5.0] (/usr/bin/python3)
  jinja version = 3.1.2
  libyaml = True

Problem description:

I'm attempting to update a previous version of the ansible playbook. I've pulled the latest and run make roles to make sure the roles are correct. I'm recieving the following error when the playbook is run:

An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ModuleNotFoundError: No module named 'requests'
fatal: [matrix.[redacted]]: FAILED! => changed=false
  msg: Failed to import the required Python library (requests) on matrix.[redacted]'s Python /usr/bin/python3. Please read the module documentation and install it in the appropriate location. If the required library is installed, but Ansible is using the wrong Python interpreter, please consult the documentation on ansible_python_interpreter

I've verified requests is installed:

pip3 install requests
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: requests in /home/taubin/.local/lib/python3.10/site-packages (2.28.1)
Requirement already satisfied: idna<4,>=2.5 in /home/taubin/.local/lib/python3.10/site-packages (from requests) (3.4)
Requirement already satisfied: certifi>=2017.4.17 in /home/taubin/.local/lib/python3.10/site-packages (from requests) (2022.9.24)
Requirement already satisfied: charset-normalizer<3,>=2 in /home/taubin/.local/lib/python3.10/site-packages (from requests) (2.1.1)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /home/taubin/.local/lib/python3.10/site-packages (from requests) (1.26.12)

Full log from install:

ansible-playbook -vvv -i inventory/hosts setup.yml --tags=install-all,ensure-matrix-users-created,start
ansible-playbook [core 2.14.0]
  config file = /home/taubin/matrix-docker-ansible-deploy/ansible.cfg
  configured module search path = ['/home/taubin/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/taubin/.local/lib/python3.10/site-packages/ansible
  ansible collection location = /home/taubin/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/taubin/.local/bin/ansible-playbook
  python version = 3.10.8 (main, Oct 12 2022, 19:14:09) [GCC 7.5.0] (/usr/bin/python3)
  jinja version = 3.1.2
  libyaml = True
Using /home/taubin/matrix-docker-ansible-deploy/ansible.cfg as config file
host_list declined parsing /home/taubin/matrix-docker-ansible-deploy/inventory/hosts as it did not pass its verify_file() method
script declined parsing /home/taubin/matrix-docker-ansible-deploy/inventory/hosts as it did not pass its verify_file() method
auto declined parsing /home/taubin/matrix-docker-ansible-deploy/inventory/hosts as it did not pass its verify_file() method
Parsed /home/taubin/matrix-docker-ansible-deploy/inventory/hosts inventory source with ini plugin
statically imported: /home/taubin/matrix-docker-ansible-deploy/roles/custom/matrix-nginx-proxy/tasks/validate_config.yml
statically imported: /home/taubin/matrix-docker-ansible-deploy/roles/custom/matrix-nginx-proxy/tasks/ssl/main.yml
statically imported: /home/taubin/matrix-docker-ansible-deploy/roles/custom/matrix-nginx-proxy/tasks/ssl/setup_ssl_lets_encrypt.yml
statically imported: /home/taubin/matrix-docker-ansible-deploy/roles/custom/matrix-nginx-proxy/tasks/ssl/purge_ssl_lets_encrypt_orphaned_configs.yml
statically imported: /home/taubin/matrix-docker-ansible-deploy/roles/custom/matrix-nginx-proxy/tasks/ssl/setup_ssl_self_signed.yml
statically imported: /home/taubin/matrix-docker-ansible-deploy/roles/custom/matrix-nginx-proxy/tasks/ssl/setup_ssl_manually_managed.yml
statically imported: /home/taubin/matrix-docker-ansible-deploy/roles/custom/matrix-nginx-proxy/tasks/setup_nginx_proxy.yml
statically imported: /home/taubin/matrix-docker-ansible-deploy/roles/galaxy/com.devture.ansible.role.playbook_state_preserver/tasks/preserve_vars.yml
statically imported: /home/taubin/matrix-docker-ansible-deploy/roles/galaxy/com.devture.ansible.role.playbook_state_preserver/tasks/preserve_commit_hash.yml
redirecting (type: callback) ansible.builtin.yaml to community.general.yaml
redirecting (type: callback) ansible.builtin.yaml to community.general.yaml
Skipping callback 'default', as we already have a stdout callback.
Skipping callback 'minimal', as we already have a stdout callback.
Skipping callback 'oneline', as we already have a stdout callback.

PLAYBOOK: setup.yml ****************************************************************************************************
1 plays in setup.yml

PLAY [Set up a Matrix server] ******************************************************************************************

TASK [Gathering Facts] *************************************************************************************************
task path: /home/taubin/matrix-docker-ansible-deploy/setup.yml:2
Using module file /home/taubin/.local/lib/python3.10/site-packages/ansible/modules/setup.py
Pipelining is enabled.
<202.5.31.156> ESTABLISH LOCAL CONNECTION FOR USER: taubin
<202.5.31.156> EXEC /bin/sh -c 'sudo -H -S -n  -u root /bin/sh -c '"'"'echo BECOME-SUCCESS-sdjcvbeygvzqgomhizmwpkwvcmcyanxw ; /usr/bin/python3'"'"' && sleep 0'
ok: [matrix.[redacted]]

TASK [custom/matrix_playbook_migration : ansible.builtin.include_tasks] ************************************************
task path: /home/taubin/matrix-docker-ansible-deploy/roles/custom/matrix_playbook_migration/tasks/main.yml:4
included: /home/taubin/matrix-docker-ansible-deploy/roles/custom/matrix_playbook_migration/tasks/validate_config.yml for matrix.[redacted]

TASK [custom/matrix_playbook_migration : (Deprecation) Catch and report renamed Matrix playbook settings] **************
task path: /home/taubin/matrix-docker-ansible-deploy/roles/custom/matrix_playbook_migration/tasks/validate_config.yml:3
skipping: [matrix.[redacted]] => (item={'old': 'matrix_vars_yml_snapshotting_enabled', 'new': 'devture_playbook_state_preserver_vars_preservation_enabled'})  => changed=false
  ansible_loop_var: item
  item:
    new: devture_playbook_state_preserver_vars_preservation_enabled
    old: matrix_vars_yml_snapshotting_enabled
  skip_reason: Conditional result was False
skipping: [matrix.[redacted]] => (item={'old': 'matrix_vars_yml_snapshotting_src', 'new': 'devture_playbook_state_preserver_vars_preservation_src'})  => changed=false
  ansible_loop_var: item
  item:
    new: devture_playbook_state_preserver_vars_preservation_src
    old: matrix_vars_yml_snapshotting_src
  skip_reason: Conditional result was False
skipping: [matrix.[redacted]] => (item={'old': 'matrix_playbook_commit_hash_preservation_enabled', 'new': 'devture_playbook_state_preserver_commit_hash_preservation_enabled'})  => changed=false
  ansible_loop_var: item
  item:
    new: devture_playbook_state_preserver_commit_hash_preservation_enabled
    old: matrix_playbook_commit_hash_preservation_enabled
  skip_reason: Conditional result was False
skipping: [matrix.[redacted]] => (item={'old': 'matrix_ntpd_package', 'new': 'devture_timesync_ntpd_package'})  => changed=false
  ansible_loop_var: item
  item:
    new: devture_timesync_ntpd_package
    old: matrix_ntpd_package
  skip_reason: Conditional result was False
skipping: [matrix.[redacted]] => (item={'old': 'matrix_ntpd_service', 'new': 'devture_timesync_ntpd_service'})  => changed=false
  ansible_loop_var: item
  item:
    new: devture_timesync_ntpd_service
    old: matrix_ntpd_service
  skip_reason: Conditional result was False
skipping: [matrix.[redacted]] => (item={'old': 'matrix_systemd_unit_home_path', 'new': 'devture_systemd_docker_base_systemd_unit_home_path'})  => changed=false
  ansible_loop_var: item
  item:
    new: devture_systemd_docker_base_systemd_unit_home_path
    old: matrix_systemd_unit_home_path
  skip_reason: Conditional result was False
skipping: [matrix.[redacted]] => (item={'old': 'matrix_systemd_path', 'new': 'devture_systemd_docker_base_systemd_path'})  => changed=false
  ansible_loop_var: item
  item:
    new: devture_systemd_docker_base_systemd_path
    old: matrix_systemd_path
  skip_reason: Conditional result was False
skipping: [matrix.[redacted]] => (item={'old': 'matrix_host_command_docker', 'new': 'devture_systemd_docker_base_host_command_docker'})  => changed=false
  ansible_loop_var: item
  item:
    new: devture_systemd_docker_base_host_command_docker
    old: matrix_host_command_docker
  skip_reason: Conditional result was False
skipping: [matrix.[redacted]] => (item={'old': 'matrix_host_command_sh', 'new': 'devture_systemd_docker_base_host_command_sh'})  => changed=false
  ansible_loop_var: item
  item:
    new: devture_systemd_docker_base_host_command_sh
    old: matrix_host_command_sh
  skip_reason: Conditional result was False
skipping: [matrix.[redacted]] => (item={'old': 'matrix_host_command_systemctl', 'new': 'devture_systemd_docker_base_host_command_systemctl'})  => changed=false
  ansible_loop_var: item
  item:
    new: devture_systemd_docker_base_host_command_systemctl
    old: matrix_host_command_systemctl
  skip_reason: Conditional result was False
skipping: [matrix.[redacted]] => (item={'old': 'matrix_container_retries_count', 'new': 'devture_playbook_help_container_retries_count'})  => changed=false
  ansible_loop_var: item
  item:
    new: devture_playbook_help_container_retries_count
    old: matrix_container_retries_count
  skip_reason: Conditional result was False
skipping: [matrix.[redacted]] => (item={'old': 'matrix_container_retries_delay', 'new': 'devture_playbook_help_container_retries_delay'})  => changed=false
  ansible_loop_var: item
  item:
    new: devture_playbook_help_container_retries_delay
    old: matrix_container_retries_delay
  skip_reason: Conditional result was False
skipping: [matrix.[redacted]] => (item={'old': 'matrix_geturl_retries_count', 'new': 'devture_playbook_help_geturl_retries_count'})  => changed=false
  ansible_loop_var: item
  item:
    new: devture_playbook_help_geturl_retries_count
    old: matrix_geturl_retries_count
  skip_reason: Conditional result was False
skipping: [matrix.[redacted]] => (item={'old': 'matrix_geturl_retries_delay', 'new': 'devture_playbook_help_geturl_retries_delay'})  => changed=false
  ansible_loop_var: item
  item:
    new: devture_playbook_help_geturl_retries_delay
    old: matrix_geturl_retries_delay
  skip_reason: Conditional result was False
skipping: [matrix.[redacted]] => (item={'old': 'matrix_nginx_proxy_synapse_cache_path', 'new': 'matrix_synapse_reverse_proxy_companion_synapse_cache_path'})  => changed=false
  ansible_loop_var: item
  item:
    new: matrix_synapse_reverse_proxy_companion_synapse_cache_path
    old: matrix_nginx_proxy_synapse_cache_path
  skip_reason: Conditional result was False
skipping: [matrix.[redacted]] => (item={'old': 'matrix_nginx_proxy_synapse_cache_enabled', 'new': 'matrix_synapse_reverse_proxy_companion_synapse_cache_enabled'})  => changed=false
  ansible_loop_var: item
  item:
    new: matrix_synapse_reverse_proxy_companion_synapse_cache_enabled
    old: matrix_nginx_proxy_synapse_cache_enabled
  skip_reason: Conditional result was False
skipping: [matrix.[redacted]] => (item={'old': 'matrix_docker_installation_enabled', 'new': 'matrix_playbook_docker_installation_enabled'})  => changed=false
  ansible_loop_var: item
  item:
    new: matrix_playbook_docker_installation_enabled
    old: matrix_docker_installation_enabled
  skip_reason: Conditional result was False
skipping: [matrix.[redacted]] => (item={'old': 'matrix_docker_package_name', 'new': '<Not applicable. Docker is installed using https://github.com/geerlingguy/ansible-role-docker now>'})  => changed=false
  ansible_loop_var: item
  item:
    new: <Not applicable. Docker is installed using https://github.com/geerlingguy/ansible-role-docker now>
    old: matrix_docker_package_name
  skip_reason: Conditional result was False
skipping: [matrix.[redacted]] => (item={'old': 'matrix_systemd_services_list', 'new': 'devture_systemd_service_manager_services_list_additional'})  => changed=false
  ansible_loop_var: item
  item:
    new: devture_systemd_service_manager_services_list_additional
    old: matrix_systemd_services_list
  skip_reason: Conditional result was False
skipping: [matrix.[redacted]] => (item={'old': 'matrix_common_after_systemd_service_start_wait_for_timeout_seconds', 'new': 'devture_systemd_service_manager_up_verification_delay_seconds'})  => changed=false
  ansible_loop_var: item
  item:
    new: devture_systemd_service_manager_up_verification_delay_seconds
    old: matrix_common_after_systemd_service_start_wait_for_timeout_seconds
  skip_reason: Conditional result was False
skipping: [matrix.[redacted]] => (item={'old': 'matrix_systemd_services_autostart_enabled', 'new': 'devture_systemd_service_manager_services_autostart_enabled'})  => changed=false
  ansible_loop_var: item
  item:
    new: devture_systemd_service_manager_services_autostart_enabled
    old: matrix_systemd_services_autostart_enabled
  skip_reason: Conditional result was False
skipping: [matrix.[redacted]] => changed=false
  msg: All items skipped

TASK [custom/matrix_playbook_migration : (Deprecation) Catch and report matrix_postgres variables] *********************
task path: /home/taubin/matrix-docker-ansible-deploy/roles/custom/matrix_playbook_migration/tasks/validate_config.yml:38
skipping: [matrix.[redacted]] => changed=false
  skip_reason: Conditional result was False

TASK [custom/matrix_playbook_migration : ansible.builtin.include_tasks] ************************************************
task path: /home/taubin/matrix-docker-ansible-deploy/roles/custom/matrix_playbook_migration/tasks/main.yml:10
included: /home/taubin/matrix-docker-ansible-deploy/roles/custom/matrix_playbook_migration/tasks/cleanup_usr_local_bin.yml for matrix.[redacted]

TASK [custom/matrix_playbook_migration : Find leftover matrix scripts in /usr/local/bin] *******************************
task path: /home/taubin/matrix-docker-ansible-deploy/roles/custom/matrix_playbook_migration/tasks/cleanup_usr_local_bin.yml:3
Using module file /home/taubin/.local/lib/python3.10/site-packages/ansible/modules/find.py
Pipelining is enabled.
<202.5.31.156> ESTABLISH LOCAL CONNECTION FOR USER: taubin
<202.5.31.156> EXEC /bin/sh -c 'sudo -H -S -n  -u root /bin/sh -c '"'"'echo BECOME-SUCCESS-grwnuhopvpgcluejxnjbaxhdgktkcuan ; /usr/bin/python3'"'"' && sleep 0'
ok: [matrix.[redacted]] => changed=false
  examined: 1
  files: []
  invocation:
    module_args:
      age: null
      age_stamp: mtime
      contains: null
      depth: null
      excludes: null
      file_type: file
      follow: false
      get_checksum: false
      hidden: false
      path: /usr/local/bin
      paths:
      - /usr/local/bin
      patterns:
      - matrix-change-user-admin-status
      - matrix-dendrite-create-account
      - matrix-make-user-admin
      - matrix-postgres-cli
      - matrix-postgres-cli-non-interactive
      - matrix-postgres-update-user-password-hash
      - matrix-remove-all
      - matrix-ssl-certificates-renew
      - matrix-ssl-lets-encrypt-certificates-renew
      - matrix-synapse-register-user
      - matrix-synapse-s3-storage-provider-migrate
      - matrix-synapse-s3-storage-provider-shell
      - matrix-synapse-worker-write-pid
      read_whole_file: false
      recurse: false
      size: null
      use_regex: false
  matched: 0
  msg: All paths examined
  skipped_paths: {}

TASK [custom/matrix_playbook_migration : Ensure /usr/local/bin does not contain matrix scripts] ************************
task path: /home/taubin/matrix-docker-ansible-deploy/roles/custom/matrix_playbook_migration/tasks/cleanup_usr_local_bin.yml:22
skipping: [matrix.[redacted]] => changed=false
  skipped_reason: No items in the list

TASK [custom/matrix-base : ansible.builtin.include_tasks] **************************************************************
task path: /home/taubin/matrix-docker-ansible-deploy/roles/custom/matrix-base/tasks/main.yml:4
included: /home/taubin/matrix-docker-ansible-deploy/roles/custom/matrix-base/tasks/validate_config.yml for matrix.[redacted]

TASK [custom/matrix-base : Fail if invalid homeserver implementation] **************************************************
task path: /home/taubin/matrix-docker-ansible-deploy/roles/custom/matrix-base/tasks/validate_config.yml:3
skipping: [matrix.[redacted]] => changed=false
  skip_reason: Conditional result was False

TASK [custom/matrix-base : (Deprecation) Catch and report renamed settings] ********************************************
task path: /home/taubin/matrix-docker-ansible-deploy/roles/custom/matrix-base/tasks/validate_config.yml:8
skipping: [matrix.[redacted]] => (item={'old': 'host_specific_hostname_identity', 'new': 'matrix_domain'})  => changed=false
  ansible_loop_var: item
  item:
    new: matrix_domain
    old: host_specific_hostname_identity
  skip_reason: Conditional result was False
skipping: [matrix.[redacted]] => (item={'old': 'hostname_identity', 'new': 'matrix_domain'})  => changed=false
  ansible_loop_var: item
  item:
    new: matrix_domain
    old: hostname_identity
  skip_reason: Conditional result was False
skipping: [matrix.[redacted]] => (item={'old': 'hostname_matrix', 'new': 'matrix_server_fqn_matrix'})  => changed=false
  ansible_loop_var: item
  item:
    new: matrix_server_fqn_matrix
    old: hostname_matrix
  skip_reason: Conditional result was False
skipping: [matrix.[redacted]] => (item={'old': 'hostname_riot', 'new': 'matrix_server_fqn_element'})  => changed=false
  ansible_loop_var: item
  item:
    new: matrix_server_fqn_element
    old: hostname_riot
  skip_reason: Conditional result was False
skipping: [matrix.[redacted]] => (item={'old': 'matrix_server_fqn_riot', 'new': 'matrix_server_fqn_element'})  => changed=false
  ansible_loop_var: item
  item:
    new: matrix_server_fqn_element
    old: matrix_server_fqn_riot
  skip_reason: Conditional result was False
skipping: [matrix.[redacted]] => (item={'old': 'matrix_local_bin_path', 'new': '<there is no global bin path anymore - each role has its own>'})  => changed=false
  ansible_loop_var: item
  item:
    new: <there is no global bin path anymore - each role has its own>
    old: matrix_local_bin_path
  skip_reason: Conditional result was False
skipping: [matrix.[redacted]] => changed=false
  msg: All items skipped

TASK [custom/matrix-base : Fail if matrix_homeserver_generic_secret_key is undefined] **********************************
task path: /home/taubin/matrix-docker-ansible-deploy/roles/custom/matrix-base/tasks/validate_config.yml:23
skipping: [matrix.[redacted]] => changed=false
  skip_reason: Conditional result was False

TASK [custom/matrix-base : Fail if required variables are undefined] ***************************************************
task path: /home/taubin/matrix-docker-ansible-deploy/roles/custom/matrix-base/tasks/validate_config.yml:37
skipping: [matrix.[redacted]] => (item={'var': 'matrix_domain', 'value': '[redacted]'})  => changed=false
  ansible_loop_var: item
  item:
    value: [redacted]
    var: matrix_domain
  skip_reason: Conditional result was False
skipping: [matrix.[redacted]] => (item={'var': 'matrix_server_fqn_matrix', 'value': 'matrix.[redacted]'})  => changed=false
  ansible_loop_var: item
  item:
    value: matrix.[redacted]
    var: matrix_server_fqn_matrix
  skip_reason: Conditional result was False
skipping: [matrix.[redacted]] => (item={'var': 'matrix_server_fqn_element', 'value': 'element.[redacted]'})  => changed=false
  ansible_loop_var: item
  item:
    value: element.[redacted]
    var: matrix_server_fqn_element
  skip_reason: Conditional result was False
skipping: [matrix.[redacted]] => (item={'var': 'matrix_homeserver_container_url', 'value': 'http://matrix-nginx-proxy:12080'})  => changed=false
  ansible_loop_var: item
  item:
    value: http://matrix-nginx-proxy:12080
    var: matrix_homeserver_container_url
  skip_reason: Conditional result was False
skipping: [matrix.[redacted]] => (item={'var': 'matrix_homeserver_container_federation_url', 'value': 'http://matrix-nginx-proxy:12088'})  => changed=false
  ansible_loop_var: item
  item:
    value: http://matrix-nginx-proxy:12088
    var: matrix_homeserver_container_federation_url
  skip_reason: Conditional result was False
skipping: [matrix.[redacted]] => (item={'var': 'matrix_architecture', 'value': 'amd64'})  => changed=false
  ansible_loop_var: item
  item:
    value: amd64
    var: matrix_architecture
  skip_reason: Conditional result was False
skipping: [matrix.[redacted]] => changed=false
  msg: All items skipped

TASK [custom/matrix-base : Fail if matrix_architecture is set incorrectly] *********************************************
task path: /home/taubin/matrix-docker-ansible-deploy/roles/custom/matrix-base/tasks/validate_config.yml:49
skipping: [matrix.[redacted]] => changed=false
  skip_reason: Conditional result was False

TASK [custom/matrix-base : Fail if uppercase domain used] **************************************************************
task path: /home/taubin/matrix-docker-ansible-deploy/roles/custom/matrix-base/tasks/validate_config.yml:54
skipping: [matrix.[redacted]] => (item=[redacted])  => changed=false
  ansible_loop_var: item
  item: [redacted]
  skip_reason: Conditional result was False
skipping: [matrix.[redacted]] => (item=matrix.[redacted])  => changed=false
  ansible_loop_var: item
  item: matrix.[redacted]
  skip_reason: Conditional result was False
skipping: [matrix.[redacted]] => (item=element.[redacted])  => changed=false
  ansible_loop_var: item
  item: element.[redacted]
  skip_reason: Conditional result was False
skipping: [matrix.[redacted]] => changed=false
  msg: All items skipped

TASK [custom/matrix-base : Fail if encountering usage of removed role (mx-puppet-skype)] *******************************
task path: /home/taubin/matrix-docker-ansible-deploy/roles/custom/matrix-base/tasks/validate_config.yml:63
skipping: [matrix.[redacted]] => changed=false
  skip_reason: Conditional result was False

TASK [custom/matrix-base : ansible.builtin.include_tasks] **************************************************************
task path: /home/taubin/matrix-docker-ansible-deploy/roles/custom/matrix-base/tasks/main.yml:12
included: /home/taubin/matrix-docker-ansible-deploy/roles/custom/matrix-base/tasks/setup_matrix_user.yml for matrix.[redacted]

TASK [custom/matrix-base : Ensure Matrix group is created] *************************************************************
task path: /home/taubin/matrix-docker-ansible-deploy/roles/custom/matrix-base/tasks/setup_matrix_user.yml:3
Using module file /home/taubin/.local/lib/python3.10/site-packages/ansible/modules/group.py
Pipelining is enabled.
<202.5.31.156> ESTABLISH LOCAL CONNECTION FOR USER: taubin
<202.5.31.156> EXEC /bin/sh -c 'sudo -H -S -n  -u root /bin/sh -c '"'"'echo BECOME-SUCCESS-orczamwmewlevgyixunyvomoslhblnhg ; /usr/bin/python3'"'"' && sleep 0'
ok: [matrix.[redacted]] => changed=false
  gid: 1001
  invocation:
    module_args:
      gid: null
      local: false
      name: matrix
      non_unique: false
      state: present
      system: false
  name: matrix
  state: present
  system: false

TASK [custom/matrix-base : Ensure Matrix user is created] **************************************************************
task path: /home/taubin/matrix-docker-ansible-deploy/roles/custom/matrix-base/tasks/setup_matrix_user.yml:10
Using module file /home/taubin/.local/lib/python3.10/site-packages/ansible/modules/user.py
Pipelining is enabled.
<202.5.31.156> ESTABLISH LOCAL CONNECTION FOR USER: taubin
<202.5.31.156> EXEC /bin/sh -c 'sudo -H -S -n  -u root /bin/sh -c '"'"'echo BECOME-SUCCESS-lxsnszlogjxxoxuosnfbircqhvhkeuoh ; /usr/bin/python3'"'"' && sleep 0'
ok: [matrix.[redacted]] => changed=false
  append: false
  comment: ''
  group: 1001
  home: /matrix
  invocation:
    module_args:
      append: false
      authorization: null
      comment: null
      create_home: false
      expires: null
      force: false
      generate_ssh_key: null
      group: matrix
      groups: null
      hidden: null
      home: /matrix
      local: null
      login_class: null
      move_home: false
      name: matrix
      non_unique: false
      password: null
      password_expire_max: null
      password_expire_min: null
      password_lock: null
      profile: null
      remove: false
      role: null
      seuser: null
      shell: null
      skeleton: null
      ssh_key_bits: 0
      ssh_key_comment: ansible-generated on matrix.[redacted]
      ssh_key_file: null
      ssh_key_passphrase: null
      ssh_key_type: rsa
      state: present
      system: true
      uid: null
      umask: null
      update_password: always
  move_home: false
  name: matrix
  shell: /bin/sh
  state: present
  uid: 999

TASK [custom/matrix-base : Initialize matrix_user_uid and matrix_user_gid] *********************************************
task path: /home/taubin/matrix-docker-ansible-deploy/roles/custom/matrix-base/tasks/setup_matrix_user.yml:21
ok: [matrix.[redacted]] => changed=false
  ansible_facts:
    matrix_user_gid: '1001'
    matrix_user_uid: '999'

TASK [custom/matrix-base : ansible.builtin.include_tasks] **************************************************************
task path: /home/taubin/matrix-docker-ansible-deploy/roles/custom/matrix-base/tasks/main.yml:19
included: /home/taubin/matrix-docker-ansible-deploy/roles/custom/matrix-base/tasks/setup_matrix_base.yml for matrix.[redacted]

TASK [custom/matrix-base : Ensure Matrix base paths exists] ************************************************************
task path: /home/taubin/matrix-docker-ansible-deploy/roles/custom/matrix-base/tasks/setup_matrix_base.yml:3
Using module file /home/taubin/.local/lib/python3.10/site-packages/ansible/modules/file.py
Pipelining is enabled.
<202.5.31.156> ESTABLISH LOCAL CONNECTION FOR USER: taubin
<202.5.31.156> EXEC /bin/sh -c 'sudo -H -S -n  -u root /bin/sh -c '"'"'echo BECOME-SUCCESS-fkrusxpkjbbglavyspticfwlxofnlaay ; /usr/bin/python3'"'"' && sleep 0'
ok: [matrix.[redacted]] => (item=/matrix) => changed=false
  ansible_loop_var: item
  diff:
    after:
      path: /matrix
    before:
      path: /matrix
  gid: 1001
  group: matrix
  invocation:
    module_args:
      _diff_peek: null
      _original_basename: null
      access_time: null
      access_time_format: '%Y%m%d%H%M.%S'
      attributes: null
      follow: true
      force: false
      group: matrix
      mode: '750'
      modification_time: null
      modification_time_format: '%Y%m%d%H%M.%S'
      owner: matrix
      path: /matrix
      recurse: false
      selevel: null
      serole: null
      setype: null
      seuser: null
      src: null
      state: directory
      unsafe_writes: false
  item: /matrix
  mode: '0750'
  owner: matrix
  path: /matrix
  size: 4096
  state: directory
  uid: 999
Using module file /home/taubin/.local/lib/python3.10/site-packages/ansible/modules/file.py
Pipelining is enabled.
<202.5.31.156> EXEC /bin/sh -c 'sudo -H -S -n  -u root /bin/sh -c '"'"'echo BECOME-SUCCESS-ffnxuhkmsbzmeurudxozxspqxwmbzrjz ; /usr/bin/python3'"'"' && sleep 0'
ok: [matrix.[redacted]] => (item=/matrix/bin) => changed=false
  ansible_loop_var: item
  diff:
    after:
      path: /matrix/bin
    before:
      path: /matrix/bin
  gid: 1001
  group: matrix
  invocation:
    module_args:
      _diff_peek: null
      _original_basename: null
      access_time: null
      access_time_format: '%Y%m%d%H%M.%S'
      attributes: null
      follow: true
      force: false
      group: matrix
      mode: '750'
      modification_time: null
      modification_time_format: '%Y%m%d%H%M.%S'
      owner: matrix
      path: /matrix/bin
      recurse: false
      selevel: null
      serole: null
      setype: null
      seuser: null
      src: null
      state: directory
      unsafe_writes: false
  item: /matrix/bin
  mode: '0750'
  owner: matrix
  path: /matrix/bin
  size: 4096
  state: directory
  uid: 999

TASK [custom/matrix-base : Ensure Matrix network is created in Docker] *************************************************
task path: /home/taubin/matrix-docker-ansible-deploy/roles/custom/matrix-base/tasks/setup_matrix_base.yml:14
Using module file /home/taubin/.ansible/collections/ansible_collections/community/docker/plugins/modules/docker_network.py
Pipelining is enabled.
<202.5.31.156> ESTABLISH LOCAL CONNECTION FOR USER: taubin
<202.5.31.156> EXEC /bin/sh -c 'sudo -H -S -n  -u root /bin/sh -c '"'"'echo BECOME-SUCCESS-neoszfhzqwbxrojyybjiktwakvnbrddu ; /usr/bin/python3'"'"' && sleep 0'
The full traceback is:
Traceback (most recent call last):
  File "/tmp/ansible_community.docker.docker_network_payload_1ro9crm7/ansible_community.docker.docker_network_payload.zip/ansible_collections/community/docker/plugins/module_utils/_api/_import_helper.py", line 24, in <module>
    from requests import Session
ModuleNotFoundError: No module named 'requests'
fatal: [matrix.[redacted]]: FAILED! => changed=false
  invocation:
    module_args:
      api_version: auto
      appends: false
      attachable: null
      ca_cert: null
      client_cert: null
      client_key: null
      connected: []
      debug: false
      docker_host: unix://var/run/docker.sock
      driver: bridge
      driver_options: {}
      enable_ipv6: null
      force: false
      internal: null
      ipam_config: null
      ipam_driver: null
      ipam_driver_options: null
      labels: {}
      name: matrix
      scope: null
      ssl_version: null
      state: present
      timeout: 60
      tls: false
      tls_hostname: null
      use_ssh_client: false
      validate_certs: false
  msg: Failed to import the required Python library (requests) on matrix.[redacted]'s Python /usr/bin/python3. Please read the module documentation and install it in the appropriate location. If the required library is installed, but Ansible is using the wrong Python interpreter, please consult the documentation on ansible_python_interpreter

PLAY RECAP *************************************************************************************************************
matrix.[redacted]           : ok=11   changed=0    unreachable=0    failed=1    skipped=10   rescued=0    ignored=0

Additional context Add any other context about the problem here.

Taubin avatar Dec 20 '22 19:12 Taubin

Interesting that the Docker SDK for Python needs requests and doesn't pull it in as a dependency.. Check how you installed that thing (docker-python, python-docker, etc). You may wish to install it on the Matrix server via pip.

You may also reconsider your choice of distro. 2018 was many years ago. I suggest you go for Ubuntu 22 or another more recent distro.

spantaleev avatar Dec 20 '22 19:12 spantaleev

Upgrading the server isn't easy, this is an existing installation with existing users.

Check how you installed that thing (docker-python, python-docker, etc).

I'm not sure what you mean here. Do you mean python? Docker? Requests?

If it's requests, it's shown in my original post that it's already installed and pip shows it as existing.

Ubuntu 18.04.6 was released last year and is EOL in 2028. Standard support is still in effect until April 2023.

Taubin avatar Dec 20 '22 19:12 Taubin

@spantaleev

Brand new 22.04 VPS I've run up. I've installed the prerequisites

ansible [core 2.13.7]
  config file = /home/taubin/matrix-docker-ansible-deploy/ansible.cfg
  configured module search path = ['/home/taubin/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  ansible collection location = /home/taubin/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.10.6 (main, Nov 14 2022, 16:10:14) [GCC 11.3.0]
  jinja version = 3.0.3
  libyaml = True

Python:

python3 --version
Python 3.10.6

Same yaml and host file as above

New errors

ansible-playbook -vvv -i inventory/hosts setup.yml --tags=install-all,ensure-matrix-users-created,start
ansible-playbook [core 2.13.7]
  config file = /home/taubin/matrix-docker-ansible-deploy/ansible.cfg
  configured module search path = ['/home/taubin/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  ansible collection location = /home/taubin/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible-playbook
  python version = 3.10.6 (main, Nov 14 2022, 16:10:14) [GCC 11.3.0]
  jinja version = 3.0.3
  libyaml = True
Using /home/taubin/matrix-docker-ansible-deploy/ansible.cfg as config file
host_list declined parsing /home/taubin/matrix-docker-ansible-deploy/inventory/hosts as it did not pass its verify_file() method
script declined parsing /home/taubin/matrix-docker-ansible-deploy/inventory/hosts as it did not pass its verify_file() method
auto declined parsing /home/taubin/matrix-docker-ansible-deploy/inventory/hosts as it did not pass its verify_file() method
Parsed /home/taubin/matrix-docker-ansible-deploy/inventory/hosts inventory source with ini plugin
statically imported: /home/taubin/matrix-docker-ansible-deploy/roles/custom/matrix-nginx-proxy/tasks/validate_config.yml
statically imported: /home/taubin/matrix-docker-ansible-deploy/roles/custom/matrix-nginx-proxy/tasks/ssl/main.yml
statically imported: /home/taubin/matrix-docker-ansible-deploy/roles/custom/matrix-nginx-proxy/tasks/ssl/setup_ssl_lets_encrypt.yml
statically imported: /home/taubin/matrix-docker-ansible-deploy/roles/custom/matrix-nginx-proxy/tasks/ssl/purge_ssl_lets_encrypt_orphaned_configs.yml
statically imported: /home/taubin/matrix-docker-ansible-deploy/roles/custom/matrix-nginx-proxy/tasks/ssl/setup_ssl_self_signed.yml
statically imported: /home/taubin/matrix-docker-ansible-deploy/roles/custom/matrix-nginx-proxy/tasks/ssl/setup_ssl_manually_managed.yml
statically imported: /home/taubin/matrix-docker-ansible-deploy/roles/custom/matrix-nginx-proxy/tasks/setup_nginx_proxy.yml
statically imported: /home/taubin/matrix-docker-ansible-deploy/roles/galaxy/com.devture.ansible.role.playbook_state_preserver/tasks/preserve_vars.yml
statically imported: /home/taubin/matrix-docker-ansible-deploy/roles/galaxy/com.devture.ansible.role.playbook_state_preserver/tasks/preserve_commit_hash.yml
redirecting (type: callback) ansible.builtin.yaml to community.general.yaml
redirecting (type: callback) ansible.builtin.yaml to community.general.yaml
Skipping callback 'default', as we already have a stdout callback.
Skipping callback 'minimal', as we already have a stdout callback.
Skipping callback 'oneline', as we already have a stdout callback.

PLAYBOOK: setup.yml ****************************************************************************************************
1 plays in setup.yml

PLAY [Set up a Matrix server] ******************************************************************************************

TASK [Gathering Facts] *************************************************************************************************
task path: /home/taubin/matrix-docker-ansible-deploy/setup.yml:2
Using module file /usr/lib/python3/dist-packages/ansible/modules/setup.py
Pipelining is enabled.
<[ip.redacted]> ESTABLISH LOCAL CONNECTION FOR USER: taubin
<[ip.redacted]> EXEC /bin/sh -c 'sudo -H -S -n  -u root /bin/sh -c '"'"'echo BECOME-SUCCESS-iujbbyazqdvkcdariexowcolrcoxfulh ; /usr/bin/python3'"'"' && sleep 0'
ok: [matrix.[server.redacted]]
META: ran handlers
META:
META:

TASK [custom/matrix_playbook_migration : ansible.builtin.include_tasks] ************************************************
task path: /home/taubin/matrix-docker-ansible-deploy/roles/custom/matrix_playbook_migration/tasks/main.yml:4
included: /home/taubin/matrix-docker-ansible-deploy/roles/custom/matrix_playbook_migration/tasks/validate_config.yml for matrix.[server.redacted]

TASK [custom/matrix_playbook_migration : (Deprecation) Catch and report renamed Matrix playbook settings] **************
task path: /home/taubin/matrix-docker-ansible-deploy/roles/custom/matrix_playbook_migration/tasks/validate_config.yml:3
skipping: [matrix.[server.redacted]] => (item={'old': 'matrix_vars_yml_snapshotting_enabled', 'new': 'devture_playbook_state_preserver_vars_preservation_enabled'})  => changed=false
  ansible_loop_var: item
  item:
    new: devture_playbook_state_preserver_vars_preservation_enabled
    old: matrix_vars_yml_snapshotting_enabled
  skip_reason: Conditional result was False
skipping: [matrix.[server.redacted]] => (item={'old': 'matrix_vars_yml_snapshotting_src', 'new': 'devture_playbook_state_preserver_vars_preservation_src'})  => changed=false
  ansible_loop_var: item
  item:
    new: devture_playbook_state_preserver_vars_preservation_src
    old: matrix_vars_yml_snapshotting_src
  skip_reason: Conditional result was False
skipping: [matrix.[server.redacted]] => (item={'old': 'matrix_playbook_commit_hash_preservation_enabled', 'new': 'devture_playbook_state_preserver_commit_hash_preservation_enabled'})  => changed=false
  ansible_loop_var: item
  item:
    new: devture_playbook_state_preserver_commit_hash_preservation_enabled
    old: matrix_playbook_commit_hash_preservation_enabled
  skip_reason: Conditional result was False
skipping: [matrix.[server.redacted]] => (item={'old': 'matrix_ntpd_package', 'new': 'devture_timesync_ntpd_package'})  => changed=false
  ansible_loop_var: item
  item:
    new: devture_timesync_ntpd_package
    old: matrix_ntpd_package
  skip_reason: Conditional result was False
skipping: [matrix.[server.redacted]] => (item={'old': 'matrix_ntpd_service', 'new': 'devture_timesync_ntpd_service'})  => changed=false
  ansible_loop_var: item
  item:
    new: devture_timesync_ntpd_service
    old: matrix_ntpd_service
  skip_reason: Conditional result was False
skipping: [matrix.[server.redacted]] => (item={'old': 'matrix_systemd_unit_home_path', 'new': 'devture_systemd_docker_base_systemd_unit_home_path'})  => changed=false
  ansible_loop_var: item
  item:
    new: devture_systemd_docker_base_systemd_unit_home_path
    old: matrix_systemd_unit_home_path
  skip_reason: Conditional result was False
skipping: [matrix.[server.redacted]] => (item={'old': 'matrix_systemd_path', 'new': 'devture_systemd_docker_base_systemd_path'})  => changed=false
  ansible_loop_var: item
  item:
    new: devture_systemd_docker_base_systemd_path
    old: matrix_systemd_path
  skip_reason: Conditional result was False
skipping: [matrix.[server.redacted]] => (item={'old': 'matrix_host_command_docker', 'new': 'devture_systemd_docker_base_host_command_docker'})  => changed=false
  ansible_loop_var: item
  item:
    new: devture_systemd_docker_base_host_command_docker
    old: matrix_host_command_docker
  skip_reason: Conditional result was False
skipping: [matrix.[server.redacted]] => (item={'old': 'matrix_host_command_sh', 'new': 'devture_systemd_docker_base_host_command_sh'})  => changed=false
  ansible_loop_var: item
  item:
    new: devture_systemd_docker_base_host_command_sh
    old: matrix_host_command_sh
  skip_reason: Conditional result was False
skipping: [matrix.[server.redacted]] => (item={'old': 'matrix_host_command_systemctl', 'new': 'devture_systemd_docker_base_host_command_systemctl'})  => changed=false
  ansible_loop_var: item
  item:
    new: devture_systemd_docker_base_host_command_systemctl
    old: matrix_host_command_systemctl
  skip_reason: Conditional result was False
skipping: [matrix.[server.redacted]] => (item={'old': 'matrix_container_retries_count', 'new': 'devture_playbook_help_container_retries_count'})  => changed=false
  ansible_loop_var: item
  item:
    new: devture_playbook_help_container_retries_count
    old: matrix_container_retries_count
  skip_reason: Conditional result was False
skipping: [matrix.[server.redacted]] => (item={'old': 'matrix_container_retries_delay', 'new': 'devture_playbook_help_container_retries_delay'})  => changed=false
  ansible_loop_var: item
  item:
    new: devture_playbook_help_container_retries_delay
    old: matrix_container_retries_delay
  skip_reason: Conditional result was False
skipping: [matrix.[server.redacted]] => (item={'old': 'matrix_geturl_retries_count', 'new': 'devture_playbook_help_geturl_retries_count'})  => changed=false
  ansible_loop_var: item
  item:
    new: devture_playbook_help_geturl_retries_count
    old: matrix_geturl_retries_count
  skip_reason: Conditional result was False
skipping: [matrix.[server.redacted]] => (item={'old': 'matrix_geturl_retries_delay', 'new': 'devture_playbook_help_geturl_retries_delay'})  => changed=false
  ansible_loop_var: item
  item:
    new: devture_playbook_help_geturl_retries_delay
    old: matrix_geturl_retries_delay
  skip_reason: Conditional result was False
skipping: [matrix.[server.redacted]] => (item={'old': 'matrix_nginx_proxy_synapse_cache_path', 'new': 'matrix_synapse_reverse_proxy_companion_synapse_cache_path'})  => changed=false
  ansible_loop_var: item
  item:
    new: matrix_synapse_reverse_proxy_companion_synapse_cache_path
    old: matrix_nginx_proxy_synapse_cache_path
  skip_reason: Conditional result was False
skipping: [matrix.[server.redacted]] => (item={'old': 'matrix_nginx_proxy_synapse_cache_enabled', 'new': 'matrix_synapse_reverse_proxy_companion_synapse_cache_enabled'})  => changed=false
  ansible_loop_var: item
  item:
    new: matrix_synapse_reverse_proxy_companion_synapse_cache_enabled
    old: matrix_nginx_proxy_synapse_cache_enabled
  skip_reason: Conditional result was False
skipping: [matrix.[server.redacted]] => (item={'old': 'matrix_docker_installation_enabled', 'new': 'matrix_playbook_docker_installation_enabled'})  => changed=false
  ansible_loop_var: item
  item:
    new: matrix_playbook_docker_installation_enabled
    old: matrix_docker_installation_enabled
  skip_reason: Conditional result was False
skipping: [matrix.[server.redacted]] => (item={'old': 'matrix_docker_package_name', 'new': '<Not applicable. Docker is installed using https://github.com/geerlingguy/ansible-role-docker now>'})  => changed=false
  ansible_loop_var: item
  item:
    new: <Not applicable. Docker is installed using https://github.com/geerlingguy/ansible-role-docker now>
    old: matrix_docker_package_name
  skip_reason: Conditional result was False
skipping: [matrix.[server.redacted]] => (item={'old': 'matrix_systemd_services_list', 'new': 'devture_systemd_service_manager_services_list_additional'})  => changed=false
  ansible_loop_var: item
  item:
    new: devture_systemd_service_manager_services_list_additional
    old: matrix_systemd_services_list
  skip_reason: Conditional result was False
skipping: [matrix.[server.redacted]] => (item={'old': 'matrix_common_after_systemd_service_start_wait_for_timeout_seconds', 'new': 'devture_systemd_service_manager_up_verification_delay_seconds'})  => changed=false
  ansible_loop_var: item
  item:
    new: devture_systemd_service_manager_up_verification_delay_seconds
    old: matrix_common_after_systemd_service_start_wait_for_timeout_seconds
  skip_reason: Conditional result was False
skipping: [matrix.[server.redacted]] => (item={'old': 'matrix_systemd_services_autostart_enabled', 'new': 'devture_systemd_service_manager_services_autostart_enabled'})  => changed=false
  ansible_loop_var: item
  item:
    new: devture_systemd_service_manager_services_autostart_enabled
    old: matrix_systemd_services_autostart_enabled
  skip_reason: Conditional result was False

TASK [custom/matrix_playbook_migration : (Deprecation) Catch and report matrix_postgres variables] *********************
task path: /home/taubin/matrix-docker-ansible-deploy/roles/custom/matrix_playbook_migration/tasks/validate_config.yml:38
skipping: [matrix.[server.redacted]] => changed=false
  skip_reason: Conditional result was False

TASK [custom/matrix_playbook_migration : ansible.builtin.include_tasks] ************************************************
task path: /home/taubin/matrix-docker-ansible-deploy/roles/custom/matrix_playbook_migration/tasks/main.yml:10
included: /home/taubin/matrix-docker-ansible-deploy/roles/custom/matrix_playbook_migration/tasks/cleanup_usr_local_bin.yml for matrix.[server.redacted]

TASK [custom/matrix_playbook_migration : Find leftover matrix scripts in /usr/local/bin] *******************************
task path: /home/taubin/matrix-docker-ansible-deploy/roles/custom/matrix_playbook_migration/tasks/cleanup_usr_local_bin.yml:3
Using module file /usr/lib/python3/dist-packages/ansible/modules/find.py
Pipelining is enabled.
<[ip.redacted]> ESTABLISH LOCAL CONNECTION FOR USER: taubin
<[ip.redacted]> EXEC /bin/sh -c 'sudo -H -S -n  -u root /bin/sh -c '"'"'echo BECOME-SUCCESS-qafapybnuvlgcuzhisiwhfrxlhhynlke ; /usr/bin/python3'"'"' && sleep 0'
ok: [matrix.[server.redacted]] => changed=false
  examined: 0
  files: []
  invocation:
    module_args:
      age: null
      age_stamp: mtime
      contains: null
      depth: null
      excludes: null
      file_type: file
      follow: false
      get_checksum: false
      hidden: false
      path: /usr/local/bin
      paths:
      - /usr/local/bin
      patterns:
      - matrix-change-user-admin-status
      - matrix-dendrite-create-account
      - matrix-make-user-admin
      - matrix-postgres-cli
      - matrix-postgres-cli-non-interactive
      - matrix-postgres-update-user-password-hash
      - matrix-remove-all
      - matrix-ssl-certificates-renew
      - matrix-ssl-lets-encrypt-certificates-renew
      - matrix-synapse-register-user
      - matrix-synapse-s3-storage-provider-migrate
      - matrix-synapse-s3-storage-provider-shell
      - matrix-synapse-worker-write-pid
      read_whole_file: false
      recurse: false
      size: null
      use_regex: false
  matched: 0
  msg: All paths examined
  skipped_paths: {}

TASK [custom/matrix_playbook_migration : Ensure /usr/local/bin does not contain matrix scripts] ************************
task path: /home/taubin/matrix-docker-ansible-deploy/roles/custom/matrix_playbook_migration/tasks/cleanup_usr_local_bin.yml:22
META: role_complete for matrix.[server.redacted]
META:
META:
META:

TASK [custom/matrix-base : ansible.builtin.include_tasks] **************************************************************
task path: /home/taubin/matrix-docker-ansible-deploy/roles/custom/matrix-base/tasks/main.yml:4
included: /home/taubin/matrix-docker-ansible-deploy/roles/custom/matrix-base/tasks/validate_config.yml for matrix.[server.redacted]

TASK [custom/matrix-base : Fail if invalid homeserver implementation] **************************************************
task path: /home/taubin/matrix-docker-ansible-deploy/roles/custom/matrix-base/tasks/validate_config.yml:3
skipping: [matrix.[server.redacted]] => changed=false
  skip_reason: Conditional result was False

TASK [custom/matrix-base : (Deprecation) Catch and report renamed settings] ********************************************
task path: /home/taubin/matrix-docker-ansible-deploy/roles/custom/matrix-base/tasks/validate_config.yml:8
skipping: [matrix.[server.redacted]] => (item={'old': 'host_specific_hostname_identity', 'new': 'matrix_domain'})  => changed=false
  ansible_loop_var: item
  item:
    new: matrix_domain
    old: host_specific_hostname_identity
  skip_reason: Conditional result was False
skipping: [matrix.[server.redacted]] => (item={'old': 'hostname_identity', 'new': 'matrix_domain'})  => changed=false
  ansible_loop_var: item
  item:
    new: matrix_domain
    old: hostname_identity
  skip_reason: Conditional result was False
skipping: [matrix.[server.redacted]] => (item={'old': 'hostname_matrix', 'new': 'matrix_server_fqn_matrix'})  => changed=false
  ansible_loop_var: item
  item:
    new: matrix_server_fqn_matrix
    old: hostname_matrix
  skip_reason: Conditional result was False
skipping: [matrix.[server.redacted]] => (item={'old': 'hostname_riot', 'new': 'matrix_server_fqn_element'})  => changed=false
  ansible_loop_var: item
  item:
    new: matrix_server_fqn_element
    old: hostname_riot
  skip_reason: Conditional result was False
skipping: [matrix.[server.redacted]] => (item={'old': 'matrix_server_fqn_riot', 'new': 'matrix_server_fqn_element'})  => changed=false
  ansible_loop_var: item
  item:
    new: matrix_server_fqn_element
    old: matrix_server_fqn_riot
  skip_reason: Conditional result was False
skipping: [matrix.[server.redacted]] => (item={'old': 'matrix_local_bin_path', 'new': '<there is no global bin path anymore - each role has its own>'})  => changed=false
  ansible_loop_var: item
  item:
    new: <there is no global bin path anymore - each role has its own>
    old: matrix_local_bin_path
  skip_reason: Conditional result was False

TASK [custom/matrix-base : Fail if matrix_homeserver_generic_secret_key is undefined] **********************************
task path: /home/taubin/matrix-docker-ansible-deploy/roles/custom/matrix-base/tasks/validate_config.yml:23
skipping: [matrix.[server.redacted]] => changed=false
  skip_reason: Conditional result was False

TASK [custom/matrix-base : Fail if required variables are undefined] ***************************************************
task path: /home/taubin/matrix-docker-ansible-deploy/roles/custom/matrix-base/tasks/validate_config.yml:37
skipping: [matrix.[server.redacted]] => (item={'var': 'matrix_domain', 'value': '[server.redacted]'})  => changed=false
  ansible_loop_var: item
  item:
    value: [server.redacted]
    var: matrix_domain
  skip_reason: Conditional result was False
skipping: [matrix.[server.redacted]] => (item={'var': 'matrix_server_fqn_matrix', 'value': 'matrix.[server.redacted]'})  => changed=false
  ansible_loop_var: item
  item:
    value: matrix.[server.redacted]
    var: matrix_server_fqn_matrix
  skip_reason: Conditional result was False
skipping: [matrix.[server.redacted]] => (item={'var': 'matrix_server_fqn_element', 'value': 'element.[server.redacted]'})  => changed=false
  ansible_loop_var: item
  item:
    value: element.[server.redacted]
    var: matrix_server_fqn_element
  skip_reason: Conditional result was False
skipping: [matrix.[server.redacted]] => (item={'var': 'matrix_homeserver_container_url', 'value': 'http://matrix-nginx-proxy:12080'})  => changed=false
  ansible_loop_var: item
  item:
    value: http://matrix-nginx-proxy:12080
    var: matrix_homeserver_container_url
  skip_reason: Conditional result was False
skipping: [matrix.[server.redacted]] => (item={'var': 'matrix_homeserver_container_federation_url', 'value': 'http://matrix-nginx-proxy:12088'})  => changed=false
  ansible_loop_var: item
  item:
    value: http://matrix-nginx-proxy:12088
    var: matrix_homeserver_container_federation_url
  skip_reason: Conditional result was False
skipping: [matrix.[server.redacted]] => (item={'var': 'matrix_architecture', 'value': 'amd64'})  => changed=false
  ansible_loop_var: item
  item:
    value: amd64
    var: matrix_architecture
  skip_reason: Conditional result was False

TASK [custom/matrix-base : Fail if matrix_architecture is set incorrectly] *********************************************
task path: /home/taubin/matrix-docker-ansible-deploy/roles/custom/matrix-base/tasks/validate_config.yml:49
skipping: [matrix.[server.redacted]] => changed=false
  skip_reason: Conditional result was False

TASK [custom/matrix-base : Fail if uppercase domain used] **************************************************************
task path: /home/taubin/matrix-docker-ansible-deploy/roles/custom/matrix-base/tasks/validate_config.yml:54
skipping: [matrix.[server.redacted]] => (item=[server.redacted])  => changed=false
  ansible_loop_var: item
  item: [server.redacted]
  skip_reason: Conditional result was False
skipping: [matrix.[server.redacted]] => (item=matrix.[server.redacted])  => changed=false
  ansible_loop_var: item
  item: matrix.[server.redacted]
  skip_reason: Conditional result was False
skipping: [matrix.[server.redacted]] => (item=element.[server.redacted])  => changed=false
  ansible_loop_var: item
  item: element.[server.redacted]
  skip_reason: Conditional result was False

TASK [custom/matrix-base : Fail if encountering usage of removed role (mx-puppet-skype)] *******************************
task path: /home/taubin/matrix-docker-ansible-deploy/roles/custom/matrix-base/tasks/validate_config.yml:63
skipping: [matrix.[server.redacted]] => changed=false
  skip_reason: Conditional result was False

TASK [custom/matrix-base : ansible.builtin.include_tasks] **************************************************************
task path: /home/taubin/matrix-docker-ansible-deploy/roles/custom/matrix-base/tasks/main.yml:12
included: /home/taubin/matrix-docker-ansible-deploy/roles/custom/matrix-base/tasks/setup_matrix_user.yml for matrix.[server.redacted]

TASK [custom/matrix-base : Ensure Matrix group is created] *************************************************************
task path: /home/taubin/matrix-docker-ansible-deploy/roles/custom/matrix-base/tasks/setup_matrix_user.yml:3
Using module file /usr/lib/python3/dist-packages/ansible/modules/group.py
Pipelining is enabled.
<[ip.redacted]> ESTABLISH LOCAL CONNECTION FOR USER: taubin
<[ip.redacted]> EXEC /bin/sh -c 'sudo -H -S -n  -u root /bin/sh -c '"'"'echo BECOME-SUCCESS-uujjrshnjydazjahmmshxmqahhwywkkn ; /usr/bin/python3'"'"' && sleep 0'
ok: [matrix.[server.redacted]] => changed=false
  gid: 1001
  invocation:
    module_args:
      gid: null
      local: false
      name: matrix
      non_unique: false
      state: present
      system: false
  name: matrix
  state: present
  system: false

TASK [custom/matrix-base : Ensure Matrix user is created] **************************************************************
task path: /home/taubin/matrix-docker-ansible-deploy/roles/custom/matrix-base/tasks/setup_matrix_user.yml:10
Using module file /usr/lib/python3/dist-packages/ansible/modules/user.py
Pipelining is enabled.
<[ip.redacted]> ESTABLISH LOCAL CONNECTION FOR USER: taubin
<[ip.redacted]> EXEC /bin/sh -c 'sudo -H -S -n  -u root /bin/sh -c '"'"'echo BECOME-SUCCESS-wokbwwlfueqoljwlzkglbnjfpbqghbkn ; /usr/bin/python3'"'"' && sleep 0'
ok: [matrix.[server.redacted]] => changed=false
  append: false
  comment: ''
  group: 1001
  home: /matrix
  invocation:
    module_args:
      append: false
      authorization: null
      comment: null
      create_home: false
      expires: null
      force: false
      generate_ssh_key: null
      group: matrix
      groups: null
      hidden: null
      home: /matrix
      local: null
      login_class: null
      move_home: false
      name: matrix
      non_unique: false
      password: null
      password_expire_max: null
      password_expire_min: null
      password_lock: null
      profile: null
      remove: false
      role: null
      seuser: null
      shell: null
      skeleton: null
      ssh_key_bits: 0
      ssh_key_comment: ansible-generated on s1
      ssh_key_file: null
      ssh_key_passphrase: null
      ssh_key_type: rsa
      state: present
      system: true
      uid: null
      umask: null
      update_password: always
  move_home: false
  name: matrix
  shell: /bin/sh
  state: present
  uid: 998

TASK [custom/matrix-base : Initialize matrix_user_uid and matrix_user_gid] *********************************************
task path: /home/taubin/matrix-docker-ansible-deploy/roles/custom/matrix-base/tasks/setup_matrix_user.yml:21
ok: [matrix.[server.redacted]] => changed=false
  ansible_facts:
    matrix_user_gid: '1001'
    matrix_user_uid: '998'

TASK [custom/matrix-base : ansible.builtin.include_tasks] **************************************************************
task path: /home/taubin/matrix-docker-ansible-deploy/roles/custom/matrix-base/tasks/main.yml:19
included: /home/taubin/matrix-docker-ansible-deploy/roles/custom/matrix-base/tasks/setup_matrix_base.yml for matrix.[server.redacted]

TASK [custom/matrix-base : Ensure Matrix base paths exists] ************************************************************
task path: /home/taubin/matrix-docker-ansible-deploy/roles/custom/matrix-base/tasks/setup_matrix_base.yml:3
Using module file /usr/lib/python3/dist-packages/ansible/modules/file.py
Pipelining is enabled.
<[ip.redacted]> ESTABLISH LOCAL CONNECTION FOR USER: taubin
<[ip.redacted]> EXEC /bin/sh -c 'sudo -H -S -n  -u root /bin/sh -c '"'"'echo BECOME-SUCCESS-itakpynzvbkcnipwknxbqvcvvsgrthsy ; /usr/bin/python3'"'"' && sleep 0'
ok: [matrix.[server.redacted]] => (item=/matrix) => changed=false
  ansible_loop_var: item
  diff:
    after:
      path: /matrix
    before:
      path: /matrix
  gid: 1001
  group: matrix
  invocation:
    module_args:
      _diff_peek: null
      _original_basename: null
      access_time: null
      access_time_format: '%Y%m%d%H%M.%S'
      attributes: null
      follow: true
      force: false
      group: matrix
      mode: '750'
      modification_time: null
      modification_time_format: '%Y%m%d%H%M.%S'
      owner: matrix
      path: /matrix
      recurse: false
      selevel: null
      serole: null
      setype: null
      seuser: null
      src: null
      state: directory
      unsafe_writes: false
  item: /matrix
  mode: '0750'
  owner: matrix
  path: /matrix
  size: 4096
  state: directory
  uid: 998
Using module file /usr/lib/python3/dist-packages/ansible/modules/file.py
Pipelining is enabled.
<[ip.redacted]> EXEC /bin/sh -c 'sudo -H -S -n  -u root /bin/sh -c '"'"'echo BECOME-SUCCESS-ixeioccrqffhvhkrksfpybvkgscacald ; /usr/bin/python3'"'"' && sleep 0'
ok: [matrix.[server.redacted]] => (item=/matrix/bin) => changed=false
  ansible_loop_var: item
  diff:
    after:
      path: /matrix/bin
    before:
      path: /matrix/bin
  gid: 1001
  group: matrix
  invocation:
    module_args:
      _diff_peek: null
      _original_basename: null
      access_time: null
      access_time_format: '%Y%m%d%H%M.%S'
      attributes: null
      follow: true
      force: false
      group: matrix
      mode: '750'
      modification_time: null
      modification_time_format: '%Y%m%d%H%M.%S'
      owner: matrix
      path: /matrix/bin
      recurse: false
      selevel: null
      serole: null
      setype: null
      seuser: null
      src: null
      state: directory
      unsafe_writes: false
  item: /matrix/bin
  mode: '0750'
  owner: matrix
  path: /matrix/bin
  size: 4096
  state: directory
  uid: 998

TASK [custom/matrix-base : Ensure Matrix network is created in Docker] *************************************************
task path: /home/taubin/matrix-docker-ansible-deploy/roles/custom/matrix-base/tasks/setup_matrix_base.yml:14
Using module file /usr/lib/python3/dist-packages/ansible_collections/community/docker/plugins/modules/docker_network.py
Pipelining is enabled.
<[ip.redacted]> ESTABLISH LOCAL CONNECTION FOR USER: taubin
<[ip.redacted]> EXEC /bin/sh -c 'sudo -H -S -n  -u root /bin/sh -c '"'"'echo BECOME-SUCCESS-xnaozxtimphniilndpozzyobdyvunnsi ; /usr/bin/python3'"'"' && sleep 0'
The full traceback is:
Traceback (most recent call last):
  File "/tmp/ansible_community.docker.docker_network_payload_fu370x5b/ansible_community.docker.docker_network_payload.zip/ansible_collections/community/docker/plugins/module_utils/common.py", line 33, in <module>
    from docker import __version__ as docker_version
ModuleNotFoundError: No module named 'docker'
fatal: [matrix.[server.redacted]]: FAILED! => changed=false
  invocation:
    module_args:
      api_version: auto
      appends: false
      attachable: null
      ca_cert: null
      client_cert: null
      client_key: null
      connected: []
      debug: false
      docker_host: unix://var/run/docker.sock
      driver: bridge
      driver_options: {}
      enable_ipv6: null
      force: false
      internal: null
      ipam_config: null
      ipam_driver: null
      ipam_driver_options: null
      labels: {}
      name: matrix
      scope: null
      ssl_version: null
      state: present
      timeout: 60
      tls: false
      tls_hostname: null
      use_ssh_client: false
      validate_certs: false
  msg: 'Failed to import the required Python library (Docker SDK for Python: docker above 5.0.0 (Python >= 3.6) or docker before 5.0.0 (Python 2.7) or docker-py (Python 2.6)) on s1''s Python /usr/bin/python3. Please read the module documentation and install it in the appropriate location. If the required library is installed, but Ansible is using the wrong Python interpreter, please consult the documentation on ansible_python_interpreter, for example via `pip install docker` (Python >= 3.6) or `pip install docker==4.4.4` (Python 2.7) or `pip install docker-py` (Python 2.6). The error was: No module named ''docker'''

PLAY RECAP *************************************************************************************************************
matrix.[server.redacted]           : ok=11   changed=0    unreachable=0    failed=1    skipped=10   rescued=0    ignored=0

Taubin avatar Dec 20 '22 21:12 Taubin

Just ran into this issue as well on Ubuntu 22.04.

Additional steps taken on the target machine:

sudo apt install python3-pip python3-docker python-is-python3 -y
pip install docker docker-compose

Which gets me a bit further in the ansible deploy, but produces a new error message:

TASK [custom/matrix-base : Ensure Matrix network is created in Docker] **************************************************************
fatal: [matrix.mydomain.com]: FAILED! => changed=false
  msg: 'Error connecting: Error while fetching server API version: (''Connection aborted.'', FileNotFoundError(2, ''No such file or directory''))'

CaseyLabs avatar Dec 21 '22 17:12 CaseyLabs

Update - I manually installed docker on the target machine to get around the error:

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update
sudo apt install docker-ce -y

CaseyLabs avatar Dec 21 '22 18:12 CaseyLabs

Now it gets stuck here:

TASK [galaxy/com.devture.ansible.role.systemd_service_manager : include_tasks] ******************************************************
included: /home/scasey/matrix-docker-ansible-deploy/roles/galaxy/com.devture.ansible.role.systemd_service_manager/tasks/restart_specified.yml for matrix.caseylabs.com

TASK [galaxy/com.devture.ansible.role.systemd_service_manager : Ensure systemd is reloaded] *****************************************
ok: [matrix.caseylabs.com]

TASK [galaxy/com.devture.ansible.role.systemd_service_manager : Ensure systemd services are stopped] ********************************
fatal: [matrix.mydomain.com]: FAILED! =>
  msg: '''dict object'' has no attribute ''priority,name'''

CaseyLabs avatar Dec 21 '22 19:12 CaseyLabs

pip install -U Jinja2 fixed the above issue

CaseyLabs avatar Dec 21 '22 19:12 CaseyLabs

Had to manually install docker and Jinja2 too

maxwell-kalin avatar Dec 23 '22 20:12 maxwell-kalin

Imho this might be due to an error in the docs: The first inital run needs to use the tag setup-all not install-all since only setup-all will also call the geerlingguy-ansible role to install docker and requirements.

so it should be

ansible-playbook -i inventory/hosts setup.yml  --tags=setup-all,ensure-matrix-users-created,start

Edit:

That might be wrong also and running into an error. However - running the playbook with setup-all will definitely install the docker requirements you need to being with

Fobhep avatar Dec 28 '22 13:12 Fobhep

The bug is not in the documentation, but in setup.yml. The install-* tags should have been added there. It's fixed now.

Thanks for reporting it and finding the problem!

spantaleev avatar Dec 28 '22 13:12 spantaleev

awesome - thanks for your quick fix

Fobhep avatar Dec 28 '22 14:12 Fobhep