Exceptions when trying to use apache2_mod_proxy

41 views
Skip to first unread message

Jeff Sondag

unread,
Mar 28, 2019, 12:05:30 PM3/28/19
to Ansible Project
I'm trying to manage an apache load balancer with apache2_mod_proxy, and am getting the following error. If someone could help that would be very much appreciated.

I've submitted it as a bug with more information, here. https://github.com/ansible/ansible/issues/54259

TASK [apache2_mod_proxy] ********************************************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: TypeError: first argument must be string or compiled pattern

fatal: [localhost]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):

  File \"/root/.ansible/tmp/ansible-tmp-1553280134.74-29374324244571/AnsiballZ_apache2_mod_proxy.py\", line 114, in <module>
    _ansiballz_main()
  File \"/root/.ansible/tmp/ansible-tmp-1553280134.74-29374324244571/AnsiballZ_apache2_mod_proxy.py\", line 106, in _ansiballz_main
    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
  File \"/root/.ansible/tmp/ansible-tmp-1553280134.74-29374324244571/AnsiballZ_apache2_mod_proxy.py\", line 49, in invoke_module
    imp.load_module('__main__', mod, module, MOD_DESC)
  File \"/tmp/ansible_apache2_mod_proxy_payload_6P4Nj2/__main__.py\", line 444, in <module>
  File \"/tmp/ansible_apache2_mod_proxy_payload_6P4Nj2/__main__.py\", line 388, in main
  File \"/tmp/ansible_apache2_mod_proxy_payload_6P4Nj2/__main__.py\", line 271, in get_member_status
  File \"/tmp/ansible_apache2_mod_proxy_payload_6P4Nj2/__main__.py\", line 260, in get_member_attributes
  File \"/usr/lib64/python2.7/re.py\", line 142, in search
    return _compile(pattern, flags).search(string)
  File \"/usr/lib64/python2.7/re.py\", line 238, in _compile
    raise TypeError, \"first argument must be string or compiled pattern\"
TypeError: first argument must be string or compiled pattern
", "module_stdout": "", "msg": "MODULE FAILURE
See stdout/stderr for the exact error", "rc": 1}

-----------------------------------------------------------------------------
My playbook:


- name: test apache load balancer management
  hosts: localhost
  gather_facts: no
  tasks:

  - apache2_mod_proxy:
      balancer_vhost: 10.10.20.30
      tls: yes
      validate_certs: no

Jean-Yves LENHOF

unread,
Mar 28, 2019, 1:33:52 PM3/28/19
to ansible...@googlegroups.com

Hi,

First point, did you install "BeautifulSoup python module" as written in documentation ?

Seems you can install this module with EPEL repo (https://centos.pkgs.org/7/epel-x86_64/python-BeautifulSoup-3.2.1-7.el7.noarch.rpm.html)

Regards,

JYL


Jeff Sondag

unread,
Mar 28, 2019, 2:14:57 PM3/28/19
to Ansible Project
I installed it the following way, which installed version 3.2.1
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum install ./epel-release-latest-*.noarch.rpm
yum -y install python-pip
pip install beautifulsoup

Jean-Yves LENHOF

unread,
Mar 28, 2019, 2:34:20 PM3/28/19
to ansible...@googlegroups.com


Le 28/03/2019 à 17:05, Jeff Sondag a écrit :

Did you enabled balancer-manager as written in documentation ?

https://httpd.apache.org/docs/2.4/mod/mod_proxy_balancer.html

Regards,

Jeff Sondag

unread,
Mar 28, 2019, 2:57:29 PM3/28/19
to Ansible Project
Yes, the server I'm pointing at is a production server working as a load balancer for Genesys Web Services.
Reply all
Reply to author
Forward
0 new messages